mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 06:00:44 +00:00
Changes to allow addition of a menu, if the main menu has been deleted.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18878 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c1907d45be
commit
78412a87fa
3 changed files with 24 additions and 11 deletions
|
@ -1,3 +1,11 @@
|
|||
2004-03-24 01:00 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormDocument.m: [GormDocument attachObject:toParent:] changes
|
||||
to improve adding a new menu, if the main menu has been removed.
|
||||
* GormPalettesManager.m: [GormPaletteView draggedImage:endedAt:
|
||||
deposited:] added code to allow copying of menus in a similar
|
||||
fashion to windows.
|
||||
|
||||
2004-03-23 22:01 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Palettes/0Menus/GormMenuEditor.m: Added code to recursivly
|
||||
|
|
|
@ -314,15 +314,15 @@ static NSImage *classesImage = nil;
|
|||
*/
|
||||
if ([anObject isKindOfClass: [NSMenu class]] == YES)
|
||||
{
|
||||
// NSArray *menus = findAllMenus(anObject);
|
||||
// NSEnumerator *en = [menus objectEnumerator];
|
||||
// id obj = nil;
|
||||
// if there is no main menu and a menu gets added, it
|
||||
// will become the main menu.
|
||||
if([self objectForName: @"NSMenu"] == nil)
|
||||
{
|
||||
[self setName: @"NSMenu" forObject: anObject];
|
||||
[objectsView addObject: anObject];
|
||||
}
|
||||
|
||||
[[self openEditorForObject: anObject] activate];
|
||||
// while((obj = [en nextObject]) != nil)
|
||||
// {
|
||||
// [[self openEditorForObject: obj] activate];
|
||||
// }
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -91,16 +91,21 @@ static NSImage *dragImage = nil;
|
|||
NSString *type = [[dragPb types] lastObject];
|
||||
|
||||
/*
|
||||
* Windows are an exception to the normal DnD mechanism - we create them
|
||||
* if they are dropped anywhere except back in the pallettes view -
|
||||
* ie. if they are dragged, but the drop fails.
|
||||
* Windows and Menus are an exception to the normal DnD mechanism -
|
||||
* we create them if they are dropped anywhere except back in the \
|
||||
* pallettes view ie. if they are dragged, but the drop fails.
|
||||
*/
|
||||
if (f == NO && [type isEqual: IBWindowPboardType] == YES)
|
||||
if (f == NO && ([type isEqual: IBWindowPboardType] == YES ||
|
||||
[type isEqual: IBMenuPboardType] == YES))
|
||||
{
|
||||
id<IBDocuments> active = [(id<IB>)NSApp activeDocument];
|
||||
|
||||
if (active != nil)
|
||||
{
|
||||
if([active objectForName: @"NSMenu"] != nil &&
|
||||
[type isEqual: IBMenuPboardType] == YES)
|
||||
return;
|
||||
|
||||
[active pasteType: type fromPasteboard: dragPb parent: nil];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue