Author: dpsimons
Date: Mon Jul 14 22:08:26 2014
New Revision: 37996
URL: http://svn.gna.org/viewcvs/gnustep?rev=37996&view=rev
Log:
Implemented NSMenu removeAllItems method
Modified:
libs/gui/branches/gnustep_testplant_branch/ChangeLog
libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenu.h
libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m
Modified: libs/gui/branches/gnustep_testplant_branch/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/ChangeLog?rev=37996&r1=37995&r2=37996&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/ChangeLog (original)
+++ libs/gui/branches/gnustep_testplant_branch/ChangeLog Mon Jul 14
22:08:26 2014
@@ -1,3 +1,8 @@
+2014-07-14 Doug Simons <[email protected]>
+
+ * Headers/NSMenu.h
+ * Source/NSMenu.m: Implemented removeAllItems method.
+
2013-02-18 Frank Le Grand <[email protected]>
* Source\NSToolbarItem.m: Fixed a bug where calling setImage:
Modified: libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenu.h
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenu.h?rev=37996&r1=37995&r2=37996&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenu.h
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenu.h Mon Jul
14 22:08:26 2014
@@ -568,6 +568,10 @@
*/
- (void) removeItemAtIndex: (NSInteger)index;
+/** Removes all menu items.
+ */
+- (void) removeAllItems;
+
/** Sets if a menu does autoenable.
*/
- (void) setAutoenablesItems: (BOOL)flag;
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m?rev=37996&r1=37995&r2=37996&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m (original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m Mon Jul 14
22:08:26 2014
@@ -829,6 +829,15 @@
[self menuChanged];
}
+- (void) removeAllItems
+{
+ [_items makeObjectsPerformSelector:@selector(setMenu:) withObject:nil];
+ [_items removeAllObjects];
+ _menu.needsSizing = YES;
+ [(NSMenuView*)_view setNeedsSizing: YES];
+ [self menuChanged];
+}
+
- (void) itemChanged: (id <NSMenuItem>)anObject
{
NSNotification *changed;
@@ -1563,6 +1572,10 @@
forView: (NSView *)view
withFont: (NSFont *)font
{
+ NSPoint point = [view frame].origin;
+ point = [[view superview] convertPoint:point toView:nil];
+ point = [[view window] convertBaseToScreen: point];
+// [[menu window] setFrameOrigin:point];
[menu _rightMouseDisplay: event];
}
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs