diff --git a/ChangeLog b/ChangeLog index 4639ea7cf..90f2e8a8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * Source/NSMenuView.m: some fixes to get things to work correctly when calling menu item actions. Also autoenable should be working a little better. + In setHighlightedItemIndex: if new item is disabled do not + highlight or target action. * Source/NSMenuItemCell.m: drawing fixes for disabled cells. 1999-07-20 Michael Hanni diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index c20680a50..28c61cf34 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -140,7 +140,6 @@ static float GSMenuBarHeight = 25.0; // a guess. - (void)setHighlightedItemIndex: (int)index { id anItem; - BOOL _closeASubmenu = NO; [self lockFocus]; @@ -173,20 +172,24 @@ static float GSMenuBarHeight = 25.0; // a guess. } if (menuv_highlightedItemIndex != index) { + anItem = [menuv_items_link objectAtIndex: index]; - [anItem highlight: YES - withFrame: [self rectOfItemAtIndex: index] - inView: self]; + if ([anItem isEnabled]) + { + [anItem highlight: YES + withFrame: [self rectOfItemAtIndex: index] + inView: self]; - [anItem setState: 1]; + [anItem setState: 1]; - if ([anItem hasSubmenu] && ![[anItem target] isTornOff]) - [[anItem target] display]; + if ([anItem hasSubmenu] && ![[anItem target] isTornOff]) + [[anItem target] display]; + } // set ivar to new index menuv_highlightedItemIndex = index; - } else { + } else { menuv_highlightedItemIndex = -1; } }