mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Submenu management bugfixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7448 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d74e41f68b
commit
033960073c
3 changed files with 18 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
2000-09-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSMenu.m: ([-setSupermenu:]) don't retain supermenu.
|
||||
* Source/NSMenuItem.m: ([-setSubmenu:]) set target and action for
|
||||
handling submenu, and set supermenu for submenu.
|
||||
([-setMenu:]) if item has a submenu, set supermenu for submenu of item,
|
||||
and set target to be the new menu, so clicking on this item will raise
|
||||
the submenu.
|
||||
|
||||
2000-09-08 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSText.m: Changed varius places to make
|
||||
|
|
|
@ -596,7 +596,7 @@ static NSString *NSMenuLocationsKey = @"NSMenuLocations";
|
|||
|
||||
- (void) setSupermenu: (NSMenu *)supermenu
|
||||
{
|
||||
ASSIGN(menu_supermenu, supermenu);
|
||||
menu_supermenu = supermenu;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -115,6 +115,11 @@ static Class imageClass;
|
|||
- (void) setMenu: (NSMenu*)menu
|
||||
{
|
||||
mi_menu = menu;
|
||||
if (mi_submenu != nil)
|
||||
{
|
||||
[mi_submenu setSupermenu: menu];
|
||||
[self setTarget: mi_menu];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMenu*) menu
|
||||
|
@ -133,6 +138,9 @@ static Class imageClass;
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"submenu already has supermenu: "];
|
||||
ASSIGN(mi_submenu, submenu);
|
||||
[submenu setSupermenu: mi_menu];
|
||||
[self setTarget: mi_menu];
|
||||
[self setAction: @selector(submenuAction:)];
|
||||
}
|
||||
|
||||
- (NSMenu*) submenu
|
||||
|
@ -393,7 +401,6 @@ static Class imageClass;
|
|||
*/
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
[super encodeWithCoder: aCoder];
|
||||
[aCoder encodeObject: mi_title];
|
||||
[aCoder encodeObject: mi_keyEquivalent];
|
||||
[aCoder encodeValueOfObjCType: "I" at: &mi_keyEquivalentModifierMask];
|
||||
|
@ -414,7 +421,6 @@ static Class imageClass;
|
|||
|
||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
{
|
||||
self = [super initWithCoder: aDecoder];
|
||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &mi_title];
|
||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &mi_keyEquivalent];
|
||||
[aDecoder decodeValueOfObjCType: "I" at: &mi_keyEquivalentModifierMask];
|
||||
|
|
Loading…
Reference in a new issue