From d9e1caa37e53c7dbc42b1fc652efc23a40c47c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 31 Jul 2022 19:56:53 +0200 Subject: Limit use of Hungarian notation. I don't hate Hungarian notation. It has some very nice qualities. But it also adds a lot of typing. That said, not using it feels a bit... unsafe. I might go back on this decision. We'll see. --- c/listview.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'c/listview.cpp') diff --git a/c/listview.cpp b/c/listview.cpp index b4a61b4..6dfa888 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -22,7 +22,7 @@ ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle m_hWndParent, hMenu, GetModuleHandle(NULL), this)); if (require(SetProp(hWnd, L"this", (HANDLE)this))) - m_prevProc = (WNDPROC)SetWindowLongPtr(hWnd, + m_proc0 = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)::WndProc); ListView_SetExtendedListViewStyle(hWnd, LVS_EX_FULLROWSELECT); @@ -42,8 +42,8 @@ int ListView::Height(int bHeader) { if (bHeader == -1) bHeader = m_bHeader; - const int iCount = ListView_GetItemCount(hWnd); - return iCount? Dpi(bHeader? 27: 4)+iCount*Dpi(19): 0; + const int cItem = ListView_GetItemCount(hWnd); + return cItem? Dpi(bHeader? 27: 4)+cItem*Dpi(19): 0; } void ListView::ResizeColumns(int) {} @@ -51,29 +51,29 @@ void ListView::ResizeColumns(int) {} void ListView::UpdateTheme(const BOOL bThemeActive) { DWORD dwStyle; - const wchar_t* wszTheme; - WORD wAction; + const wchar_t* theme; + WORD action; extern int g_bThemes; if (!g_bThemes) return; if (bThemeActive) { dwStyle = LVS_EX_DOUBLEBUFFER; - wszTheme = L"Explorer"; - wAction = UIS_SET; + theme = L"Explorer"; + action = UIS_SET; } else { dwStyle = 0; - wszTheme = NULL; - wAction = UIS_CLEAR; + theme = NULL; + action = UIS_CLEAR; } /* Use modern "Explorer" theme. */ - SetWindowTheme(hWnd, wszTheme, NULL); + SetWindowTheme(hWnd, theme, NULL); /* The modern theme requires double buffering. */ ListView_SetExtendedListViewStyleEx(hWnd, LVS_EX_DOUBLEBUFFER, dwStyle); /* Hide focus rectangles. */ - SendMessage(hWnd, WM_UPDATEUISTATE, MAKEWPARAM(wAction, UISF_HIDEFOCUS), 0); + SendMessage(hWnd, WM_UPDATEUISTATE, MAKEWPARAM(action, UISF_HIDEFOCUS), 0); } LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg, @@ -89,16 +89,16 @@ LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg, break; } - return CallWindowProc(m_prevProc, hWnd, uMsg, wParam, lParam); + return CallWindowProc(m_proc0, hWnd, uMsg, wParam, lParam); } LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, const LPARAM lParam) { - ListView* const pLv = (ListView*)GetProp(hWnd, L"this"); + ListView* const lv = (ListView*)GetProp(hWnd, L"this"); if (uMsg == WM_DESTROY) RemoveProp(hWnd, L"this"); - return pLv? pLv->WndProc(hWnd, uMsg, wParam, lParam): FALSE; + return lv? lv->WndProc(hWnd, uMsg, wParam, lParam): FALSE; } -- cgit v1.2.3