mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Fixes to correct bugs found while savannah was down. Corrections to the
addition and deletion of outlets/actions. Made the test application use a .gorm file instead of a hardcoded interface. Corrected a problem with the "set name" functionality and removed the "establishConnection" call in the GormInspectorsManager since this was causing issues when the user added a delegate or a next key view. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18266 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4bea75fdf2
commit
f00f63fac7
13 changed files with 440 additions and 179 deletions
24
ChangeLog
24
ChangeLog
|
@ -1,3 +1,27 @@
|
|||
2003-12-23 23:32 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Gorm.m: Update the minor release number. Add call to
|
||||
method which checks if an object is a "top level object"
|
||||
before allowing the user to rename it.
|
||||
* GormClassInspector.m: There was a bug which was preventing users
|
||||
from removing outlets/actions. Also added a call to the method which
|
||||
removes connections when an outlet or action is deleted from the document.
|
||||
* GormClassManager.m: Added code to correct problem removing actions/outlets.
|
||||
The outlets were not being properly deleted from the dictionary.
|
||||
* GormCustomClassInspector.m: The special case for NSSecureTextField, which
|
||||
allows it to replace NSTextField, was not properly replacing the cell with
|
||||
a secure one for archiving. A new method called _replaceCellClassForObject:
|
||||
className: was added to allow the cell to be replace as appropriate for the
|
||||
assigned class.
|
||||
* GormDocument.[hm]: Added code to properly notify the class inspector when
|
||||
something is deleted from the class it's editing. Added implementation
|
||||
for isTopLevelObject.
|
||||
* GormSetNameController.m: Removed RELEASE for outlets. RELEASE
|
||||
and deallocation of the toplevel panel object should release the outlets
|
||||
pointed to by the gorm file.
|
||||
* Testing/GormTest.gorm: Added.
|
||||
* Testing/GormTest.m: Modified to use the .gorm file.
|
||||
|
||||
2003-12-23 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* GormLib/GNUmakefile (libGorm_LIBRARIES_DEPEND_UPON): Add
|
||||
|
|
190
Gorm.m
190
Gorm.m
|
@ -519,9 +519,9 @@ NSString *GormWillDetachObjectFromDocumentNotification = @"GormWillDetachObjectF
|
|||
forKey: @"ApplicationName"];
|
||||
[dict setObject: @"[GNUstep | Graphical] Object Relationship Modeller"
|
||||
forKey: @"ApplicationDescription"];
|
||||
[dict setObject: @"Gorm 0.5.1 (Beta)"
|
||||
[dict setObject: @"Gorm 0.5.2 (Beta)"
|
||||
forKey: @"ApplicationRelease"];
|
||||
[dict setObject: @"0.5.1 Nov 29 2003"
|
||||
[dict setObject: @"0.5.2 Dec 13 2003"
|
||||
forKey: @"FullVersionID"];
|
||||
[dict setObject: [NSArray arrayWithObjects: @"Gregory John Casamento <greg_casamento@yahoo.com>",
|
||||
@"Richard Frith-Macdonald <rfm@gnu.org>",
|
||||
|
@ -671,95 +671,104 @@ NSString *GormWillDetachObjectFromDocumentNotification = @"GormWillDetachObjectF
|
|||
}
|
||||
else
|
||||
{
|
||||
NSUserDefaults *defaults;
|
||||
NSNotificationCenter *notifCenter = [NSNotificationCenter defaultCenter];
|
||||
GormDocument *activDoc = (GormDocument*)[self activeDocument];
|
||||
NSData *data;
|
||||
NSArchiver *archiver;
|
||||
|
||||
|
||||
isTesting = YES; // set here, so that beginArchiving and endArchiving do not use templates.
|
||||
archiver = [[NSArchiver alloc] init];
|
||||
[activDoc beginArchiving];
|
||||
[archiver encodeClassName: @"GormNSWindow"
|
||||
intoClassName: @"NSWindow"];
|
||||
[archiver encodeClassName: @"GormNSPanel"
|
||||
intoClassName: @"NSPanel"];
|
||||
[archiver encodeClassName: @"GormNSMenu"
|
||||
intoClassName: @"NSMenu"];
|
||||
[archiver encodeClassName: @"GormNSPopUpButton"
|
||||
intoClassName: @"NSPopUpButton"];
|
||||
[archiver encodeClassName: @"GormNSPopUpButtonCell"
|
||||
intoClassName: @"NSPopUpButtonCell"];
|
||||
[archiver encodeClassName: @"GormCustomView"
|
||||
intoClassName: @"GormTestCustomView"];
|
||||
[archiver encodeRootObject: activDoc];
|
||||
data = RETAIN([archiver archiverData]);
|
||||
[activDoc endArchiving];
|
||||
RELEASE(archiver);
|
||||
|
||||
[notifCenter postNotificationName: IBWillBeginTestingInterfaceNotification
|
||||
object: self];
|
||||
|
||||
if ([selectionOwner conformsToProtocol: @protocol(IBEditors)] == YES)
|
||||
NS_DURING
|
||||
{
|
||||
[(id<IBEditors>)selectionOwner makeSelectionVisible: NO];
|
||||
}
|
||||
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
menuLocations = [[defaults objectForKey: @"NSMenuLocations"] copy];
|
||||
[defaults removeObjectForKey: @"NSMenuLocations"];
|
||||
|
||||
testContainer = [NSUnarchiver unarchiveObjectWithData: data];
|
||||
if (testContainer != nil)
|
||||
{
|
||||
[testContainer awakeWithContext: nil];
|
||||
RETAIN(testContainer);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the NIB didn't have a main menu, create one,
|
||||
* otherwise, ensure that 'quit' ends testing mode.
|
||||
*/
|
||||
if ([self mainMenu] == mainMenu)
|
||||
{
|
||||
NSMenu *testMenu;
|
||||
|
||||
testMenu = [[NSMenu alloc] initWithTitle: _(@"Test")];
|
||||
[testMenu addItemWithTitle: _(@"Quit")
|
||||
action: @selector(deferredEndTesting:)
|
||||
keyEquivalent: @"q"];
|
||||
[self setMainMenu: testMenu];
|
||||
RELEASE(testMenu);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSMenu *testMenu = [self mainMenu];
|
||||
id item;
|
||||
|
||||
item = [testMenu itemWithTitle: _(@"Quit")];
|
||||
if (item != nil)
|
||||
NSUserDefaults *defaults;
|
||||
NSNotificationCenter *notifCenter = [NSNotificationCenter defaultCenter];
|
||||
GormDocument *activDoc = (GormDocument*)[self activeDocument];
|
||||
NSData *data;
|
||||
NSArchiver *archiver;
|
||||
|
||||
|
||||
isTesting = YES; // set here, so that beginArchiving and endArchiving do not use templates.
|
||||
archiver = [[NSArchiver alloc] init];
|
||||
[activDoc beginArchiving];
|
||||
[archiver encodeClassName: @"GormNSWindow"
|
||||
intoClassName: @"NSWindow"];
|
||||
[archiver encodeClassName: @"GormNSPanel"
|
||||
intoClassName: @"NSPanel"];
|
||||
[archiver encodeClassName: @"GormNSMenu"
|
||||
intoClassName: @"NSMenu"];
|
||||
[archiver encodeClassName: @"GormNSPopUpButton"
|
||||
intoClassName: @"NSPopUpButton"];
|
||||
[archiver encodeClassName: @"GormNSPopUpButtonCell"
|
||||
intoClassName: @"NSPopUpButtonCell"];
|
||||
[archiver encodeClassName: @"GormCustomView"
|
||||
intoClassName: @"GormTestCustomView"];
|
||||
[archiver encodeRootObject: activDoc];
|
||||
data = RETAIN([archiver archiverData]);
|
||||
[activDoc endArchiving];
|
||||
RELEASE(archiver);
|
||||
|
||||
[notifCenter postNotificationName: IBWillBeginTestingInterfaceNotification
|
||||
object: self];
|
||||
|
||||
if ([selectionOwner conformsToProtocol: @protocol(IBEditors)] == YES)
|
||||
{
|
||||
[item setAction: @selector(deferredEndTesting:)];
|
||||
[(id<IBEditors>)selectionOwner makeSelectionVisible: NO];
|
||||
}
|
||||
else
|
||||
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
menuLocations = [[defaults objectForKey: @"NSMenuLocations"] copy];
|
||||
[defaults removeObjectForKey: @"NSMenuLocations"];
|
||||
|
||||
testContainer = [NSUnarchiver unarchiveObjectWithData: data];
|
||||
if (testContainer != nil)
|
||||
{
|
||||
[testContainer awakeWithContext: nil];
|
||||
RETAIN(testContainer);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the NIB didn't have a main menu, create one,
|
||||
* otherwise, ensure that 'quit' ends testing mode.
|
||||
*/
|
||||
if ([self mainMenu] == mainMenu)
|
||||
{
|
||||
NSMenu *testMenu;
|
||||
|
||||
testMenu = [[NSMenu alloc] initWithTitle: _(@"Test")];
|
||||
[testMenu addItemWithTitle: _(@"Quit")
|
||||
action: @selector(deferredEndTesting:)
|
||||
keyEquivalent: @"q"];
|
||||
[self setMainMenu: testMenu];
|
||||
RELEASE(testMenu);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSMenu *testMenu = [self mainMenu];
|
||||
id item;
|
||||
|
||||
item = [testMenu itemWithTitle: _(@"Quit")];
|
||||
if (item != nil)
|
||||
{
|
||||
[item setAction: @selector(deferredEndTesting:)];
|
||||
}
|
||||
else
|
||||
{
|
||||
[testMenu addItemWithTitle: _(@"Quit")
|
||||
action: @selector(deferredEndTesting:)
|
||||
keyEquivalent: @"q"];
|
||||
}
|
||||
}
|
||||
|
||||
[notifCenter postNotificationName: IBDidBeginTestingInterfaceNotification
|
||||
object: self];
|
||||
|
||||
RELEASE(data);
|
||||
}
|
||||
|
||||
[notifCenter postNotificationName: IBDidBeginTestingInterfaceNotification
|
||||
object: self];
|
||||
|
||||
RELEASE(data);
|
||||
NS_HANDLER
|
||||
{
|
||||
// reset the application after the error.
|
||||
NSLog(@"Error while testing interface: %@",
|
||||
[localException reason]);
|
||||
[self endTesting: self];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
/*********************** Edit Menu Actions*****************************/
|
||||
/***********************************************************************/
|
||||
|
@ -816,19 +825,22 @@ NSString *GormWillDetachObjectFromDocumentNotification = @"GormWillDetachObjectF
|
|||
id obj = [selectionArray objectAtIndex: 0];
|
||||
NSString *name;
|
||||
|
||||
panel = [GormSetNameController new];
|
||||
returnPanel = [panel runAsModal];
|
||||
textField = [panel textField];
|
||||
|
||||
if (returnPanel == NSAlertDefaultReturn)
|
||||
if([(GormDocument *)[self activeDocument] isTopLevelObject: obj])
|
||||
{
|
||||
name = [[textField stringValue] stringByTrimmingSpaces];
|
||||
if (name != nil && [name isEqual: @""] == NO)
|
||||
panel = [GormSetNameController new];
|
||||
returnPanel = [panel runAsModal];
|
||||
textField = [panel textField];
|
||||
|
||||
if (returnPanel == NSAlertDefaultReturn)
|
||||
{
|
||||
[[self activeDocument] setName: name forObject: obj];
|
||||
name = [[textField stringValue] stringByTrimmingSpaces];
|
||||
if (name != nil && [name isEqual: @""] == NO)
|
||||
{
|
||||
[[self activeDocument] setName: name forObject: obj];
|
||||
}
|
||||
}
|
||||
RELEASE(panel);
|
||||
}
|
||||
RELEASE(panel);
|
||||
}
|
||||
|
||||
- (void) guideline: (id) sender
|
||||
|
@ -1413,8 +1425,6 @@ main(int argc, const char **argv)
|
|||
{
|
||||
startDate = [[NSDate alloc] init];
|
||||
// [NSObject enableDoubleReleaseCheck: YES];
|
||||
NSApplicationMain(argc, argv);
|
||||
|
||||
return 0;
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
||||
|
||||
|
|
|
@ -231,23 +231,42 @@ objectValueForTableColumn: (NSTableColumn *)tc
|
|||
- (void) removeAction: (id)sender
|
||||
{
|
||||
int i = [actionTable selectedRow];
|
||||
NSArray *list = [[(Gorm *)NSApp classManager] allActionsForClassNamed: [self _currentClass]];
|
||||
NSString *className = [self _currentClass];
|
||||
NSArray *list = [[(Gorm *)NSApp classManager] allActionsForClassNamed: className];
|
||||
NSString *name = [list objectAtIndex: i];
|
||||
[[(Gorm *)NSApp classManager] removeAction: name fromClassNamed: [self _currentClass]];
|
||||
[nc postNotificationName: IBInspectorDidModifyObjectNotification
|
||||
object: classManager];
|
||||
[actionTable reloadData];
|
||||
BOOL removed = [(GormDocument *)[(id <IB>)NSApp activeDocument]
|
||||
removeConnectionsWithLabel: name
|
||||
forClassNamed: currentClass
|
||||
isAction: YES];
|
||||
|
||||
if(removed)
|
||||
{
|
||||
[[(Gorm *)NSApp classManager] removeAction: name fromClassNamed: className];
|
||||
|
||||
[nc postNotificationName: IBInspectorDidModifyObjectNotification
|
||||
object: classManager];
|
||||
[actionTable reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) removeOutlet: (id)sender
|
||||
{
|
||||
int i = [outletTable selectedRow];
|
||||
NSArray *list = [[(Gorm *)NSApp classManager] allOutletsForClassNamed: [self _currentClass]];
|
||||
NSString *className = [self _currentClass];
|
||||
NSArray *list = [[(Gorm *)NSApp classManager] allOutletsForClassNamed: className];
|
||||
NSString *name = [list objectAtIndex: i];
|
||||
[[(Gorm *)NSApp classManager] removeOutlet: name fromClassNamed: [self _currentClass]];
|
||||
[nc postNotificationName: IBInspectorDidModifyObjectNotification
|
||||
object: classManager];
|
||||
[outletTable reloadData];
|
||||
BOOL removed = [(GormDocument *)[(id <IB>)NSApp activeDocument]
|
||||
removeConnectionsWithLabel: name
|
||||
forClassNamed: currentClass
|
||||
isAction: NO];
|
||||
|
||||
if(removed)
|
||||
{
|
||||
[[(Gorm *)NSApp classManager] removeOutlet: name fromClassNamed: className];
|
||||
[nc postNotificationName: IBInspectorDidModifyObjectNotification
|
||||
object: classManager];
|
||||
[outletTable reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) select: (id)sender
|
||||
|
|
|
@ -870,8 +870,9 @@
|
|||
if ([superActions containsObject: anAction] == NO)
|
||||
{
|
||||
NSMutableArray *array = [info objectForKey: @"AllActions"];
|
||||
|
||||
NSMutableArray *actions = [info objectForKey: @"Actions"];
|
||||
[array removeObject: anAction];
|
||||
[actions removeObject: anAction];
|
||||
}
|
||||
}
|
||||
[extraActions removeObject: anAction];
|
||||
|
@ -888,16 +889,28 @@
|
|||
NSMutableArray *extraOutlets = [info objectForKey: @"ExtraOutlets"];
|
||||
NSMutableArray *allOutlets = [info objectForKey: @"AllOutlets"];
|
||||
|
||||
if ([extraOutlets containsObject: anOutlet] == YES)
|
||||
if ([extraOutlets containsObject: anOutlet] == YES
|
||||
|| [allOutlets containsObject: anOutlet] == YES)
|
||||
{
|
||||
NSString *superName = [info objectForKey: @"Super"];
|
||||
|
||||
[self _touch];
|
||||
if (superName != nil)
|
||||
{
|
||||
NSArray *superOutlets;
|
||||
|
||||
// remove the outlet from the other arrays...
|
||||
superOutlets = [self allOutletsForClassNamed: superName];
|
||||
if ([superOutlets containsObject: anOutlet] == NO)
|
||||
{
|
||||
NSMutableArray *array = [info objectForKey: @"AllOutlets"];
|
||||
NSMutableArray *actions = [info objectForKey: @"Outlets"];
|
||||
[array removeObject: anOutlet];
|
||||
[actions removeObject: anOutlet];
|
||||
}
|
||||
}
|
||||
[extraOutlets removeObject: anOutlet];
|
||||
}
|
||||
if ([allOutlets containsObject: anOutlet] == YES)
|
||||
{
|
||||
[self _touch];
|
||||
[allOutlets removeObject: anOutlet];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) removeOutlet: (NSString*)anOutlet fromClassNamed: (NSString *)className
|
||||
|
@ -906,16 +919,28 @@
|
|||
NSMutableArray *extraOutlets = [info objectForKey: @"ExtraOutlets"];
|
||||
NSMutableArray *allOutlets = [info objectForKey: @"AllOutlets"];
|
||||
|
||||
if ([extraOutlets containsObject: anOutlet] == YES)
|
||||
if ([extraOutlets containsObject: anOutlet] == YES
|
||||
|| [allOutlets containsObject: anOutlet] == YES)
|
||||
{
|
||||
NSString *superName = [info objectForKey: @"Super"];
|
||||
|
||||
[self _touch];
|
||||
if (superName != nil)
|
||||
{
|
||||
NSArray *superOutlets;
|
||||
|
||||
// remove the outlet from the other arrays...
|
||||
superOutlets = [self allOutletsForClassNamed: superName];
|
||||
if ([superOutlets containsObject: anOutlet] == NO)
|
||||
{
|
||||
NSMutableArray *array = [info objectForKey: @"AllOutlets"];
|
||||
NSMutableArray *actions = [info objectForKey: @"Outlets"];
|
||||
[array removeObject: anOutlet];
|
||||
[actions removeObject: anOutlet];
|
||||
}
|
||||
}
|
||||
[extraOutlets removeObject: anOutlet];
|
||||
}
|
||||
if ([allOutlets containsObject: anOutlet] == YES)
|
||||
{
|
||||
[self _touch];
|
||||
[allOutlets removeObject: anOutlet];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) removeClassNamed: (NSString *)className
|
||||
|
|
|
@ -104,6 +104,43 @@
|
|||
[browser setAction: @selector(select:)];
|
||||
}
|
||||
|
||||
- (void) _replaceCellClassForObject: (id)obj
|
||||
className: (NSString *)name
|
||||
{
|
||||
if([name isEqualToString: @"NSSecureTextField"] ||
|
||||
[name isEqualToString: @"NSTextField"])
|
||||
{
|
||||
NSCell *cell = [obj cell];
|
||||
NSCell *newCell = nil;
|
||||
|
||||
// instantiate the cell...
|
||||
if([name isEqualToString: @"NSSecureTextField"])
|
||||
{
|
||||
newCell = [[NSSecureTextFieldCell alloc] init];
|
||||
}
|
||||
else if([name isEqualToString: @"NSTextField"])
|
||||
{
|
||||
newCell = [[NSTextFieldCell alloc] init];
|
||||
}
|
||||
|
||||
// copy everything from the old cell...
|
||||
[newCell setFont: [cell font]];
|
||||
[newCell setEnabled: [cell isEnabled]];
|
||||
[newCell setEditable: [cell isEditable]];
|
||||
// [newCell setRichText: [cell isRichText]];
|
||||
[newCell setImportsGraphics: [cell importsGraphics]];
|
||||
[newCell setShowsFirstResponder: [cell showsFirstResponder]];
|
||||
[newCell setRefusesFirstResponder: [cell refusesFirstResponder]];
|
||||
[newCell setBordered: [cell isBordered]];
|
||||
[newCell setBezeled: [cell isBezeled]];
|
||||
[newCell setScrollable: [cell isScrollable]];
|
||||
[newCell setSelectable: [cell isSelectable]];
|
||||
[newCell setState: [cell state]];
|
||||
|
||||
[object setCell: newCell];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) select: (id)sender
|
||||
{
|
||||
NSCell *cell = [browser selectedCellInColumn: 0];
|
||||
|
@ -125,6 +162,10 @@
|
|||
{
|
||||
[_classManager removeCustomClassForObject: nameForObject];
|
||||
}
|
||||
|
||||
[self _replaceCellClassForObject: [self object]
|
||||
className: stringValue];
|
||||
|
||||
}
|
||||
else
|
||||
NSLog(@"name for object %@ returned as nil",_currentSelection);
|
||||
|
|
|
@ -156,6 +156,8 @@
|
|||
- (BOOL) removeConnectionsForClassNamed: (NSString *)name;
|
||||
- (BOOL) renameConnectionsForClassNamed: (NSString *)name
|
||||
toName: (NSString *)newName;
|
||||
- (BOOL) isTopLevelObject: (id)obj;
|
||||
|
||||
// class loading
|
||||
- (id) loadClass: (id)sender;
|
||||
|
||||
|
|
|
@ -178,6 +178,8 @@ static NSImage *classesImage = nil;
|
|||
- (void) awakeWithContext: (NSDictionary *)context
|
||||
{
|
||||
// do nothing.. This is defined to override the one in GSNibContainer.
|
||||
RETAIN(self);
|
||||
NSLog(@"In awakeWithContext");
|
||||
}
|
||||
|
||||
- (void) addConnector: (id<IBConnectors>)aConnector
|
||||
|
@ -1032,7 +1034,8 @@ static NSImage *classesImage = nil;
|
|||
if ([anitem isKindOfClass: [GormOutletActionHolder class]])
|
||||
{
|
||||
id itemBeingEdited = [classesView itemBeingEdited];
|
||||
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
// if the class being edited is a custom class, then allow the deletion...
|
||||
if ([classManager isCustomClass: itemBeingEdited])
|
||||
{
|
||||
|
@ -1053,6 +1056,8 @@ static NSImage *classesImage = nil;
|
|||
[classManager removeAction: name
|
||||
fromClassNamed: itemBeingEdited];
|
||||
[classesView removeItemAtRow: i];
|
||||
[nc postNotificationName: GormDidModifyClassNotification
|
||||
object: classManager];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1071,6 +1076,8 @@ static NSImage *classesImage = nil;
|
|||
[classManager removeOutlet: name
|
||||
fromClassNamed: itemBeingEdited];
|
||||
[classesView removeItemAtRow: i];
|
||||
[nc postNotificationName: GormDidModifyClassNotification
|
||||
object: classManager];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3593,6 +3600,30 @@ shouldEditTableColumn: (NSTableColumn *)tableColumn
|
|||
(unsigned long)self,
|
||||
nameTable];
|
||||
}
|
||||
|
||||
- (BOOL) isTopLevelObject: (id)obj
|
||||
{
|
||||
BOOL result = NO;
|
||||
|
||||
if ([obj isKindOfClass: [NSMenu class]] == YES)
|
||||
{
|
||||
if ([self objectForName: @"NSMenu"] == obj)
|
||||
{
|
||||
result = YES;
|
||||
}
|
||||
}
|
||||
else if ([obj isKindOfClass: [NSWindow class]] == YES)
|
||||
{
|
||||
result = YES;
|
||||
}
|
||||
else if ([obj isKindOfClass: [GSNibItem class]] == YES &&
|
||||
[obj isKindOfClass: [GormCustomView class]] == NO)
|
||||
{
|
||||
result = YES;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation GormDocument (MenuValidation)
|
||||
|
|
|
@ -1067,7 +1067,7 @@ selectCellWithString: (NSString*)title
|
|||
{
|
||||
// prevent invalid connections from being made...
|
||||
NS_DURING
|
||||
[currentConnector establishConnection];
|
||||
// [currentConnector establishConnection];
|
||||
NS_HANDLER
|
||||
NSString *msg = [NSString stringWithFormat: @"Cannot establish connection: %@",
|
||||
[localException reason]];
|
||||
|
@ -1109,7 +1109,7 @@ selectCellWithString: (NSString*)title
|
|||
[[(id<IB>)NSApp activeDocument] removeConnector: con];
|
||||
[con setDestination: nil];
|
||||
[con setLabel: nil];
|
||||
[con establishConnection];
|
||||
// [con establishConnection];
|
||||
[connectors removeObjectIdenticalTo: con];
|
||||
break;
|
||||
}
|
||||
|
@ -1128,7 +1128,7 @@ selectCellWithString: (NSString*)title
|
|||
isKindOfClass: [GormObjectProxy class]] == NO)
|
||||
{
|
||||
NS_DURING
|
||||
[currentConnector establishConnection];
|
||||
// [currentConnector establishConnection];
|
||||
NS_HANDLER
|
||||
NSString *msg = [NSString stringWithFormat: @"Cannot establish connection: %@",
|
||||
[localException reason]];
|
||||
|
|
|
@ -11,15 +11,6 @@
|
|||
#include <AppKit/NSPanel.h>
|
||||
|
||||
@implementation GormSetNameController : NSObject
|
||||
- (void)dealloc
|
||||
{
|
||||
RELEASE(window);
|
||||
RELEASE(textField);
|
||||
RELEASE(okButton);
|
||||
RELEASE(cancelButton);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
- (int)runAsModal
|
||||
{
|
||||
int result;
|
||||
|
|
|
@ -28,9 +28,8 @@ include $(GNUSTEP_MAKEFILES)/common.make
|
|||
# MAIN APP
|
||||
#
|
||||
APP_NAME = GormTest
|
||||
GormTest_RESOURCE_FILES = \
|
||||
|
||||
|
||||
GormTest_MAIN_MODEL_FILE = GormTest.gorm
|
||||
GormTest_RESOURCE_FILES = GormTest.gorm
|
||||
GormTest_OBJC_FILES = \
|
||||
GormTest.m
|
||||
|
||||
|
@ -40,5 +39,4 @@ GormTest_OBJC_FILES = \
|
|||
|
||||
include $(GNUSTEP_MAKEFILES)/application.make
|
||||
|
||||
-include GNUmakefile.postamble
|
||||
|
||||
-include GNUmakefile.postamble
|
154
Testing/GormTest.gorm/data.classes
Normal file
154
Testing/GormTest.gorm/data.classes
Normal file
|
@ -0,0 +1,154 @@
|
|||
{
|
||||
Controller = {
|
||||
Actions = (
|
||||
"open:"
|
||||
);
|
||||
Outlets = (
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
FirstResponder = {
|
||||
Actions = (
|
||||
"activateContextHelpMode:",
|
||||
"alignCenter:",
|
||||
"alignJustified:",
|
||||
"alignLeft:",
|
||||
"alignRight:",
|
||||
"arrangeInFront:",
|
||||
"cancel:",
|
||||
"capitalizeWord:",
|
||||
"changeColor:",
|
||||
"changeFont:",
|
||||
"checkSpelling:",
|
||||
"close:",
|
||||
"complete:",
|
||||
"copy:",
|
||||
"copyFont:",
|
||||
"copyRuler:",
|
||||
"cut:",
|
||||
"delete:",
|
||||
"deleteBackward:",
|
||||
"deleteForward:",
|
||||
"deleteToBeginningOfLine:",
|
||||
"deleteToBeginningOfParagraph:",
|
||||
"deleteToEndOfLine:",
|
||||
"deleteToEndOfParagraph:",
|
||||
"deleteToMark:",
|
||||
"deleteWordBackward:",
|
||||
"deleteWordForward:",
|
||||
"deminiaturize:",
|
||||
"deselectAll:",
|
||||
"fax:",
|
||||
"hide:",
|
||||
"hideOtherApplications:",
|
||||
"indent:",
|
||||
"loosenKerning:",
|
||||
"lowerBaseline:",
|
||||
"lowercaseWord:",
|
||||
"makeKeyAndOrderFront:",
|
||||
"miniaturize:",
|
||||
"miniaturizeAll:",
|
||||
"moveBackward:",
|
||||
"moveBackwardAndModifySelection:",
|
||||
"moveDown:",
|
||||
"moveDownAndModifySelection:",
|
||||
"moveForward:",
|
||||
"moveForwardAndModifySelection:",
|
||||
"moveLeft:",
|
||||
"moveRight:",
|
||||
"moveToBeginningOfDocument:",
|
||||
"moveToBeginningOfLine:",
|
||||
"moveToBeginningOfParagraph:",
|
||||
"moveToEndOfDocument:",
|
||||
"moveToEndOfLine:",
|
||||
"moveToEndOfParagraph:",
|
||||
"moveUp:",
|
||||
"moveUpAndModifySelection:",
|
||||
"moveWordBackward:",
|
||||
"moveWordBackwardAndModifySelection:",
|
||||
"moveWordForward:",
|
||||
"moveWordForwardAndModifySelection:",
|
||||
"newDocument:",
|
||||
"ok:",
|
||||
"openDocument:",
|
||||
"orderBack:",
|
||||
"orderFront:",
|
||||
"orderFrontColorPanel:",
|
||||
"orderFrontDataLinkPanel:",
|
||||
"orderFrontFontPanel:",
|
||||
"orderFrontHelpPanel:",
|
||||
"orderFrontStandardAboutPanel:",
|
||||
"orderFrontStandardInfoPanel:",
|
||||
"orderOut:",
|
||||
"pageDown:",
|
||||
"pageUp:",
|
||||
"paste:",
|
||||
"pasteAsPlainText:",
|
||||
"pasteAsRichText:",
|
||||
"pasteFont:",
|
||||
"pasteRuler:",
|
||||
"performClose:",
|
||||
"performMiniaturize:",
|
||||
"performZoom:",
|
||||
"print:",
|
||||
"raiseBaseline:",
|
||||
"revertDocumentToSaved:",
|
||||
"runPageLayout:",
|
||||
"runToolbarCustomizationPalette:",
|
||||
"saveAllDocuments:",
|
||||
"saveDocument:",
|
||||
"saveDocumentAs:",
|
||||
"saveDocumentTo:",
|
||||
"scrollLineDown:",
|
||||
"scrollLineUp:",
|
||||
"scrollPageDown:",
|
||||
"scrollPageUp:",
|
||||
"scrollViaScroller:",
|
||||
"selectAll:",
|
||||
"selectLine:",
|
||||
"selectNextKeyView:",
|
||||
"selectParagraph:",
|
||||
"selectPreviousKeyView:",
|
||||
"selectText:",
|
||||
"selectText:",
|
||||
"selectToMark:",
|
||||
"selectWord:",
|
||||
"showContextHelp:",
|
||||
"showGuessPanel:",
|
||||
"showHelp:",
|
||||
"showWindow:",
|
||||
"stop:",
|
||||
"subscript:",
|
||||
"superscript:",
|
||||
"swapWithMark:",
|
||||
"takeDoubleValueFrom:",
|
||||
"takeFloatValueFrom:",
|
||||
"takeIntValueFrom:",
|
||||
"takeObjectValueFrom:",
|
||||
"takeStringValueFrom:",
|
||||
"terminate:",
|
||||
"tightenKerning:",
|
||||
"toggle:",
|
||||
"toggleContinuousSpellChecking:",
|
||||
"toggleRuler:",
|
||||
"toggleToolbarShown:",
|
||||
"toggleTraditionalCharacterShape:",
|
||||
"transpose:",
|
||||
"transposeWords:",
|
||||
"turnOffKerning:",
|
||||
"turnOffLigatures:",
|
||||
"underline:",
|
||||
"unhide:",
|
||||
"unhideAllApplications:",
|
||||
"unscript:",
|
||||
"uppercaseWord:",
|
||||
"useAllLigatures:",
|
||||
"useStandardKerning:",
|
||||
"useStandardLigatures:",
|
||||
"yank:",
|
||||
"zoom:",
|
||||
"open:"
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
}
|
BIN
Testing/GormTest.gorm/objects.gorm
Normal file
BIN
Testing/GormTest.gorm/objects.gorm
Normal file
Binary file not shown.
|
@ -14,7 +14,7 @@
|
|||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
|
@ -35,11 +35,11 @@
|
|||
|
||||
- (id) open: (id)sender
|
||||
{
|
||||
NSArray *fileTypes = [NSArray arrayWithObjects: @"gorm", @"nib", nil];
|
||||
NSArray *fileTypes = [NSArray arrayWithObjects: @"gorm", nil];
|
||||
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
|
||||
id oldDelegate = [NSApp delegate];
|
||||
int result;
|
||||
|
||||
|
||||
[oPanel setAllowsMultipleSelection: NO];
|
||||
[oPanel setCanChooseFiles: YES];
|
||||
[oPanel setCanChooseDirectories: NO];
|
||||
|
@ -49,67 +49,33 @@
|
|||
if (result == NSOKButton)
|
||||
{
|
||||
[NSBundle loadNibFile: [oPanel filename]
|
||||
externalNameTable:
|
||||
[NSDictionary dictionaryWithObject: NSApp forKey: @"NSOwner"]
|
||||
withZone: NSDefaultMallocZone()];
|
||||
externalNameTable:
|
||||
[NSDictionary dictionaryWithObject: NSApp forKey: @"NSOwner"]
|
||||
withZone: NSDefaultMallocZone()];
|
||||
if ([NSApp delegate] == oldDelegate)
|
||||
{
|
||||
NSRunAlertPanel(NULL,
|
||||
[NSString stringWithFormat: @"Nib did not set app delegate"],
|
||||
@"OK", NULL, NULL);
|
||||
[NSString stringWithFormat: @"Nib did not set app delegate"],
|
||||
@"OK", NULL, NULL);
|
||||
return nil;
|
||||
}
|
||||
if ([[NSApp delegate] isKindOfClass: [NSWindow class]] == NO)
|
||||
{
|
||||
NSRunAlertPanel(NULL,
|
||||
[NSString stringWithFormat:
|
||||
@"Nib set app delegate to something other than a window"],
|
||||
@"OK", NULL, NULL);
|
||||
[NSString stringWithFormat:
|
||||
@"Nib set app delegate to something other than a window"],
|
||||
@"OK", NULL, NULL);
|
||||
return nil;
|
||||
}
|
||||
[[NSApp delegate] makeKeyAndOrderFront: self];
|
||||
return self;
|
||||
}
|
||||
return nil; /* Failed */
|
||||
return nil; /* Failed */
|
||||
}
|
||||
@end
|
||||
|
||||
int
|
||||
main (void)
|
||||
main(int argc, const char **argv)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
NSApplication *app;
|
||||
NSMenu *mainMenu;
|
||||
NSMenu *windowsMenu;
|
||||
NSMenuItem *menuItem;
|
||||
Controller *appController;
|
||||
|
||||
pool = [NSAutoreleasePool new];
|
||||
app = [NSApplication sharedApplication];
|
||||
|
||||
mainMenu = [[NSMenu alloc] initWithTitle: @"Gorm Test"];
|
||||
|
||||
[mainMenu addItemWithTitle: @"Open"
|
||||
action: @selector(open:)
|
||||
keyEquivalent: @"o"];
|
||||
|
||||
menuItem = [mainMenu addItemWithTitle: @"Windows"
|
||||
action: NULL
|
||||
keyEquivalent: @""];
|
||||
windowsMenu = [NSMenu new];
|
||||
[mainMenu setSubmenu: windowsMenu forItem: menuItem];
|
||||
|
||||
[mainMenu addItemWithTitle: @"Quit"
|
||||
action: @selector(terminate:)
|
||||
keyEquivalent: @"q"];
|
||||
|
||||
[app setMainMenu: mainMenu];
|
||||
[app setWindowsMenu: windowsMenu];
|
||||
[mainMenu display];
|
||||
appController = [Controller new];
|
||||
[app setDelegate: appController];
|
||||
[app run];
|
||||
[pool release];
|
||||
return 0;
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue