mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 11:41:05 +00:00
Update styleMask code, add autoresizeMask
This commit is contained in:
parent
96fd979f1c
commit
e8e536c06a
1 changed files with 36 additions and 2 deletions
|
@ -248,6 +248,7 @@ static NSUInteger _count = INT_MAX;
|
||||||
@"NSUInteger", @"alignment",
|
@"NSUInteger", @"alignment",
|
||||||
@"NSUInteger", @"bezelStyle",
|
@"NSUInteger", @"bezelStyle",
|
||||||
@"BOOL", @"isBordered",
|
@"BOOL", @"isBordered",
|
||||||
|
@"NSUInteger", @"autoresizingMask",
|
||||||
nil];
|
nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -589,7 +590,7 @@ static NSUInteger _count = INT_MAX;
|
||||||
|
|
||||||
if (mask | NSWindowStyleMaskTitled)
|
if (mask | NSWindowStyleMaskTitled)
|
||||||
{
|
{
|
||||||
attr = [NSXMLNode attributeWithName: @"windowed" stringValue: @"YES"];
|
attr = [NSXMLNode attributeWithName: @"titled" stringValue: @"YES"];
|
||||||
[styleMaskElem addAttribute: attr];
|
[styleMaskElem addAttribute: attr];
|
||||||
}
|
}
|
||||||
if (mask | NSWindowStyleMaskClosable)
|
if (mask | NSWindowStyleMaskClosable)
|
||||||
|
@ -608,6 +609,9 @@ static NSUInteger _count = INT_MAX;
|
||||||
[styleMaskElem addAttribute: attr];
|
[styleMaskElem addAttribute: attr];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
attr = [NSXMLNode attributeWithName: @"key" stringValue: @"styleMask"];
|
||||||
|
[styleMaskElem addAttribute: attr];
|
||||||
|
|
||||||
[elem addChild: styleMaskElem];
|
[elem addChild: styleMaskElem];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -707,6 +711,30 @@ static NSUInteger _count = INT_MAX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) _addAutoresizingMask: (NSAutoresizingMaskOptions)m toElement: (NSXMLElement *)elem
|
||||||
|
{
|
||||||
|
if (m != 0)
|
||||||
|
{
|
||||||
|
NSXMLElement *autoresizingMaskElem = [NSXMLNode elementWithName: @"autoresizingMask"];
|
||||||
|
NSXMLNode *attr = nil;
|
||||||
|
|
||||||
|
if (m | NSViewWidthSizable)
|
||||||
|
{
|
||||||
|
attr = [NSXMLNode attributeWithName: @"flexibleMaxX" stringValue: @"YES"];
|
||||||
|
}
|
||||||
|
if (m | NSViewHeightSizable)
|
||||||
|
{
|
||||||
|
attr = [NSXMLNode attributeWithName: @"flexibleMaxY" stringValue: @"YES"];
|
||||||
|
}
|
||||||
|
|
||||||
|
[autoresizingMaskElem addAttribute: attr];
|
||||||
|
attr = [NSXMLNode attributeWithName: @"key" stringValue: @"autoresizeMask"];
|
||||||
|
[autoresizingMaskElem addAttribute: attr];
|
||||||
|
|
||||||
|
[elem addChild: autoresizingMaskElem];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void) _addProperty: (NSString *)name
|
- (void) _addProperty: (NSString *)name
|
||||||
withType: (NSString *)type
|
withType: (NSString *)type
|
||||||
toElem: (NSXMLElement *)elem
|
toElem: (NSXMLElement *)elem
|
||||||
|
@ -734,7 +762,13 @@ static NSUInteger _count = INT_MAX;
|
||||||
NSString *buttonTypeString = [obj buttonTypeString];
|
NSString *buttonTypeString = [obj buttonTypeString];
|
||||||
[self _addButtonType: buttonTypeString
|
[self _addButtonType: buttonTypeString
|
||||||
toElement: elem];
|
toElement: elem];
|
||||||
}
|
}
|
||||||
|
else if ([name isEqualToString: @"autoresizingMask"])
|
||||||
|
{
|
||||||
|
NSAutoresizingMaskOptions m = [obj autoresizingMask];
|
||||||
|
[self _addAutoresizingMask: m
|
||||||
|
toElement: elem];
|
||||||
|
}
|
||||||
else if ([name isEqualToString: @"alignment"] && [obj respondsToSelector: @selector(cell)] == NO)
|
else if ([name isEqualToString: @"alignment"] && [obj respondsToSelector: @selector(cell)] == NO)
|
||||||
{
|
{
|
||||||
[self _addAlignment: [obj alignment]
|
[self _addAlignment: [obj alignment]
|
||||||
|
|
Loading…
Reference in a new issue