Started a new, bare-bones windows/tab.c for testing.
This commit is contained in:
parent
92f1933e82
commit
70b4c72c96
|
@ -0,0 +1,87 @@
|
|||
// 16 may 2015
|
||||
#include "uipriv_windows.h"
|
||||
|
||||
struct tab {
|
||||
uiTab t;
|
||||
HWND hwnd;
|
||||
};
|
||||
|
||||
static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void onDestroy(void *data)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
static void tabPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *height)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
static void tabAppendPage(uiTab *tt, const char *name, uiControl *child)
|
||||
{
|
||||
}
|
||||
|
||||
static void tabInsertPageBefore(uiTab *tt, const char *name, uintmax_t n, uiControl *child)
|
||||
{
|
||||
}
|
||||
|
||||
static void tabDeletePage(uiTab *tt, uintmax_t n)
|
||||
{
|
||||
}
|
||||
|
||||
static uintmax_t tabNumPages(uiTab *tt)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tabMargined(uiTab *tt, uintmax_t n)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void tabSetMargined(uiTab *tt, uintmax_t n, int margined)
|
||||
{
|
||||
}
|
||||
|
||||
uiTab *uiNewTab(void)
|
||||
{
|
||||
struct tab *t;
|
||||
uiWindowsMakeControlParams p;
|
||||
|
||||
t = uiNew(struct tab);
|
||||
|
||||
p.dwExStyle = 0; // don't set WS_EX_CONTROLPARENT yet; we do that dynamically in the message loop (see main_windows.c)
|
||||
p.lpClassName = WC_TABCONTROLW;
|
||||
p.lpWindowName = L"";
|
||||
p.dwStyle = TCS_TOOLTIPS | WS_TABSTOP; // start with this; we will alternate between this and WS_EX_CONTROLPARENT as needed (see main.c and msgHasTabStops above and the toggling functions below)
|
||||
p.hInstance = hInstance;
|
||||
p.lpParam = NULL;
|
||||
p.useStandardControlFont = TRUE;
|
||||
p.onWM_COMMAND = onWM_COMMAND;
|
||||
p.onWM_NOTIFY = onWM_NOTIFY;
|
||||
p.onDestroy = onDestroy;
|
||||
p.onDestroyData = t;
|
||||
uiWindowsMakeControl(uiControl(t), &p);
|
||||
|
||||
t->hwnd = (HWND) uiControlHandle(uiControl(t));
|
||||
|
||||
uiControl(t)->PreferredSize = tabPreferredSize;
|
||||
|
||||
uiTab(t)->AppendPage = tabAppendPage;
|
||||
uiTab(t)->InsertPageBefore = tabInsertPageBefore;
|
||||
uiTab(t)->DeletePage = tabDeletePage;
|
||||
uiTab(t)->NumPages = tabNumPages;
|
||||
uiTab(t)->Margined = tabMargined;
|
||||
uiTab(t)->SetMargined = tabSetMargined;
|
||||
|
||||
return uiTab(t);
|
||||
}
|
Loading…
Reference in New Issue