mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 06:51:44 +00:00
Add methods to header for NSStackView
This commit is contained in:
parent
6f8fa92b7a
commit
4b6c1ea985
1 changed files with 88 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
#define _NSStackView_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <AppKit/NSView.h>
|
||||
#import <AppKit/NSLayoutConstraint.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
|
||||
|
||||
|
@ -60,9 +61,96 @@ static const NSStackViewVisibilityPriority NSStackViewVisibilityPriorityDetachOn
|
|||
static const NSStackViewVisibilityPriority NSStackViewVisibilityPriorityNotVisible = 0;
|
||||
|
||||
static const CGFloat NSStackViewSpacingUseDefault = FLT_MAX;
|
||||
|
||||
@protocol NSStackViewDelegate;
|
||||
|
||||
@interface NSStackView : NSView
|
||||
{
|
||||
id<NSStackViewDelegate> _delegate;
|
||||
NSUserInterfaceLayoutOrientation orientation;
|
||||
NSLayoutAttribute _alignment;
|
||||
NSEdgeInsets _edgeInsets;
|
||||
NSStackViewDistribution _distribution;
|
||||
CGFloat _spacing;
|
||||
BOOL _detachesHiddenViews;
|
||||
NSArray *_arrangedSubviews;
|
||||
NSArray *_detachedViews;
|
||||
NSArray *_views;
|
||||
}
|
||||
|
||||
// Properties
|
||||
- (void) setDelegate: (id<NSStackViewDelegate>)delegate;
|
||||
- (id<NSStackViewDelegate>) delegate;
|
||||
|
||||
- (void) setOrientation: (NSUserInterfaceLayoutOrientation)o;
|
||||
- (NSUserInterfaceLayoutOrientation) orientation;
|
||||
|
||||
- (void) setAlignment: (NSLayoutAttribute)alignment;
|
||||
- (NSLayoutAttribute) alignment;
|
||||
|
||||
- (void) setEdgeInsets: (NSEdgeInsets)insets;
|
||||
- (NSEdgeInsets) edgeInsets;
|
||||
|
||||
- (void) setDistribution: (NSStackViewDistribution)d;
|
||||
- (NSStackViewDistribution) distribution;
|
||||
|
||||
- (void) setSpacing: (CGFloat)f;
|
||||
- (CGFloat) spacing;
|
||||
|
||||
- (void) setDetachesHiddenViews: (BOOL)f;
|
||||
- (BOOL) detachesHiddenViews;
|
||||
|
||||
- (void) setArrangedSubviews: (NSArray *)arrangedSubviews;
|
||||
- (NSArray *) arrangedSubviews;
|
||||
|
||||
- (void) setDetachedSubviews: (NSArray *)detachedSubviews;
|
||||
- (NSArray *) detachedSubviews;
|
||||
|
||||
// Instance methods
|
||||
// Manage views...
|
||||
+ (instancetype) stackViewWithViews: (NSArray *)views;
|
||||
|
||||
- (void) setCustomSpacing: (CGFloat)spacing afterView: (NSView *)v;
|
||||
- (CGFloat) customSpacingAfterView: (NSView *)v;
|
||||
|
||||
- (void) addArrangedSubview: (NSView *)v;
|
||||
- (void) insertArrangedSubview: (NSView *)v;
|
||||
- (void) removeArrangedSubview: (NSView *)v;
|
||||
|
||||
// Custom priorities
|
||||
- (void)setVisibilityPriority: (NSStackViewVisibilityPriority)priority
|
||||
forView: (NSView *)v;
|
||||
- (NSStackViewVisibilityPriority) visibilityPriorityForView: (NSView *)v;
|
||||
|
||||
- (NSLayoutPriority)clippingResistancePriorityForOrientation:(NSLayoutConstraintOrientation)orientation;
|
||||
- (void) setClippingResistancePriority: (NSLayoutPriority)clippingResistancePriority
|
||||
forOrientation: (NSLayoutConstraintOrientation)orientation;
|
||||
|
||||
- (NSLayoutPriority) huggingPriorityForOrientation: (NSLayoutConstraintOrientation)o;
|
||||
- (void) setHuggingPriority: (NSLayoutPriority)huggingPriority
|
||||
forOrientation: (NSLayoutConstraintOrientation)o;
|
||||
|
||||
- (void) setHasEqualSpacing: (BOOL)f; // deprecated
|
||||
- (BOOL) hasEqualSpacing; // deprecated
|
||||
|
||||
@end
|
||||
|
||||
// Protocol
|
||||
@protocol NSStackViewDelegate <NSObject>
|
||||
|
||||
- (void) stackView: (NSStackView *)stackView willDetachViews: (NSArray *)views;
|
||||
- (void) stackView: (NSStackView *)stackView didReattachViews: (NSArray *)views;
|
||||
|
||||
@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)
|
||||
|
|
Loading…
Reference in a new issue