Commit graph

165 commits

Author SHA1 Message Date
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
Eric Wasylishen
07f8682baf * Source/NSMenuView.m: For horizontal menus, treat clicking in the
8 pixels of padding to the left of the first menu item as activating
the first menu item.
This lets you open the application menu with a Macintosh-syle
menu bar when the mouse is on the top-left pixel of the screen.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29375 72102866-910b-0410-8b05-ffd578937521
2010-01-24 00:08:32 +00:00
Gregory John Casamento
cf119063e9 * Source/NSMenuView.m: Removed adjustment to Y coords in the
setWindowFrame... method.  This adjustment is only supposed to be
	done when a popup is under "restrictive screen conditions" which
	is currently unimplemented.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28191 72102866-910b-0410-8b05-ffd578937521
2009-04-10 05:33:14 +00:00
Gregory John Casamento
f5a5223ac1 * Source/NSMenuView.m: In the method
- (void) setWindowFrameForAttachingToRect:... test if the view
	is flipped and make the adjustment.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28190 72102866-910b-0410-8b05-ffd578937521
2009-04-10 05:15:24 +00:00
Gregory John Casamento
59d5a9818b * Source/NSMenuView.m: In the method
- (void) setWindowFrameForAttachingToRect:... changed how
	popup/pulldown buttons handle the preferred edge.
	Per Cocoa documentation, the selected cell should always show up
	over the button for popups.   For pull down menus, the preferred 
	edge is relevant.   This is also apparent from testing under Cocoa.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28189 72102866-910b-0410-8b05-ffd578937521
2009-04-10 04:54:24 +00:00
Gregory John Casamento
6d63225010 * Source/NSMenuView.m: Return from the trackWithEvent: method
if the indexOfActionToExecute is -1.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27690 72102866-910b-0410-8b05-ffd578937521
2009-01-25 16:44:35 +00:00
Gregory John Casamento
29fdc21b77 * Source/NSMenuView.m: Refactor code which executes the action
of a menu item at a given index into a separate method to make it
	easier to override this behavior when necessary.   Added method 
	_executeItemAtIndex:removeSubmenu:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27680 72102866-910b-0410-8b05-ffd578937521
2009-01-25 11:41:57 +00:00
Riccardo Mottola
1c25d7e977 Convert between window and view coordinate system for NSMenuView.
Correct small bugs in last NSDocument rework.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27661 72102866-910b-0410-8b05-ffd578937521
2009-01-23 22:01:40 +00:00
Fred Kiefer
dda7640fa5 First attempt at in window menus.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27649 72102866-910b-0410-8b05-ffd578937521
2009-01-22 09:19:22 +00:00
Adam Fedor
7afdd32ac1 Revert library license version to 2 until applications can be converted
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26619 72102866-910b-0410-8b05-ffd578937521
2008-06-10 04:01:49 +00:00
Fred Kiefer
96f343878a Better size integration between a popup and the menu view.
Reworked patch by Matt Rice <ratmice@gmail.com>. 


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26093 72102866-910b-0410-8b05-ffd578937521
2008-02-18 20:45:24 +00:00
Fred Kiefer
d8b13a0a6d White space clean up.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26080 72102866-910b-0410-8b05-ffd578937521
2008-02-17 17:18:34 +00:00
Fred Kiefer
65ceda6b9d Patch by Matt Rice to get popup buttons that support
setUsesItemFromMenu: set to NO.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26036 72102866-910b-0410-8b05-ffd578937521
2008-02-07 19:12:59 +00:00
Fred Kiefer
d5e445c620 Add support for popup preferred edge.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26023 72102866-910b-0410-8b05-ffd578937521
2008-02-04 14:56:15 +00:00
Fred Kiefer
193e31e678 Change all files to use GPL 3 and LGPL 3.
Prepare for next release.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25536 72102866-910b-0410-8b05-ffd578937521
2007-10-29 21:16:17 +00:00
Richard Frith-MacDonald
b4441a1798 Minor menu adjustments.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24601 72102866-910b-0410-8b05-ffd578937521
2007-02-16 11:33:53 +00:00
Sergii Stoian
02beced9a5 (menuBarHeight): Fix calculation. Set minimum height to 22.
(setFont:): Fix calculation default cell size.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24570 72102866-910b-0410-8b05-ffd578937521
2007-02-14 17:23:59 +00:00
Richard Frith-MacDonald
57435da7d5 tidyups and minor theme tiling updates.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23871 72102866-910b-0410-8b05-ffd578937521
2006-10-15 08:34:47 +00:00
Richard Frith-MacDonald
c033d17a2d merge in themes branch to keep in sync
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23705 72102866-910b-0410-8b05-ffd578937521
2006-10-02 05:09:48 +00:00