aboutsummaryrefslogtreecommitdiff
path: root/c/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/main.c')
-rw-r--r--c/main.c33
1 files changed, 25 insertions, 8 deletions
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);
}