Fixed some bugs and added code to updated the class inspector when the class is edited in the class editor.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@16895 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2003-06-08 04:38:59 +00:00
parent c5e0ce6438
commit a057b2a714
6 changed files with 31 additions and 9 deletions

7
Gorm.m
View file

@ -32,8 +32,7 @@
NSDate *startDate;
NSString *GormToggleGuidelineNotification = @"GormToggleGuidelineNotification";
// NSString *GormAddedActionNotification = @"GormAddedActionNotification";
// NSString *GormAddedOutletNotification = @"GormAddedOutletNotification";
NSString *GormDidModifyClassNotification = @"GormDidModifyClassNotification";
@class InfoPanel;
@ -947,8 +946,6 @@ static NSButtonType _buttonTypeForObject( id button )
[self setMainMenu: mainMenu];
DESTROY(testContainer);
isTesting = NO;
if ([selectionOwner conformsToProtocol: @protocol(IBEditors)] == YES)
@ -1469,7 +1466,7 @@ static NSButtonType _buttonTypeForObject( id button )
[nc postNotificationName: IBDidBeginTestingInterfaceNotification
object: self];
RELEASE(d);
return self;
}

View file

@ -58,4 +58,6 @@
- (void) removeOutlet: (id)sender;
- (void) select: (id)sender;
- (NSString *) _currentClass;
- (void) _refreshView;
- (void) handleNotification: (NSNotification *)notification;
@end

View file

@ -31,6 +31,7 @@
#include "GormPrivate.h"
#include "GormClassManager.h"
#include "GormDocument.h"
#include <InterfaceBuilder/IBApplicationAdditions.h>
NSNotificationCenter *nc = nil;
@ -155,6 +156,12 @@ objectValueForTableColumn: (NSTableColumn *)tc
NSLog(@"Could not open gorm GormClassInspector");
return nil;
}
[nc addObserver: self
selector: @selector(handleNotification:)
name: GormDidModifyClassNotification
object: nil];
}
return self;
}
@ -256,6 +263,15 @@ objectValueForTableColumn: (NSTableColumn *)tc
return [theobject className];
}
- (void) handleNotification: (NSNotification *)notification
{
if([notification object] == classManager)
{
[self _refreshView];
}
}
// table delegate/data source methods...
- (BOOL) tableView: (NSTableView *)tableView
shouldEditTableColumn: (NSTableColumn *)aTableColumn
row: (int)rowIndex

View file

@ -38,6 +38,9 @@
- (void) _touch
{
id<IBDocuments> doc = [(id<IB>)NSApp activeDocument];
[[NSNotificationCenter defaultCenter]
postNotificationName: GormDidModifyClassNotification
object: self];
[doc touch];
}
@ -171,7 +174,7 @@
RELEASE(classInfo);
// copy all actions from the class imported to the first responder
while(action = [e nextObject])
while((action = [e nextObject]))
{
[self addAction: action forClassNamed: @"FirstResponder"];
}

View file

@ -1568,7 +1568,12 @@ static NSImage *classesImage = nil;
selector: @selector(handleNotification:)
name: IBInspectorDidModifyObjectNotification
object: nil];
/*
[nc addObserver: self
selector: @selector(handleNotification:)
name: GormDidModifyClassNotification
object: nil];
*/
selectionView = [[NSMatrix alloc] initWithFrame: selectionRect
mode: NSRadioModeMatrix
cellClass: [GormDisplayCell class]

View file

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