mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:50:48 +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
|
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
||||||
{
|
{
|
||||||
id cells = [menuCells itemArray];
|
id cells = [menuCells itemArray];
|
||||||
int i, count = [cells count];
|
unsigned i;
|
||||||
NSEventType type = [theEvent type];
|
unsigned count = [cells count];
|
||||||
|
NSEventType type = [theEvent type];
|
||||||
|
|
||||||
if (type != NSKeyDown && type != NSKeyUp)
|
if (type != NSKeyDown && type != NSKeyUp)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++)
|
||||||
id<NSMenuItem> cell = [cells objectAtIndex: i];
|
{
|
||||||
|
id<NSMenuItem> cell = [cells objectAtIndex: i];
|
||||||
|
|
||||||
if ([cell hasSubmenu]) {
|
if ([cell hasSubmenu])
|
||||||
if ([[cell target] performKeyEquivalent: theEvent])
|
{
|
||||||
/* The event has been handled by a cell in submenu */
|
if ([[cell target] performKeyEquivalent: theEvent])
|
||||||
return YES;
|
{
|
||||||
|
/* 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;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue