diff options
author | John Ankarström <john@ankarstrom.se> | 2022-04-04 01:20:30 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-04-04 01:20:30 +0200 |
commit | 12176831abde1f4545fae95ee9edd5688f8cc584 (patch) | |
tree | 4591be39e96b4deb4f45072808be48724e84108e /c | |
parent | d77a1f32a0ea391628a6c43dcfe02f648f1ae488 (diff) | |
download | EpisodeBrowser-12176831abde1f4545fae95ee9edd5688f8cc584.tar.gz |
Remove column headers from data list view.
Diffstat (limited to 'c')
-rw-r--r-- | c/datalistview.c | 2 | ||||
-rw-r--r-- | c/defs.h | 4 | ||||
-rw-r--r-- | c/episodelistview.c | 2 | ||||
-rw-r--r-- | c/listview.c | 9 | ||||
-rw-r--r-- | c/main.c | 4 |
5 files changed, 10 insertions, 11 deletions
diff --git a/c/datalistview.c b/c/datalistview.c index efeb7d4..fe16913 100644 --- a/c/datalistview.c +++ b/c/datalistview.c @@ -13,7 +13,7 @@ DlvCreate() { LVCOLUMN lvc; - HDlv = LvCreate((HMENU)IDC_DATALISTVIEW); + HDlv = LvCreate((HMENU)IDC_DATALISTVIEW, LVS_NOCOLUMNHEADER); lvc.mask = LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM; lvc.iSubItem = 0; @@ -11,8 +11,8 @@ TCHAR *TszFromSz(const char *, int); void UpdateLayout(); /* listview.c */ -HWND LvCreate(HMENU); -int LvHeight(HWND); +HWND LvCreate(HMENU, DWORD); +int LvHeight(HWND, int); /* episodelistview.c */ HWND ElvCreate(); diff --git a/c/episodelistview.c b/c/episodelistview.c index 54c8b8c..0a85635 100644 --- a/c/episodelistview.c +++ b/c/episodelistview.c @@ -17,7 +17,7 @@ ElvCreate() LpLviElvSelection = malloc(sizeof(LVITEM)); if (!LpLviElvSelection) return NULL; - HElv = LvCreate((HMENU)IDC_EPISODELISTVIEW); + HElv = LvCreate((HMENU)IDC_EPISODELISTVIEW, 0); lvc.mask = LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM; lvc.iSubItem = 0; diff --git a/c/listview.c b/c/listview.c index e357905..868ab9e 100644 --- a/c/listview.c +++ b/c/listview.c @@ -11,7 +11,7 @@ WNDPROC LvPrevProc; static LRESULT CALLBACK LvProc(HWND, UINT, WPARAM, LPARAM); HWND -LvCreate(HMENU hMenu) +LvCreate(HMENU hMenu, DWORD dwStyle) { HWND hLv; @@ -19,7 +19,7 @@ LvCreate(HMENU hMenu) WS_EX_CLIENTEDGE, WC_LISTVIEW, TEXT(""), - WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP + dwStyle|WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP |LVS_REPORT|LVS_NOSORTHEADER|LVS_SHOWSELALWAYS, 0, 0, 0, 0, HWnd, hMenu, GetModuleHandle(NULL), NULL @@ -70,10 +70,9 @@ LvProc(HWND hLv, UINT uMsg, WPARAM wParam, LPARAM lParam) /* Naively calculate height of list view. */ int -LvHeight(HWND hLv) +LvHeight(HWND hLv, int bHeader) { int iCount; iCount = ListView_GetItemCount(hLv); - return iCount? Dpi(27)+iCount*Dpi(19): 0; + return iCount? Dpi(bHeader? 27: 3)+iCount*Dpi(19): 0; } - @@ -125,7 +125,7 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { LPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam; extern HWND HDlv; - lpMMI->ptMinTrackSize.y = LvHeight(HDlv)+80; + lpMMI->ptMinTrackSize.y = LvHeight(HDlv, 0)+80; break; } case WM_THEMECHANGED: @@ -314,7 +314,7 @@ UpdateLayout() /* Resize data list view. */ hDlv = GetDlgItem(HWnd, IDC_DATALISTVIEW); - cyDlv = rc.bottom - LvHeight(hDlv); + cyDlv = rc.bottom - LvHeight(hDlv, 0); MoveWindow(hDlv, 0, cyDlv, rc.right, rc.bottom, TRUE); cxColumn = ListView_GetColumnWidth(hDlv, 0); |