Add thousands separator for FindReplace dialog

Closes #2132
pull/1923/merge
dail8859 8 years ago
parent c547dce797
commit 27d80432d8

@ -1105,7 +1105,7 @@ bool Notepad_plus::replaceInOpenedFiles() {
if (nbTotal) if (nbTotal)
enableCommand(IDM_FILE_SAVEALL, true, MENU | TOOLBAR); enableCommand(IDM_FILE_SAVEALL, true, MENU | TOOLBAR);
TCHAR result[64]; TCHAR result[64];
wsprintf(result, TEXT("Replace in Opened Files: %d occurrences replaced."), nbTotal); wsprintf(result, TEXT("Replace in Opened Files: %s occurrences replaced."), commafyInt(nbTotal).c_str());
_findReplaceDlg.setStatusbarMessage(result, FSMessage); _findReplaceDlg.setStatusbarMessage(result, FSMessage);
} }
return true; return true;
@ -1536,7 +1536,7 @@ bool Notepad_plus::replaceInFiles()
_pEditView = pOldView; _pEditView = pOldView;
TCHAR msg[128]; TCHAR msg[128];
wsprintf(msg, TEXT("Replace in Files: %d occurrences replaced"), nbTotal); wsprintf(msg, TEXT("Replace in Files: %s occurrences replaced"), commafyInt(nbTotal).c_str());
_findReplaceDlg.setStatusbarMessage(msg, FSMessage); _findReplaceDlg.setStatusbarMessage(msg, FSMessage);
return true; return true;

@ -1008,7 +1008,7 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
if(nbReplaced == 1) if(nbReplaced == 1)
wsprintf(moreInfo, TEXT("Replace All: %d occurrence was replaced."), nbReplaced); wsprintf(moreInfo, TEXT("Replace All: %d occurrence was replaced."), nbReplaced);
else else
wsprintf(moreInfo, TEXT("Replace All: %d occurrences were replaced."), nbReplaced); wsprintf(moreInfo, TEXT("Replace All: %s occurrences were replaced."), commafyInt(nbReplaced).c_str());
result = moreInfo; result = moreInfo;
} }
setStatusbarMessage(result, FSMessage); setStatusbarMessage(result, FSMessage);
@ -1038,7 +1038,7 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
if (nbCounted == 1) if (nbCounted == 1)
wsprintf(moreInfo, TEXT("Count: %d match."), nbCounted); wsprintf(moreInfo, TEXT("Count: %d match."), nbCounted);
else else
wsprintf(moreInfo, TEXT("Count: %d matches."), nbCounted); wsprintf(moreInfo, TEXT("Count: %s matches."), commafyInt(nbCounted).c_str());
result = moreInfo; result = moreInfo;
} }
if (isMacroRecording) saveInMacro(wParam, FR_OP_FIND); if (isMacroRecording) saveInMacro(wParam, FR_OP_FIND);
@ -1071,7 +1071,7 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
if(nbMarked == 1) if(nbMarked == 1)
wsprintf(moreInfo, TEXT("Mark: %d match."), nbMarked); wsprintf(moreInfo, TEXT("Mark: %d match."), nbMarked);
else else
wsprintf(moreInfo, TEXT("Mark: %d matches."), nbMarked); wsprintf(moreInfo, TEXT("Mark: %s matches."), commafyInt(nbMarked).c_str());
result = moreInfo; result = moreInfo;
} }
setStatusbarMessage(result, FSMessage); setStatusbarMessage(result, FSMessage);
@ -2015,7 +2015,7 @@ void FindReplaceDlg::findAllIn(InWhat op)
if(_findAllResult == 1) if(_findAllResult == 1)
wsprintf(_findAllResultStr, TEXT("1 hit")); wsprintf(_findAllResultStr, TEXT("1 hit"));
else else
wsprintf(_findAllResultStr, TEXT("%d hits"), _findAllResult); wsprintf(_findAllResultStr, TEXT("%s hits"), commafyInt(_findAllResult).c_str());
if (_findAllResult) if (_findAllResult)
{ {
focusOnFinder(); focusOnFinder();
@ -2409,7 +2409,7 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
if (nbReplaced == 1) if (nbReplaced == 1)
wsprintf(moreInfo, TEXT("Replace All: %d occurrence was replaced."), nbReplaced); wsprintf(moreInfo, TEXT("Replace All: %d occurrence was replaced."), nbReplaced);
else else
wsprintf(moreInfo, TEXT("Replace All: %d occurrences were replaced."), nbReplaced); wsprintf(moreInfo, TEXT("Replace All: %s occurrences were replaced."), commafyInt(nbReplaced).c_str());
result = moreInfo; result = moreInfo;
} }
@ -2429,7 +2429,7 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
if (nbCounted == 1) if (nbCounted == 1)
wsprintf(moreInfo, TEXT("Count: %d match."), nbCounted); wsprintf(moreInfo, TEXT("Count: %d match."), nbCounted);
else else
wsprintf(moreInfo, TEXT("Count: %d matches."), nbCounted); wsprintf(moreInfo, TEXT("Count: %s matches."), commafyInt(nbCounted).c_str());
result = moreInfo; result = moreInfo;
} }
setStatusbarMessage(result, FSMessage); setStatusbarMessage(result, FSMessage);
@ -2452,7 +2452,7 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
if (nbMarked <= 1) if (nbMarked <= 1)
wsprintf(moreInfo, TEXT("%d match."), nbMarked); wsprintf(moreInfo, TEXT("%d match."), nbMarked);
else else
wsprintf(moreInfo, TEXT("%d matches."), nbMarked); wsprintf(moreInfo, TEXT("%s matches."), commafyInt(nbMarked).c_str());
result = moreInfo; result = moreInfo;
} }
@ -3256,7 +3256,7 @@ void FindIncrementDlg::setFindStatus(FindStatus iStatus, int nbCounted)
else if (nbCounted == 1) else if (nbCounted == 1)
wsprintf(findCount, TEXT("%d match."), nbCounted); wsprintf(findCount, TEXT("%d match."), nbCounted);
else else
wsprintf(findCount, TEXT("%d matches."), nbCounted); wsprintf(findCount, TEXT("%s matches."), commafyInt(nbCounted).c_str());
if (iStatus<0 || iStatus >= sizeof(findStatus)/sizeof(findStatus[0])) if (iStatus<0 || iStatus >= sizeof(findStatus)/sizeof(findStatus[0]))
return; // out of range return; // out of range

Loading…
Cancel
Save