From ff096410a8476f15554ab49c8b41a66152e2dc78 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 22 Apr 2016 22:20:02 -0400 Subject: [PATCH] More migrations. --- windows/{group.c => group.cpp} | 6 +++--- windows/{tabpage.c => tabpage.cpp} | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) rename windows/{group.c => group.cpp} (96%) rename windows/{tabpage.c => tabpage.cpp} (90%) diff --git a/windows/group.c b/windows/group.cpp similarity index 96% rename from windows/group.c rename to windows/group.cpp index 1db16ba2..c8c70f91 100644 --- a/windows/group.c +++ b/windows/group.cpp @@ -1,5 +1,5 @@ // 16 may 2015 -#include "uipriv_windows.h" +#include "uipriv_windows.hpp" struct uiGroup { uiWindowsControl c; @@ -138,7 +138,7 @@ static LRESULT CALLBACK groupSubProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM switch (uMsg) { case WM_NCDESTROY: if (RemoveWindowSubclass(hwnd, groupSubProc, uIdSubclass) == FALSE) - logLastError("error removing groupbox subclass in groupSubProc()"); + logLastError(L"error removing groupbox subclass"); break; } return DefSubclassProc(hwnd, uMsg, wParam, lParam); @@ -160,7 +160,7 @@ uiGroup *uiNewGroup(const char *text) uiFree(wtext); 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); uiControl(g)->ContainerUpdateState = groupContainerUpdateState; diff --git a/windows/tabpage.c b/windows/tabpage.cpp similarity index 90% rename from windows/tabpage.c rename to windows/tabpage.cpp index 75b87eb0..942ffcd9 100644 --- a/windows/tabpage.c +++ b/windows/tabpage.cpp @@ -1,5 +1,7 @@ // 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. // 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 SendMessageW(hwnd, WM_ERASEBKGND, wParam, lParam); // 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; } if (uMsg == WM_INITDIALOG) @@ -54,11 +57,11 @@ HWND newTabPage(void) hwnd = CreateDialogW(hInstance, MAKEINTRESOURCE(rcTabPageDialog), utilWindow, dlgproc); 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); 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 ShowWindow(hwnd, SW_HIDE);