mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 14:20:37 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4344 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bfb3253bea
commit
1042d20507
1 changed files with 26 additions and 20 deletions
|
@ -577,32 +577,38 @@ static Class menuCellClass = nil;
|
|||
|
||||
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
||||
{
|
||||
id cells = [menuCells itemArray];
|
||||
int i, count = [cells count];
|
||||
NSEventType type = [theEvent type];
|
||||
id cells = [menuCells itemArray];
|
||||
unsigned i;
|
||||
unsigned count = [cells count];
|
||||
NSEventType type = [theEvent type];
|
||||
|
||||
if (type != NSKeyDown && type != NSKeyUp)
|
||||
return NO;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
id<NSMenuItem> cell = [cells objectAtIndex: i];
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
id<NSMenuItem> cell = [cells objectAtIndex: i];
|
||||
|
||||
if ([cell hasSubmenu]) {
|
||||
if ([[cell target] performKeyEquivalent: theEvent])
|
||||
/* The event has been handled by a cell in submenu */
|
||||
return YES;
|
||||
if ([cell hasSubmenu])
|
||||
{
|
||||
if ([[cell target] performKeyEquivalent: theEvent])
|
||||
{
|
||||
/* The event has been handled by a cell in submenu */
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([[cell keyEquivalent] isEqual:
|
||||
[theEvent charactersIgnoringModifiers]])
|
||||
{
|
||||
[menuCells lockFocus];
|
||||
[(id)cell performClick: self];
|
||||
[menuCells unlockFocus];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ([[cell keyEquivalent] isEqual: [theEvent charactersIgnoringModifiers]]
|
||||
&& [cell keyEquivalentModifierMask] == [theEvent modifierFlags]) {
|
||||
[menuCells lockFocus];
|
||||
[(id)cell performClick: self];
|
||||
[menuCells unlockFocus];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue