mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 05:00:47 +00:00
* Source/NSMenu.m: Correction to previous change. Update when
setAutoenableItems: value is changed. Altered update to enable menu items when autoenable is not being performed. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27569 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
94d202c31a
commit
4e9cc540e9
2 changed files with 22 additions and 1 deletions
|
@ -933,6 +933,7 @@ static BOOL menuBarVisible = YES;
|
|||
- (void) setAutoenablesItems: (BOOL)flag
|
||||
{
|
||||
_menu.autoenable = flag;
|
||||
[self update];
|
||||
}
|
||||
|
||||
- (BOOL) autoenablesItems
|
||||
|
@ -1056,6 +1057,20 @@ static BOOL menuBarVisible = YES;
|
|||
// Reenable displaying of menus
|
||||
[self setMenuChangedMessagesEnabled: YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
id<NSMenuItem> item = nil;
|
||||
NSEnumerator *en = [_items objectEnumerator];
|
||||
|
||||
//
|
||||
// If the menu items are not autoenabled, they should be enabled by default
|
||||
// sincer we're not checking them.
|
||||
//
|
||||
while((item = [en nextObject]) != nil)
|
||||
{
|
||||
[item setEnabled: YES];
|
||||
}
|
||||
}
|
||||
|
||||
if (_menu.needsSizing && ([_aWindow isVisible] || [_bWindow isVisible]))
|
||||
{
|
||||
|
@ -1420,7 +1435,7 @@ static BOOL menuBarVisible = YES;
|
|||
}
|
||||
else
|
||||
{
|
||||
dAuto = NO;
|
||||
dAuto = YES; // if the no-autoenable flag isn't present, then autoenable.
|
||||
}
|
||||
dTitle = [aDecoder decodeObjectForKey: @"NSTitle"];
|
||||
dItems = [aDecoder decodeObjectForKey: @"NSMenuItems"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue