Commit graph

183 commits

Author SHA1 Message Date
Kyle J Cardoza
096327e87b Addressed changes requested in PR 201 2023-09-22 15:20:23 -04:00
Kyle J Cardoza
81b59ad0a0 Initial implementation of new GSTheme hooks and default implementations. 2023-09-19 22:20:12 -04:00
fredkiefer
6e417da18e * Source/NSMenuView.m (-mouseDown:): Protect against _window going
away during tracking.
2020-11-29 23:04:50 +01:00
fredkiefer
e85a1a0664 * Source/NSMenuView.m (-attachSubmenuForItemAtIndex:): We should
not use [NSMenu display] for NSWindows95InterfaceStyle as there we
	have two NSMenuViews for the NSMenu.
2017-07-28 19:24:45 +02:00
Fred Kiefer
753415895b 2017-04-01 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSMenu.m (-displayTransient): Update menu before displaying.
	* Source/NSMenuView.m (-attachSubmenuForItemAtIndex:): Use NSMenu
	display method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40431 72102866-910b-0410-8b05-ffd578937521
2017-03-31 22:14:50 +00:00
Fred Kiefer
065d45ff59 * Headers/AppKit/NSMenu.h,
* Source/externs.m: Add NSMenuDidBeginTrackingNotification.
        * Source/NSMenuView.m (-trackWithEvent:): send tracking
        notifications.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39008 72102866-910b-0410-8b05-ffd578937521
2015-09-21 20:37:56 +00:00
Fred Kiefer
56803c6c14 * Source/NSMenuView.m (-heightForItem:): Use
-menuItemCellForItemAtIndex: to protect against an index being to
  big. This happens when the menu does not send notifications and a
  non-existing item gets highlighted.
* Source/NSMenuView.m (-menuItemCellForItemAtIndex:): Protect
  against negative index values.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37279 72102866-910b-0410-8b05-ffd578937521
2013-10-25 22:34:18 +00:00
Eric Wasylishen
326a3d57f4 * Source/GSThemeDrawing.m:
* Headers/Additions/GNUstepGUI/GSTheme.h: Add methods
	-menuSubmenuHorizontalOverlap and -menuSubmenuVerticalOverlap
	wrapping user defaults GSMenuSubmenuHorizontalOverlap and
	GSMenuSubmenuVerticalOverlap
	* Source/NSMenuView.m (-locationForSubmenu:): Offset calculations
	by -[GSTheme menuSubmenuHorizontalOverlap] and
	-[GSTheme menuSubmenuVerticalOverlap]


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37243 72102866-910b-0410-8b05-ffd578937521
2013-10-16 07:08:15 +00:00
Eric Wasylishen
d3be1c555f * Source/NSMenuView.m (heightForItem:, yOriginForItem:):
Accept negative item indicies, which are passed in when
opening the preferences window in TextEdit. Need to investigate
further why that is happening.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37184 72102866-910b-0410-8b05-ffd578937521
2013-10-03 00:35:27 +00:00
Eric Wasylishen
ea8ded398f * Source/NSMenuView.m: Read the menu item/menu bar/separator
height from GSTheme.
* Headers/Additions/GNUstepGUI/GSTheme.h:
* Source/GSThemeDrawing.m: Add -menuBarHeight, -menuItemHeight,
-menuSeparatorHeight. Corresponding defaults are GSMenuBarHeight,
GSMenuItemHeight, GSMenuSeparatorHeight


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37182 72102866-910b-0410-8b05-ffd578937521
2013-10-02 22:06:24 +00:00
Germán Arias
b8217cb63e Don't change the location of submenus in NSMacintoshInterfaceStyle.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37161 72102866-910b-0410-8b05-ffd578937521
2013-09-27 22:20:12 +00:00
Germán Arias
2decccabe0 Close popup if user press a modifier flag an theme process events.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37158 72102866-910b-0410-8b05-ffd578937521
2013-09-27 07:47:01 +00:00
Germán Arias
4877916592 Revert last change and implement a better solution.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37157 72102866-910b-0410-8b05-ffd578937521
2013-09-27 04:33:30 +00:00
Germán Arias
4fe34147c1 Ignore the first mouse up in transient menus if style is NSWindows95InterfaceStyle.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36852 72102866-910b-0410-8b05-ffd578937521
2013-07-08 19:20:36 +00:00
Fred Kiefer
d4f80c2258 Change NSEvent to CGFloat, NSUInteger and NSInteger.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36121 72102866-910b-0410-8b05-ffd578937521
2013-02-13 08:40:36 +00:00
David Chisnall
40fb48e5de Next bit of NSInteger cleanup for -gui.
Fix all of the current warnings in Gorm so that it can be used to test
NSInteger things.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36039 72102866-910b-0410-8b05-ffd578937521
2013-01-30 12:43:27 +00:00
Fred Kiefer
e9f1eff154 Started rewrite that simplifies menu tracking code.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33926 72102866-910b-0410-8b05-ffd578937521
2011-10-01 14:09:56 +00:00
Fred Kiefer
1c39281aaf Merge original in-window menu branch.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33924 72102866-910b-0410-8b05-ffd578937521
2011-10-01 11:17:16 +00:00
Eric Wasylishen
56bf8c17be * Source/NSMenuView.m (-_trackWithEvent:): Fix for the bug where
the highlighted menu item can be offset from the mouse pointer
location when menu windows are moved by the window manager. See
detailed comment in the code for more info.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33508 72102866-910b-0410-8b05-ffd578937521
2011-07-11 02:58:36 +00:00
Eric Wasylishen
1bc738ec3e * Source/NSMenuView.m: Allow any mouse up (left/right/other)
to choose a menu item.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33435 72102866-910b-0410-8b05-ffd578937521
2011-07-03 06:47:41 +00:00
Eric Wasylishen
eb4dc65d90 * Source/NSMenuView.m (-setWindowFrameForAttachingToRect:...):
This method mixed user space and window base coordinates in some
places, which I fixed.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32888 72102866-910b-0410-8b05-ffd578937521
2011-04-18 21:10:55 +00:00
Fred Kiefer
486fa5a2eb Use _trackWithEvent: instead of trackWithEvent: to have just one mouse capture call.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32629 72102866-910b-0410-8b05-ffd578937521
2011-03-17 10:26:14 +00:00
Fred Kiefer
2e738f7ba2 Correct issues with missing or incorrect self
tests in initXXX methods pointed out by static analyser.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32588 72102866-910b-0410-8b05-ffd578937521
2011-03-14 22:59:20 +00:00
Fred Kiefer
2d01942e4b Replace #include -> #import
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32451 72102866-910b-0410-8b05-ffd578937521
2011-03-04 11:33:22 +00:00
Eric Wasylishen
77cdf8bbea Release mouse before invoking menu action
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32307 72102866-910b-0410-8b05-ffd578937521
2011-02-22 22:22:01 +00:00
Fred Kiefer
c6b1c45739 * Source/NSMenuView.m (-trackWithEvent:): Rewrite that uses mouse
capture to ensure we get mouse events outside our windows.
Patch by Christopher Armstrong <carmstrong@fastmail.com.au>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32273 72102866-910b-0410-8b05-ffd578937521
2011-02-22 00:22:46 +00:00
Fred Kiefer
906201acf6 Remove dead assignments found by static code analysis.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32022 72102866-910b-0410-8b05-ffd578937521
2011-02-09 22:20:00 +00:00
Germán Arias
6370fa3b07 Fixed problems with menu in windows: transient menus and pop-ups.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31938 72102866-910b-0410-8b05-ffd578937521
2011-01-24 07:02:15 +00:00
Gregory John Casamento
8133269602 * Source/NSMenuView.m: Fix to previous change to
[NSMenuView _executeItemAtIndex:removeSubmenu:].  
	Assign attachedMenu to local variable and test for nil
	prior to entering the code to close the menu when tracking
	the mouse for normal menus.  Previous version of this code 
	was causing menu items owned by pull downs (NSPopUpButton) to 
	close prior to mouse up event.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31896 72102866-910b-0410-8b05-ffd578937521
2011-01-16 04:42:44 +00:00
Germán Arias
f999016f34 Applied changes in menuInWindow.patch
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31895 72102866-910b-0410-8b05-ffd578937521
2011-01-16 00:32:54 +00:00
Germán Arias
90687109f7 Improvements for menu in window
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31857 72102866-910b-0410-8b05-ffd578937521
2011-01-08 07:04:57 +00:00
Germán Arias
a803a8f4c2 Fixed the tracking of mouse at horizontal menu
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31844 72102866-910b-0410-8b05-ffd578937521
2011-01-07 05:27:29 +00:00
Wolfgang Lux
abd36c5caa Make pop up menus in Macintosh menu style behave more similar to OS X.
In particular, when the user clicks the button, the menu stays open
until the next click.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31802 72102866-910b-0410-8b05-ffd578937521
2010-12-30 20:13:14 +00:00
Wolfgang Lux
b436fc237c Make pop up menus in Macintosh menu style behave more similar to OS X.
In particular, when the user clicks the button, the menu stays open
until the next click.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31801 72102866-910b-0410-8b05-ffd578937521
2010-12-30 20:10:37 +00:00
Wolfgang Lux
2583abd450 Various fixes for menus in Macintosh interface style (some apply to
Windows95 style as well).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31800 72102866-910b-0410-8b05-ffd578937521
2010-12-30 19:56:03 +00:00
Gregory John Casamento
cc3ce8896e * Source/GSThemeMenu.m: Added implementation for
updateAllWindowsWithMenu:, updateMenu:forWindow:, altered
	implementation for setMenu:forWindow:, added private method
	_setMenu: to set the current menu on the window.
	* Source/GSWindowDecorationView.m: Changes to layout
	* Source/NSMenu.m: Only call the method updateAllWindowsWithMenu:
	when NSMenuInterfaceStyle = NSWindows95InterfaceStyle.
	* Source/NSMenuView.m: Change to -update so that it does not
	render the top bar of the menu if NSMenuInterfaceStyle =
	NSWindows95InterfaceStyle.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31782 72102866-910b-0410-8b05-ffd578937521
2010-12-27 07:05:38 +00:00
Jonathan Gillaspie
77495ccde1 Prevent trying to retrieve a menuCell that is out of range.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31729 72102866-910b-0410-8b05-ffd578937521
2010-12-13 17:50:09 +00:00
Gregory John Casamento
72963b2f49 Added theming for NSMenuView into GSTheme.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31660 72102866-910b-0410-8b05-ffd578937521
2010-11-26 20:28:45 +00:00
Fred Kiefer
eb812a70c0 Revert the WinUX theme specific patch Doug put in some time ago.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31522 72102866-910b-0410-8b05-ffd578937521
2010-10-17 12:19:24 +00:00
Doug Simons
56e074cdb8 fix problem of pulldown action not being called for correct cell, and being called twice on Windows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31213 72102866-910b-0410-8b05-ffd578937521
2010-08-30 23:02:21 +00:00
Wolfgang Lux
3ec0536ba5 Better placement of pull down menus. If there is not enough room at
the preferred edge display the menu at the opposite edge.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31040 72102866-910b-0410-8b05-ffd578937521
2010-07-26 22:13:11 +00:00
Wolfgang Lux
85c794ab22 While shifting a menu on screen that is partially off screen, correctly
handle the cases where the menu is off screen on the top and the left
side of the screen, respectively. This fixes bug #31415.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31038 72102866-910b-0410-8b05-ffd578937521
2010-07-26 19:16:18 +00:00
Fred Kiefer
2eb0a85405 Try to correct bug #30025. This corrects the initial display of a popup
button.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30964 72102866-910b-0410-8b05-ffd578937521
2010-07-14 22:21:59 +00:00
Wolfgang Lux
1c4797d2a0 When sizing a menu view correctly take into account that the first
item of a pull down menu is not visible.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30837 72102866-910b-0410-8b05-ffd578937521
2010-06-23 21:38:29 +00:00
Wolfgang Lux
4a7cd92c2d Fix display of pull down menus to not show their first item, which
holds the title, and fix the attachment of pull down menus to their
button. In addition, fix -setTitle: to actually set the title of a
pull down menu.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30807 72102866-910b-0410-8b05-ffd578937521
2010-06-22 07:34:31 +00:00
Fred Kiefer
7e289df84b Yet another set of #include -> #import replacement.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30083 72102866-910b-0410-8b05-ffd578937521
2010-03-31 08:14:50 +00:00
Fred Kiefer
53381f6992 Some more #include -> #import replacement.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30036 72102866-910b-0410-8b05-ffd578937521
2010-03-25 21:30:28 +00:00
Eric Wasylishen
56dc23f173 Make NSMenuView return NO for isOpaque
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29596 72102866-910b-0410-8b05-ffd578937521
2010-02-13 00:07:57 +00:00
Eric Wasylishen
f03ffb9793 Create a new GSTheme method for drawing the background of NSMenuView,
-drawBackgroundForMenuView:withFrame:dirtyRect:horizontal:


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29430 72102866-910b-0410-8b05-ffd578937521
2010-01-28 04:28:23 +00:00
Quentin Mathe
84683f1c4d Added the possibility to customize the title view look and behavior in a theme
with a GSTitleView subclass.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29419 72102866-910b-0410-8b05-ffd578937521
2010-01-27 11:29:07 +00:00