From 52c70f4d3213b82a19e42310f046abd1ebb21cc4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 17 Apr 2019 22:43:05 +0300 Subject: merge with trunk --- plugins/NotesAndReminders/src/reminders.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'plugins/NotesAndReminders/src') diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 547dc262af..37118cf764 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -1741,7 +1741,7 @@ static BOOL DoListContextMenu(HWND AhWnd, WPARAM wParam, LPARAM lParam) static INT_PTR CALLBACK DlgProcViewReminders(HWND hwndDlg, UINT Message, WPARAM wParam, LPARAM lParam) { HWND H = GetDlgItem(hwndDlg, IDC_LISTREMINDERS); - int idx; + int idx, cx1, cx2; switch (Message) { case WM_SIZE: @@ -1771,16 +1771,25 @@ static INT_PTR CALLBACK DlgProcViewReminders(HWND hwndDlg, UINT Message, WPARAM TranslateDialogDefault(hwndDlg); SetDlgItemTextA(hwndDlg, IDC_REMINDERDATA, ""); + { + cx1 = 150, cx2 = 205; + ptrA colWidth(g_plugin.getStringA("ColWidth")); + if (colWidth != 0) { + int tmp1 = 0, tmp2 = 0; + if (2 == sscanf(colWidth, "%d,%d", &tmp1, &tmp2)) + cx1 = tmp1, cx2 = tmp2; + } + } LV_COLUMN lvCol; - lvCol.mask = LVCF_TEXT | LVCF_WIDTH; + lvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_DEFAULTWIDTH; lvCol.pszText = TranslateT("Reminder text"); - lvCol.cx = 150; + lvCol.cx = lvCol.cxDefault = cx1; ListView_InsertColumn(H, 0, &lvCol); - lvCol.mask = LVCF_TEXT | LVCF_WIDTH; + lvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_DEFAULTWIDTH; lvCol.pszText = TranslateT("Date of activation"); - lvCol.cx = 205; + lvCol.cx = lvCol.cxDefault = cx2; ListView_InsertColumn(H, 0, &lvCol); InitListView(H); @@ -1852,6 +1861,10 @@ static INT_PTR CALLBACK DlgProcViewReminders(HWND hwndDlg, UINT Message, WPARAM break; case WM_DESTROY: + cx1 = ListView_GetColumnWidth(H, 0); + cx2 = ListView_GetColumnWidth(H, 1); + g_plugin.setString("ColWidth", CMStringA(FORMAT, "%d,%d", cx1, cx2)); + Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "ListReminders"); Window_FreeIcon_IcoLib(hwndDlg); break; -- cgit v1.2.3