libui/redo/windows/group.c

56 lines
991 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;
};
static void onDestroy(void *data)
{
// TODO
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;
uiWindowsMakeControlParams p;
WCHAR *wtext;
g = uiNew(struct group);
2015-05-17 18:07:07 -05:00
uiTyped(g)->Type = uiTypeGroup();
2015-05-16 19:31:56 -05:00
p.dwExStyle = WS_EX_CONTROLPARENT;
p.lpClassName = L"button";
wtext = toUTF16(text);
p.lpWindowName = wtext;
p.dwStyle = BS_GROUPBOX;
p.hInstance = hInstance;
p.lpParam = NULL;
p.useStandardControlFont = TRUE;
p.onDestroy = onDestroy;
p.onDestroyData = g;
uiWindowsMakeControl(uiControl(g), &p);
uiFree(wtext);
g->hwnd = (HWND) uiControlHandle(uiControl(g));
uiControl(g)->PreferredSize = groupPreferredSize;
uiGroup(g)->SetChild = groupSetChild;
return uiGroup(g);
}