Skip to content

Commit

Permalink
[NEW_FEATURE]
Browse files Browse the repository at this point in the history
1. New "Mark" tab for "Mark all" feature in Find/Replace dialog.
2. Make "Fide what" and "Replace with" fields larger in Find/Replace dialog.
3. Make some message dialogs translatable.

- Notepad-plus svn trunk @ 733
  • Loading branch information
donho committed Jan 19, 2011
1 parent 59daab7 commit cf4ade9
Show file tree
Hide file tree
Showing 14 changed files with 295 additions and 152 deletions.
2 changes: 1 addition & 1 deletion PowerEditor/installer/nativeLang/english.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
</Menu>

<Dialog>
<Find title="" titleFind="Find" titleReplace="Replace" titleFindInFiles="Find in Files">
<Find title="" titleFind="Find" titleReplace="Replace" titleFindInFiles="Find in Files" titleMark="Mark">
<Item id="1" name="Find Next"/>
<Item id="2" name="Close"/>
<Item id="1620" name="Find what:"/>
Expand Down
13 changes: 13 additions & 0 deletions PowerEditor/installer/nativeLang/french.xml
Original file line number Diff line number Diff line change
Expand Up @@ -588,5 +588,18 @@
<Item id="2" name="Annuler"/>
</ColumnEditor>
</Dialog>
<MessageBox>
<ContextMenuXmlEditWaring title="Editing contextMenu" message="Editing contextMenu.xml allows you to modify your Notepad++ popup context menu.\rYou have to restart your Notepad++ to take effect after modifying contextMenu.xml."/>
<NppHelpAbsentWaring title="File does not exist" message="\rdoesn't exist. Please download it on Notepad++ site."/>
<SaveCurrentModifWaring title="Save Current Modification" message="You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"/>
<LoseUndoAbilityWaring title="Lose Undo Ability Waning" message="You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"/>
<CannotMoveDoc title="Move to new Notepad++ Instance" message="Document is modified, save it then try again."/>
<DocReloadWarning title="Reload" message="Are you sure you want to reload the current file and lose the changes made in Notepad++?"/>
<FileLockedWarning title="Save failed" message="Please check whether if this file is opened in another program"/>
<FileAlreadyOpenedInNpp title="" message="The file is already opened in the Notepad++."/>
<DeleteFileFailed title="Delete File" message="Delete File failed"/>
<FileAlreadyOpenedInNpp title="" message=""/>
<FileAlreadyOpenedInNpp title="" message=""/>
</MessageBox>
</Native-Langue>
</NotepadPlus>
33 changes: 15 additions & 18 deletions PowerEditor/misc/npp.help/HTML/Introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
<link rel="stylesheet" href="styles.css" type="text/css"></head>
<body>
<h1>Introduction</h1>
<p>
This
document assumes that you have an English install of Notepad++. If
you have installed it in another language, the commands and options
will probably have been translated into your native language. In that
case, find the command with the similar name, the logical grouping
will still be the same.
p>All the images used in this helpfile assume the default settings.

<p>This document
is dedicated to the countless lost hours of both people having
to search for simple answers, and people having to answer questions
that shouldn't have to be asked in the first place. Documentation is
always hard to get, good documentation nearly impossible =].
<p>This
markup is based in the default appearance of Microsoft Windows. This
can be different on your own system, but the names (text) should always
the same. This is especially important on the screenshots. They are
only for reference, your appearance of Notepad++ can be quite different.

<p>All the images used in this helpfile assume the default settings.
If you change any of these settings, you'll have to look for the other
image instead, this is most noticable with the toolbar (the position of
images will always remain the same).
Expand Down Expand Up @@ -43,16 +48,8 @@ <h1>Introduction</h1>
<tr><td>Finally, when mouse or keyboard interaction is required, the buttons or keys to press are marked like this:
<td><span class="shortcut">Leftmousebutton</span>
</table>
<p>This
markup is based in the default appearance of Microsoft Windows. This
can be different on your own system, but the names (text) should always
the same. This is especially important on the screenshots. They are
only for reference, your appearance of Notepad++ can be quite different.
<p>This
helpfile is dedicated to the countless lost hours of both people having
to search for simple answers, and people having to answer questions
that shouldn't have to be asked in the first place. Documentation is
always hard to get, good documentation nearly impossible =].
<p>&nbsp;</p>

<p>This
help file was written by Harry (harrybharry@users.sourceforge.net) and
converted to HTML using KompoZer, compiled to a help file with
Expand Down
1 change: 0 additions & 1 deletion PowerEditor/src/Notepad_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ LRESULT Notepad_plus::init(HWND hwnd)
// Updater menu item
if (!nppGUI._doesExistUpdater)
{
//::MessageBox(NULL, TEXT("pas de updater"), TEXT(""), MB_OK);
::DeleteMenu(_mainMenuHandle, IDM_UPDATE_NPP, MF_BYCOMMAND);
::DrawMenuBar(hwnd);
}
Expand Down
48 changes: 40 additions & 8 deletions PowerEditor/src/NppCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,12 @@ void Notepad_plus::command(int id)
{
if (buf->isDirty())
{
int answer = ::MessageBox(NULL, TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"), TEXT("Save Current Modification"), MB_YESNO);
int answer = _nativeLangSpeaker.messageBox("SaveCurrentModifWaring",
NULL,
TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"),
TEXT("Save Current Modification"),
MB_YESNO);

if (answer == IDYES)
{
fileSave();
Expand All @@ -1194,7 +1199,12 @@ void Notepad_plus::command(int id)

if (_pEditView->execute(SCI_CANUNDO) == TRUE)
{
int answer = ::MessageBox(NULL, TEXT("All the saved modifications can not be undone.\r\rContinue?"), TEXT("Lose Undo Ability Waning"), MB_YESNO);
generic_string msg, title;
int answer = _nativeLangSpeaker.messageBox("LoseUndoAbilityWaring",
NULL,
TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"),
TEXT("Lose Undo Ability Waning"),
MB_YESNO);
if (answer == IDYES)
{
// Do nothing
Expand Down Expand Up @@ -1286,7 +1296,13 @@ void Notepad_plus::command(int id)
Buffer * buf = _pEditView->getCurrentBuffer();
if (buf->isDirty())
{
int answer = ::MessageBox(NULL, TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"), TEXT("Save Current Modification"), MB_YESNO);
generic_string warning, title;
int answer = _nativeLangSpeaker.messageBox("SaveCurrentModifWaring",
NULL,
TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"),
TEXT("Save Current Modification"),
MB_YESNO);

if (answer == IDYES)
{
fileSave();
Expand All @@ -1298,7 +1314,13 @@ void Notepad_plus::command(int id)

if (_pEditView->execute(SCI_CANUNDO) == TRUE)
{
int answer = ::MessageBox(NULL, TEXT("All the saved modifications can not be undone.\r\rContinue?"), TEXT("Lose Undo Ability Waning"), MB_YESNO);
generic_string msg, title;
int answer = _nativeLangSpeaker.messageBox("LoseUndoAbilityWaring",
NULL,
TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"),
TEXT("Lose Undo Ability Waning"),
MB_YESNO);

if (answer == IDYES)
{
// Do nothing
Expand Down Expand Up @@ -1688,8 +1710,12 @@ void Notepad_plus::command(int id)
{
//if (contion)
{
TCHAR warning[] = TEXT("Editing contextMenu.xml allows you to modify your Notepad++ popup context menu.\rYou have to restart your Notepad++ to take effect after modifying contextMenu.xml.");
::MessageBox(_pPublicInterface->getHSelf(), warning, TEXT("Editing contextMenu"), MB_OK|MB_APPLMODAL);
generic_string warning, title;
_nativeLangSpeaker.messageBox("ContextMenuXmlEditWaring",
_pPublicInterface->getHSelf(),
TEXT("Editing contextMenu.xml allows you to modify your Notepad++ popup context menu.\rYou have to restart your Notepad++ to take effect after modifying contextMenu.xml."),
TEXT("Editing contextMenu"),
MB_OK|MB_APPLMODAL);
}
NppParameters *pNppParams = NppParameters::getInstance();
BufferID bufID = doOpen((pNppParams->getContextMenuPath()).c_str());
Expand Down Expand Up @@ -1765,8 +1791,14 @@ void Notepad_plus::command(int id)
else
{
generic_string msg = nppHelpPath;
msg += TEXT("\rdoesn't exist. Please download it on Notepad++ site.");
::MessageBox(_pPublicInterface->getHSelf(), msg.c_str(), TEXT("File does not exist"), MB_OK);
generic_string warning, title;
if (!_nativeLangSpeaker.getMsgBoxLang("NppHelpAbsentWaring", title, warning))
{
title = TEXT("File does not exist");
warning = TEXT("\rdoesn't exist. Please download it on Notepad++ site.");
}
msg += warning;
::MessageBox(_pPublicInterface->getHSelf(), msg.c_str(), title.c_str(), MB_OK);
}
}
break;
Expand Down
25 changes: 21 additions & 4 deletions PowerEditor/src/NppIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ bool Notepad_plus::doReload(BufferID id, bool alert)
{
if (alert)
{
if (::MessageBox(_pPublicInterface->getHSelf(), TEXT("Are you sure you want to reload the current file and lose the changes made in Notepad++?"), TEXT("Reload"), MB_YESNO | MB_ICONEXCLAMATION | MB_APPLMODAL) != IDYES)
int answer = _nativeLangSpeaker.messageBox("DocReloadWarning",
_pPublicInterface->getHSelf(),
TEXT("Are you sure you want to reload the current file and lose the changes made in Notepad++?"),
TEXT("Reload"),
MB_YESNO | MB_ICONEXCLAMATION | MB_APPLMODAL);
if (answer != IDYES)
return false;
}

Expand Down Expand Up @@ -263,7 +268,11 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy)
}

if (!res)
::MessageBox(_pPublicInterface->getHSelf(), TEXT("Please check whether if this file is opened in another program"), TEXT("Save failed"), MB_OK);
_nativeLangSpeaker.messageBox("FileLockedWarning",
_pPublicInterface->getHSelf(),
TEXT("Please check whether if this file is opened in another program"),
TEXT("Save failed"),
MB_OK);
return res;
}

Expand Down Expand Up @@ -778,7 +787,11 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy)
}
else //cannot save, other view has buffer already open, activate it
{
::MessageBox(_pPublicInterface->getHSelf(), TEXT("The file is already opened in the Notepad++."), TEXT("ERROR"), MB_OK | MB_ICONSTOP);
_nativeLangSpeaker.messageBox("FileAlreadyOpenedInNpp",
_pPublicInterface->getHSelf(),
TEXT("The file is already opened in the Notepad++."),
TEXT("ERROR"),
MB_OK | MB_ICONSTOP);
switchToFile(other);
return false;
}
Expand Down Expand Up @@ -826,7 +839,11 @@ bool Notepad_plus::fileDelete(BufferID id)
{
if (!MainFileManager->deleteFile(bufferID))
{
::MessageBox(_pPublicInterface->getHSelf(), TEXT("Delete File failed"), TEXT("Delete File"), MB_OK);
_nativeLangSpeaker.messageBox("DeleteFileFailed",
_pPublicInterface->getHSelf(),
TEXT("Delete File failed"),
TEXT("Delete File"),
MB_OK);
return false;
}
doClose(bufferID, MAIN_VIEW);
Expand Down
7 changes: 6 additions & 1 deletion PowerEditor/src/NppNotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ BOOL Notepad_plus::notify(SCNotification *notification)
int iView = isFromPrimary?MAIN_VIEW:SUB_VIEW;
if (buf->isDirty())
{
::MessageBox(_pPublicInterface->getHSelf(), TEXT("Document is modified, save it then try again."), TEXT("Move to new Notepad++ Instance"), MB_OK);
generic_string msg, title;
_nativeLangSpeaker.messageBox("CannotMoveDoc",
_pPublicInterface->getHSelf(),
TEXT("Document is modified, save it then try again."),
TEXT("Move to new Notepad++ Instance"),
MB_OK);
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion PowerEditor/src/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "FileDialog.h"
#include "ScintillaEditView.h"
#include "keys.h"
#include "localization.h"

struct WinMenuKeyDefinition { //more or less matches accelerator table definition, easy copy/paste
//const TCHAR * name; //name retrieved from menu?
Expand Down Expand Up @@ -608,7 +609,7 @@ NppParameters::NppParameters() : _pXmlDoc(NULL),_pXmlUserDoc(NULL), _pXmlUserSty
_nbLang(0), _nbFile(0), _nbMaxFile(10), _pXmlToolIconsDoc(NULL),\
_pXmlShortcutDoc(NULL), _pXmlContextMenuDocA(NULL), _pXmlSessionDoc(NULL), _pXmlBlacklistDoc(NULL),\
_nbUserLang(0), _nbExternalLang(0), _hUser32(NULL), _hUXTheme(NULL),\
_transparentFuncAddr(NULL), _enableThemeDialogTextureFuncAddr(NULL),\
_transparentFuncAddr(NULL), _enableThemeDialogTextureFuncAddr(NULL), _pNativeLangSpeaker(NULL),\
_isTaskListRBUTTONUP_Active(false), _fileSaveDlgFilterIndex(-1), _asNotepadStyle(false), _isFindReplacing(false)
{
// init import UDL array
Expand Down
10 changes: 6 additions & 4 deletions PowerEditor/src/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
#include "ContextMenu.h"
#endif //CONTEXTMENU

class NativeLangSpeaker;

using namespace std;

const bool POS_VERTICAL = true;
Expand Down Expand Up @@ -1353,10 +1355,8 @@ class NppParameters
generic_string _find;
generic_string _replace;
generic_string _findInFiles;
FindDlgTabTitiles() : _find(TEXT("")), _replace(TEXT("")), _findInFiles(TEXT("")) {};
bool isWellFilled() {
return (lstrcmp(_find.c_str(), TEXT("")) != 0 && lstrcmp(_replace.c_str(), TEXT("")) && lstrcmp(_findInFiles.c_str(), TEXT("")));
};
generic_string _mark;
FindDlgTabTitiles() : _find(TEXT("")), _replace(TEXT("")), _findInFiles(TEXT("")), _mark(TEXT("")) {};
};

FindDlgTabTitiles & getFindDlgTabTitiles() { return _findDlgTabTitiles;};
Expand Down Expand Up @@ -1518,6 +1518,8 @@ class NppParameters

winVer _winVersion;

NativeLangSpeaker *_pNativeLangSpeaker;

static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *, int, LPARAM lParam) {
vector<generic_string> *pStrVect = (vector<generic_string> *)lParam;
size_t vectSize = pStrVect->size();
Expand Down

0 comments on commit cf4ade9

Please sign in to comment.