libui/zOLD_darwin/separator.m

46 lines
1010 B
Mathematica
Raw Normal View History

2015-08-14 22:50:38 -05:00
// 14 august 2015
#import "uipriv_darwin.h"
2016-05-28 21:49:27 -05:00
// TODO make this intrinsic
#define separatorWidth 96
2016-06-17 10:02:17 -05:00
#define separatorHeight 96
2015-08-14 22:50:38 -05:00
struct uiSeparator {
uiDarwinControl c;
NSBox *box;
};
uiDarwinControlAllDefaults(uiSeparator, box)
2015-08-14 22:50:38 -05:00
uiSeparator *uiNewHorizontalSeparator(void)
{
uiSeparator *s;
2016-04-25 12:38:17 -05:00
uiDarwinNewControl(uiSeparator, s);
2015-08-14 22:50:38 -05:00
2016-05-28 21:49:27 -05:00
// make the initial width >= initial height to force horizontal
s->box = [[NSBox alloc] initWithFrame:NSMakeRect(0, 0, 100, 1)];
2015-08-14 22:50:38 -05:00
[s->box setBoxType:NSBoxSeparator];
[s->box setBorderType:NSGrooveBorder];
2015-08-14 22:50:38 -05:00
[s->box setTransparent:NO];
[s->box setTitlePosition:NSNoTitle];
return s;
}
2016-06-17 10:02:17 -05:00
uiSeparator *uiNewVerticalSeparator(void)
{
uiSeparator *s;
uiDarwinNewControl(uiSeparator, s);
// make the initial height >= initial width to force vertical
s->box = [[NSBox alloc] initWithFrame:NSMakeRect(0, 0, 1, 100)];
[s->box setBoxType:NSBoxSeparator];
[s->box setBorderType:NSGrooveBorder];
[s->box setTransparent:NO];
[s->box setTitlePosition:NSNoTitle];
return s;
}