Handled events in tab pages.

This commit is contained in:
Pietro Gagliardi 2015-06-01 19:27:28 -04:00
parent 54e71b3357
commit 6d64922055
1 changed files with 8 additions and 3 deletions

View File

@ -75,9 +75,16 @@ static void tabPageContainerUpdateState(uiControl *c)
uiControlUpdateState(t->child); uiControlUpdateState(t->child);
} }
// dummy dialog function; see below for details // dummy dialog procedure; see below for details
// let's handle parent messages here to avoid needing to subclass
static INT_PTR CALLBACK dlgproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) static INT_PTR CALLBACK dlgproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
LRESULT lResult;
if (handleParentMessages(hwnd, uMsg, wParam, lParam, &lResult) != FALSE) {
SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, (LONG_PTR) lResult);
return TRUE;
}
if (uMsg == WM_INITDIALOG) if (uMsg == WM_INITDIALOG)
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -100,8 +107,6 @@ uiControl *newTabPage(uiControl *child)
if (hr != S_OK) if (hr != S_OK)
logHRESULT("error setting tab page background in newTabPage()", hr); logHRESULT("error setting tab page background in newTabPage()", hr);
// TODO subclass hwnd to handle events
// needs to be done here, otherwise the uiControlSetParent() below will crash // needs to be done here, otherwise the uiControlSetParent() below will crash
// TODO split into separate functions // TODO split into separate functions
uiControl(t)->Handle = tabPageHandle; uiControl(t)->Handle = tabPageHandle;