* 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
This commit is contained in:
anders_k 2019-10-23 02:50:39 +00:00
parent 4c7f46920b
commit f39c8f241d
4 changed files with 16 additions and 3 deletions

View file

@ -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;

View file

@ -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("<A ID=\"D\">Donate</A> to support NSIS development.")

View file

@ -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

View file

@ -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