diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 2bccbd61d..1ea997e2d 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -1967,10 +1967,26 @@ void FindIncrementDlg::display(bool toShow) const } #define SHIFTED 0x8000 +#define BCKGRD_COLOR (RGB(255,102,102)) +#define TXT_COLOR (RGB(255,255,255)) + BOOL CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) { - switch (message) + switch (message) { + case WM_CTLCOLOREDIT : + { + // if the text not found modify the background color of the editor + static HBRUSH hBrushBackground = CreateSolidBrush(BCKGRD_COLOR); + if (FSNotFound != getFindStatus()) + return FALSE; // text found, use the default color + + // text not found + SetTextColor((HDC)wParam, TXT_COLOR); + SetBkColor((HDC)wParam, BCKGRD_COLOR); + return (LRESULT)hBrushBackground; + } + case WM_COMMAND : { bool isUnicode = (*(_pFRDlg->_ppEditView))->getCurrentBuffer()->getUnicodeMode() != uni8Bit; diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h index d7cf46dc9..9c5cf971b 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h @@ -539,7 +539,7 @@ private : class FindIncrementDlg : public StaticDialog { public : - FindIncrementDlg() : _pFRDlg(NULL), _pRebar(NULL) {}; + FindIncrementDlg() : _pFRDlg(NULL), _pRebar(NULL), _FindStatus(FSFound) {}; void init(HINSTANCE hInst, HWND hPere, FindReplaceDlg *pFRDlg, bool isRTL = false) { Window::init(hInst, hPere); if (!pFRDlg) @@ -583,13 +583,26 @@ public : TEXT("Reached end of page, continued from top")}; // FSEndReached if (iStatus<0 || iStatus >= sizeof(findStatus)/sizeof(findStatus[0])) return; // out of range + + _FindStatus = iStatus; + + // get the HWND of the editor + HWND hEditor = ::GetDlgItem(_hSelf, IDC_INCFINDTEXT); + + // invalidate the editor rect + ::InvalidateRect(hEditor, NULL, TRUE); ::SendDlgItemMessage(_hSelf, IDC_INCFINDSTATUS, WM_SETTEXT, 0, (LPARAM)findStatus[iStatus]); } + + FindStatus getFindStatus() { + return _FindStatus; + } void addToRebar(ReBar * rebar); private : bool _isRTL; FindReplaceDlg *_pFRDlg; + FindStatus _FindStatus; ReBar * _pRebar; REBARBANDINFO _rbBand; diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc index 4f6f21260..09c03710d 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc @@ -88,7 +88,7 @@ BEGIN PUSHBUTTON ">",IDC_INCFINDNXTOK | WS_TABSTOP,243,3,16,14 CONTROL "Highlight all", IDC_INCFINDHILITEALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,270,5,65,12 CONTROL "Match case", IDC_INCFINDMATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,335,5,60,12 - LTEXT "Find Status",IDC_INCFINDSTATUS,400,6,180,12 + LTEXT "",IDC_INCFINDSTATUS,400,6,180,12 END IDD_FINDRESULT DIALOGEX 26, 41, 223, 67