From d5b8efeef0df624bd09c67ccf2a61fc102690334 Mon Sep 17 00:00:00 2001 From: yniq Date: Fri, 6 Feb 2009 13:55:04 +0000 Subject: [PATCH] [UPDATE] Updated some MessageBoxes and minor code changes. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@416 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 25 ++++++++++++------------- PowerEditor/src/Notepad_plus.h | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index a0103901..412103ae 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -675,7 +675,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly) bool res = MainFileManager->createEmptyFile(longFileName); if (!res) { 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; } } @@ -734,7 +734,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isReadOnly) //lstrcat(msg, fullPath); lstrcat(msg, longFileName); lstrcat(msg, TEXT("\".")); - ::MessageBox(_hSelf, msg, TEXT("ERR"), MB_OK); + printMsg(msg, TEXT("Open File")); return BUFFER_INVALID; } } @@ -805,7 +805,7 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) } 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; } @@ -1139,7 +1139,7 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy) } 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); return false; } @@ -1208,7 +1208,7 @@ bool Notepad_plus::fileDelete(BufferID id, int curView) { 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; } doClose(bufferID, MAIN_VIEW); @@ -1374,7 +1374,7 @@ bool Notepad_plus::fileCloseAllButCurrent() return true; } -bool Notepad_plus::replaceAllFiles() { +bool Notepad_plus::replaceInOpenFiles() { ScintillaEditView *pOldView = _pEditView; _pEditView = &_invisibleEditView; @@ -1428,8 +1428,7 @@ bool Notepad_plus::replaceAllFiles() { else wsprintf(result, TEXT("%d occurrences replaced."), nbTotal); - ::printStr(result); - + printMsg(result, TEXT("Replace in all opened documents")); return true; } @@ -1640,10 +1639,10 @@ bool Notepad_plus::replaceInFiles() _invisibleEditView.execute(SCI_SETDOCPOINTER, 0, oldDoc); _invisibleEditView._currentBuffer = oldBuf; _pEditView = pOldView; - + TCHAR msg[128]; - wsprintf(msg, TEXT("%d occurences replaced"), nbTotal); - printStr(msg); + wsprintf(msg, TEXT("%d occurrences replaced."), nbTotal); + printMsg(msg, TEXT("Replace in files")); return true; } @@ -7077,7 +7076,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa case WM_REPLACEALL_INOPENEDDOC : { - replaceAllFiles(); + replaceInOpenFiles(); return TRUE; } @@ -7488,7 +7487,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa { 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; } } diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index 6daa10e4..4075d89c 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -722,7 +722,7 @@ private: void showFunctionComp(); void changeStyleCtrlsLang(HWND hDlg, int *idArray, const char **translatedText); - bool replaceAllFiles(); + bool replaceInOpenFiles(); bool findInOpenedFiles(); bool matchInList(const TCHAR *fileName, const vector & patterns);