Some cleanup in the Auto Layout test.
This commit is contained in:
parent
c9da21e350
commit
63439daffc
|
@ -1,16 +1,13 @@
|
||||||
// 31 july 2015
|
// 31 july 2015
|
||||||
#import "osxaltest.h"
|
#import "osxaltest.h"
|
||||||
|
|
||||||
@interface tBox : NSObject<tControl> {
|
@implementation tBox {
|
||||||
NSMutableArray *children;
|
NSMutableArray *children;
|
||||||
NSView *sv;
|
NSView *sv;
|
||||||
BOOL vertical;
|
BOOL vertical;
|
||||||
}
|
}
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation tBox
|
- (id)tInitVertical:(BOOL)vert
|
||||||
|
|
||||||
- (id)initVertical:(BOOL)vert
|
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
@ -21,7 +18,7 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)addControl:(NSObject<tControl> *)c stretchy:(BOOL)s
|
- (void)tAddControl:(id<tControl>)c stretchy:(BOOL)s
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
// 31 july 2015
|
// 31 july 2015
|
||||||
#import "osxaltest.h"
|
#import "osxaltest.h"
|
||||||
|
|
||||||
@interface tButton : NSObject<tControl> {
|
@implementation tButton {
|
||||||
NSButton *b;
|
NSButton *b;
|
||||||
}
|
}
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation tButton
|
- (id)tInitWithText:(NSString *)text
|
||||||
|
|
||||||
- (id)initWithText:(NSString *)text
|
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
|
Binary file not shown.
|
@ -9,8 +9,17 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface tWindowDelegate : NSObject<NSWindowDelegate>
|
@interface tWindowDelegate : NSObject<NSWindowDelegate>
|
||||||
- (void)tSetControl:(NSObject<tControl> *)cc;
|
- (void)tSetControl:(id<tControl>)cc;
|
||||||
- (void)tRelayout;
|
- (void)tRelayout;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface tBox : NSObject<tControl>
|
||||||
|
- (id)tInitVertical:(BOOL)vert;
|
||||||
|
- (void)tAddControl:(id<tControl>)c stretchy:(BOOL)s;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface tButton : NSObject<tControl>
|
||||||
|
- (id)tInitWithText:(NSString *)text;
|
||||||
|
@end
|
||||||
|
|
||||||
extern NSString *tAutoLayoutKey(uintmax_t);
|
extern NSString *tAutoLayoutKey(uintmax_t);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#import "osxaltest.h"
|
#import "osxaltest.h"
|
||||||
|
|
||||||
@implementation tWindowDelegate {
|
@implementation tWindowDelegate {
|
||||||
NSObject<tControl> *c;
|
id<tControl> c;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)init
|
- (id)init
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tSetControl:(NSObject<tControl> *)cc
|
- (void)tSetControl:(id<tControl>)cc
|
||||||
{
|
{
|
||||||
self->c = cc;
|
self->c = cc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue