From c2534ee8f28013bd470ffafb1736b864c4845815 Mon Sep 17 00:00:00 2001 From: Ashfaaq18 Date: Tue, 8 Jun 2021 09:46:03 +0530 Subject: [PATCH] Make the Search Results Window locked (grayed) until the first search The search result window option will only enable after the first Find All search Fix #9655, close #9967 --- PowerEditor/src/Notepad_plus.cpp | 3 +++ PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 48d10674c..26f62fd65 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -534,6 +534,9 @@ LRESULT Notepad_plus::init(HWND hwnd) _pluginsAdminDlg.setPluginsManager(&_pluginsManager); _pluginsManager.setMenu(_mainMenuHandle, NULL, enablePluginAdmin); + //Search menu + //disable "Search Results Window" under Search Menu + ::EnableMenuItem(_mainMenuHandle, IDM_FOCUS_ON_FOUND_RESULTS, MF_DISABLED | MF_GRAYED | MF_BYCOMMAND); //Main menu is loaded, now load context menu items nppParam.getContextMenuFromXmlTree(_mainMenuHandle, _pluginsManager.getMenuHandle()); diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index eef79dc16..5bb843688 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -2584,6 +2584,9 @@ void FindReplaceDlg::findAllIn(InWhat op) char ptrword[sizeof(void*)*2+1]; sprintf(ptrword, "%p", &_pFinder->_markingsStruct); _pFinder->_scintView.execute(SCI_SETPROPERTY, reinterpret_cast("@MarkingsStruct"), reinterpret_cast(ptrword)); + + //enable "Search Results Window" under Search Menu + ::EnableMenuItem(::GetMenu(_hParent), IDM_FOCUS_ON_FOUND_RESULTS, MF_ENABLED | MF_BYCOMMAND); } ::SendMessage(_pFinder->getHSelf(), WM_SIZE, 0, 0);