[UPDATE] Updated some MessageBoxes and minor code changes.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@416 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
yniq 2009-02-06 13:55:04 +00:00
parent 2ae8792fe8
commit d5b8efeef0
2 changed files with 13 additions and 14 deletions

View File

@ -675,7 +675,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly)
bool res = MainFileManager->createEmptyFile(longFileName); bool res = MainFileManager->createEmptyFile(longFileName);
if (!res) { if (!res) {
wsprintf(str2display, TEXT("Cannot create the file \"%s\""), longFileName); wsprintf(str2display, TEXT("Cannot create the file \"%s\""), longFileName);
::MessageBox(_hSelf, str2display, TEXT("Create new file"), MB_OK); printMsg(str2display, TEXT("Create new file"));
return BUFFER_INVALID; return BUFFER_INVALID;
} }
} }
@ -734,7 +734,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly)
//lstrcat(msg, fullPath); //lstrcat(msg, fullPath);
lstrcat(msg, longFileName); lstrcat(msg, longFileName);
lstrcat(msg, TEXT("\".")); lstrcat(msg, TEXT("\"."));
::MessageBox(_hSelf, msg, TEXT("ERR"), MB_OK); printMsg(msg, TEXT("Open File"));
return BUFFER_INVALID; return BUFFER_INVALID;
} }
} }
@ -805,7 +805,7 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy)
} }
if (!res) if (!res)
::MessageBox(_hSelf, TEXT("Please check whether if this file is opened in another program"), TEXT("Save failed"), MB_OK); printMsg(TEXT("Please check whether if this file is opened in another program"), TEXT("Save failed"));
return res; return res;
} }
@ -1139,7 +1139,7 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy)
} }
else //cannot save, other view has buffer already open, activate it else //cannot save, other view has buffer already open, activate it
{ {
::MessageBox(_hSelf, TEXT("The file is already opened in the Notepad++."), TEXT("ERROR"), MB_OK | MB_ICONSTOP); printMsg(TEXT("The file is already opened in Notepad++."), TEXT("Save File As"), MB_OK | MB_ICONSTOP);
switchToFile(other); switchToFile(other);
return false; return false;
} }
@ -1208,7 +1208,7 @@ bool Notepad_plus::fileDelete(BufferID id, int curView)
{ {
if (!MainFileManager->deleteFile(bufferID)) if (!MainFileManager->deleteFile(bufferID))
{ {
::MessageBox(_hSelf, TEXT("Delete File failed"), TEXT("Delete File"), MB_OK); printMsg(TEXT("Delete File failed"), TEXT("Delete File"));
return false; return false;
} }
doClose(bufferID, MAIN_VIEW); doClose(bufferID, MAIN_VIEW);
@ -1374,7 +1374,7 @@ bool Notepad_plus::fileCloseAllButCurrent()
return true; return true;
} }
bool Notepad_plus::replaceAllFiles() { bool Notepad_plus::replaceInOpenFiles() {
ScintillaEditView *pOldView = _pEditView; ScintillaEditView *pOldView = _pEditView;
_pEditView = &_invisibleEditView; _pEditView = &_invisibleEditView;
@ -1428,8 +1428,7 @@ bool Notepad_plus::replaceAllFiles() {
else else
wsprintf(result, TEXT("%d occurrences replaced."), nbTotal); wsprintf(result, TEXT("%d occurrences replaced."), nbTotal);
::printStr(result); printMsg(result, TEXT("Replace in all opened documents"));
return true; return true;
} }
@ -1642,8 +1641,8 @@ bool Notepad_plus::replaceInFiles()
_pEditView = pOldView; _pEditView = pOldView;
TCHAR msg[128]; TCHAR msg[128];
wsprintf(msg, TEXT("%d occurences replaced"), nbTotal); wsprintf(msg, TEXT("%d occurrences replaced."), nbTotal);
printStr(msg); printMsg(msg, TEXT("Replace in files"));
return true; return true;
} }
@ -7077,7 +7076,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
case WM_REPLACEALL_INOPENEDDOC : case WM_REPLACEALL_INOPENEDDOC :
{ {
replaceAllFiles(); replaceInOpenFiles();
return TRUE; return TRUE;
} }
@ -7488,7 +7487,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
{ {
if (lstrlen(str) >= int(wParam)) if (lstrlen(str) >= int(wParam))
{ {
::MessageBox(_hSelf, TEXT("Allocated buffer size is not enough to copy the string."), TEXT("NPPM_GETNPPDIRECTORY error"), MB_OK); printMsg(TEXT("Allocated buffer size is not large enough to copy the string."), TEXT("NPPM_GETNPPDIRECTORY error"));
return FALSE; return FALSE;
} }
} }

View File

@ -722,7 +722,7 @@ private:
void showFunctionComp(); void showFunctionComp();
void changeStyleCtrlsLang(HWND hDlg, int *idArray, const char **translatedText); void changeStyleCtrlsLang(HWND hDlg, int *idArray, const char **translatedText);
bool replaceAllFiles(); bool replaceInOpenFiles();
bool findInOpenedFiles(); bool findInOpenedFiles();
bool matchInList(const TCHAR *fileName, const vector<generic_string> & patterns); bool matchInList(const TCHAR *fileName, const vector<generic_string> & patterns);