2015-08-14 21:50:20 -05:00
|
|
|
// 14 august 2015
|
|
|
|
#import "uipriv_darwin.h"
|
|
|
|
|
|
|
|
struct uiGroup {
|
|
|
|
uiDarwinControl c;
|
|
|
|
NSBox *box;
|
|
|
|
uiControl *child;
|
|
|
|
int margined;
|
|
|
|
};
|
|
|
|
|
|
|
|
uiDarwinDefineControlWithOnDestroy(
|
|
|
|
uiGroup, // type name
|
|
|
|
uiGroupType, // type function
|
|
|
|
box, // handle
|
|
|
|
/* TODO */; // on destroy
|
|
|
|
)
|
|
|
|
|
|
|
|
// TODO group container update
|
|
|
|
|
|
|
|
char *uiGroupTitle(uiGroup *g)
|
|
|
|
{
|
|
|
|
return PUT_CODE_HERE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void uiGroupSetTitle(uiGroup *g, const char *text)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
// changing the text might necessitate a change in the groupbox's size
|
2015-08-16 21:19:15 -05:00
|
|
|
//TODO uiControlQueueResize(uiControl(g));
|
2015-08-14 21:50:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void uiGroupSetChild(uiGroup *g, uiControl *child)
|
|
|
|
{
|
|
|
|
/* TODO
|
|
|
|
if (g->child != NULL)
|
|
|
|
uiControlSetParent(g->child, NULL);
|
|
|
|
g->child = child;
|
|
|
|
if (g->child != NULL) {
|
|
|
|
uiControlSetParent(g->child, uiControl(g));
|
2015-08-16 21:19:15 -05:00
|
|
|
//TODO uiControlQueueResize(g->child);
|
2015-08-14 21:50:20 -05:00
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
int uiGroupMargined(uiGroup *g)
|
|
|
|
{
|
|
|
|
return g->margined;
|
|
|
|
}
|
|
|
|
|
|
|
|
void uiGroupSetMargined(uiGroup *g, int margined)
|
|
|
|
{
|
|
|
|
g->margined = margined;
|
|
|
|
// TODO
|
2015-08-16 21:19:15 -05:00
|
|
|
//TODO uiControlQueueResize(uiControl(g));
|
2015-08-14 21:50:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
uiGroup *uiNewGroup(const char *title)
|
|
|
|
{
|
|
|
|
uiGroup *g;
|
|
|
|
|
|
|
|
g = (uiGroup *) uiNewControl(uiGroupType());
|
|
|
|
|
|
|
|
g->box = [[NSBox alloc] initWithFrame:NSZeroRect];
|
|
|
|
// TODO title
|
|
|
|
[g->box setBoxType:NSBoxPrimary];
|
|
|
|
//TODO [g->box setBorderType:TODO];
|
|
|
|
[g->box setTransparent:NO];
|
|
|
|
[g->box setTitlePosition:NSAtTop];
|
|
|
|
uiDarwinSetControlFont(g->box, NSSmallControlSize);
|
|
|
|
|
|
|
|
uiDarwinFinishNewControl(g, uiGroup);
|
|
|
|
|
|
|
|
return g;
|
|
|
|
}
|