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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  | 
// 20 may 2015
#include "uipriv_windows.hpp"
// references:
// - http://stackoverflow.com/questions/2892703/how-do-i-draw-separators
// - https://msdn.microsoft.com/en-us/library/windows/desktop/dn742405%28v=vs.85%29.aspx
struct uiSeparator {
	uiWindowsControl c;
	HWND hwnd;
	BOOL vertical;
};
uiWindowsControlAllDefaults(uiSeparator)
// via https://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx
#define separatorHeight 1
// TODO
#define separatorWidth 1
static void uiSeparatorMinimumSize(uiWindowsControl *c, int *width, int *height)
{
	uiSeparator *s = uiSeparator(c);
	uiWindowsSizing sizing;
	int x, y;
	*width = 1;		// TODO
	*height = 1;
	x = separatorWidth;
	y = separatorHeight;
	uiWindowsGetSizing(s->hwnd, &sizing);
	uiWindowsSizingDlgUnitsToPixels(&sizing, &x, &y);
	if (s->vertical)
		*width = x;
	else
		*height = y;
}
uiSeparator *uiNewHorizontalSeparator(void)
{
	uiSeparator *s;
	uiWindowsNewControl(uiSeparator, s);
	s->hwnd = uiWindowsEnsureCreateControlHWND(0,
		L"static", L"",
		SS_ETCHEDHORZ,
		hInstance, NULL,
		TRUE);
	return s;
}
uiSeparator *uiNewVerticalSeparator(void)
{
	uiSeparator *s;
	uiWindowsNewControl(uiSeparator, s);
	s->hwnd = uiWindowsEnsureCreateControlHWND(0,
		L"static", L"",
		SS_ETCHEDHORZ,
		hInstance, NULL,
		TRUE);
	s->vertical = TRUE;
	return s;
}
 
  |