From 0b7dc4b65ecb2b3367a8a68973fb4b97ce643947 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 8 Aug 2012 19:29:41 +0000 Subject: dynamic updates dialog git-svn-id: http://svn.miranda-ng.org/main/trunk@1408 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Notifications.cpp | 20 +++++++++++++++++++- plugins/PluginUpdater/src/resource.h | 7 +++++-- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'plugins/PluginUpdater/src') diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index 04b24b56e2..70a337d88b 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. #include "common.h" HWND hwndDialog = NULL; +static bool bShowDetails; void PopupAction(HWND hWnd, BYTE action) { @@ -289,6 +290,14 @@ static void ApplyUpdates(void* param) CallFunctionAsync(RestartMe, 0); } +static void ResizeVert(HWND hDlg, int yy) +{ + RECT r = { 0, 0, 244, yy }; + MapDialogRect(hDlg, &r); + r.bottom += GetSystemMetrics(SM_CYSMCAPTION); + SetWindowPos(hDlg, 0, 0, 0, r.right, r.bottom, SWP_NOMOVE | SWP_NOZORDER); +} + INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES); @@ -343,8 +352,12 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam todo[i].enabled = true; } HWND hwOk = GetDlgItem(hDlg, IDOK); - EnableWindow(hwOk, true/*one_enabled ? TRUE : FALSE*/); + EnableWindow(hwOk, true); } + + bShowDetails = false; + ResizeVert(hDlg, 60); + // do this after filling list - enables 'ITEMCHANGED' below SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam); Utils_RestoreWindowPositionNoSize(hDlg,0,MODNAME,"ConfirmWindow"); @@ -390,6 +403,11 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam mir_forkthread(ApplyUpdates, hDlg); return TRUE; + case IDC_DETAILS: + bShowDetails = !bShowDetails; + ResizeVert(hDlg, bShowDetails ? 242 : 60); + break; + case IDC_SELALL: SelectAll(hDlg, true); break; diff --git a/plugins/PluginUpdater/src/resource.h b/plugins/PluginUpdater/src/resource.h index 40bb68f2ca..c5d64e2b7f 100644 --- a/plugins/PluginUpdater/src/resource.h +++ b/plugins/PluginUpdater/src/resource.h @@ -17,6 +17,7 @@ #define IDC_INFO2 1005 #define IDC_SELNONE 1005 #define IDC_LABEL 1006 +#define IDC_DETAILS 1006 #define IDC_USEWINCOLORS 1007 #define IDC_RC 1008 #define IDC_USEPOPUPCOLORS 1009 @@ -40,6 +41,7 @@ #define IDC_PROGR_DLG_MSG 1027 #define IDC_LINK_HOTKEY 1028 #define IDC_UPDATEICONS 1029 +#define IDC_SEPARATOR 1030 #define IDC_NOTIFY 1034 #define IDC_UPDATEONSTARTUP 1035 #define IDC_ONLYONCEADAY 1036 @@ -47,6 +49,7 @@ #define IDC_PERIOD 1038 #define IDC_PERIODSPIN 1039 #define IDC_PERIODMEASURE 1040 +#define IDC_EDIT1 1042 #define IDC_MSG_BOXES 40071 #define IDC_ERRORS 40072 #define IDC_INFO_MESSAGES 40073 @@ -61,12 +64,12 @@ #define IDC_PROGR_DLG_BG 42074 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 110 #define _APS_NEXT_COMMAND_VALUE 40075 -#define _APS_NEXT_CONTROL_VALUE 1042 +#define _APS_NEXT_CONTROL_VALUE 1043 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif -- cgit v1.2.3