More migrations.

This commit is contained in:
Pietro Gagliardi 2016-04-22 22:20:02 -04:00
parent f829a06a7c
commit ff096410a8
2 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,5 @@
// 16 may 2015 // 16 may 2015
#include "uipriv_windows.h" #include "uipriv_windows.hpp"
struct uiGroup { struct uiGroup {
uiWindowsControl c; uiWindowsControl c;
@ -138,7 +138,7 @@ static LRESULT CALLBACK groupSubProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
switch (uMsg) { switch (uMsg) {
case WM_NCDESTROY: case WM_NCDESTROY:
if (RemoveWindowSubclass(hwnd, groupSubProc, uIdSubclass) == FALSE) if (RemoveWindowSubclass(hwnd, groupSubProc, uIdSubclass) == FALSE)
logLastError("error removing groupbox subclass in groupSubProc()"); logLastError(L"error removing groupbox subclass");
break; break;
} }
return DefSubclassProc(hwnd, uMsg, wParam, lParam); return DefSubclassProc(hwnd, uMsg, wParam, lParam);
@ -160,7 +160,7 @@ uiGroup *uiNewGroup(const char *text)
uiFree(wtext); uiFree(wtext);
if (SetWindowSubclass(g->hwnd, groupSubProc, 0, (DWORD_PTR) g) == FALSE) if (SetWindowSubclass(g->hwnd, groupSubProc, 0, (DWORD_PTR) g) == FALSE)
logLastError("error subclassing groupbox to handle parent messages in uiNewGroup()"); logLastError(L"error subclassing groupbox to handle parent messages");
uiWindowsFinishNewControl(g, uiGroup); uiWindowsFinishNewControl(g, uiGroup);
uiControl(g)->ContainerUpdateState = groupContainerUpdateState; uiControl(g)->ContainerUpdateState = groupContainerUpdateState;

View File

@ -1,5 +1,7 @@
// 30 may 2015 // 30 may 2015
#include "uipriv_windows.h" #include "uipriv_windows.hpp"
// TODO refine error handling
// This just defines the implementation of the tab page HWND itself. // This just defines the implementation of the tab page HWND itself.
// The actual work of hosting a tab page's control is in child.c. // The actual work of hosting a tab page's control is in child.c.
@ -38,6 +40,7 @@ static INT_PTR CALLBACK dlgproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
// we COULD paint the dialog background brush ourselves but meh, it works // we COULD paint the dialog background brush ourselves but meh, it works
SendMessageW(hwnd, WM_ERASEBKGND, wParam, lParam); SendMessageW(hwnd, WM_ERASEBKGND, wParam, lParam);
// and pretend we did nothing just so the themed dialog can still paint its content // and pretend we did nothing just so the themed dialog can still paint its content
// TODO see if w ecan avoid erasing the background in this case in the first place, or if we even need to
return FALSE; return FALSE;
} }
if (uMsg == WM_INITDIALOG) if (uMsg == WM_INITDIALOG)
@ -54,11 +57,11 @@ HWND newTabPage(void)
hwnd = CreateDialogW(hInstance, MAKEINTRESOURCE(rcTabPageDialog), hwnd = CreateDialogW(hInstance, MAKEINTRESOURCE(rcTabPageDialog),
utilWindow, dlgproc); utilWindow, dlgproc);
if (hwnd == NULL) if (hwnd == NULL)
logLastError("error creating tab page in newTabPage()"); logLastError(L"error creating tab page");
hr = EnableThemeDialogTexture(hwnd, ETDT_ENABLE | ETDT_USETABTEXTURE | ETDT_ENABLETAB); hr = EnableThemeDialogTexture(hwnd, ETDT_ENABLE | ETDT_USETABTEXTURE | ETDT_ENABLETAB);
if (hr != S_OK) if (hr != S_OK)
logHRESULT("error setting tab page background in newTabPage()", hr); logHRESULT(L"error setting tab page background", hr);
// and start the tab page hidden // and start the tab page hidden
ShowWindow(hwnd, SW_HIDE); ShowWindow(hwnd, SW_HIDE);