diff --git a/ChangeLog b/ChangeLog index 2d475d97..4390581f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-06-07 Gregory John Casamento + + * GormClassInspector.m: Added post of notification in + appropriate places. Now sends IBInspectorDidModifyObjectNotification + when the class is updated from the inspector. + * GormDocument.m: Added check in handleNotification to + process the new notification sent above. + 2003-06-07 Gregory John Casamento * Resources/GormClassInspector.gorm: Moved buttons into diff --git a/Gorm.m b/Gorm.m index 1d2f650d..ab276154 100644 --- a/Gorm.m +++ b/Gorm.m @@ -32,6 +32,8 @@ NSDate *startDate; NSString *GormToggleGuidelineNotification = @"GormToggleGuidelineNotification"; +// NSString *GormAddedActionNotification = @"GormAddedActionNotification"; +// NSString *GormAddedOutletNotification = @"GormAddedOutletNotification"; @class InfoPanel; diff --git a/GormClassInspector.m b/GormClassInspector.m index cb8b4c5b..e6c13b10 100644 --- a/GormClassInspector.m +++ b/GormClassInspector.m @@ -32,6 +32,8 @@ #include "GormClassManager.h" #include "GormDocument.h" +NSNotificationCenter *nc = nil; + // the data source classes for each of the tables... @interface GormOutletDataSource : NSObject { @@ -124,7 +126,7 @@ objectValueForTableColumn: (NSTableColumn *)tc { if (self == [GormClassInspector class]) { - // TBD + nc = [NSNotificationCenter defaultCenter]; } } @@ -201,12 +203,16 @@ objectValueForTableColumn: (NSTableColumn *)tc - (void) addAction: (id)sender { [[(Gorm *)NSApp classManager] addNewActionToClassNamed: [self _currentClass]]; + [nc postNotificationName: IBInspectorDidModifyObjectNotification + object: classManager]; [actionTable reloadData]; } - (void) addOutlet: (id)sender { - [[(Gorm *)NSApp classManager] addNewOutletToClassNamed: [self _currentClass]]; + [[(Gorm *)NSApp classManager] addNewOutletToClassNamed: [self _currentClass]]; + [nc postNotificationName: IBInspectorDidModifyObjectNotification + object: classManager]; [outletTable reloadData]; } @@ -216,6 +222,8 @@ objectValueForTableColumn: (NSTableColumn *)tc NSArray *list = [[(Gorm *)NSApp classManager] allActionsForClassNamed: [self _currentClass]]; NSString *name = [list objectAtIndex: i]; [[(Gorm *)NSApp classManager] removeAction: name fromClassNamed: [self _currentClass]]; + [nc postNotificationName: IBInspectorDidModifyObjectNotification + object: classManager]; [actionTable reloadData]; } @@ -225,6 +233,8 @@ objectValueForTableColumn: (NSTableColumn *)tc NSArray *list = [[(Gorm *)NSApp classManager] allOutletsForClassNamed: [self _currentClass]]; NSString *name = [list objectAtIndex: i]; [[(Gorm *)NSApp classManager] removeOutlet: name fromClassNamed: [self _currentClass]]; + [nc postNotificationName: IBInspectorDidModifyObjectNotification + object: classManager]; [outletTable reloadData]; } diff --git a/GormDocument.m b/GormDocument.m index 099951a5..9f3a937a 100644 --- a/GormDocument.m +++ b/GormDocument.m @@ -1487,6 +1487,10 @@ static NSImage *classesImage = nil; { if ([aNotification object] == classManager) [classesView reloadData]; } + else if ([name isEqual: IBInspectorDidModifyObjectNotification] == YES) + { + if ([aNotification object] == classManager) [classesView reloadData]; + } } - (id) init @@ -1560,6 +1564,10 @@ static NSImage *classesImage = nil; selector: @selector(handleNotification:) name: IBClassNameChangedNotification object: nil]; + [nc addObserver: self + selector: @selector(handleNotification:) + name: IBInspectorDidModifyObjectNotification + object: nil]; selectionView = [[NSMatrix alloc] initWithFrame: selectionRect mode: NSRadioModeMatrix diff --git a/GormPrivate.h b/GormPrivate.h index 6a7cc4b1..c593d202 100644 --- a/GormPrivate.h +++ b/GormPrivate.h @@ -39,6 +39,8 @@ extern NSString *GormLinkPboardType; extern NSString *GormToggleGuidelineNotification; +// extern NSString *GormAddedActionNotification; +// extern NSString *GormAddedOutletNotification; // templates @interface GSNibItem (GormAdditions)