Added multiple primary horizontal and vertical Auto Layout views. This will accomodate tSpinbox. Now we can go back to tBox.

This commit is contained in:
Pietro Gagliardi 2015-08-01 17:26:56 -04:00
parent 4dc63828e4
commit b528d1ff0c
4 changed files with 23 additions and 18 deletions

View File

@ -32,14 +32,14 @@
return n;
}
- (void)tFillAutoLayoutHorz:(NSMutableString *)horz
vert:(NSMutableString *)vert
- (void)tFillAutoLayoutHorz:(NSMutableArray *)horz
vert:(NSMutableArray *)vert
extra:(NSMutableArray *)extra
extraVert:(NSMutableArray *)extraVert
views:(NSMutableDictionary *)views
{
[horz setString:@"[view0]"];
[vert setString:@"[view0]"];
[horz addObject:@"[view0]"];
[vert addObject:@"[view0]"];
[views setObject:self->b forKey:@"view0"];
}

View File

@ -6,8 +6,8 @@
@required
- (void)tAddToView:(NSView *)v;
//TODO- (uintmax_t)tAddToAutoLayoutDictionary:(NSMutableDictionary *)views keyNumber:(uintmax_t)n;
- (void)tFillAutoLayoutHorz:(NSMutableString *)horz
vert:(NSMutableString *)vert
- (void)tFillAutoLayoutHorz:(NSMutableArray *)horz
vert:(NSMutableArray *)vert
extra:(NSMutableArray *)extra
extraVert:(NSMutableArray *)extraVert
views:(NSMutableDictionary *)views;

View File

@ -43,14 +43,15 @@
return n;
}
- (void)tFillAutoLayoutHorz:(NSMutableString *)horz
vert:(NSMutableString *)vert
- (void)tFillAutoLayoutHorz:(NSMutableArray *)horz
vert:(NSMutableArray *)vert
extra:(NSMutableArray *)extra
extraVert:(NSMutableArray *)extraVert
views:(NSMutableDictionary *)views
{
[horz setString:@"[view0]-[view1]"];
[vert setString:@"[view0]"];
[horz addObject:@"[view0]-[view1]"];
[vert addObject:@"[view0]"];
[vert addObject:@"[view1]"];
[views setObject:self->t forKey:@"view0"];
[views setObject:self->s forKey:@"view1"];
}

View File

@ -42,18 +42,18 @@
- (void)tRelayout
{
NSView *contentView;
NSMutableString *horz, *vert;
NSMutableArray *horz, *vert;
NSMutableArray *extra, *extraVert;
NSMutableDictionary *views;
NSInteger i;
NSUInteger i;
NSString *margin;
if (self->c == nil)
return;
contentView = [self->w contentView];
[contentView removeConstraints:[contentView constraints]];
horz = [NSMutableString new];
vert = [NSMutableString new];
horz = [NSMutableArray new];
vert = [NSMutableArray new];
extra = [NSMutableArray new];
extraVert = [NSMutableArray new];
views = [NSMutableDictionary new];
@ -61,10 +61,14 @@
margin = @"";
if (self->margined)
margin = @"-";
[extra addObject:[NSString stringWithFormat:@"|%@%@%@|", margin, horz, margin]];
[extraVert addObject:@NO];
[extra addObject:[NSString stringWithFormat:@"|%@%@%@|", margin, vert, margin]];
[extraVert addObject:@YES];
[horz enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop) {
[extra addObject:[NSString stringWithFormat:@"|%@%@%@|", margin, obj, margin]];
[extraVert addObject:@NO];
}];
[vert enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop) {
[extra addObject:[NSString stringWithFormat:@"|%@%@%@|", margin, obj, margin]];
[extraVert addObject:@YES];
}];
for (i = 0; i < [extra count]; i++) {
NSString *constraint;
NSNumber *vertical;