diff options
Diffstat (limited to 'c/listview.cpp')
-rw-r--r-- | c/listview.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/c/listview.cpp b/c/listview.cpp index c2f5593..e5d22b2 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -11,19 +11,16 @@ static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle) { m_hWndParent = hWndParent; - m_bHeader = !(dwStyle & LVS_NOCOLUMNHEADER); hWnd = require(CreateWindowEx( WS_EX_CLIENTEDGE, WC_LISTVIEW, L"", dwStyle|WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|LVS_REPORT|LVS_SHOWSELALWAYS, 0, 0, 0, 0, - m_hWndParent, hMenu, GetModuleHandle(NULL), this)); - - if (require(SetProp(hWnd, L"this", (HANDLE)this))) - m_proc0 = (WNDPROC)SetWindowLongPtr(hWnd, - GWLP_WNDPROC, (LONG_PTR)::WndProc); + hWndParent, hMenu, GetModuleHandle(NULL), this)); + m_proc0 = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)::WndProc); + require(SetProp(hWnd, L"this", (HANDLE)this)); ListView_SetExtendedListViewStyle(hWnd, LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER); SendMessage(hWnd, WM_SETFONT, (WPARAM)g_hfNormal, MAKELPARAM(FALSE, 0)); } @@ -37,12 +34,10 @@ bool ListView::FindNextItem(LVITEM* const lvi, const LPARAM lParam) } /* Naively calculate height of list view. */ -int ListView::Height(int bHeader) +int ListView::Height() { - if (bHeader == -1) - bHeader = m_bHeader; const int cItem = ListView_GetItemCount(hWnd); - return cItem? Dpi(bHeader? 27: 4)+cItem*Dpi(19): 0; + return Dpi(4)+cItem*Dpi(19); } void ListView::ResizeColumns(int) {} |