mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Improve predicate editor decoding.
This commit is contained in:
parent
97cb13a5ff
commit
5f147345fc
5 changed files with 64 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
2020-01-11 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSRuleEditor.h
|
||||
* Source/NSRuleEditor.m: Add action and target.
|
||||
* Source/NSPredicateEditor.m: Add encoding and decoding.
|
||||
* Source/GSXib5KeyedUnarchiver.m: Decode row templates.
|
||||
|
||||
2020-01-10 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSKeyValueBinding.h,
|
||||
|
|
|
@ -58,7 +58,8 @@ extern NSString * const NSRuleEditorPredicateCompoundType;
|
|||
extern NSString *NSRuleEditorRowsDidChangeNotification;
|
||||
|
||||
@interface NSRuleEditor : NSControl {
|
||||
|
||||
id _target;
|
||||
SEL _action;
|
||||
}
|
||||
|
||||
- (void) addRow: (id)sender;
|
||||
|
|
|
@ -362,6 +362,7 @@ static NSArray *XmlBoolDefaultYes = nil;
|
|||
@"NSMutableArray", @"prototypeCellViews",
|
||||
@"NSMutableArray", @"allowedToolbarItems",
|
||||
@"NSMutableArray", @"defaultToolbarItems",
|
||||
@"NSMutableArray", @"rowTemplates",
|
||||
@"NSSegmentItem", @"segment",
|
||||
@"NSCell", @"customCell",
|
||||
@"NSCustomObject5", @"customObject",
|
||||
|
|
|
@ -47,4 +47,38 @@
|
|||
ASSIGN(_rowTemplates, templates);
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
[super encodeWithCoder: aCoder];
|
||||
|
||||
if ([aCoder allowsKeyedCoding])
|
||||
{
|
||||
[aCoder encodeObject: _rowTemplates forKey: @"NSRowTemplates"];
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
{
|
||||
self = [super initWithCoder: aDecoder];
|
||||
if (nil == self)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
if ([aDecoder allowsKeyedCoding])
|
||||
{
|
||||
NSArray *rowTemplates = [aDecoder decodeObjectForKey: @"NSRowTemplates"];
|
||||
|
||||
[self setRowTemplates: rowTemplates];
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -230,4 +230,24 @@
|
|||
{
|
||||
}
|
||||
|
||||
- (void) setAction: (SEL)action
|
||||
{
|
||||
_action = action;
|
||||
}
|
||||
|
||||
- (SEL) action
|
||||
{
|
||||
return _action;
|
||||
}
|
||||
|
||||
- (void) setTarget: (id)target
|
||||
{
|
||||
_target = target;
|
||||
}
|
||||
|
||||
- (id) target
|
||||
{
|
||||
return _target;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue