From f39c8f241dd77165709b42d1f63017b81cb63252 Mon Sep 17 00:00:00 2001 From: anders_k Date: Wed, 23 Oct 2019 02:50:39 +0000 Subject: [PATCH] * Re-use find window * Focus toolbar with F6 * Unicode symbols in usage text git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7129 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/makensisw.cpp | 9 +++++++-- Contrib/Makensisw/makensisw.h | 4 ++++ Contrib/Makensisw/resource.h | 5 ++++- Contrib/Makensisw/resource.rc | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Contrib/Makensisw/makensisw.cpp b/Contrib/Makensisw/makensisw.cpp index 4b2413cd..2a34ab63 100644 --- a/Contrib/Makensisw/makensisw.cpp +++ b/Contrib/Makensisw/makensisw.cpp @@ -581,6 +581,9 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam case WM_COMMAND: { switch (LOWORD(wParam)) { + case IDM_UI_SWITCHSECTION: //devblogs.microsoft.com/oldnewthing/20191022-00/?p=103016 + SetDialogFocus(hwndDlg, g_toolbar.hwnd); // Toolbar does not have WS_TABSTOP and we have no other "UI areas" to switch to so just go there + break; case IDM_BROWSESCR: { if (g_sdata.input_script) { TCHAR str[MAX_PATH],*str2; @@ -740,6 +743,7 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam } case IDM_FIND: { + bool reuseWindow = true; if (!g_find.uFindReplaceMsg) g_find.uFindReplaceMsg = RegisterWindowMessage(FINDMSGSTRING); memset(&g_find.fr, 0, sizeof(FINDREPLACE)); g_find.fr.lStructSize = sizeof(FINDREPLACE); @@ -747,7 +751,8 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam g_find.fr.Flags = FR_NOUPDOWN; g_find.fr.lpstrFindWhat = g_findbuf; g_find.fr.wFindWhatLen = COUNTOF(g_findbuf); - g_find.hwndFind = FindText(&g_find.fr); + if (!reuseWindow || !SetForegroundWindow(g_find.hwndFind)) + g_find.hwndFind = FindText(&g_find.fr); return TRUE; } default: @@ -764,7 +769,7 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam } } } - if (g_find.uFindReplaceMsg && msg == g_find.uFindReplaceMsg) { + if (msg == g_find.uFindReplaceMsg && msg) { LPFINDREPLACE lpfr = (LPFINDREPLACE)lParam; if (lpfr->Flags & FR_FINDNEXT) { WPARAM flags = FR_DOWN; diff --git a/Contrib/Makensisw/makensisw.h b/Contrib/Makensisw/makensisw.h index 53acdc41..73e08ca7 100644 --- a/Contrib/Makensisw/makensisw.h +++ b/Contrib/Makensisw/makensisw.h @@ -43,7 +43,11 @@ #define NSIS_FORUM_URL "http://forums.winamp.com/forumdisplay.php?forumid=65" #define NSIS_UC_URL "http://nsis.sourceforge.net/update.php?version=" #define NSIS_DL_URL "http://nsis.sourceforge.net/download/" +#ifdef UNICODE +#define USAGE _T("Usage:\r\n\r\n \x2022 File \x203a Load Script...\r\n \x2022 Drag the .nsi file into this window\r\n \x2022 Right click the .nsi file and choose \"Compile NSIS Script\"") +#else #define USAGE _T("Usage:\r\n\r\n - File | Load Script...\r\n - Drag the .nsi file into this window\r\n - Right click the .nsi file and choose \"Compile NSIS Script\"") +#endif #define COPYRIGHT _T("Copyright (C) 2002 Robert Rainwater") #define CONTRIB _T("Fritz Elfert, Justin Frankel, Amir Szekely, Sunil Kamath, Joost Verburg, Anders Kjersem") #define DONATE _T("Donate to support NSIS development.") diff --git a/Contrib/Makensisw/resource.h b/Contrib/Makensisw/resource.h index 8cc29a7b..89623da2 100644 --- a/Contrib/Makensisw/resource.h +++ b/Contrib/Makensisw/resource.h @@ -124,13 +124,16 @@ #define IDM_SETTINGS 535 #define IDM_WNDSPY 536 #define IDM_COPY 537 +#define IDM_UI_SWITCHOWNEDWINDOW 538 // Alt+F6 +#define IDM_UI_SWITCHSECTION 539 // F6 + // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 138 -#define _APS_NEXT_COMMAND_VALUE 538 +#define _APS_NEXT_COMMAND_VALUE 540 #define _APS_NEXT_CONTROL_VALUE 241 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/Contrib/Makensisw/resource.rc b/Contrib/Makensisw/resource.rc index 4f30966f..639d0468 100644 --- a/Contrib/Makensisw/resource.rc +++ b/Contrib/Makensisw/resource.rc @@ -135,6 +135,7 @@ END IDK_ACCEL ACCELERATORS BEGIN + VK_F6, IDM_UI_SWITCHSECTION, VIRTKEY, NOINVERT "A", IDM_SELECTALL, VIRTKEY, CONTROL, NOINVERT "B", IDM_BROWSESCR, VIRTKEY, CONTROL, NOINVERT "C", IDM_COPYSELECTED, VIRTKEY, CONTROL, NOINVERT