diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-14 04:05:34 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-14 04:05:34 +0200 |
commit | 96f0accc818ad98abcb0d37e53d0a31e08ce4987 (patch) | |
tree | 0ff850793420b66cf78ac539d4dbe9f7c393ac11 /c/listview.cpp | |
parent | 26f70ab37bee8ffd70b662ff999613c643215605 (diff) | |
download | EpisodeBrowser-96f0accc818ad98abcb0d37e53d0a31e08ce4987.tar.gz |
Minor formal changes.
Height(DLVSIKEY) was incorrect. The argument to Height is supposed to
be a boolean value, in this case false. It happened to work because
DLVSIKEY is 0 (because Key is the 0th column in the data list view).
Diffstat (limited to 'c/listview.cpp')
-rw-r--r-- | c/listview.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/c/listview.cpp b/c/listview.cpp index 8e92ea1..b375454 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -11,12 +11,14 @@ static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); ListView::ListView(HMENU hMenu, DWORD dwStyle) { + if (dwStyle & LVS_NOCOLUMNHEADER) + m_bHeader = 0; + m_hWnd = CreateWindowEx( WS_EX_CLIENTEDGE, WC_LISTVIEW, TEXT(""), - dwStyle - |WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|LVS_REPORT|LVS_SHOWSELALWAYS, + dwStyle|WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|LVS_REPORT|LVS_SHOWSELALWAYS, 0, 0, 0, 0, g_hWnd, hMenu, GetModuleHandle(NULL), this ); @@ -34,6 +36,8 @@ ListView::ListView(HMENU hMenu, DWORD dwStyle) int ListView::Height(int bHeader) { + if (bHeader == -1) + bHeader = m_bHeader; int iCount = ListView_GetItemCount(m_hWnd); return iCount? Dpi(bHeader? 27: 4)+iCount*Dpi(19): 0; } @@ -89,7 +93,7 @@ ListView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return CallWindowProc(m_prevProc, hWnd, uMsg, wParam, lParam); } -static LRESULT CALLBACK +LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { @@ -98,6 +102,6 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; } - ListView *lpThis = (ListView *)GetProp(hWnd, TEXT("this")); - return lpThis? lpThis->WndProc(hWnd, uMsg, wParam, lParam): FALSE; + ListView *lpLv = (ListView *)GetProp(hWnd, TEXT("this")); + return lpLv? lpLv->WndProc(hWnd, uMsg, wParam, lParam): FALSE; } |