[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] NSMenu patch version 2.
From: |
Willem Rein Oudshoorn |
Subject: |
[PATCH] NSMenu patch version 2. |
Date: |
06 Mar 2003 16:29:45 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
This is the rewritten NSMenu patch. It fixes
#100248 - Ghost menu
#101875 - Menu flickering
#101877 - Menu does not move down
#101880 - popupbutton does not scroll
It should also behave correctly with respect to highlighting
and opening closing menus. (Correct means, as I understood
it is supposed to work.)
Besides bug fixes the main changes are:
* Added a NSMenuView protocol for the menu representation
Tried to achieve cleaner seperation between NSMenu and
the NSMenuView. This can be used to implement
horizontal menus without cluttering the NSMenuView as it
is now.
I think it is better this way, but the limited API
between NSMenu and NSMenuView makes it a little difficult
to achieve nice menu behaviour.
As it is now the current NSMenuView should be mixable with
other implementations of the NSMenuView protocol. But
this has not been tested.
* Moved TitleView to the NSMenuView
I think displaying the title of the menu is part of the
responsibility of the NSMenuView instead of the NSMenu.
* Added documentation to the NSMenu and NSMenuView.
Although not completely finished it is, hopefully, better
than it was.
Wim Oudshoorn.
[ChangeLog, is also included in the patch]
2003-03-06 Willem Rein Oudshoorn <woudshoo@xs4all.nl>
* Source/NSMenuView.m: Added NSMenuTitleView (moved
from NSMenu).
([NSMenuView -detachSubmenu]): Removed setting highlighting.
([NSMenuView -attachSubmenuForItemAtIndex:]) added logging.
([NSMenuView -update]): Handle _titleView.
([NSMenuView -sizeToFit]): Take titleView into account
([NSMenuView -performActionWithHighlightingForItemAtIndex:]):
restore old highlighting.
([NSMenuView -trackWithEvent:]): Rewritten.
([NSMenuView -mouseDown:]): Only restore menu position
when needed.
([NSMenuView -rightMouseDown:theEvent]): On menus treat
as ordinary mouse down to avoid rightclick menus on menus.
* Source/NSMenu.m (NSView): Moved NSMenuWindowTitleView to
NSMenuView. Added comments. Added -_updateUserDefaults:,
-_menuMoved: methods to track moving menus.
Renamed -_setTornOff: to -setTornOff:, -isFollowTransient to
-isTransient.
([NSMenu -initWithTitle:]): Remove some old comments, remove
reference to titleView, listen to window move notification and
enqueued move notification.
([NSMenu -attachedMenu]): Adjusted for renamed ivar.
([NSMenu -sizeToFit]): Remove references to titleView
([NSMenu -setTornOff:]): Remove references to titleView,
call update to NSMenuView instead.
([NSMenu -isPartlyOffScreen]): Do not depend in removed ivar.
([NSMenu -_performMenuClose:]): adjust to renamed methods, will
force synchronization of userdefaults.
([NSMenu -displayTransient]): Removed references to _titleView,
remember the highlighted index to restore with -closeTransient.
([NSMenu -close]): remove references to _titleview, use methods instead
of relying on ivars. added call to update on menu representation.
([NSMenu -closeTransient]): Remove references to _titleView, restore
highlighted index. Call update on menu representantation.
([NSMenu -shiftOnScreen]): Rewrote to move in x and y direction
simultanuously.
([NSMenuWindowTitleView -acceptsFirstMouse:]): Removed useless
code to set menuview for itemCells.
* Headers/gnustep/gui/NSMenuView.h: added ivar _titleView.
(moved from NSMenu).
* Headers/gnustep/gui/NSMenu.h: Added NSMenuView protocol,
added documentation to NSMenu class.
(MSMenu): Removed ivar _titleView, _isPartlyOffScreen, added
ivar _oldHighlightedIndex. Renamed method -isFollowTransient to
-isTransient. Removed method -nestedCheckOffScreen
NSMenu-patch.diff.bz2
Description: NSMenu patch