2015-05-17 12:01:42 -05:00
|
|
|
// 16 may 2015
|
2015-05-16 19:31:56 -05:00
|
|
|
#include "uipriv_windows.h"
|
|
|
|
|
|
|
|
struct group {
|
|
|
|
uiGroup g;
|
|
|
|
HWND hwnd;
|
|
|
|
};
|
|
|
|
|
2015-05-29 17:03:24 -05:00
|
|
|
uiDefineControlType(uiGroup, uiTypeGroup, struct group)
|
2015-05-16 19:31:56 -05:00
|
|
|
|
2015-05-29 18:48:27 -05:00
|
|
|
static uintptr_t groupHandle(uiControl *c)
|
|
|
|
{
|
|
|
|
struct group *g = (struct group *) c;
|
|
|
|
|
|
|
|
return (uintptr_t) (g->hwnd);
|
|
|
|
}
|
|
|
|
|
2015-05-16 19:31:56 -05:00
|
|
|
static void groupPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *height)
|
|
|
|
{
|
2015-05-17 12:01:42 -05:00
|
|
|
// TODO
|
2015-05-18 14:00:12 -05:00
|
|
|
*width = 0;
|
|
|
|
*height = 0;
|
2015-05-16 19:31:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static void groupSetChild(uiGroup *gg, uiControl *c)
|
|
|
|
{
|
2015-05-17 12:01:42 -05:00
|
|
|
// TODO
|
2015-05-16 19:31:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
uiGroup *uiNewGroup(const char *text)
|
|
|
|
{
|
|
|
|
struct group *g;
|
|
|
|
WCHAR *wtext;
|
|
|
|
|
2015-05-29 17:03:24 -05:00
|
|
|
g = (struct group *) uiWindowsNewSingleHWNDControl(uiTypeGroup());
|
2015-05-16 19:31:56 -05:00
|
|
|
|
|
|
|
wtext = toUTF16(text);
|
2015-05-29 19:53:12 -05:00
|
|
|
g->hwnd = uiWindowsUtilCreateControlHWND(WS_EX_CONTROLPARENT,
|
2015-05-29 17:03:24 -05:00
|
|
|
L"button", wtext,
|
|
|
|
BS_GROUPBOX,
|
|
|
|
hInstance, NULL,
|
|
|
|
TRUE);
|
2015-05-16 19:31:56 -05:00
|
|
|
uiFree(wtext);
|
|
|
|
|
2015-05-29 18:48:27 -05:00
|
|
|
uiControl(g)->Handle = groupHandle;
|
2015-05-16 19:31:56 -05:00
|
|
|
uiControl(g)->PreferredSize = groupPreferredSize;
|
|
|
|
|
|
|
|
uiGroup(g)->SetChild = groupSetChild;
|
|
|
|
|
|
|
|
return uiGroup(g);
|
|
|
|
}
|