mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 20:50:38 +00:00
Fixed serios bug that affected establishing connections. Support for NSBox.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2697 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
70f73da4bd
commit
45741ba6e9
3 changed files with 76 additions and 18 deletions
|
@ -32,6 +32,9 @@
|
||||||
@interface NSApplication (GMArchiverMethods) <ModelCoding>
|
@interface NSApplication (GMArchiverMethods) <ModelCoding>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface NSBox (GMArchiverMethods) <ModelCoding>
|
||||||
|
@end
|
||||||
|
|
||||||
@interface NSButton (GMArchiverMethods) <ModelCoding>
|
@interface NSButton (GMArchiverMethods) <ModelCoding>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,10 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
windows = [unarchiver decodeObjectWithName:@"windows"];
|
windows = [unarchiver decodeObjectWithName:@"windows"];
|
||||||
keyWindow = [unarchiver decodeObjectWithName:@"keyWindow"];
|
keyWindow = [unarchiver decodeObjectWithName:@"keyWindow"];
|
||||||
mainWindow = [unarchiver decodeObjectWithName:@"mainWindow"];
|
mainWindow = [unarchiver decodeObjectWithName:@"mainWindow"];
|
||||||
|
|
||||||
anObject = [unarchiver decodeObjectWithName:@"delegate"];
|
anObject = [unarchiver decodeObjectWithName:@"delegate"];
|
||||||
[self setDelegate:anObject];
|
if (anObject)
|
||||||
|
[self setDelegate:anObject];
|
||||||
|
|
||||||
#if NeXT_GUI_LIBRARY
|
#if NeXT_GUI_LIBRARY
|
||||||
mainMenu = [unarchiver decodeObjectWithName:@"mainMenu"];
|
mainMenu = [unarchiver decodeObjectWithName:@"mainMenu"];
|
||||||
|
@ -105,12 +107,47 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSApplication class];
|
// return [NSApplication class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSApplication (GMArchiverMethods) */
|
@end /* NSApplication (GMArchiverMethods) */
|
||||||
|
|
||||||
|
|
||||||
|
@implementation NSBox (GMArchiverMethods)
|
||||||
|
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
||||||
|
{
|
||||||
|
[super encodeWithModelArchiver:archiver];
|
||||||
|
|
||||||
|
[archiver encodeInt:[self borderType] withName:@"borderType"];
|
||||||
|
[archiver encodeInt:[self titlePosition] withName:@"titlePosition"];
|
||||||
|
[archiver encodeString:[self title] withName:@"title"];
|
||||||
|
[archiver encodeObject:[self titleFont] withName:@"titleFont"];
|
||||||
|
[archiver encodeObject:[self contentView] withName:@"contentView"];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver
|
||||||
|
{
|
||||||
|
self = [super initWithModelUnarchiver:unarchiver];
|
||||||
|
|
||||||
|
[self setBorderType:[unarchiver decodeIntWithName:@"borderType"]];
|
||||||
|
[self setTitlePosition:[unarchiver decodeIntWithName:@"titlePosition"]];
|
||||||
|
[self setTitle:[unarchiver decodeStringWithName:@"title"]];
|
||||||
|
[self setTitleFont:[unarchiver decodeObjectWithName:@"titleFont"]];
|
||||||
|
[self setContentView:[unarchiver decodeObjectWithName:@"contentView"]];
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (Class)classForModelArchiver
|
||||||
|
{
|
||||||
|
// return [NSBox class];
|
||||||
|
return isa;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end /* NSBox (GMArchiverMethods) */
|
||||||
|
|
||||||
|
|
||||||
@implementation NSButton (GMArchiverMethods)
|
@implementation NSButton (GMArchiverMethods)
|
||||||
|
|
||||||
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
||||||
|
@ -165,7 +202,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSButton class];
|
// return [NSButton class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSButton (GMArchiverMethods) */
|
@end /* NSButton (GMArchiverMethods) */
|
||||||
|
@ -190,7 +228,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSCell class];
|
// return [NSCell class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSCell (GMArchiverMethods) */
|
@end /* NSCell (GMArchiverMethods) */
|
||||||
|
@ -298,7 +337,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSColor class];
|
// return [NSColor class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSColor (GMArchiverMethods) */
|
@end /* NSColor (GMArchiverMethods) */
|
||||||
|
@ -345,7 +385,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSControl class];
|
// return [NSControl class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSControl (GMArchiverMethods) */
|
@end /* NSControl (GMArchiverMethods) */
|
||||||
|
@ -365,7 +406,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSCStringText class];
|
// return [NSCStringText class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSCStringText (GMArchiverMethods) */
|
@end /* NSCStringText (GMArchiverMethods) */
|
||||||
|
@ -392,7 +434,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSFont class];
|
// return [NSFont class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSFont (GMArchiverMethods) */
|
@end /* NSFont (GMArchiverMethods) */
|
||||||
|
@ -423,7 +466,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSImage class];
|
// return [NSImage class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSImage (GMArchiverMethods) */
|
@end /* NSImage (GMArchiverMethods) */
|
||||||
|
@ -468,7 +512,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSMenuItem class];
|
// return [NSMenuItem class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSMenuItem (GMArchiverMethods) */
|
@end /* NSMenuItem (GMArchiverMethods) */
|
||||||
|
@ -523,7 +568,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSMenu class];
|
// return [NSMenu class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSMenu (GMArchiverMethods) */
|
@end /* NSMenu (GMArchiverMethods) */
|
||||||
|
@ -544,7 +590,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSPopUpButton class];
|
// return [NSPopUpButton class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSPopUpButton (GMArchiverMethods) */
|
@end /* NSPopUpButton (GMArchiverMethods) */
|
||||||
|
@ -568,7 +615,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSResponder class];
|
// return [NSResponder class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSResponder (GMArchiverMethods) */
|
@end /* NSResponder (GMArchiverMethods) */
|
||||||
|
@ -631,7 +679,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSTextField class];
|
// return [NSTextField class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSTextField (GMArchiverMethods) */
|
@end /* NSTextField (GMArchiverMethods) */
|
||||||
|
@ -696,7 +745,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSView class];
|
// return [NSView class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSView (GMArchiverMethods) */
|
@end /* NSView (GMArchiverMethods) */
|
||||||
|
@ -777,7 +827,8 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
- (Class)classForModelArchiver
|
- (Class)classForModelArchiver
|
||||||
{
|
{
|
||||||
return [NSWindow class];
|
// return [NSWindow class];
|
||||||
|
return isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSWindow (GMArchiverMethods) */
|
@end /* NSWindow (GMArchiverMethods) */
|
||||||
|
|
|
@ -117,10 +117,14 @@ object_set_instance_variable (id anObject,
|
||||||
{
|
{
|
||||||
id _source = [source nibInstantiate];
|
id _source = [source nibInstantiate];
|
||||||
id _destination = [destination nibInstantiate];
|
id _destination = [destination nibInstantiate];
|
||||||
NSString* setMethodName = [@"set" stringByAppendingString:
|
NSString* setMethodName = [[@"set" stringByAppendingString:
|
||||||
[label capitalizedString]];
|
[label capitalizedString]]
|
||||||
|
stringByAppendingString:@":"];
|
||||||
SEL setSelector = NSSelectorFromString (setMethodName);
|
SEL setSelector = NSSelectorFromString (setMethodName);
|
||||||
|
|
||||||
|
// NSLog (@"establish connection: source %@, destination %@, label %@",
|
||||||
|
// _source, _destination, label);
|
||||||
|
|
||||||
if (setSelector && [_source respondsToSelector:setSelector])
|
if (setSelector && [_source respondsToSelector:setSelector])
|
||||||
[_source performSelector:setSelector withObject:_destination];
|
[_source performSelector:setSelector withObject:_destination];
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue