libui/redo/windows/group.c

52 lines
924 B
C
Raw Normal View History

// 16 may 2015
2015-05-16 19:31:56 -05:00
#include "uipriv_windows.h"
struct group {
uiGroup g;
HWND hwnd;
};
uiDefineControlType(uiGroup, uiTypeGroup, struct group)
2015-05-16 19:31:56 -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)
{
// TODO
*width = 0;
*height = 0;
2015-05-16 19:31:56 -05:00
}
static void groupSetChild(uiGroup *gg, uiControl *c)
{
// TODO
2015-05-16 19:31:56 -05:00
}
uiGroup *uiNewGroup(const char *text)
{
struct group *g;
WCHAR *wtext;
g = (struct group *) uiWindowsNewSingleHWNDControl(uiTypeGroup());
2015-05-16 19:31:56 -05:00
wtext = toUTF16(text);
g->hwnd = uiWindowsNewSingleHWNDControl(WS_EX_CONTROLPARENT,
L"button", wtext,
BS_GROUPBOX,
hInstance, NULL,
TRUE);
2015-05-16 19:31:56 -05:00
uiFree(wtext);
uiControl(g)->Handle = groupHandle;
2015-05-16 19:31:56 -05:00
uiControl(g)->PreferredSize = groupPreferredSize;
uiGroup(g)->SetChild = groupSetChild;
return uiGroup(g);
}