libui/redo/darwin/separator.m

38 lines
760 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;
2015-07-28 13:14:41 -05:00
s = (struct separator *) uiNewControl(uiTypeSeparator());
2015-07-27 22:38:44 -05:00
s->box = [[NSBox alloc] initWithFrame:NSZeroRect];
[s->box setBoxType:NSBoxSeparator];
2015-07-28 13:14:41 -05:00
//TODO [s->box setBorderType:TODO];
2015-07-27 22:38:44 -05:00
[s->box setTransparent:NO];
[s->box setTitlePosition:NSNoTitle];
uiDarwinMakeSingleViewControl(uiControl(s), s->box, NO);
uiControl(s)->Handle = separatorHandle;
return uiSeparator(s);
}