diff --git a/ChangeLog b/ChangeLog index d53083e6..fec12fc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-12-17 21:28 Gregory John Casamento + + * GormClassInspector.m: Set the double action and target + for parentClass. + * GormObjectEditor.m: Moved the pasteInSelection method. + 2004-12-17 05:48 Gregory John Casamento * GormDocument.m: Changed implementation here to call the one diff --git a/GormClassInspector.m b/GormClassInspector.m index c3852b11..2f0db530 100644 --- a/GormClassInspector.m +++ b/GormClassInspector.m @@ -291,6 +291,7 @@ objectValueForTableColumn: (NSTableColumn *)tc [outletTable setDataSource: outletData]; [parentClass setDataSource: parentClassData]; [parentClass setDoubleAction: @selector(selectClass:)]; + [parentClass setTarget: self]; // delegate... [actionTable setDelegate: self]; @@ -471,26 +472,34 @@ objectValueForTableColumn: (NSTableColumn *)tc { NSArray *list = [classManager allClassNames]; int row = [parentClass selectedRow]; - NSString *newParent = [list objectAtIndex: row]; - NSString *name = [self _currentClass]; - BOOL removed = NO; - GormDocument *document = (GormDocument *)[(id )NSApp activeDocument]; - // check to see if the user wants to do this and remove the connections. - removed = [document removeConnectionsForClassNamed: name]; - - // if removed, move the class and notify... - if(removed) + if(row >= 0) { - NSString *oldSuper = [classManager superClassNameForClassNamed: name]; + NSString *newParent = [list objectAtIndex: row]; + NSString *name = [self _currentClass]; + BOOL removed = NO; + GormDocument *document = (GormDocument *)[(id )NSApp activeDocument]; - [classManager setSuperClassNamed: newParent forClassNamed: name]; - [nc postNotificationName: IBInspectorDidModifyObjectNotification - object: classManager]; - [document collapseClass: oldSuper]; - [document collapseClass: name]; - [document reloadClasses]; - [document selectClass: name]; + // if it's a custom class, let it go, if not do nothing. + if([classManager isCustomClass: name]) + { + // check to see if the user wants to do this and remove the connections. + removed = [document removeConnectionsForClassNamed: name]; + + // if removed, move the class and notify... + if(removed) + { + NSString *oldSuper = [classManager superClassNameForClassNamed: name]; + + [classManager setSuperClassNamed: newParent forClassNamed: name]; + [nc postNotificationName: IBInspectorDidModifyObjectNotification + object: classManager]; + [document collapseClass: oldSuper]; + [document collapseClass: name]; + [document reloadClasses]; + [document selectClass: name]; + } + } } } diff --git a/GormObjectEditor.m b/GormObjectEditor.m index 2208484f..b2b27f47 100644 --- a/GormObjectEditor.m +++ b/GormObjectEditor.m @@ -138,6 +138,10 @@ static NSMapTable *docMap = 0; return NO; } +- (void) pasteInSelection +{ +} + - (void) copySelection { if (selected != nil) @@ -433,11 +437,6 @@ static NSMapTable *docMap = 0; [super mouseDown: theEvent]; } - -- (void) pasteInSelection -{ -} - - (BOOL) performDragOperation: (id)sender { if (dragType == IBObjectPboardType)