More uiGroup work.
This commit is contained in:
parent
f2e30548fc
commit
df832fbff8
|
@ -32,9 +32,9 @@ char *uiGroupTitle(uiGroup *g)
|
||||||
return PUT_CODE_HERE;
|
return PUT_CODE_HERE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiGroupSetTitle(uiGroup *g, const char *text)
|
void uiGroupSetTitle(uiGroup *g, const char *title)
|
||||||
{
|
{
|
||||||
// TODO
|
[g->box setTitle:toNSString(title)];
|
||||||
// changing the text might necessitate a change in the groupbox's size
|
// changing the text might necessitate a change in the groupbox's size
|
||||||
//TODO uiControlQueueResize(uiControl(g));
|
//TODO uiControlQueueResize(uiControl(g));
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,9 @@ void uiGroupSetMargined(uiGroup *g, int margined)
|
||||||
g->margined = margined;
|
g->margined = margined;
|
||||||
if (g->child != NULL) {
|
if (g->child != NULL) {
|
||||||
childView = (NSView *) uiControlHandle(g->child);
|
childView = (NSView *) uiControlHandle(g->child);
|
||||||
|
NSLog(@"fitting size before %@", NSStringFromSize([g->box fittingSize]));
|
||||||
layoutSingleView(g->box, childView, g->margined);
|
layoutSingleView(g->box, childView, g->margined);
|
||||||
|
NSLog(@"fitting size after %@", NSStringFromSize([g->box fittingSize]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,12 +82,13 @@ uiGroup *uiNewGroup(const char *title)
|
||||||
g = (uiGroup *) uiNewControl(uiGroupType());
|
g = (uiGroup *) uiNewControl(uiGroupType());
|
||||||
|
|
||||||
g->box = [[NSBox alloc] initWithFrame:NSZeroRect];
|
g->box = [[NSBox alloc] initWithFrame:NSZeroRect];
|
||||||
// TODO title
|
[g->box setTitle:toNSString(title)];
|
||||||
[g->box setBoxType:NSBoxPrimary];
|
[g->box setBoxType:NSBoxPrimary];
|
||||||
//TODO [g->box setBorderType:TODO];
|
[g->box setBorderType:NSLineBorder];
|
||||||
[g->box setTransparent:NO];
|
[g->box setTransparent:NO];
|
||||||
[g->box setTitlePosition:NSAtTop];
|
[g->box setTitlePosition:NSAtTop];
|
||||||
//TODO uiDarwinSetControlFont(g->box, NSSmallControlSize);
|
// we can't use uiDarwinSetControlFont() because the selector is different
|
||||||
|
[g->box setTitleFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
|
||||||
|
|
||||||
uiDarwinFinishNewControl(g, uiGroup);
|
uiDarwinFinishNewControl(g, uiGroup);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue