Commit graph

167 commits

Author SHA1 Message Date
fredkiefer
db54238627 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
fredkiefer
0de761d88e 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
ericwa
5a6cc44ba3 * 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
ericwa
3272af2163 * 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
ericwa
3067b0465d * 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
fredkiefer
6dd53d2980 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
fredkiefer
8cf1cd3bab 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
fredkiefer
3cdc68a09b 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
ericwa
dbc85d3b9a 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
fredkiefer
5c86b5e9bc * 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
fredkiefer
475f2d07aa 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
espectador
2d2edfca4f 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
gcasa
11d7762cec * 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
espectador
b3d789fcec 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
espectador
285febd6c4 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
espectador
b7d5dadadd 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
wlux
40a085631a 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
wlux
ffe89ad119 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
wlux
507a365344 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
gcasa
74c604cbb0 * 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
jonathanosx
6b7156882f 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
gcasa
10fb5175e7 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
fredkiefer
687d59cb1a 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
dpsimons
ae51e23b36 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
wlux
52d2e5cf3b 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
wlux
b623ba6665 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
fredkiefer
5b7393b71d 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
wlux
6e30942930 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
wlux
bc7dabba43 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
fredkiefer
3d559c477e 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
fredkiefer
c06bffe250 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
ericwa
fb11be2f73 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
ericwa
775d9caf51 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
qmathe
05a3aad048 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
ericwa
dd093185eb * 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
gcasa
77635ad0d1 * 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
gcasa
384da96300 * 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
gcasa
6573b6c50f * 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
gcasa
d9f18ec9b4 * 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
gcasa
771bce4672 * 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
rmottola
d983415d4d 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
fredkiefer
511b5be242 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
fedor
ce41d782c1 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
fredkiefer
f580b967f4 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
fredkiefer
f333fe138b 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
fredkiefer
0cf68500dd 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
fredkiefer
f76e07d9af 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
fredkiefer
e25cceb710 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
rfm
054846e3ea 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
stoyan
65f76b0d62 (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