mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 03:51:22 +00:00
* Palettes/0Menu/GormMenuEditor.m: Protect against the menu parent
being a popup button cell. * Plugins/Xib/GormXibWrapperLoader.m: Move additional methods into gui and correct handling of file owner. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@34056 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7cf6d8e775
commit
0f8b9f3d20
3 changed files with 33 additions and 117 deletions
|
@ -1,3 +1,10 @@
|
|||
2011-10-25 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Palettes/0Menu/GormMenuEditor.m: Protect against the menu parent
|
||||
being a popup button cell.
|
||||
* Plugins/Xib/GormXibWrapperLoader.m: Move additional methods into
|
||||
gui and correct handling of file owner.
|
||||
|
||||
2011-09-15 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* GormCore/GormPrivate.h ([NSDateFormatter +initialize],
|
||||
|
|
|
@ -385,7 +385,7 @@
|
|||
// Line up submenu with parent menu.
|
||||
//
|
||||
item = [document parentOfObject: edited];
|
||||
if (item != nil)
|
||||
if (item != nil && [item isKindOfClass: [NSMenuItem class]])
|
||||
{
|
||||
NSMenu *parent = [document parentOfObject: item];
|
||||
NSRect frame = [[[parent menuRepresentation] window] frame];
|
||||
|
|
|
@ -37,100 +37,6 @@
|
|||
#include "GormXibWrapperLoader.h"
|
||||
// #include "GormWindowTemplate.h"
|
||||
|
||||
/*
|
||||
* Additional methods needed to read xibs into gorm...
|
||||
*/
|
||||
@interface IBObjectRecord (GormLoading)
|
||||
- (id) parent;
|
||||
@end
|
||||
|
||||
@implementation IBObjectRecord (GormLoading)
|
||||
- (id) parent
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface IBConnectionRecord (GormLoading)
|
||||
- (IBConnection *) connection;
|
||||
@end
|
||||
|
||||
@implementation IBConnectionRecord (GormLoading)
|
||||
- (IBConnection *) connection
|
||||
{
|
||||
return connection;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface IBConnection (GormLoading)
|
||||
- (NSString *) label;
|
||||
- (id) source;
|
||||
- (id) destination;
|
||||
- (NSNibConnector *) nibConnector;
|
||||
@end
|
||||
|
||||
@implementation IBConnection (GormLoading)
|
||||
- (NSString *) label
|
||||
{
|
||||
return label;
|
||||
}
|
||||
|
||||
- (id) source
|
||||
{
|
||||
return source;
|
||||
}
|
||||
|
||||
- (id) destination
|
||||
{
|
||||
return destination;
|
||||
}
|
||||
|
||||
- (NSNibConnector *) nibConnector
|
||||
{
|
||||
NSString *tag = [self label];
|
||||
NSRange colonRange = [tag rangeOfString: @":"];
|
||||
unsigned int location = colonRange.location;
|
||||
NSNibConnector *result = nil;
|
||||
|
||||
if(location == NSNotFound)
|
||||
{
|
||||
result = [[NSNibOutletConnector alloc] init];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = [[NSNibControlConnector alloc] init];
|
||||
}
|
||||
|
||||
[result setDestination: [self destination]];
|
||||
[result setSource: [self source]];
|
||||
[result setLabel: [self label]];
|
||||
|
||||
return result;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface IBObjectContainer (GormLoading)
|
||||
- (NSEnumerator *) connectionRecordEnumerator;
|
||||
@end
|
||||
|
||||
@implementation IBObjectContainer (GormLoading)
|
||||
- (NSEnumerator *) connectionRecordEnumerator
|
||||
{
|
||||
return [connectionRecords objectEnumerator];
|
||||
}
|
||||
@end
|
||||
|
||||
@interface GSXibKeyedUnarchiver (GormLoading)
|
||||
- (id) objectForKey: (id)key;
|
||||
@end
|
||||
|
||||
@implementation GSXibKeyedUnarchiver (GormLoading)
|
||||
- (id) objectForKey: (id)key
|
||||
{
|
||||
return [decoded objectForKey: key];
|
||||
}
|
||||
@end
|
||||
|
||||
/*
|
||||
* Forward declarations for classes
|
||||
*/
|
||||
|
@ -271,8 +177,10 @@
|
|||
else
|
||||
{
|
||||
IBObjectRecord *or = nil;
|
||||
en = [container objectRecordEnumerator];
|
||||
nibFilesOwner = [u objectForKey: @"File's Owner"];
|
||||
NSArray *rootObjects;
|
||||
|
||||
rootObjects = [u decodeObjectForKey: @"IBDocument.RootObjects"];
|
||||
nibFilesOwner = [rootObjects objectAtIndex: 0];
|
||||
docFilesOwner = [document filesOwner];
|
||||
|
||||
if ([nibFilesOwner isKindOfClass: [GormObjectProxy class]])
|
||||
|
@ -283,6 +191,7 @@
|
|||
//
|
||||
// add objects...
|
||||
//
|
||||
en = [container objectRecordEnumerator];
|
||||
while ((or = [en nextObject]) != nil)
|
||||
{
|
||||
id obj = [or object];
|
||||
|
|
Loading…
Reference in a new issue