mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 12:01:16 +00:00
Correcting some menu difficulties with Gorm.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@17827 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7c8894276f
commit
7b2f9f74b4
6 changed files with 78 additions and 11 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2003-10-12 23:25 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* GormInspectorsManager.m: Corrected method of disassociating
|
||||||
|
connection after exception.
|
||||||
|
* GormMenuEditor.m: Added _findAll:withArray: and _findAllSubmenus:
|
||||||
|
to recursively collect all objects which should be deleted from the
|
||||||
|
nameTable when the user deletes a menu item.
|
||||||
|
* Palettes/0Menus/GormMenuInspectors.m: Eliminated uneeded variable
|
||||||
|
and corrected method being called to eliminate previous setting
|
||||||
|
of services/window menu.
|
||||||
|
* Palettes/0Menus/GormNSMenu.m: Beginnings of fix to prevent Gorm
|
||||||
|
from loading all menus at once.
|
||||||
|
|
||||||
2003-10-12 01:49 Gregory John Casamento <greg_casamento@yahoo.com>
|
2003-10-12 01:49 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* GormDocument.m: Added code to help with copy/paste issue.
|
* GormDocument.m: Added code to help with copy/paste issue.
|
||||||
|
|
4
Gorm.m
4
Gorm.m
|
@ -517,9 +517,9 @@ NSString *GormDidDeleteClassNotification = @"GormDidDeleteClassNotification";
|
||||||
forKey: @"ApplicationName"];
|
forKey: @"ApplicationName"];
|
||||||
[dict setObject: @"[GNUstep | Graphical] Object Relationship Modeller"
|
[dict setObject: @"[GNUstep | Graphical] Object Relationship Modeller"
|
||||||
forKey: @"ApplicationDescription"];
|
forKey: @"ApplicationDescription"];
|
||||||
[dict setObject: @"Gorm 0.4.1 (Beta)"
|
[dict setObject: @"Gorm 0.4.3 (Beta)"
|
||||||
forKey: @"ApplicationRelease"];
|
forKey: @"ApplicationRelease"];
|
||||||
[dict setObject: @"0.4.1 Oct 12 2003"
|
[dict setObject: @"0.4.3 Oct 12 2003"
|
||||||
forKey: @"FullVersionID"];
|
forKey: @"FullVersionID"];
|
||||||
[dict setObject: [NSArray arrayWithObjects: @"Gregory John Casamento <greg_casamento@yahoo.com>",
|
[dict setObject: [NSArray arrayWithObjects: @"Gregory John Casamento <greg_casamento@yahoo.com>",
|
||||||
@"Richard Frith-Macdonald <rfm@gnu.org>",
|
@"Richard Frith-Macdonald <rfm@gnu.org>",
|
||||||
|
|
|
@ -1074,8 +1074,8 @@ selectCellWithString: (NSString*)title
|
||||||
NSString *msg = [NSString stringWithFormat: @"Cannot establish connection: %@",
|
NSString *msg = [NSString stringWithFormat: @"Cannot establish connection: %@",
|
||||||
[localException reason]];
|
[localException reason]];
|
||||||
// get rid of the bad connector and recover.
|
// get rid of the bad connector and recover.
|
||||||
[[currentConnector source] setTarget: nil]; // unset these values on the source.
|
[currentConnector setDestination: nil];
|
||||||
[[currentConnector source] setAction: nil]; // ibid.
|
[currentConnector establishConnection];
|
||||||
[[(id<IB>)NSApp activeDocument] removeConnector: currentConnector];
|
[[(id<IB>)NSApp activeDocument] removeConnector: currentConnector];
|
||||||
NSRunAlertPanel(_(@"Problem making connection"), msg,
|
NSRunAlertPanel(_(@"Problem making connection"), msg,
|
||||||
_(@"OK"),nil,nil,nil);
|
_(@"OK"),nil,nil,nil);
|
||||||
|
@ -1135,8 +1135,8 @@ selectCellWithString: (NSString*)title
|
||||||
NSString *msg = [NSString stringWithFormat: @"Cannot establish connection: %@",
|
NSString *msg = [NSString stringWithFormat: @"Cannot establish connection: %@",
|
||||||
[localException reason]];
|
[localException reason]];
|
||||||
// get rid of the bad connector and recover.
|
// get rid of the bad connector and recover.
|
||||||
[[currentConnector source] setTarget: nil]; // unset these values on the source.
|
[currentConnector setDestination: nil];
|
||||||
[[currentConnector source] setAction: nil]; // ibid.
|
[currentConnector establishConnection];
|
||||||
[[(id<IB>)NSApp activeDocument] removeConnector: currentConnector];
|
[[(id<IB>)NSApp activeDocument] removeConnector: currentConnector];
|
||||||
NSRunAlertPanel(_(@"Problem making connection"), msg,
|
NSRunAlertPanel(_(@"Problem making connection"), msg,
|
||||||
_(@"OK"),nil,nil,nil);
|
_(@"OK"),nil,nil,nil);
|
||||||
|
|
|
@ -506,6 +506,43 @@
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// find all subitems for the given items...
|
||||||
|
- (void) _findAll: (id)item withArray: (NSMutableArray *)array
|
||||||
|
{
|
||||||
|
[array addObject: item];
|
||||||
|
if([item isKindOfClass: [NSMenuItem class]])
|
||||||
|
{
|
||||||
|
if([item hasSubmenu])
|
||||||
|
{
|
||||||
|
NSMenu *submenu = [item submenu];
|
||||||
|
NSArray *items = [submenu itemArray];
|
||||||
|
NSEnumerator *e = [items objectEnumerator];
|
||||||
|
id i = nil;
|
||||||
|
|
||||||
|
[array addObject: submenu];
|
||||||
|
while((i = [e nextObject]) != nil)
|
||||||
|
{
|
||||||
|
[self _findAll: i withArray: array];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// find all sub items for the selections...
|
||||||
|
- (NSArray *) _findAllSubmenus: (NSArray *)array
|
||||||
|
{
|
||||||
|
NSEnumerator *e = [array objectEnumerator];
|
||||||
|
id i = nil;
|
||||||
|
NSMutableArray *results = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
|
while((i = [e nextObject]) != nil)
|
||||||
|
{
|
||||||
|
[self _findAll: i withArray: results];
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) deleteSelection
|
- (void) deleteSelection
|
||||||
{
|
{
|
||||||
if ([selection count] > 0)
|
if ([selection count] > 0)
|
||||||
|
@ -513,14 +550,20 @@
|
||||||
NSArray *s = [NSArray arrayWithArray: selection];
|
NSArray *s = [NSArray arrayWithArray: selection];
|
||||||
NSEnumerator *e = [s objectEnumerator];
|
NSEnumerator *e = [s objectEnumerator];
|
||||||
NSMenuItem *i;
|
NSMenuItem *i;
|
||||||
|
NSArray *d = nil;
|
||||||
|
|
||||||
[self makeSelectionVisible: NO];
|
[self makeSelectionVisible: NO];
|
||||||
[self selectObjects: [NSArray array]];
|
[self selectObjects: [NSArray array]];
|
||||||
|
|
||||||
|
// find all relavent objects. Remove them from the nameTable.
|
||||||
|
d = [self _findAllSubmenus: s];
|
||||||
|
[document detachObjects: d];
|
||||||
|
|
||||||
|
// remove the items from the menu...
|
||||||
while ((i = [e nextObject]) != nil && [edited numberOfItems] > 1)
|
while ((i = [e nextObject]) != nil && [edited numberOfItems] > 1)
|
||||||
{
|
{
|
||||||
[edited removeItem: i];
|
[edited removeItem: i];
|
||||||
}
|
}
|
||||||
[document detachObjects: s];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,9 @@
|
||||||
|
|
||||||
- (void) setObject: (id)anObject
|
- (void) setObject: (id)anObject
|
||||||
{
|
{
|
||||||
BOOL flag = NO;
|
|
||||||
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
|
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
|
||||||
|
// BOOL flag = NO;
|
||||||
|
|
||||||
[super setObject: anObject];
|
[super setObject: anObject];
|
||||||
[titleText setStringValue: [object title]];
|
[titleText setStringValue: [object title]];
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@
|
||||||
[doc setWindowsMenu: [self object]];
|
[doc setWindowsMenu: [self object]];
|
||||||
if([doc servicesMenu] == [self object])
|
if([doc servicesMenu] == [self object])
|
||||||
{
|
{
|
||||||
[doc setServicesObject: nil];
|
[doc setServicesMenu: nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +100,7 @@
|
||||||
[doc setServicesMenu: [self object]];
|
[doc setServicesMenu: [self object]];
|
||||||
if([doc windowsMenu] == [self object])
|
if([doc windowsMenu] == [self object])
|
||||||
{
|
{
|
||||||
[doc setWindowsObject: nil];
|
[doc setWindowsMenu: nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GormNSMenuWindow : NSWindow
|
@interface GormNSMenuWindow : NSWindow // NSPanel
|
||||||
{
|
{
|
||||||
GormDocument *_document;
|
GormDocument *_document;
|
||||||
}
|
}
|
||||||
|
@ -125,9 +125,19 @@
|
||||||
|
|
||||||
[win setMenu: self];
|
[win setMenu: self];
|
||||||
[win setLevel: NSSubmenuWindowLevel];
|
[win setLevel: NSSubmenuWindowLevel];
|
||||||
|
// [win setWorksWhenModal: NO];
|
||||||
|
// [win setBecomesKeyOnlyIfNeeded: YES];
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) awakeFromDocument: (id)document
|
||||||
|
{
|
||||||
|
if([self supermenu] == nil)
|
||||||
|
{
|
||||||
|
// bring main menu to front.
|
||||||
|
}
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation NSMenu (GormNSMenu)
|
@implementation NSMenu (GormNSMenu)
|
||||||
|
|
Loading…
Reference in a new issue