Added horizontal/vertical first/last flags. These flags are used by single controls for attachments. tBox will set them conditionally, so it can use the attachment values directly.
This commit is contained in:
parent
3e8aad0068
commit
f72b47c4dc
|
@ -53,11 +53,11 @@
|
||||||
horzpred = predicate;
|
horzpred = predicate;
|
||||||
}
|
}
|
||||||
[p->horz addObject:[NSString stringWithFormat:@"[%@%@]", key, horzpred]];
|
[p->horz addObject:[NSString stringWithFormat:@"[%@%@]", key, horzpred]];
|
||||||
[p->horzAttachLeft addObject:@YES];
|
[p->horzAttachLeft addObject:[NSNumtber numberWithBool:p->horzFirst]];
|
||||||
[p->horzAttachRight addObject:@YES];
|
[p->horzAttachRight addObject:[NSNumber numberWithBool:p->horzLast]];
|
||||||
[p->vert addObject:[NSString stringWithFormat:@"[%@%@]", key, vertpred]];
|
[p->vert addObject:[NSString stringWithFormat:@"[%@%@]", key, vertpred]];
|
||||||
[p->vertAttachTop addObject:@YES];
|
[p->vertAttachTop addObject:[NSNumber numberWithBool:p->vertFirst]];
|
||||||
[p->vertAttachBottom addObject:@YES];
|
[p->vertAttachBottom addObject:[NSNumber numberWithBool:p->vertLast]];
|
||||||
[p->views setObject:self->b forKey:key];
|
[p->views setObject:self->b forKey:key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,13 @@ struct tAutoLayoutParams {
|
||||||
NSMutableArray *horz;
|
NSMutableArray *horz;
|
||||||
NSMutableArray *horzAttachLeft;
|
NSMutableArray *horzAttachLeft;
|
||||||
NSMutableArray *horzAttachRight;
|
NSMutableArray *horzAttachRight;
|
||||||
|
BOOL horzFirst;
|
||||||
|
BOOL horzLast;
|
||||||
NSMutableArray *vert;
|
NSMutableArray *vert;
|
||||||
NSMutableArray *vertAttachTop;
|
NSMutableArray *vertAttachTop;
|
||||||
NSMutableArray *vertAttachBottom;
|
NSMutableArray *vertAttachBottom;
|
||||||
|
BOOL vertFirst;
|
||||||
|
BOOL vertLast;
|
||||||
NSMutableDictionary *views;
|
NSMutableDictionary *views;
|
||||||
uintmax_t n;
|
uintmax_t n;
|
||||||
BOOL stretchy;
|
BOOL stretchy;
|
||||||
|
|
|
@ -95,11 +95,11 @@
|
||||||
horzpred = predicate;
|
horzpred = predicate;
|
||||||
}
|
}
|
||||||
[p->horz addObject:[NSString stringWithFormat:@"[%@%@]", key, horzpred]];
|
[p->horz addObject:[NSString stringWithFormat:@"[%@%@]", key, horzpred]];
|
||||||
[p->horzAttachLeft addObject:@YES];
|
[p->horzAttachLeft addObject:[NSNumtber numberWithBool:p->horzFirst]];
|
||||||
[p->horzAttachRight addObject:@YES];
|
[p->horzAttachRight addObject:[NSNumber numberWithBool:p->horzLast]];
|
||||||
[p->vert addObject:[NSString stringWithFormat:@"[%@%@]", key, vertpred]];
|
[p->vert addObject:[NSString stringWithFormat:@"[%@%@]", key, vertpred]];
|
||||||
[p->vertAttachTop addObject:@YES];
|
[p->vertAttachTop addObject:[NSNumber numberWithBool:p->vertFirst]];
|
||||||
[p->vertAttachBottom addObject:@YES];
|
[p->vertAttachBottom addObject:[NSNumber numberWithBool:p->vertLast]];
|
||||||
[p->views setObject:self->c forKey:key];
|
[p->views setObject:self->c forKey:key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,9 +55,13 @@
|
||||||
p.horz = [NSMutableArray new];
|
p.horz = [NSMutableArray new];
|
||||||
p.horzAttachLeft = [NSMutableArray new];
|
p.horzAttachLeft = [NSMutableArray new];
|
||||||
p.horzAttachRight = [NSMutableArray new];
|
p.horzAttachRight = [NSMutableArray new];
|
||||||
|
p.horzFirst = YES; // only control here
|
||||||
|
p.horzLast = YES;
|
||||||
p.vert = [NSMutableArray new];
|
p.vert = [NSMutableArray new];
|
||||||
p.vertAttachTop = [NSMutableArray new];
|
p.vertAttachTop = [NSMutableArray new];
|
||||||
p.vertAttachBottom = [NSMutableArray new];
|
p.vertAttachBottom = [NSMutableArray new];
|
||||||
|
p.vertFirst = YES;
|
||||||
|
p.vertLast = YES;
|
||||||
p.views = [NSMutableDictionary new];
|
p.views = [NSMutableDictionary new];
|
||||||
p.n = 0;
|
p.n = 0;
|
||||||
[self->c tFillAutoLayout:&p];
|
[self->c tFillAutoLayout:&p];
|
||||||
|
|
Loading…
Reference in New Issue