Don't validate menu items in design menus in Gorm.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@30466 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-05-28 21:46:07 +00:00
parent b8cc207f46
commit 35848ad6fd
4 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2010-05-28 Wolfgang Lux <wolfgang.lux@gmail.com>
* Palettes/0Menus/GormNSMenu.h:
* Palettes/0Menus/GormNSMenu.m:
* Palettes/0Menus/GormMenuAttributesInspector.m: Don't validate
menu items in design menus.
2010-05-28 Wolfgang Lux <wolfgang.lux@gmail.com>
* GormCore/GormDocument.h:

View file

@ -33,6 +33,7 @@
*/
#include "GormMenuAttributesInspector.h"
#include "GormNSMenu.h"
#include <Foundation/NSNotification.h>
@ -134,7 +135,7 @@
doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
[titleText setStringValue: [object title]];
[autoenable setState: ([object autoenablesItems]?NSOnState:NSOffState)];
[autoenable setState: ([object realAutoenablesItems]?NSOnState:NSOffState)];
// set up the menu type matrix...
if([doc windowsMenu] == object)

View file

@ -28,6 +28,7 @@
@interface GormNSMenu : NSMenu
+ (GormNSMenu *) menuWithMenu: (NSMenu *)menu;
- (BOOL) realAutoenablesItems;
@end
#endif

View file

@ -209,6 +209,18 @@
[super dealloc];
}
// Override -autoenablesItems to disable menu validation for design menus in
// Gorm. This avoids disabling menu items by default in Gorm documents.
- (BOOL) realAutoenablesItems
{
return [super autoenablesItems];
}
- (BOOL) autoenablesItems
{
return NO;
}
- (NSString*) _locationKey
{
if ([self supermenu] == nil)