diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index ecd14249e..de0cafd41 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -8224,6 +8224,12 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa return TRUE; } + case WM_UPDATEFINDERSCINTILLA : + { + _findReplaceDlg.updateFinderScintilla(); + return TRUE; + } + case WM_QUERYENDSESSION: case WM_CLOSE: { diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h index ad3770bd0..5d0e9d5e2 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h @@ -384,12 +384,20 @@ public : void focusOnFinder() { // Show finder and set focus - if (_pFinder) { + if (_pFinder) + { ::SendMessage(_hParent, NPPM_DMMSHOW, 0, (LPARAM)_pFinder->getHSelf()); _pFinder->_scintView.getFocus(); } }; + void updateFinderScintilla() { + if (_pFinder && _pFinder->isCreated() && _pFinder->isVisible()) + { + _pFinder->setFinderStyle(); + } + }; + protected : virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); void addText2Combo(const TCHAR * txt2add, HWND comboID, bool isUTF8 = false); diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp index 54842c835..fe60e9273 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp @@ -217,10 +217,8 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar _isDirty = false; setVisualFromStyleList(); ::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0); + ::SendMessage(_hParent, WM_UPDATEFINDERSCINTILLA, 0, 0); } - //else - //::MessageBox(NULL, TEXT("no dirty"), TEXT(""), MB_OK); - //::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE); ::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), !_isSync); display(false); return TRUE; @@ -709,5 +707,17 @@ void WordStyleDlg::apply() ::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE); //_isDirty = false; _isSync = false; - ::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0); + + TCHAR str[256] = TEXT(""); + int i = ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_GETCURSEL, 0, 0); + if (i == LB_ERR) + return; + ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_GETTEXT, i, (LPARAM)str); + + int cmdid = 0; + if (lstrcmp(str, TEXT("Search result")) == 0) + cmdid = WM_UPDATEFINDERSCINTILLA; + else + cmdid = WM_UPDATESCINTILLAS; + ::SendMessage(_hParent, cmdid, 0, 0); } diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h index 8f06bda52..6ff3de239 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h @@ -28,8 +28,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "Parameters.h" #include "resource.h" -#define WM_UPDATESCINTILLAS (WORDSTYLE_USER + 1) //GlobalStyleDlg's msg 2 send 2 its parent -#define WM_DATA_MODIFIED (WORDSTYLE_USER + 2) //WordStyleDlg's msg 2 send 2 its parent(GlobalStyleDlg) +#define WM_UPDATESCINTILLAS (WORDSTYLE_USER + 1) //GlobalStyleDlg's msg 2 send 2 its parent +#define WM_UPDATEFINDERSCINTILLA (WORDSTYLE_USER + 2) //the msg 2 notify the finder's styles changed enum fontStyleType {BOLD_STATUS, ITALIC_STATUS, UNDERLINE_STATUS};