From 70b4c72c96d0d771735ba743e0edac74f36e2e54 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 16 May 2015 20:28:35 -0400 Subject: [PATCH] Started a new, bare-bones windows/tab.c for testing. --- redo/windows/tab.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 redo/windows/tab.c diff --git a/redo/windows/tab.c b/redo/windows/tab.c new file mode 100644 index 00000000..c7cd444a --- /dev/null +++ b/redo/windows/tab.c @@ -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); +}