From c605ea0545ac22dc328c83d78011e3d18346eb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 15 Feb 2022 16:56:31 +0100 Subject: Show data list view. --- c/main.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'c/main.c') diff --git a/c/main.c b/c/main.c index 80578dc..40c25b4 100644 --- a/c/main.c +++ b/c/main.c @@ -12,8 +12,8 @@ HFONT g_GUIFontBold; static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); static INT_PTR CALLBACK AboutDlgProc(HWND, UINT, WPARAM, LPARAM); -static void SetupFonts(); static int Attach(void); +static void SetupFonts(); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -114,6 +114,7 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case WM_CREATE: ElvCreate(hWnd); + DlvCreate(hWnd); break; case WM_SIZE: UpdateLayout(hWnd); @@ -205,7 +206,7 @@ SetupFonts() void UpdateLayout(HWND hWnd) { - HWND hListView; + HWND hElv, hDlv; int cxColumn; RECT rc; static int cxVScroll = 0; @@ -215,14 +216,30 @@ UpdateLayout(HWND hWnd) cxVScroll = GetSystemMetrics(SM_CXVSCROLL); GetClientRect(hWnd, &rc); - hListView = GetDlgItem(hWnd, IDC_EPISODELISTVIEW); - MoveWindow(hListView, 0, 0, + +#define EDGE 4 + + /* Resize data list view. */ + + hDlv = GetDlgItem(hWnd, IDC_DATALISTVIEW); + MoveWindow(hDlv, 0, rc.bottom-100, rc.right, rc.bottom, TRUE); - cxColumn = ListView_GetColumnWidth(hListView, 0); - ListView_SetColumnWidth(hListView, 1, - rc.right-cxColumn-cxVScroll); + cxColumn = ListView_GetColumnWidth(hDlv, 0); + ListView_SetColumnWidth(hDlv, 1, + rc.right-cxColumn-cxVScroll-EDGE); + + /* Resize episode list view. */ + + hElv = GetDlgItem(hWnd, IDC_EPISODELISTVIEW); + MoveWindow(hElv, 0, 0, + rc.right, rc.bottom-100+1, + TRUE); + + cxColumn = ListView_GetColumnWidth(hElv, 0); + ListView_SetColumnWidth(hElv, 1, + rc.right-cxColumn-cxVScroll-EDGE); - ListView_EnsureVisible(hListView, g_SelectedItem, TRUE); + ListView_EnsureVisible(hElv, g_SelectedItem, TRUE); } -- cgit v1.2.3