diff --git a/ChangeLog b/ChangeLog index b087b557e..eabb3c307 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,16 @@ -Fri Dec 3 10:27:00 1999 Richard Frith-Macdonald +Fri Dec 3 11:34:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-updateWindowsItem:]) modified to show document state image with new menus. + ([-changeWindowsitem:title:filename:]) updated to understand filename + format and discard path info. * Source/NSMenuView.m: Implement ([-setNeedsDisplayForItemAtIndex:]) + and fixed ([-itemRemoved:]) to update the highlighted item properly + and avoid a crash. * Source/NSMenuItemCell.m: Fix so that images are drawn. + * Source/NSWindow.m: ([-setTitle:]), ([-setRepresentedFilename:]), + ([-setTitleWithRepresentedFilename:]), ([-setMiniwindowTitle:]) + rewritten to conform to documented behavior. Fri Dec 3 05:21:40 1999 Nicola Pero diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index 8c6aec0bb..3a87c04f2 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -279,7 +279,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess. // // Notification Methods // -- (void)itemChanged: (NSNotification *)notification +- (void) itemChanged: (NSNotification *)notification { int index = [[[notification userInfo] objectForKey: @"NSMenuItemIndex"] intValue]; @@ -291,7 +291,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess. [self setNeedsSizing: YES]; } -- (void)itemAdded: (NSNotification *)notification +- (void) itemAdded: (NSNotification *)notification { int index = [[[notification userInfo] objectForKey: @"NSMenuItemIndex"] intValue]; @@ -314,13 +314,22 @@ static float GSMenuBarHeight = 25.0; // A wild guess. [self setNeedsSizing: YES]; } -- (void)itemRemoved: (NSNotification *)notification +- (void) itemRemoved: (NSNotification *)notification { + int wasHighlighted = [self highlightedItemIndex]; int index = [[[notification userInfo] objectForKey: @"NSMenuItemIndex"] intValue]; + if (index <= wasHighlighted) + { + [self setHighlightedItemIndex: -1]; + } [menuv_itemCells removeObjectAtIndex: index]; + if (wasHighlighted > index) + { + [self setHighlightedItemIndex: --wasHighlighted]; + } // Mark the menu view as needing to be resized. [self setNeedsSizing: YES]; }