mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 06:51:44 +00:00
Fix decoding in Xib unarchiver. Other changes
This commit is contained in:
parent
6ee3740797
commit
ba9dfadbf5
3 changed files with 71 additions and 36 deletions
|
@ -73,9 +73,9 @@ static const CGFloat NSStackViewSpacingUseDefault = FLT_MAX;
|
|||
NSStackViewDistribution _distribution;
|
||||
CGFloat _spacing;
|
||||
BOOL _detachesHiddenViews;
|
||||
NSArray *_arrangedSubviews;
|
||||
NSArray *_detachedViews;
|
||||
NSArray *_views;
|
||||
NSMutableArray *_arrangedSubviews;
|
||||
NSMutableArray *_detachedViews;
|
||||
NSMutableArray *_views;
|
||||
}
|
||||
|
||||
// Properties
|
||||
|
@ -103,7 +103,7 @@ static const CGFloat NSStackViewSpacingUseDefault = FLT_MAX;
|
|||
- (void) setArrangedSubviews: (NSArray *)arrangedSubviews;
|
||||
- (NSArray *) arrangedSubviews;
|
||||
|
||||
- (void) setDetachedSubviews: (NSArray *)detachedViews;
|
||||
- (void) setDetachedViews: (NSArray *)detachedViews;
|
||||
- (NSArray *) detachedViews;
|
||||
|
||||
// Instance methods
|
||||
|
@ -133,6 +133,12 @@ static const CGFloat NSStackViewSpacingUseDefault = FLT_MAX;
|
|||
- (void) setHasEqualSpacing: (BOOL)f; // deprecated
|
||||
- (BOOL) hasEqualSpacing; // deprecated
|
||||
|
||||
- (void)addView: (NSView *)view inGravity: (NSStackViewGravity)gravity;
|
||||
- (void)insertView: (NSView *)view atIndex: (NSUInteger)index inGravity: (NSStackViewGravity)gravity;
|
||||
- (void)removeView: (NSView *)view;
|
||||
- (NSArray *) viewsInGravity: (NSStackViewGravity)gravity;
|
||||
- (void)setViews: (NSArray *)views inGravity: (NSStackViewGravity)gravity;
|
||||
|
||||
@end
|
||||
|
||||
// Protocol
|
||||
|
@ -143,16 +149,6 @@ static const CGFloat NSStackViewSpacingUseDefault = FLT_MAX;
|
|||
|
||||
@end
|
||||
|
||||
@interface NSStackView (NSStackViewGravityAreas)
|
||||
|
||||
- (void)addView: (NSView *)view inGravity: (NSStackViewGravity)gravity;
|
||||
- (void)insertView: (NSView *)view atIndex: (NSUInteger)index inGravity: (NSStackViewGravity)gravity;
|
||||
- (void)removeView: (NSView *)view;
|
||||
- (NSArray *) viewsInGravity: (NSStackViewGravity)gravity;
|
||||
- (void)setViews: (NSArray *)views inGravity: (NSStackViewGravity)gravity;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2945,40 +2945,40 @@ didStartElement: (NSString*)elementName
|
|||
|
||||
- (id) _decodePlacementForObject: (id)obj
|
||||
{
|
||||
NSNumber *num = [NSNumber numberWithInteger: 0];
|
||||
NSGridRowAlignment alignment = NSGridCellPlacementNone;
|
||||
if ([obj isEqualToString: @"inherited"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridCellPlacementInherited];
|
||||
alignment = NSGridCellPlacementInherited;
|
||||
}
|
||||
else if ([obj isEqualToString: @"leading"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridCellPlacementLeading];
|
||||
alignment = NSGridCellPlacementLeading;
|
||||
}
|
||||
else if ([obj isEqualToString: @"top"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridCellPlacementTop];
|
||||
alignment = NSGridCellPlacementTop;
|
||||
}
|
||||
else if ([obj isEqualToString: @"trailing"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridCellPlacementTrailing];
|
||||
alignment = NSGridCellPlacementTrailing;
|
||||
}
|
||||
else if ([obj isEqualToString: @"bottom"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridCellPlacementBottom];
|
||||
alignment = NSGridCellPlacementBottom;
|
||||
}
|
||||
else if ([obj isEqualToString: @"center"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridCellPlacementCenter];
|
||||
alignment = NSGridCellPlacementCenter;
|
||||
}
|
||||
else if ([obj isEqualToString: @"fill"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridCellPlacementFill];
|
||||
alignment = NSGridCellPlacementFill;
|
||||
}
|
||||
else // if not specified then assume none...
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridCellPlacementNone];
|
||||
alignment = NSGridCellPlacementNone;
|
||||
}
|
||||
return num;
|
||||
return [NSNumber numberWithInteger: alignment];
|
||||
}
|
||||
|
||||
- (id) decodeXPlacementForElement: (GSXibElement *)element
|
||||
|
@ -2996,24 +2996,24 @@ didStartElement: (NSString*)elementName
|
|||
- (id) decodeRowAlignmentForElement: (GSXibElement *)element
|
||||
{
|
||||
id obj = [element attributeForKey: @"rowAlignment"];
|
||||
NSNumber *num = [NSNumber numberWithInteger: 0];
|
||||
NSGridRowAlignment alignment = NSGridRowAlignmentNone;
|
||||
if ([obj isEqualToString: @"inherited"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridRowAlignmentInherited];
|
||||
alignment = NSGridRowAlignmentInherited;
|
||||
}
|
||||
else if ([obj isEqualToString: @"firstBaseline"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridRowAlignmentFirstBaseline];
|
||||
alignment = NSGridRowAlignmentFirstBaseline;
|
||||
}
|
||||
else if ([obj isEqualToString: @"lastBaseline"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridRowAlignmentLastBaseline];
|
||||
alignment = NSGridRowAlignmentLastBaseline;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSGridRowAlignmentNone];
|
||||
alignment = NSGridRowAlignmentNone;
|
||||
}
|
||||
return num;
|
||||
return [NSNumber numberWithInteger: alignment];
|
||||
}
|
||||
|
||||
- (id) objectForXib: (GSXibElement*)element
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
*/
|
||||
|
||||
#import "AppKit/NSStackView.h"
|
||||
|
||||
#import "GSFastEnumeration.h"
|
||||
|
||||
@implementation NSStackView
|
||||
|
||||
// Properties
|
||||
|
@ -119,8 +120,27 @@
|
|||
|
||||
// Instance methods
|
||||
// Manage views...
|
||||
- (instancetype) initWithViews: (NSArray *)views
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
_arrangedSubviews = [[NSArray alloc] initWithArray: views];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_arrangedSubviews);
|
||||
RELEASE(_detachedViews);
|
||||
_delegate = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
+ (instancetype) stackViewWithViews: (NSArray *)views
|
||||
{
|
||||
return [[self alloc] initWithViews: views];
|
||||
}
|
||||
|
||||
- (void) setCustomSpacing: (CGFloat)spacing afterView: (NSView *)v
|
||||
|
@ -135,7 +155,7 @@
|
|||
{
|
||||
}
|
||||
|
||||
- (void) insertArrangedSubview: (NSView *)v
|
||||
- (void) insertArrangedSubview: (NSView *)v atIndex: (NSInteger)idx
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -181,10 +201,6 @@
|
|||
// deprecated
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSStackView (NSStackViewGravityAreas)
|
||||
|
||||
- (void)addView: (NSView *)view inGravity: (NSStackViewGravity)gravity
|
||||
{
|
||||
}
|
||||
|
@ -204,6 +220,29 @@
|
|||
- (void)setViews: (NSArray *)views inGravity: (NSStackViewGravity)gravity
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setViews: (NSArray *)views
|
||||
{
|
||||
}
|
||||
|
||||
- (NSArray *) views
|
||||
{
|
||||
}
|
||||
|
||||
// Encoding...
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
[super encodeWithCoder: coder];
|
||||
}
|
||||
|
||||
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
self = [super initWithCoder: coder];
|
||||
if (self != nil)
|
||||
{
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in a new issue