diff options
author | John Ankarström <john@ankarstrom.se> | 2022-02-15 16:56:31 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-02-15 16:56:31 +0100 |
commit | c605ea0545ac22dc328c83d78011e3d18346eb63 (patch) | |
tree | b809214638566a8dc0621095c4be3fd721577b0c /c/main.c | |
parent | 2e5ea298da89df79fc057ad46253e5a9d860e7e3 (diff) | |
download | EpisodeBrowser-c605ea0545ac22dc328c83d78011e3d18346eb63.tar.gz |
Show data list view.
Diffstat (limited to 'c/main.c')
-rw-r--r-- | c/main.c | 33 |
1 files changed, 25 insertions, 8 deletions
@@ -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); } |