libui/redo/darwin/separator.m

38 lines
763 B
Mathematica
Raw Normal View History

// 11 june 2015
2015-07-11 16:02:01 -05:00
#include "uipriv_darwin.h"
2015-07-27 22:38:44 -05:00
// TODO sizing
struct separator {
uiSeparator s;
2015-07-27 22:38:44 -05:00
NSBox *box;
};
uiDefineControlType(uiSeparator, uiTypeSeparator, struct separator)
static uintptr_t separatorHandle(uiControl *c)
{
struct separator *s = (struct separator *) c;
2015-07-27 22:38:44 -05:00
return (uintptr_t) (s->box);
}
uiSeparator *uiNewHorizontalSeparator(void)
{
struct separator *s;
s = (struct separator *) MAKE_CONTROL_INSTANCE(uiTypeSeparator());
2015-07-27 22:38:44 -05:00
s->box = [[NSBox alloc] initWithFrame:NSZeroRect];
[s->box setBoxType:NSBoxSeparator];
[s->box setBorderType:TODO];
[s->box setTransparent:NO];
[s->box setTitlePosition:NSNoTitle];
uiDarwinMakeSingleViewControl(uiControl(s), s->box, NO);
uiControl(s)->Handle = separatorHandle;
return uiSeparator(s);
}