[NEW_FEATURE] Add NPPM_ACTIVATEDOCMENU message.
Fix NPPN_SHUTDOWN notification bug. Fix Russian display problem in the shortcut mapper. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@63 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
d24b0372ad
commit
249b9a79d8
|
@ -170,6 +170,9 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
|
||||||
// in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
|
// in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
|
||||||
// to access all the Notepad++ menu command items
|
// to access all the Notepad++ menu command items
|
||||||
|
|
||||||
|
#define NPPM_ACTIVATEDOCMENU (NPPMSG + 49)
|
||||||
|
//void NPPM_ACTIVATEDOCMENU(int view, int index2Activate)
|
||||||
|
|
||||||
#define RUNCOMMAND_USER (WM_USER + 3000)
|
#define RUNCOMMAND_USER (WM_USER + 3000)
|
||||||
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
|
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
|
||||||
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)
|
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)
|
||||||
|
@ -232,8 +235,8 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
|
||||||
//scnNotification->nmhdr.idFrom = 0;
|
//scnNotification->nmhdr.idFrom = 0;
|
||||||
|
|
||||||
|
|
||||||
#define NPPN_SHOUTDOWN (NPPN_FIRST + 9) // To notify plugins that Notepad++ is about to be shutdowned.
|
#define NPPN_SHUTDOWN (NPPN_FIRST + 9) // To notify plugins that Notepad++ is about to be shutdowned.
|
||||||
//scnNotification->nmhdr.code = NPPN_SHOUTDOWN;
|
//scnNotification->nmhdr.code = NPPN_SHUTDOWN;
|
||||||
//scnNotification->nmhdr.hwndFrom = hwndNpp;
|
//scnNotification->nmhdr.hwndFrom = hwndNpp;
|
||||||
//scnNotification->nmhdr.idFrom = 0;
|
//scnNotification->nmhdr.idFrom = 0;
|
||||||
|
|
||||||
|
|
|
@ -492,6 +492,9 @@ bool Notepad_plus::doOpen(const char *fileName, bool isReadOnly)
|
||||||
(_pEditView->getCurrentBuffer()).determinateFormat(isNotEmpty?UnicodeConvertor.getNewBuf():(char *)(""));
|
(_pEditView->getCurrentBuffer()).determinateFormat(isNotEmpty?UnicodeConvertor.getNewBuf():(char *)(""));
|
||||||
_pEditView->execute(SCI_SETEOLMODE, _pEditView->getCurrentBuffer().getFormat());
|
_pEditView->execute(SCI_SETEOLMODE, _pEditView->getCurrentBuffer().getFormat());
|
||||||
|
|
||||||
|
// detect if it's a binary file (non ascii file)
|
||||||
|
//(_pEditView->getCurrentBuffer()).detectBin(isNotEmpty?UnicodeConvertor.getNewBuf():(char *)(""));
|
||||||
|
|
||||||
UniMode unicodeMode = static_cast<UniMode>(UnicodeConvertor.getEncoding());
|
UniMode unicodeMode = static_cast<UniMode>(UnicodeConvertor.getEncoding());
|
||||||
(_pEditView->getCurrentBuffer()).setUnicodeMode(unicodeMode);
|
(_pEditView->getCurrentBuffer()).setUnicodeMode(unicodeMode);
|
||||||
|
|
||||||
|
@ -2335,6 +2338,7 @@ void Notepad_plus::command(int id)
|
||||||
{
|
{
|
||||||
int eolMode = int(_pEditView->execute(SCI_GETEOLMODE));
|
int eolMode = int(_pEditView->execute(SCI_GETEOLMODE));
|
||||||
_pEditView->execute(WM_PASTE);
|
_pEditView->execute(WM_PASTE);
|
||||||
|
//if (!(_pEditView->getCurrentBuffer()).isBin())
|
||||||
_pEditView->execute(SCI_CONVERTEOLS, eolMode);
|
_pEditView->execute(SCI_CONVERTEOLS, eolMode);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -6386,7 +6390,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||||
|
|
||||||
case NPPM_ENCODESCI:
|
case NPPM_ENCODESCI:
|
||||||
{
|
{
|
||||||
/* convert */
|
// convert
|
||||||
Utf8_16_Read UnicodeConvertor;
|
Utf8_16_Read UnicodeConvertor;
|
||||||
UINT length = 0;
|
UINT length = 0;
|
||||||
char* buffer = NULL;
|
char* buffer = NULL;
|
||||||
|
@ -6429,7 +6433,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||||
|
|
||||||
return um;
|
return um;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
case NPPM_ACTIVATEDOC :
|
case NPPM_ACTIVATEDOC :
|
||||||
{
|
{
|
||||||
int whichView = ((wParam != MAIN_VIEW) && (wParam != SUB_VIEW))?getCurrentView():wParam;
|
int whichView = ((wParam != MAIN_VIEW) && (wParam != SUB_VIEW))?getCurrentView():wParam;
|
||||||
|
@ -6441,6 +6445,30 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/ case NPPM_ACTIVATEDOC :
|
||||||
|
case NPPM_ACTIVATEDOCMENU:
|
||||||
|
{
|
||||||
|
// similar to NPPM_ACTIVEDOC
|
||||||
|
int whichView = ((wParam != MAIN_VIEW) && (wParam != SUB_VIEW))?getCurrentView():wParam;
|
||||||
|
int index = lParam;
|
||||||
|
|
||||||
|
switchEditViewTo(whichView);
|
||||||
|
activateDoc(index);
|
||||||
|
|
||||||
|
if (Message == NPPM_ACTIVATEDOCMENU)
|
||||||
|
{
|
||||||
|
// open here tab menu
|
||||||
|
NMHDR nmhdr;
|
||||||
|
nmhdr.code = NM_RCLICK;
|
||||||
|
|
||||||
|
nmhdr.hwndFrom = (whichView == MAIN_VIEW)?_mainDocTab.getHSelf():_subDocTab.getHSelf();
|
||||||
|
|
||||||
|
nmhdr.idFrom = ::GetDlgCtrlID(nmhdr.hwndFrom);
|
||||||
|
::SendMessage(_hSelf, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_ISCURRENTMACRORECORDED :
|
case WM_ISCURRENTMACRORECORDED :
|
||||||
return (!_macro.empty() && !_recordingMacro);
|
return (!_macro.empty() && !_recordingMacro);
|
||||||
|
|
||||||
|
@ -6764,12 +6792,6 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||||
case WM_QUERYENDSESSION:
|
case WM_QUERYENDSESSION:
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
{
|
{
|
||||||
SCNotification scnN;
|
|
||||||
scnN.nmhdr.code = NPPN_SHOUTDOWN;
|
|
||||||
scnN.nmhdr.hwndFrom = _hSelf;
|
|
||||||
scnN.nmhdr.idFrom = 0;
|
|
||||||
_pluginsManager.notify(&scnN);
|
|
||||||
|
|
||||||
if (_isfullScreen)
|
if (_isfullScreen)
|
||||||
fullScreenToggle();
|
fullScreenToggle();
|
||||||
|
|
||||||
|
@ -6784,6 +6806,12 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||||
|
|
||||||
if (fileCloseAll())
|
if (fileCloseAll())
|
||||||
{
|
{
|
||||||
|
SCNotification scnN;
|
||||||
|
scnN.nmhdr.code = NPPN_SHUTDOWN;
|
||||||
|
scnN.nmhdr.hwndFrom = _hSelf;
|
||||||
|
scnN.nmhdr.idFrom = 0;
|
||||||
|
_pluginsManager.notify(&scnN);
|
||||||
|
|
||||||
_lastRecentFileList.saveLRFL();
|
_lastRecentFileList.saveLRFL();
|
||||||
|
|
||||||
saveScintillaParams(SCIV_PRIMARY);
|
saveScintillaParams(SCIV_PRIMARY);
|
||||||
|
|
|
@ -21,9 +21,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "menuCmdID.h"
|
#include "menuCmdID.h"
|
||||||
|
|
||||||
#define NOTEPAD_PLUS_VERSION "Notepad++ v4.4.1"
|
#define NOTEPAD_PLUS_VERSION "Notepad++ v4.5"
|
||||||
#define VERSION_VALUE "4.4.1\0"
|
#define VERSION_VALUE "4.5\0"
|
||||||
#define VERSION_DIGITALVALUE 4, 4, 1, 0
|
#define VERSION_DIGITALVALUE 4, 5, 0, 0
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION VERSION_DIGITALVALUE
|
FILEVERSION VERSION_DIGITALVALUE
|
||||||
|
|
|
@ -106,7 +106,7 @@ public :
|
||||||
|
|
||||||
Buffer(const Buffer & buf) : _isDirty(buf._isDirty), _doc(buf._doc), _lang(buf._lang),
|
Buffer(const Buffer & buf) : _isDirty(buf._isDirty), _doc(buf._doc), _lang(buf._lang),
|
||||||
_timeStamp(buf._timeStamp), _isReadOnly(buf._isReadOnly), _isSetReadOnly(buf._isSetReadOnly), _pos(buf._pos),
|
_timeStamp(buf._timeStamp), _isReadOnly(buf._isReadOnly), _isSetReadOnly(buf._isSetReadOnly), _pos(buf._pos),
|
||||||
_format(buf._format),_unicodeMode(buf._unicodeMode), _foldState(buf._foldState), _recentTag(buf._recentTag)
|
_format(buf._format),_unicodeMode(buf._unicodeMode), _foldState(buf._foldState), _recentTag(buf._recentTag)/*, _isBinary(false)*/
|
||||||
{
|
{
|
||||||
strcpy(_fullPathName, buf._fullPathName);
|
strcpy(_fullPathName, buf._fullPathName);
|
||||||
strcpy(_userLangExt, buf._userLangExt);
|
strcpy(_userLangExt, buf._userLangExt);
|
||||||
|
@ -252,7 +252,22 @@ public :
|
||||||
}
|
}
|
||||||
_format = WIN_FORMAT;
|
_format = WIN_FORMAT;
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
|
void detectBin(char *data) {
|
||||||
|
size_t len = strlen(data);
|
||||||
|
const size_t lenMax = 2048;
|
||||||
|
|
||||||
|
size_t size2Detect = (len > lenMax)?lenMax:len;
|
||||||
|
for (size_t i = 0 ; i < size2Detect ; i++)
|
||||||
|
{
|
||||||
|
if (isNotPrintableChar(data[i]))
|
||||||
|
{
|
||||||
|
_isBinary = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
*/
|
||||||
formatType getFormat() const {
|
formatType getFormat() const {
|
||||||
return _format;
|
return _format;
|
||||||
};
|
};
|
||||||
|
@ -303,6 +318,8 @@ public :
|
||||||
_pos = pos;
|
_pos = pos;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//bool isBin() const {return _isBinary;};
|
||||||
|
|
||||||
private :
|
private :
|
||||||
bool _isDirty;
|
bool _isDirty;
|
||||||
Document _doc;
|
Document _doc;
|
||||||
|
@ -319,6 +336,7 @@ private :
|
||||||
std::vector<HeaderLineState> _foldState;
|
std::vector<HeaderLineState> _foldState;
|
||||||
long _recentTag;
|
long _recentTag;
|
||||||
static long _recentTagCtr;
|
static long _recentTagCtr;
|
||||||
|
//bool _isBinary;
|
||||||
|
|
||||||
Lang * getCurrentLang() const {
|
Lang * getCurrentLang() const {
|
||||||
int i = 0 ;
|
int i = 0 ;
|
||||||
|
|
|
@ -3054,14 +3054,14 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
hfontbody=CreateFont(16,0,0, 0,
|
hfontbody=CreateFont(16,0,0, 0,
|
||||||
100,
|
100,
|
||||||
FALSE,
|
FALSE,
|
||||||
FALSE,FALSE,ANSI_CHARSET,
|
FALSE,FALSE,DEFAULT_CHARSET,
|
||||||
OUT_DEFAULT_PRECIS,
|
OUT_DEFAULT_PRECIS,
|
||||||
CLIP_DEFAULT_PRECIS,
|
CLIP_DEFAULT_PRECIS,
|
||||||
0,
|
0,
|
||||||
0 ,
|
0 ,
|
||||||
"MS Shell Dlg");
|
"MS Shell Dlg");
|
||||||
hfontheader=CreateFont(18,0,0, 0,FW_HEAVY,FALSE,FALSE,FALSE,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,0,0,"MS Shell Dlg");
|
hfontheader=CreateFont(18,0,0, 0,FW_HEAVY,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,0,0,"MS Shell Dlg");
|
||||||
hfonttitle=CreateFont(20,0,0, 0,FW_HEAVY,FALSE,FALSE,FALSE,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,0,0,"MS Shell Dlg");
|
hfonttitle=CreateFont(20,0,0, 0,FW_HEAVY,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,0,0,"MS Shell Dlg");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue