aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/libui/darwin/separator.m
blob: a37a376e7555cac8e8f48d0602701167f9a3f7da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// 14 august 2015
#import "uipriv_darwin.h"

// TODO make this intrinsic
#define separatorWidth 96
#define separatorHeight 96

struct uiSeparator {
	uiDarwinControl c;
	NSBox *box;
};

uiDarwinControlAllDefaults(uiSeparator, box)

uiSeparator *uiNewHorizontalSeparator(void)
{
	uiSeparator *s;

	uiDarwinNewControl(uiSeparator, s);

	// make the initial width >= initial height to force horizontal
	s->box = [[NSBox alloc] initWithFrame:NSMakeRect(0, 0, 100, 1)];
	[s->box setBoxType:NSBoxSeparator];
	[s->box setBorderType:NSGrooveBorder];
	[s->box setTransparent:NO];
	[s->box setTitlePosition:NSNoTitle];

	return s;
}

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;
}