aboutsummaryrefslogtreecommitdiff
path: root/c/listview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/listview.cpp')
-rw-r--r--c/listview.cpp14
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;
}