diff --git a/ChangeLog b/ChangeLog index 164724897..001acedc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-07-08 16:15-EDT Gregory John Casamento + + * Source/NSMenu.m: Beginning of support for windows style menus on the + top of the window. + * Source/NSWindow.m: Added code in the method -setFrameFromString: to + make certain the window doesn't go out of bounds if the screen size + changes. + 2008-07-02 Fred Kiefer * Headers/AppKit/NSPopUpButton.h, diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 43ed0a4fd..e88fe3b24 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -145,8 +145,9 @@ static BOOL menuBarVisible = YES; - (NSString*) _locationKey { - if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) - == NSMacintoshInterfaceStyle) + NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); + if (style == NSMacintoshInterfaceStyle || + style == NSWindows95InterfaceStyle) { return nil; } @@ -1486,8 +1487,9 @@ static BOOL menuBarVisible = YES; - (void) _showTornOffMenuIfAny: (NSNotification*)notification { - if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) - == NSMacintoshInterfaceStyle) + NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); + if (style == NSMacintoshInterfaceStyle || + style == NSWindows95InterfaceStyle) { return; } @@ -1727,7 +1729,8 @@ static BOOL menuBarVisible = YES; NSMenuView *newRep; newRep = [[NSMenuView alloc] initWithFrame: NSZeroRect]; - if (newStyle == NSMacintoshInterfaceStyle) + if (newStyle == NSMacintoshInterfaceStyle || + newStyle == NSWindows95InterfaceStyle) { [newRep setHorizontal: YES]; } diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 66fa5b1d9..5aaa844c5 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -4483,6 +4483,14 @@ current key view.
{ fRect.origin.y = nRect.origin.y + (fRect.origin.y - nRect.origin.y) * (nRect.size.height / sRect.size.height); + + /* + * If height of the window goes above the screen height, then adjust the window down. + */ + if ((fRect.size.height + fRect.origin.y) > nRect.size.height) + { + fRect.origin.y = fRect.origin.y - ((fRect.size.height + fRect.origin.y) - nRect.size.height); + } } /* If we aren't resizable (ie. if we don't have a resize bar), make sure