Inspector now updates classes view.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@16881 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2003-06-07 19:31:48 +00:00
parent 78484ab25d
commit 0d03f3958d
5 changed files with 32 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2003-06-07 Gregory John Casamento <greg_casamento@yahoo.com>
* 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 <greg_casamento@yahoo.com>
* Resources/GormClassInspector.gorm: Moved buttons into

2
Gorm.m
View file

@ -32,6 +32,8 @@
NSDate *startDate;
NSString *GormToggleGuidelineNotification = @"GormToggleGuidelineNotification";
// NSString *GormAddedActionNotification = @"GormAddedActionNotification";
// NSString *GormAddedOutletNotification = @"GormAddedOutletNotification";
@class InfoPanel;

View file

@ -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]];
[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];
}

View file

@ -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

View file

@ -39,6 +39,8 @@
extern NSString *GormLinkPboardType;
extern NSString *GormToggleGuidelineNotification;
// extern NSString *GormAddedActionNotification;
// extern NSString *GormAddedOutletNotification;
// templates
@interface GSNibItem (GormAdditions)