#include "uipriv_windows.hpp"
struct uiSeparator {
uiWindowsControl c;
HWND hwnd;
BOOL vertical;
};
uiWindowsControlAllDefaults(uiSeparator)
#define separatorHeight 1
#define separatorWidth 1
static void uiSeparatorMinimumSize(uiWindowsControl *c, int *width, int *height)
{
uiSeparator *s = uiSeparator(c);
uiWindowsSizing sizing;
int x, y;
*width = 1; *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;
}