* Source/NSMenu.m: Do not show the menu at the top of the screen in

NSWindows95InterfaceStyle mode. 

	NOTE: This is the first half of the commits for the in-window menu
	changes.  The next change will entail regenerating the menu for each
	window.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29210 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2010-01-05 08:37:44 +00:00
parent 2de8faf99a
commit 210a987660
2 changed files with 30 additions and 0 deletions

View file

@ -108,6 +108,9 @@
/* Subclass of NSPanel since menus cannot become key */
@interface NSMenuPanel : NSPanel
{
NSMenu *_the_menu;
}
@end
@interface NSMenuView (GNUstepPrivate)
@ -133,6 +136,11 @@ static BOOL menuBarVisible = YES;
@implementation NSMenuPanel
- (void) _setmenu: (NSMenu *)menu
{
_the_menu = menu;
}
- (BOOL) canBecomeKeyWindow
{
/* See [NSWindow-_lossOfKeyOrMainWindow] */
@ -140,6 +148,20 @@ static BOOL menuBarVisible = YES;
return YES;
return NO;
}
- (void) orderFrontRegardless
{
NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil);
if (style == NSWindows95InterfaceStyle)
{
// if we're the top level menu in Windows mode, don't show it.
if([_the_menu supermenu] == nil)
{
return;
}
}
[super orderFrontRegardless];
}
@end
@implementation NSMenu (GNUstepPrivate)
@ -185,6 +207,7 @@ static BOOL menuBarVisible = YES;
[win setLevel: NSSubmenuWindowLevel];
[win setWorksWhenModal: NO];
[win setBecomesKeyOnlyIfNeeded: YES];
[win _setmenu: self];
return win;
}
@ -1328,10 +1351,12 @@ static BOOL menuBarVisible = YES;
* menu, we will still have it recorded as ours, but it won't be
* in our view hierarchy, so we have to re-add it.
*/
/*
if (contentView != [menuRep superview])
{
[contentView addSubview: menuRep];
}
*/
return;
}