[ENHANCEMENT] (Author: Jinhui Yang) Enhance Find/Replace dialog statusbar message.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1043 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
865eded304
commit
532275abb0
@ -689,8 +689,16 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
|||||||
updateCombo(IDFINDWHAT);
|
updateCombo(IDFINDWHAT);
|
||||||
|
|
||||||
nppParamInst->_isFindReplacing = true;
|
nppParamInst->_isFindReplacing = true;
|
||||||
if (isMacroRecording) saveInMacro(wParam, FR_OP_FIND);
|
if (isMacroRecording)
|
||||||
processFindNext(_options._str2Search.c_str());
|
saveInMacro(wParam, FR_OP_FIND);
|
||||||
|
|
||||||
|
FindStatus findStatus = FSFound;
|
||||||
|
processFindNext(_options._str2Search.c_str(), _env, &findStatus);
|
||||||
|
if(findStatus == FSEndReached)
|
||||||
|
setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the top. The end of document has been reached."), FSMessage);
|
||||||
|
else if(findStatus == FSTopReached)
|
||||||
|
setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the bottom. The begin of document has been reached."), FSMessage);
|
||||||
|
|
||||||
nppParamInst->_isFindReplacing = false;
|
nppParamInst->_isFindReplacing = false;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1362,11 +1370,25 @@ bool FindReplaceDlg::processReplace(const TCHAR *txt2find, const TCHAR *txt2repl
|
|||||||
|
|
||||||
// Do the next find
|
// Do the next find
|
||||||
moreMatches = processFindNext(txt2find, &replaceOptions, &status, FINDNEXTTYPE_REPLACENEXT);
|
moreMatches = processFindNext(txt2find, &replaceOptions, &status, FINDNEXTTYPE_REPLACENEXT);
|
||||||
|
|
||||||
|
if (status == FSEndReached)
|
||||||
|
{
|
||||||
|
setStatusbarMessage(TEXT("Replace: Replaced the 1st occurrence from the top. The end of document has been reached."), FSMessage);
|
||||||
|
//displayMsgDone = true;
|
||||||
|
}
|
||||||
|
else if (status == FSTopReached)
|
||||||
|
{
|
||||||
|
setStatusbarMessage(TEXT("Replace: Replaced the 1st occurrence from the bottom. The begin of document has been reached."), FSMessage);
|
||||||
|
//displayMsgDone = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
generic_string msg = TEXT("Replace: 1 occurrence was replaced. ");
|
generic_string msg = TEXT("Replace: 1 occurrence was replaced. ");
|
||||||
msg += moreMatches?TEXT("The next occurence found"):TEXT("The next occurence not found");
|
msg += moreMatches?TEXT("The next occurence found"):TEXT("The next occurence not found");
|
||||||
setStatusbarMessage(msg, FSMessage);
|
setStatusbarMessage(msg, FSMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setStatusbarMessage(TEXT("Replace: no occurrence was found."), FSNotFound);
|
setStatusbarMessage(TEXT("Replace: no occurrence was found."), FSNotFound);
|
||||||
|
Loading…
Reference in New Issue
Block a user