From 6d64922055da4bc2a8a9362f85ea176f18c4bd85 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 1 Jun 2015 19:27:28 -0400 Subject: [PATCH] Handled events in tab pages. --- redo/windows/tabpage.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/redo/windows/tabpage.c b/redo/windows/tabpage.c index 6bcc7e68..3c96af8d 100644 --- a/redo/windows/tabpage.c +++ b/redo/windows/tabpage.c @@ -75,9 +75,16 @@ static void tabPageContainerUpdateState(uiControl *c) 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) { + LRESULT lResult; + + if (handleParentMessages(hwnd, uMsg, wParam, lParam, &lResult) != FALSE) { + SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, (LONG_PTR) lResult); + return TRUE; + } if (uMsg == WM_INITDIALOG) return TRUE; return FALSE; @@ -100,8 +107,6 @@ uiControl *newTabPage(uiControl *child) if (hr != S_OK) 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 // TODO split into separate functions uiControl(t)->Handle = tabPageHandle;