mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 05:32:11 +00:00
Added support for NSPopUpButton.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2699 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9543e0213e
commit
6507878974
1 changed files with 26 additions and 98 deletions
124
Model/GMAppKit.m
124
Model/GMAppKit.m
|
@ -105,21 +105,10 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return [NSApplication sharedApplication];
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSApplication class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSApplication (GMArchiverMethods) */
|
||||
|
||||
|
||||
@implementation NSBox (GMArchiverMethods)
|
||||
+ (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver
|
||||
{
|
||||
NSLog (@"creating NSBox");
|
||||
return [self alloc];
|
||||
}
|
||||
|
||||
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
||||
{
|
||||
|
@ -145,12 +134,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSBox class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSBox (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -206,12 +189,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSButton class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSButton (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -232,12 +209,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSCell class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSCell (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -389,12 +360,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSControl class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSControl (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -410,12 +375,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return [super initWithModelUnarchiver:unarchiver];
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSCStringText class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSCStringText (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -438,12 +397,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSFont class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSFont (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -470,12 +423,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSImage class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSImage (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -516,12 +463,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSMenuItem class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSMenuItem (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -572,12 +513,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSMenu class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSMenu (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -585,19 +520,37 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
|
||||
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
||||
{
|
||||
// [super encodeWithModelArchiver:archiver];
|
||||
[super encodeWithModelArchiver:archiver];
|
||||
[archiver encodeBOOL:[self pullsDown] withName:@"pullsDown"];
|
||||
[archiver encodeArray:[self itemArray] withName:@"itemArray"];
|
||||
[archiver encodeString:[self titleOfSelectedItem] withName:@"selectedItem"];
|
||||
}
|
||||
|
||||
- (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver
|
||||
{
|
||||
// return [super initWithModelUnarchiver:unarchiver];
|
||||
return self;
|
||||
}
|
||||
int i, count;
|
||||
NSMutableArray* decodedItems
|
||||
= [unarchiver decodeObjectWithName:@"itemArray"];
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSPopUpButton class];
|
||||
return isa;
|
||||
self = [super initWithModelUnarchiver:unarchiver];
|
||||
|
||||
for (i = 0, count = [decodedItems count]; i < count; i++) {
|
||||
id item = [decodedItems objectAtIndex:i];
|
||||
id myItem;
|
||||
|
||||
[self addItemWithTitle:[item title]];
|
||||
myItem = [self itemAtIndex:i];
|
||||
[myItem setTarget:[item target]];
|
||||
[myItem setAction:[item action]];
|
||||
[myItem setEnabled:[item isEnabled]];
|
||||
[myItem setTag:[item tag]];
|
||||
[myItem setKeyEquivalent:[item keyEquivalent]];
|
||||
}
|
||||
|
||||
[self selectItemWithTitle:[unarchiver decodeStringWithName:@"selectedItem"]];
|
||||
[self synchronizeTitleAndSelectedItem];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end /* NSPopUpButton (GMArchiverMethods) */
|
||||
|
@ -619,12 +572,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSResponder class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSResponder (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -683,12 +630,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSTextField class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSTextField (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -718,7 +659,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
NSView* view = [[[self allocWithZone:[unarchiver objectZone]]
|
||||
initWithFrame:rect]
|
||||
autorelease];
|
||||
NSLog (@"created view %@", view);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -750,12 +690,6 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSView class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSView (GMArchiverMethods) */
|
||||
|
||||
|
||||
|
@ -832,11 +766,5 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
return self;
|
||||
}
|
||||
|
||||
- (Class)classForModelArchiver
|
||||
{
|
||||
// return [NSWindow class];
|
||||
return isa;
|
||||
}
|
||||
|
||||
@end /* NSWindow (GMArchiverMethods) */
|
||||
|
||||
|
|
Loading…
Reference in a new issue