mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Add NSPriority, default priority to 100 if not present
This commit is contained in:
parent
8508f9f98f
commit
bf3bc1668e
2 changed files with 19 additions and 0 deletions
|
@ -3235,6 +3235,10 @@ didStartElement: (NSString*)elementName
|
|||
{
|
||||
hasValue = [currentElement attributeForKey: @"selectedItem"] != nil;
|
||||
}
|
||||
else if ([@"NSPriority" isEqualToString: key])
|
||||
{
|
||||
hasValue = [currentElement attributeForKey: @"priority"] != nil;
|
||||
}
|
||||
else if ([XmlKeysDefined containsObject: key])
|
||||
{
|
||||
// These are arbitrarily defined through hard-coding...
|
||||
|
|
|
@ -373,6 +373,15 @@ static NSMutableArray *activeConstraints;
|
|||
{
|
||||
_secondItem = [coder decodeObjectForKey: @"NSSecondItem"];
|
||||
}
|
||||
|
||||
if ([coder containsValueForKey: @"NSPriority"])
|
||||
{
|
||||
_priority = [coder decodeIntegerForKey: @"NSPriority"];
|
||||
}
|
||||
else
|
||||
{
|
||||
_priority = 1000; // if it is not present, this defaults to 1000... per testing with Cocoa.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -384,6 +393,8 @@ static NSMutableArray *activeConstraints;
|
|||
[coder decodeValueOfObjCType: @encode(float)
|
||||
at: &_secondAttribute];
|
||||
_secondItem = [coder decodeObject];
|
||||
[coder decodeValueOfObjCType: @encode(NSUInteger)
|
||||
at: &_priority];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -411,6 +422,8 @@ static NSMutableArray *activeConstraints;
|
|||
forKey: @"NSSecondAttribute"];
|
||||
[coder encodeObject: _secondItem
|
||||
forKey: @"NSSecondItem"];
|
||||
[coder encodeInteger: _priority
|
||||
forKey: @"NSPriority"];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -422,6 +435,8 @@ static NSMutableArray *activeConstraints;
|
|||
[coder encodeValueOfObjCType: @encode(float)
|
||||
at: &_secondAttribute];
|
||||
[coder encodeObject: _secondItem];
|
||||
[coder encodeValueOfObjCType: @encode(NSUInteger)
|
||||
at: &_priority];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue