mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
More tidying up
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@5657 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9fcafd4800
commit
6d103be1b2
5 changed files with 253 additions and 127 deletions
92
Gorm.m
92
Gorm.m
|
@ -42,7 +42,21 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
|
||||
- (id<IBDocuments>) activeDocument
|
||||
{
|
||||
return activeDocument;
|
||||
unsigned i = [documents count];
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
while (i-- > 0)
|
||||
{
|
||||
id doc = [documents objectAtIndex: i];
|
||||
|
||||
if ([doc isActive] == YES)
|
||||
{
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL) applicationShouldTerminate: (NSApplication*)sender
|
||||
|
@ -92,6 +106,15 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
return classManager;
|
||||
}
|
||||
|
||||
- (id) close: (id)sender
|
||||
{
|
||||
NSWindow *window = [(id)[self activeDocument] window];
|
||||
|
||||
[window setReleasedWhenClosed: YES];
|
||||
[window performClose: self];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (id) copy: (id)sender
|
||||
{
|
||||
if ([[selectionOwner selection] count] == 0
|
||||
|
@ -154,7 +177,8 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
{
|
||||
if (connectSource != nil)
|
||||
{
|
||||
w = [activeDocument windowAndRect: &r forObject: connectSource];
|
||||
w = [[self activeDocument] windowAndRect: &r
|
||||
forObject: connectSource];
|
||||
if (w != nil)
|
||||
{
|
||||
NSView *wv = [[w contentView] superview];
|
||||
|
@ -178,7 +202,7 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
}
|
||||
if (connectSource != nil)
|
||||
{
|
||||
w = [activeDocument windowAndRect: &r forObject: connectSource];
|
||||
w = [[self activeDocument] windowAndRect: &r forObject: connectSource];
|
||||
if (w != nil)
|
||||
{
|
||||
NSView *wv = [[w contentView] superview];
|
||||
|
@ -194,7 +218,8 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
{
|
||||
if (connectDestination != nil)
|
||||
{
|
||||
w = [activeDocument windowAndRect: &r forObject: connectDestination];
|
||||
w = [[self activeDocument] windowAndRect: &r
|
||||
forObject: connectDestination];
|
||||
if (w != nil)
|
||||
{
|
||||
NSView *wv = [[w contentView] superview];
|
||||
|
@ -218,7 +243,8 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
}
|
||||
if (connectDestination != nil)
|
||||
{
|
||||
w = [activeDocument windowAndRect: &r forObject: connectDestination];
|
||||
w = [[self activeDocument] windowAndRect: &r
|
||||
forObject: connectDestination];
|
||||
if (w != nil)
|
||||
{
|
||||
NSView *wv = [[w contentView] superview];
|
||||
|
@ -307,10 +333,6 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
RETAIN(obj);
|
||||
[documents removeObjectIdenticalTo: obj];
|
||||
AUTORELEASE(obj);
|
||||
if (obj == (id)activeDocument)
|
||||
{
|
||||
activeDocument = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -395,14 +417,21 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
return [[self palettesManager] openPalette: sender];
|
||||
}
|
||||
|
||||
- (id) miniaturize: (id)sender
|
||||
{
|
||||
NSWindow *window = [(id)[self activeDocument] window];
|
||||
|
||||
[window miniaturize: self];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (id) newApplication: (id) sender
|
||||
{
|
||||
id doc = [GormDocument new];
|
||||
|
||||
[documents addObject: doc];
|
||||
[doc setDocumentActive: YES];
|
||||
activeDocument = doc;
|
||||
RELEASE(doc);
|
||||
[[doc window] makeKeyAndOrderFront: self];
|
||||
return doc;
|
||||
}
|
||||
|
||||
|
@ -419,8 +448,7 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
}
|
||||
else
|
||||
{
|
||||
[doc setDocumentActive: YES];
|
||||
activeDocument = doc;
|
||||
[[doc window] makeKeyAndOrderFront: self];
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
|
@ -456,7 +484,7 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
|
||||
- (id) save: (id)sender
|
||||
{
|
||||
return [(id)activeDocument saveDocument: sender];
|
||||
return [(id)[self activeDocument] saveDocument: sender];
|
||||
}
|
||||
|
||||
- (id) saveAll: (id)sender
|
||||
|
@ -476,7 +504,7 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
|
||||
- (id) saveAs: (id)sender
|
||||
{
|
||||
return [(id)activeDocument saveAsDocument: sender];
|
||||
return [(id)[self activeDocument] saveAsDocument: sender];
|
||||
}
|
||||
|
||||
- (id) selectAll: (id)sender
|
||||
|
@ -516,7 +544,7 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
n = [[t stringValue] stringByTrimmingSpaces];
|
||||
if (n != nil && [n isEqual: @""] == NO)
|
||||
{
|
||||
[activeDocument setName: n forObject: o];
|
||||
[[self activeDocument] setName: n forObject: o];
|
||||
}
|
||||
}
|
||||
[t removeFromSuperview];
|
||||
|
@ -535,12 +563,12 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
{
|
||||
return;
|
||||
}
|
||||
if ([activeDocument containsObject: connectDestination] == NO)
|
||||
if ([[self activeDocument] containsObject: connectDestination] == NO)
|
||||
{
|
||||
NSLog(@"Oops - connectDestination not in active document");
|
||||
return;
|
||||
}
|
||||
if ([activeDocument containsObject: connectSource] == NO)
|
||||
if ([[self activeDocument] containsObject: connectSource] == NO)
|
||||
{
|
||||
NSLog(@"Oops - connectSource not in active document");
|
||||
return;
|
||||
|
@ -564,6 +592,7 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
else
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
GormDocument *a = (GormDocument*)[self activeDocument];
|
||||
NSEnumerator *e;
|
||||
NSWindow *w;
|
||||
NSData *d;
|
||||
|
@ -573,9 +602,9 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
|
||||
isTesting = YES;
|
||||
|
||||
[activeDocument beginArchiving];
|
||||
d = [NSArchiver archivedDataWithRootObject: activeDocument];
|
||||
[activeDocument endArchiving];
|
||||
[a beginArchiving];
|
||||
d = [NSArchiver archivedDataWithRootObject: a];
|
||||
[a endArchiving];
|
||||
|
||||
e = [[self windows] objectEnumerator];
|
||||
while ((w = [e nextObject]) != nil)
|
||||
|
@ -609,25 +638,28 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
|
||||
- (BOOL) validateMenuItem: (NSMenuItem*)item
|
||||
{
|
||||
SEL action = [item action];
|
||||
GormDocument *active = (GormDocument*)[self activeDocument];
|
||||
SEL action = [item action];
|
||||
|
||||
if (sel_eq(action, @selector(save:))
|
||||
if (sel_eq(action, @selector(close:))
|
||||
|| sel_eq(action, @selector(miniaturize:))
|
||||
|| sel_eq(action, @selector(save:))
|
||||
|| sel_eq(action, @selector(saveAs:))
|
||||
|| sel_eq(action, @selector(saveAll:)))
|
||||
{
|
||||
if (activeDocument == nil)
|
||||
if (active == nil)
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (sel_eq(action, @selector(revertToSaved:)))
|
||||
{
|
||||
if (activeDocument == nil)
|
||||
if (active == nil)
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (sel_eq(action, @selector(testInterface:)))
|
||||
{
|
||||
if (activeDocument == nil)
|
||||
if (active == nil)
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -673,7 +705,7 @@ NSString *GormLinkPboardType = @"GormLinkPboardType";
|
|||
return NO;
|
||||
}
|
||||
o = [s objectAtIndex: 0];
|
||||
n = [activeDocument nameForObject: o];
|
||||
n = [active nameForObject: o];
|
||||
|
||||
if ([n isEqual: @"NSOwner"] || [n isEqual: @"NSFirst"]
|
||||
|| [n isEqual: @"NSFont"])
|
||||
|
@ -768,6 +800,12 @@ main(void)
|
|||
[aMenu addItemWithTitle: @"Test Interface"
|
||||
action: @selector(testInterface:)
|
||||
keyEquivalent: @"r"];
|
||||
[aMenu addItemWithTitle: @"Miniaturize"
|
||||
action: @selector(miniaturize:)
|
||||
keyEquivalent: @"m"];
|
||||
[aMenu addItemWithTitle: @"Close"
|
||||
action: @selector(close:)
|
||||
keyEquivalent: @""];
|
||||
menuItem = [mainMenu addItemWithTitle: @"Document"
|
||||
action: NULL
|
||||
keyEquivalent: @""];
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
NSScrollView *scrollView;
|
||||
id objectsView;
|
||||
BOOL hiddenDuringTest;
|
||||
BOOL isActive;
|
||||
NSMenu *savedMenu;
|
||||
NSMenuItem *quitItem; /* Replaced during test */
|
||||
NSMutableArray *savedEditors;
|
||||
|
@ -59,6 +60,7 @@
|
|||
- (NSString*) documentPath;
|
||||
- (void) endArchiving;
|
||||
- (void) handleNotification: (NSNotification*)aNotification;
|
||||
- (BOOL) isActive;
|
||||
- (NSString*) nameForObject: (id)anObject;
|
||||
- (id) objectForName: (NSString*)aString;
|
||||
- (BOOL) objectIsVisibleAtLaunch: (id)anObject;
|
||||
|
@ -75,7 +77,8 @@
|
|||
- (void) setName: (NSString*)aName forObject: (id)object;
|
||||
- (void) setObject: (id)anObject isVisibleAtLaunch: (BOOL)flag;
|
||||
- (void) touch; /* Mark document as having been changed. */
|
||||
- (BOOL) windowShouldClose;
|
||||
- (NSWindow*) window;
|
||||
- (BOOL) windowShouldClose: (id)sender;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
275
GormDocument.m
275
GormDocument.m
|
@ -405,6 +405,90 @@ static NSImage *classesImage = nil;
|
|||
return documentPath;
|
||||
}
|
||||
|
||||
- (void) editor: (id<IBEditors>)anEditor didCloseForObject: (id)anObject
|
||||
{
|
||||
NSArray *links;
|
||||
|
||||
/*
|
||||
* If there is a link from this editor to a parent, remove it.
|
||||
*/
|
||||
links = [self connectorsForSource: anEditor
|
||||
ofClass: [GormEditorToParent class]];
|
||||
NSAssert([links count] < 2, NSInternalInconsistencyException);
|
||||
if ([links count] == 1)
|
||||
{
|
||||
[connections removeObjectIdenticalTo: [links objectAtIndex: 0]];
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the connection linking the object to this editor
|
||||
*/
|
||||
links = [self connectorsForSource: anObject
|
||||
ofClass: [GormObjectToEditor class]];
|
||||
NSAssert([links count] < 2, NSInternalInconsistencyException);
|
||||
[connections removeObjectIdenticalTo: [links objectAtIndex: 0]];
|
||||
|
||||
/*
|
||||
* Make sure that this editor is not the selection owner.
|
||||
*/
|
||||
if ([(id<IB>)NSApp selectionOwner] == anEditor)
|
||||
{
|
||||
[self resignSelectionForEditor: anEditor];
|
||||
}
|
||||
}
|
||||
|
||||
- (id<IBEditors>) editorForObject: (id)anObject
|
||||
create: (BOOL)flag
|
||||
{
|
||||
return [self editorForObject: anObject inEditor: nil create: flag];
|
||||
}
|
||||
|
||||
- (id<IBEditors>) editorForObject: (id)anObject
|
||||
inEditor: (id<IBEditors>)anEditor
|
||||
create: (BOOL)flag
|
||||
{
|
||||
NSArray *links;
|
||||
|
||||
/*
|
||||
* Look up the editor links for the object to see if it already has an
|
||||
* editor. If it does return it, otherwise create a new editor and a
|
||||
* link to it if the flag is set.
|
||||
*/
|
||||
links = [self connectorsForSource: anObject
|
||||
ofClass: [GormObjectToEditor class]];
|
||||
if ([links count] == 0 && flag == YES)
|
||||
{
|
||||
Class eClass;
|
||||
id<IBEditors> editor;
|
||||
id<IBConnectors> link;
|
||||
|
||||
eClass = NSClassFromString([anObject editorClassName]);
|
||||
editor = [[eClass alloc] initWithObject: anObject inDocument: self];
|
||||
link = [GormObjectToEditor new];
|
||||
[link setSource: anObject];
|
||||
[link setDestination: editor];
|
||||
[connections addObject: link];
|
||||
RELEASE(link);
|
||||
if (anEditor != nil)
|
||||
{
|
||||
/*
|
||||
* This editor has a parent - so link to it.
|
||||
*/
|
||||
link = [GormEditorToParent new];
|
||||
[link setSource: editor];
|
||||
[link setDestination: anEditor];
|
||||
[connections addObject: link];
|
||||
RELEASE(link);
|
||||
}
|
||||
RELEASE(editor);
|
||||
return editor;
|
||||
}
|
||||
else
|
||||
{
|
||||
return [[links lastObject] destination];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) endArchiving
|
||||
{
|
||||
NSEnumerator *enumerator;
|
||||
|
@ -456,26 +540,60 @@ static NSImage *classesImage = nil;
|
|||
if ([name isEqual: NSWindowWillCloseNotification] == YES)
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
Class winClass = [NSWindow class];
|
||||
NSEnumerator *enumerator;
|
||||
id<IBConnectors> con;
|
||||
id obj;
|
||||
|
||||
[nc postNotificationName: IBWillCloseDocumentNotification
|
||||
object: self];
|
||||
|
||||
[self setDocumentActive: NO];
|
||||
|
||||
/*
|
||||
* Close all open windows in this document befoew we go away.
|
||||
* Destroy all windows in this document before we go away.
|
||||
*/
|
||||
enumerator = [nameTable objectEnumerator];
|
||||
while ((obj = [enumerator nextObject]) != nil)
|
||||
{
|
||||
if ([obj isKindOfClass: winClass] == YES)
|
||||
if ([obj isKindOfClass: [NSWindow class]] == YES)
|
||||
{
|
||||
[obj setReleasedWhenClosed: YES];
|
||||
[obj close];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close all editors.
|
||||
*/
|
||||
enumerator = [[NSArray arrayWithArray: connections] objectEnumerator];
|
||||
while ((con = [enumerator nextObject]) != nil)
|
||||
{
|
||||
if ([con isKindOfClass: [GormObjectToEditor class]] == YES)
|
||||
{
|
||||
[[con destination] close];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove objects from document.
|
||||
*/
|
||||
[connections removeAllObjects];
|
||||
[nameTable removeAllObjects];
|
||||
NSResetMapTable(objToName);
|
||||
DESTROY(documentPath);
|
||||
}
|
||||
else if ([name isEqual: NSWindowDidBecomeKeyNotification] == YES)
|
||||
{
|
||||
[self setDocumentActive: YES];
|
||||
}
|
||||
else if ([name isEqual: NSWindowWillMiniaturizeNotification] == YES)
|
||||
{
|
||||
[self setDocumentActive: NO];
|
||||
}
|
||||
else if ([name isEqual: NSWindowDidDeminiaturizeNotification] == YES)
|
||||
{
|
||||
[self setDocumentActive: YES];
|
||||
}
|
||||
else if ([name isEqual: IBWillBeginTestingInterfaceNotification] == YES)
|
||||
{
|
||||
if ([window isVisible] == YES)
|
||||
|
@ -575,82 +693,6 @@ static NSImage *classesImage = nil;
|
|||
}
|
||||
}
|
||||
|
||||
- (void) editor: (id<IBEditors>)anEditor didCloseForObject: (id)anObject
|
||||
{
|
||||
NSArray *links;
|
||||
|
||||
/*
|
||||
* If there is a link from this editor to a parent, remove it.
|
||||
*/
|
||||
links = [self connectorsForSource: anEditor
|
||||
ofClass: [GormEditorToParent class]];
|
||||
NSAssert([links count] < 2, NSInternalInconsistencyException);
|
||||
if ([links count] == 1)
|
||||
{
|
||||
[connections removeObjectIdenticalTo: [links objectAtIndex: 0]];
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the connection linking the object to this editor.
|
||||
*/
|
||||
links = [self connectorsForSource: anObject
|
||||
ofClass: [GormObjectToEditor class]];
|
||||
NSAssert([links count] == 1, NSInternalInconsistencyException);
|
||||
[connections removeObjectIdenticalTo: [links objectAtIndex: 0]];
|
||||
}
|
||||
|
||||
- (id<IBEditors>) editorForObject: (id)anObject
|
||||
create: (BOOL)flag
|
||||
{
|
||||
return [self editorForObject: anObject inEditor: nil create: flag];
|
||||
}
|
||||
|
||||
- (id<IBEditors>) editorForObject: (id)anObject
|
||||
inEditor: (id<IBEditors>)anEditor
|
||||
create: (BOOL)flag
|
||||
{
|
||||
NSArray *links;
|
||||
|
||||
/*
|
||||
* Look up the editor links for the object to see if it already has an
|
||||
* editor. If it does return it, otherwise create a new editor and a
|
||||
* link to it if the flag is set.
|
||||
*/
|
||||
links = [self connectorsForSource: anObject
|
||||
ofClass: [GormObjectToEditor class]];
|
||||
if ([links count] == 0 && flag == YES)
|
||||
{
|
||||
Class eClass;
|
||||
id<IBEditors> editor;
|
||||
id<IBConnectors> link;
|
||||
|
||||
eClass = NSClassFromString([anObject editorClassName]);
|
||||
editor = [[eClass alloc] initWithObject: anObject inDocument: self];
|
||||
link = [GormObjectToEditor new];
|
||||
[link setSource: anObject];
|
||||
[link setDestination: editor];
|
||||
[connections addObject: link];
|
||||
RELEASE(link);
|
||||
if (anEditor != nil)
|
||||
{
|
||||
/*
|
||||
* This editor has a parent - so link to it.
|
||||
*/
|
||||
link = [GormEditorToParent new];
|
||||
[link setSource: editor];
|
||||
[link setDestination: anEditor];
|
||||
[connections addObject: link];
|
||||
RELEASE(link);
|
||||
}
|
||||
RELEASE(editor);
|
||||
return editor;
|
||||
}
|
||||
else
|
||||
{
|
||||
return [[links lastObject] destination];
|
||||
}
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
|
@ -680,10 +722,23 @@ static NSImage *classesImage = nil;
|
|||
[window setTitle: @"UNTITLED"];
|
||||
|
||||
[window setDelegate: self];
|
||||
|
||||
[nc addObserver: self
|
||||
selector: @selector(handleNotification:)
|
||||
name: NSWindowWillCloseNotification
|
||||
object: window];
|
||||
[nc addObserver: self
|
||||
selector: @selector(handleNotification:)
|
||||
name: NSWindowDidBecomeKeyNotification
|
||||
object: window];
|
||||
[nc addObserver: self
|
||||
selector: @selector(handleNotification:)
|
||||
name: NSWindowWillMiniaturizeNotification
|
||||
object: window];
|
||||
[nc addObserver: self
|
||||
selector: @selector(handleNotification:)
|
||||
name: NSWindowDidDeminiaturizeNotification
|
||||
object: window];
|
||||
|
||||
selectionView = [[NSMatrix alloc] initWithFrame: selectionRect
|
||||
mode: NSRadioModeMatrix
|
||||
|
@ -782,6 +837,11 @@ static NSImage *classesImage = nil;
|
|||
return self;
|
||||
}
|
||||
|
||||
- (BOOL) isActive
|
||||
{
|
||||
return isActive;
|
||||
}
|
||||
|
||||
- (NSString*) nameForObject: (id)anObject
|
||||
{
|
||||
return (NSString*)NSMapGet(objToName, (void*)anObject);
|
||||
|
@ -1028,10 +1088,14 @@ static NSImage *classesImage = nil;
|
|||
{
|
||||
[e activate];
|
||||
[self setSelectionFromEditor: e];
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* No editor available to take the selection - set a nil owner.
|
||||
*/
|
||||
[self setSelectionFromEditor: nil];
|
||||
}
|
||||
|
||||
- (void) setName: (NSString*)aName forObject: (id)object
|
||||
|
@ -1222,31 +1286,43 @@ static NSImage *classesImage = nil;
|
|||
|
||||
- (void) setDocumentActive: (BOOL)flag
|
||||
{
|
||||
NSEnumerator *enumerator = [nameTable objectEnumerator];
|
||||
Class winClass = [NSWindow class];
|
||||
id obj;
|
||||
if (flag != isActive)
|
||||
{
|
||||
NSEnumerator *enumerator;
|
||||
id obj;
|
||||
|
||||
if (flag == YES)
|
||||
{
|
||||
while ((obj = [enumerator nextObject]) != nil)
|
||||
enumerator = [nameTable objectEnumerator];
|
||||
if (flag == YES)
|
||||
{
|
||||
if ([obj isKindOfClass: winClass] == YES)
|
||||
[(GormDocument*)[(id<IB>)NSApp activeDocument] setDocumentActive: NO];
|
||||
isActive = YES;
|
||||
while ((obj = [enumerator nextObject]) != nil)
|
||||
{
|
||||
[obj orderFront: self];
|
||||
if ([obj isKindOfClass: [NSWindow class]] == YES)
|
||||
{
|
||||
[obj orderFront: self];
|
||||
}
|
||||
else if ([obj isKindOfClass: [NSMenu class]] == YES)
|
||||
{
|
||||
[obj display];
|
||||
}
|
||||
}
|
||||
}
|
||||
[window orderFront: self];
|
||||
}
|
||||
else
|
||||
{
|
||||
while ((obj = [enumerator nextObject]) != nil)
|
||||
else
|
||||
{
|
||||
if ([obj isKindOfClass: winClass] == YES)
|
||||
isActive = NO;
|
||||
while ((obj = [enumerator nextObject]) != nil)
|
||||
{
|
||||
[obj orderOut: self];
|
||||
if ([obj isKindOfClass: [NSWindow class]] == YES)
|
||||
{
|
||||
[obj orderOut: self];
|
||||
}
|
||||
else if ([obj isKindOfClass: [NSMenu class]] == YES)
|
||||
{
|
||||
[obj close];
|
||||
}
|
||||
}
|
||||
}
|
||||
[window orderOut: self];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1288,7 +1364,12 @@ static NSImage *classesImage = nil;
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL) windowShouldClose
|
||||
- (NSWindow*) window
|
||||
{
|
||||
return window;
|
||||
}
|
||||
|
||||
- (BOOL) windowShouldClose: (id)sender
|
||||
{
|
||||
if ([window isDocumentEdited] == YES)
|
||||
{
|
||||
|
|
|
@ -285,6 +285,11 @@ static NSImage *dragImage = nil;
|
|||
[self loadPalette: [array objectAtIndex: index]];
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Select initial palette - this should be the standard controls palette.
|
||||
*/
|
||||
[selectionView selectCellAtRow: 0 column: 2];
|
||||
[self setCurrentPalette: selectionView];
|
||||
|
||||
[nc addObserver: self
|
||||
selector: @selector(handleNotification:)
|
||||
|
@ -383,7 +388,7 @@ static NSImage *dragImage = nil;
|
|||
[cell setImage: [palette paletteIcon]];
|
||||
[selectionView sizeToCells];
|
||||
[selectionView selectCellAtRow: 0 column: col];
|
||||
[selectionView setNeedsDisplay: YES];
|
||||
[self setCurrentPalette: selectionView];
|
||||
RELEASE(palette);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ extern NSString *GormLinkPboardType;
|
|||
GormInspectorsManager *inspectorsManager;
|
||||
GormPalettesManager *palettesManager;
|
||||
id selectionOwner;
|
||||
id activeDocument;
|
||||
NSMutableArray *documents;
|
||||
BOOL isConnecting;
|
||||
BOOL isTesting;
|
||||
|
|
Loading…
Reference in a new issue