Improve predicate editor decoding.

This commit is contained in:
fredkiefer 2020-01-11 19:33:24 +01:00
parent 97cb13a5ff
commit 5f147345fc
5 changed files with 64 additions and 1 deletions

View file

@ -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,

View file

@ -58,7 +58,8 @@ extern NSString * const NSRuleEditorPredicateCompoundType;
extern NSString *NSRuleEditorRowsDidChangeNotification;
@interface NSRuleEditor : NSControl {
id _target;
SEL _action;
}
- (void) addRow: (id)sender;

View file

@ -362,6 +362,7 @@ static NSArray *XmlBoolDefaultYes = nil;
@"NSMutableArray", @"prototypeCellViews",
@"NSMutableArray", @"allowedToolbarItems",
@"NSMutableArray", @"defaultToolbarItems",
@"NSMutableArray", @"rowTemplates",
@"NSSegmentItem", @"segment",
@"NSCell", @"customCell",
@"NSCustomObject5", @"customObject",

View file

@ -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

View file

@ -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