From 3e86ebe7ad991ee685dd14885359ceb257964d46 Mon Sep 17 00:00:00 2001 From: rainwater Date: Tue, 10 Sep 2002 19:11:03 +0000 Subject: [PATCH] Added Select All git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@977 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/Readme.txt | 2 + Contrib/Makensisw/makensisw.cpp | 78 +++++++++++++++++---------------- Contrib/Makensisw/resource.h | 3 +- Contrib/Makensisw/resource.rc | 3 ++ 4 files changed, 48 insertions(+), 38 deletions(-) diff --git a/Contrib/Makensisw/Readme.txt b/Contrib/Makensisw/Readme.txt index babac6a2..2f59a4ce 100644 --- a/Contrib/Makensisw/Readme.txt +++ b/Contrib/Makensisw/Readme.txt @@ -147,6 +147,8 @@ Version History - Drag and Drop Support into the Makensisw window - Updated icon to Trace's modern NSIS icon - Added Load Script option on File menu + - Added Search Dialog (Ctrl+F) (Kickik) + - Added Select All (Ctrl+A) Copyright Information diff --git a/Contrib/Makensisw/makensisw.cpp b/Contrib/Makensisw/makensisw.cpp index 56acf7fd..1afad878 100644 --- a/Contrib/Makensisw/makensisw.cpp +++ b/Contrib/Makensisw/makensisw.cpp @@ -59,7 +59,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmd MSG msg; int status; while ((status=GetMessage(&msg,0,0,0))!=0) { - if (status==-1) return -1; + if (status==-1) return -1; if (!IsDialogMessage(hwndFind, &msg)) { if (!TranslateAccelerator(hDialog,haccel,&msg)) { if (!IsDialogMessage(hDialog,&msg)) { @@ -181,6 +181,11 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { ShellExecute(g_hwnd,"open",NSIS_URL,NULL,NULL,SW_SHOWNORMAL); return TRUE; } + case IDM_SELECTALL: + { + SendDlgItemMessage(g_hwnd, IDC_LOGWIN, EM_SETSEL, 0, -1); + return TRUE; + } case IDM_DOCS: { char pathf[MAX_PATH],*path; @@ -288,44 +293,43 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { } return TRUE; } - case IDM_FIND: - { - if (!uFindReplaceMsg) - uFindReplaceMsg = RegisterWindowMessage(FINDMSGSTRING); - my_memset(&fr, 0, sizeof(FINDREPLACE)); - fr.lStructSize = sizeof(FINDREPLACE); - fr.hwndOwner = hwndDlg; - fr.Flags = FR_NOUPDOWN; - fr.lpstrFindWhat = (char *)GlobalAlloc(GPTR, 128); - if (!fr.lpstrFindWhat) return TRUE; - fr.wFindWhatLen = 128; - hwndFind = FindText(&fr); - return TRUE; - } + case IDM_FIND: + { + if (!uFindReplaceMsg) + uFindReplaceMsg = RegisterWindowMessage(FINDMSGSTRING); + my_memset(&fr, 0, sizeof(FINDREPLACE)); + fr.lStructSize = sizeof(FINDREPLACE); + fr.hwndOwner = hwndDlg; + fr.Flags = FR_NOUPDOWN; + fr.lpstrFindWhat = (char *)GlobalAlloc(GPTR, 128); + if (!fr.lpstrFindWhat) return TRUE; + fr.wFindWhatLen = 128; + hwndFind = FindText(&fr); + return TRUE; + } } } - } - if (msg == uFindReplaceMsg) { - LPFINDREPLACE lpfr = (LPFINDREPLACE)lParam; - if (lpfr->Flags & FR_FINDNEXT) { - WPARAM flags = FR_DOWN; - if (lpfr->Flags & FR_MATCHCASE) flags |= FR_MATCHCASE; - if (lpfr->Flags & FR_WHOLEWORD) flags |= FR_WHOLEWORD; - - FINDTEXTEX ft; - SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_EXGETSEL, 0, (LPARAM)&ft.chrg); - if (ft.chrg.cpMax == ft.chrg.cpMin) ft.chrg.cpMin = 0; - else ft.chrg.cpMin = ft.chrg.cpMax; - ft.chrg.cpMax = SendDlgItemMessage(hwndDlg, IDC_LOGWIN, WM_GETTEXTLENGTH, 0, 0); - ft.lpstrText = lpfr->lpstrFindWhat; - ft.chrg.cpMin = SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_FINDTEXTEX, flags, (LPARAM)&ft); - if (ft.chrg.cpMin != -1) - SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_SETSEL, ft.chrgText.cpMin, ft.chrgText.cpMax); - else MessageBeep(MB_ICONASTERISK); - } - if (lpfr->Flags & FR_DIALOGTERM) hwndFind = 0; - return TRUE; - } + } + if (msg == uFindReplaceMsg) { + LPFINDREPLACE lpfr = (LPFINDREPLACE)lParam; + if (lpfr->Flags & FR_FINDNEXT) { + WPARAM flags = FR_DOWN; + if (lpfr->Flags & FR_MATCHCASE) flags |= FR_MATCHCASE; + if (lpfr->Flags & FR_WHOLEWORD) flags |= FR_WHOLEWORD; + FINDTEXTEX ft; + SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_EXGETSEL, 0, (LPARAM)&ft.chrg); + if (ft.chrg.cpMax == ft.chrg.cpMin) ft.chrg.cpMin = 0; + else ft.chrg.cpMin = ft.chrg.cpMax; + ft.chrg.cpMax = SendDlgItemMessage(hwndDlg, IDC_LOGWIN, WM_GETTEXTLENGTH, 0, 0); + ft.lpstrText = lpfr->lpstrFindWhat; + ft.chrg.cpMin = SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_FINDTEXTEX, flags, (LPARAM)&ft); + if (ft.chrg.cpMin != -1) + SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_SETSEL, ft.chrgText.cpMin, ft.chrgText.cpMax); + else MessageBeep(MB_ICONASTERISK); + } + if (lpfr->Flags & FR_DIALOGTERM) hwndFind = 0; + return TRUE; + } return 0; } diff --git a/Contrib/Makensisw/resource.h b/Contrib/Makensisw/resource.h index edb087e5..b7b081c8 100644 --- a/Contrib/Makensisw/resource.h +++ b/Contrib/Makensisw/resource.h @@ -28,13 +28,14 @@ #define IDM_DOCS 40004 #define IDM_LOADSCRIPT 40005 #define IDM_FIND 40006 +#define IDM_SELECTALL 40007 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 111 -#define _APS_NEXT_COMMAND_VALUE 40007 +#define _APS_NEXT_COMMAND_VALUE 40008 #define _APS_NEXT_CONTROL_VALUE 1009 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/Contrib/Makensisw/resource.rc b/Contrib/Makensisw/resource.rc index 2dc52102..ca54d5a1 100644 --- a/Contrib/Makensisw/resource.rc +++ b/Contrib/Makensisw/resource.rc @@ -81,6 +81,8 @@ BEGIN MENUITEM "Copy &Selected", IDM_COPYSELECTED MENUITEM SEPARATOR MENUITEM "Find...\tCtrl+F", IDM_FIND + MENUITEM SEPARATOR + MENUITEM "&Select All\tCtrl+A", IDM_SELECTALL END POPUP "&Help" BEGIN @@ -99,6 +101,7 @@ END IDK_ACCEL ACCELERATORS PRELOAD MOVEABLE PURE BEGIN + "A", IDM_SELECTALL, VIRTKEY, CONTROL, NOINVERT "E", IDM_EDITSCRIPT, VIRTKEY, CONTROL, NOINVERT "F", IDM_FIND, VIRTKEY, CONTROL, NOINVERT "R", IDM_RECOMPILE, VIRTKEY, CONTROL, NOINVERT