mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
[RELEASE] v5.4.3 release.
[BUG_FIXED] Fix clickable link styling bug. [BUG_FIXED] Fix vs2008 compiling issue - toolbar always hidden. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@492 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
782dbaf7fd
commit
5b5c317872
@ -1,3 +1,9 @@
|
|||||||
|
Notepad++ v5.4.3 fixed bugs (from v5.4.2) :
|
||||||
|
|
||||||
|
1. Fix clickable link styling bug.
|
||||||
|
2. Fix document tab click launching a new instance bug.
|
||||||
|
|
||||||
|
|
||||||
Notepad++ v5.4.2 fixed bugs (from v5.4.1) :
|
Notepad++ v5.4.2 fixed bugs (from v5.4.1) :
|
||||||
|
|
||||||
1. Fix the localization switcher bug while w/o doLocalConf.xml.
|
1. Fix the localization switcher bug while w/o doLocalConf.xml.
|
||||||
|
Binary file not shown.
@ -17,18 +17,18 @@
|
|||||||
|
|
||||||
; Define the application name
|
; Define the application name
|
||||||
!define APPNAME "Notepad++"
|
!define APPNAME "Notepad++"
|
||||||
!define APPVERSION "5.4.2"
|
!define APPVERSION "5.4.3"
|
||||||
!define APPNAMEANDVERSION "Notepad++ v5.4.2"
|
!define APPNAMEANDVERSION "Notepad++ v5.4.3"
|
||||||
!define APPWEBSITE "http://notepad-plus.sourceforge.net/"
|
!define APPWEBSITE "http://notepad-plus.sourceforge.net/"
|
||||||
|
|
||||||
!define VERSION_MAJOR 5
|
!define VERSION_MAJOR 5
|
||||||
!define VERSION_MINOR 42
|
!define VERSION_MINOR 43
|
||||||
|
|
||||||
; Main Install settings
|
; Main Install settings
|
||||||
Name "${APPNAMEANDVERSION}"
|
Name "${APPNAMEANDVERSION}"
|
||||||
InstallDir "$PROGRAMFILES\Notepad++"
|
InstallDir "$PROGRAMFILES\Notepad++"
|
||||||
InstallDirRegKey HKLM "Software\${APPNAME}" ""
|
InstallDirRegKey HKLM "Software\${APPNAME}" ""
|
||||||
OutFile "..\bin\npp.5.4.2.Installer.exe"
|
OutFile "..\bin\npp.5.4.3.Installer.exe"
|
||||||
|
|
||||||
; GetWindowsVersion
|
; GetWindowsVersion
|
||||||
;
|
;
|
||||||
|
@ -2752,7 +2752,17 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
|||||||
}
|
}
|
||||||
//Else forward notification to window of rebarband
|
//Else forward notification to window of rebarband
|
||||||
REBARBANDINFO rbBand;
|
REBARBANDINFO rbBand;
|
||||||
rbBand.cbSize = sizeof(rbBand);
|
winVer winVersion = (NppParameters::getInstance())->getWinVersion();
|
||||||
|
if (winVersion <= WV_ME)
|
||||||
|
{
|
||||||
|
ZeroMemory(&rbBand, sizeof(REBARBANDINFO));
|
||||||
|
rbBand.cbSize = sizeof(REBARBANDINFO);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ZeroMemory(&rbBand, REBARBANDINFO_V3_SIZE);
|
||||||
|
rbBand.cbSize = REBARBANDINFO_V3_SIZE;
|
||||||
|
}
|
||||||
rbBand.fMask = RBBIM_CHILD;
|
rbBand.fMask = RBBIM_CHILD;
|
||||||
::SendMessage(notifRebar->getHSelf(), RB_GETBANDINFO, lpnm->uBand, (LPARAM)&rbBand);
|
::SendMessage(notifRebar->getHSelf(), RB_GETBANDINFO, lpnm->uBand, (LPARAM)&rbBand);
|
||||||
::SendMessage(rbBand.hwndChild, WM_NOTIFY, 0, (LPARAM)lpnm);
|
::SendMessage(rbBand.hwndChild, WM_NOTIFY, 0, (LPARAM)lpnm);
|
||||||
@ -2864,7 +2874,7 @@ void Notepad_plus::addHotSpot(bool docIsModifing)
|
|||||||
ch = (UCHAR)_pEditView->execute(SCI_GETCHARAT, posBegin2style--);
|
ch = (UCHAR)_pEditView->execute(SCI_GETCHARAT, posBegin2style--);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int style_hotspot = 30;
|
|
||||||
|
|
||||||
int startPos = 0;
|
int startPos = 0;
|
||||||
int endPos = _pEditView->execute(SCI_GETTEXTLENGTH);
|
int endPos = _pEditView->execute(SCI_GETTEXTLENGTH);
|
||||||
@ -2875,7 +2885,7 @@ void Notepad_plus::addHotSpot(bool docIsModifing)
|
|||||||
_pEditView->execute(SCI_SETTARGETEND, endPos);
|
_pEditView->execute(SCI_SETTARGETEND, endPos);
|
||||||
|
|
||||||
vector<pair<int, int> > hotspotStylers;
|
vector<pair<int, int> > hotspotStylers;
|
||||||
|
int style_hotspot = 30;
|
||||||
int posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(urlHttpRegExpr), (LPARAM)urlHttpRegExpr);
|
int posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(urlHttpRegExpr), (LPARAM)urlHttpRegExpr);
|
||||||
|
|
||||||
while (posFound != -1)
|
while (posFound != -1)
|
||||||
@ -2913,11 +2923,22 @@ void Notepad_plus::addHotSpot(bool docIsModifing)
|
|||||||
pair<int, int> p(style_hotspot, idStyle);
|
pair<int, int> p(style_hotspot, idStyle);
|
||||||
hotspotStylers.push_back(p);
|
hotspotStylers.push_back(p);
|
||||||
int activeFG = 0xFF0000;
|
int activeFG = 0xFF0000;
|
||||||
|
char fontNameA[128];
|
||||||
|
|
||||||
Style hotspotStyle;
|
Style hotspotStyle;
|
||||||
|
|
||||||
hotspotStyle._styleID = style_hotspot;
|
hotspotStyle._styleID = style_hotspot;
|
||||||
_pEditView->execute(SCI_STYLEGETFONT, idStyle, (LPARAM)hotspotStyle._fontName);
|
_pEditView->execute(SCI_STYLEGETFONT, idStyle, (LPARAM)fontNameA);
|
||||||
|
TCHAR *generic_fontname = new TCHAR[128];
|
||||||
|
#ifdef UNICODE
|
||||||
|
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
|
||||||
|
const wchar_t * fontNameW = wmc->char2wchar(fontNameA, _nativeLangEncoding);
|
||||||
|
lstrcpy(generic_fontname, fontNameW);
|
||||||
|
#else
|
||||||
|
lstrcpy(generic_fontname, fontNameA);
|
||||||
|
#endif
|
||||||
|
hotspotStyle._fontName = generic_fontname;
|
||||||
|
|
||||||
hotspotStyle._fgColor = _pEditView->execute(SCI_STYLEGETFORE, idStyle);
|
hotspotStyle._fgColor = _pEditView->execute(SCI_STYLEGETFORE, idStyle);
|
||||||
hotspotStyle._bgColor = _pEditView->execute(SCI_STYLEGETBACK, idStyle);
|
hotspotStyle._bgColor = _pEditView->execute(SCI_STYLEGETBACK, idStyle);
|
||||||
hotspotStyle._fontSize = _pEditView->execute(SCI_STYLEGETSIZE, idStyle);
|
hotspotStyle._fontSize = _pEditView->execute(SCI_STYLEGETSIZE, idStyle);
|
||||||
@ -2932,7 +2953,7 @@ void Notepad_plus::addHotSpot(bool docIsModifing)
|
|||||||
if (urlAction == 2)
|
if (urlAction == 2)
|
||||||
hotspotStyle._fontStyle |= FONTSTYLE_UNDERLINE;
|
hotspotStyle._fontStyle |= FONTSTYLE_UNDERLINE;
|
||||||
|
|
||||||
_pEditView->setStyle(hotspotStyle);
|
_pEditView->setHotspotStyle(hotspotStyle);
|
||||||
|
|
||||||
_pEditView->execute(SCI_STYLESETHOTSPOT, style_hotspot, TRUE);
|
_pEditView->execute(SCI_STYLESETHOTSPOT, style_hotspot, TRUE);
|
||||||
_pEditView->execute(SCI_SETHOTSPOTACTIVEFORE, TRUE, activeFG);
|
_pEditView->execute(SCI_SETHOTSPOTACTIVEFORE, TRUE, activeFG);
|
||||||
@ -2947,11 +2968,9 @@ void Notepad_plus::addHotSpot(bool docIsModifing)
|
|||||||
_pEditView->execute(SCI_SETTARGETSTART, posFound + foundTextLen);
|
_pEditView->execute(SCI_SETTARGETSTART, posFound + foundTextLen);
|
||||||
_pEditView->execute(SCI_SETTARGETEND, endPos);
|
_pEditView->execute(SCI_SETTARGETEND, endPos);
|
||||||
|
|
||||||
|
|
||||||
posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(urlHttpRegExpr), (LPARAM)urlHttpRegExpr);
|
posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(urlHttpRegExpr), (LPARAM)urlHttpRegExpr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_pEditView->execute(SCI_STARTSTYLING, endStyle, 0xFF);
|
_pEditView->execute(SCI_STARTSTYLING, endStyle, 0xFF);
|
||||||
_pEditView->execute(SCI_SETSTYLING, 0, 0);
|
_pEditView->execute(SCI_SETSTYLING, 0, 0);
|
||||||
}
|
}
|
||||||
@ -9779,22 +9798,6 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask) {
|
|||||||
setDisplayFormat(buffer->getFormat());
|
setDisplayFormat(buffer->getFormat());
|
||||||
enableConvertMenuItems(buffer->getFormat());
|
enableConvertMenuItems(buffer->getFormat());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & (BufferChangeReadonly))
|
|
||||||
{
|
|
||||||
checkDocState();
|
|
||||||
|
|
||||||
Buffer * curBuf = _pEditView->getCurrentBuffer();
|
|
||||||
bool isSysReadOnly = curBuf->getFileReadOnly();
|
|
||||||
bool isUserReadOnly = curBuf->getUserReadOnly();
|
|
||||||
|
|
||||||
// To notify plugins ro status is changed
|
|
||||||
SCNotification scnN;
|
|
||||||
scnN.nmhdr.code = NPPN_READONLYCHANGED;
|
|
||||||
scnN.nmhdr.hwndFrom = buffer;
|
|
||||||
scnN.nmhdr.idFrom = int(isSysReadOnly || isUserReadOnly);
|
|
||||||
_pluginsManager.notify(&scnN);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notepad_plus::notifyBufferActivated(BufferID bufid, int view) {
|
void Notepad_plus::notifyBufferActivated(BufferID bufid, int view) {
|
||||||
|
@ -381,6 +381,7 @@ private:
|
|||||||
} _scintillaCtrls4Plugins;
|
} _scintillaCtrls4Plugins;
|
||||||
|
|
||||||
vector<pair<int, int> > _hideLinesMarks;
|
vector<pair<int, int> > _hideLinesMarks;
|
||||||
|
StyleArray _hotspotStyles;
|
||||||
|
|
||||||
static LRESULT CALLBACK Notepad_plus_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
|
static LRESULT CALLBACK Notepad_plus_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
|
||||||
LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
|
LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
|
||||||
|
@ -1972,7 +1972,8 @@ void FindIncrementDlg::markSelectedTextInc(bool enable, FindOption *opt)
|
|||||||
_pFRDlg->markAllInc(text2Find, opt);
|
_pFRDlg->markAllInc(text2Find, opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindIncrementDlg::addToRebar(ReBar * rebar) {
|
void FindIncrementDlg::addToRebar(ReBar * rebar)
|
||||||
|
{
|
||||||
if(_pRebar)
|
if(_pRebar)
|
||||||
return;
|
return;
|
||||||
HWND hRebar = rebar->getHSelf();
|
HWND hRebar = rebar->getHSelf();
|
||||||
@ -1980,8 +1981,18 @@ void FindIncrementDlg::addToRebar(ReBar * rebar) {
|
|||||||
RECT client;
|
RECT client;
|
||||||
getClientRect(client);
|
getClientRect(client);
|
||||||
|
|
||||||
ZeroMemory(&_rbBand, sizeof(REBARBANDINFO));
|
winVer winVersion = (NppParameters::getInstance())->getWinVersion();
|
||||||
_rbBand.cbSize = sizeof(REBARBANDINFO);
|
if (winVersion <= WV_ME)
|
||||||
|
{
|
||||||
|
ZeroMemory(&_rbBand, sizeof(REBARBANDINFO));
|
||||||
|
_rbBand.cbSize = sizeof(REBARBANDINFO);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ZeroMemory(&_rbBand, REBARBANDINFO_V3_SIZE);
|
||||||
|
_rbBand.cbSize = REBARBANDINFO_V3_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
_rbBand.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE |
|
_rbBand.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE |
|
||||||
RBBIM_SIZE | RBBIM_ID;
|
RBBIM_SIZE | RBBIM_ID;
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScintillaEditView::setSpecialStyle(Style & styleToSet)
|
void ScintillaEditView::setSpecialStyle(const Style & styleToSet)
|
||||||
{
|
{
|
||||||
int styleID = styleToSet._styleID;
|
int styleID = styleToSet._styleID;
|
||||||
if ( styleToSet._colorStyle & COLORSTYLE_FOREGROUND )
|
if ( styleToSet._colorStyle & COLORSTYLE_FOREGROUND )
|
||||||
@ -408,6 +408,19 @@ void ScintillaEditView::setSpecialStyle(Style & styleToSet)
|
|||||||
execute(SCI_STYLESETSIZE, styleID, styleToSet._fontSize);
|
execute(SCI_STYLESETSIZE, styleID, styleToSet._fontSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScintillaEditView::setHotspotStyle(Style& styleToSet)
|
||||||
|
{
|
||||||
|
StyleMap* styleMap;
|
||||||
|
if( _hotspotStyles.find(_currentBuffer) == _hotspotStyles.end() )
|
||||||
|
{
|
||||||
|
_hotspotStyles[_currentBuffer] = new StyleMap;
|
||||||
|
}
|
||||||
|
styleMap = _hotspotStyles[_currentBuffer];
|
||||||
|
(*styleMap)[styleToSet._styleID] = styleToSet;
|
||||||
|
|
||||||
|
setStyle(styleToSet);
|
||||||
|
}
|
||||||
|
|
||||||
void ScintillaEditView::setStyle(Style styleToSet)
|
void ScintillaEditView::setStyle(Style styleToSet)
|
||||||
{
|
{
|
||||||
GlobalOverride & go = _pParameter->getGlobalOverrideStyle();
|
GlobalOverride & go = _pParameter->getGlobalOverrideStyle();
|
||||||
@ -1290,6 +1303,16 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
|||||||
execute(SCI_SETUSETABS, !((NppParameters::getInstance())->getNppGUI())._tabReplacedBySpace);
|
execute(SCI_SETUSETABS, !((NppParameters::getInstance())->getNppGUI())._tabReplacedBySpace);
|
||||||
int bitsNeeded = execute(SCI_GETSTYLEBITSNEEDED);
|
int bitsNeeded = execute(SCI_GETSTYLEBITSNEEDED);
|
||||||
execute(SCI_SETSTYLEBITS, bitsNeeded);
|
execute(SCI_SETSTYLEBITS, bitsNeeded);
|
||||||
|
|
||||||
|
// Reapply the hotspot styles.
|
||||||
|
if (_hotspotStyles.find(_currentBuffer) != _hotspotStyles.end())
|
||||||
|
{
|
||||||
|
StyleMap* currentStyleMap = _hotspotStyles[_currentBuffer];
|
||||||
|
for (StyleMap::iterator it(currentStyleMap->begin()); it != currentStyleMap->end(); ++it)
|
||||||
|
{
|
||||||
|
setStyle(it->second);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferID ScintillaEditView::attachDefaultDoc()
|
BufferID ScintillaEditView::attachDefaultDoc()
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
#define SCINTILLA_EDIT_VIEW_H
|
#define SCINTILLA_EDIT_VIEW_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "Scintilla.h"
|
#include "Scintilla.h"
|
||||||
#include "ScintillaRef.h"
|
#include "ScintillaRef.h"
|
||||||
@ -161,6 +163,16 @@ public:
|
|||||||
if ((!_refCount)&&(_hLib))
|
if ((!_refCount)&&(_hLib))
|
||||||
{
|
{
|
||||||
::FreeLibrary(_hLib);
|
::FreeLibrary(_hLib);
|
||||||
|
|
||||||
|
for (BufferStyleMap::iterator it(_hotspotStyles.begin()); it != _hotspotStyles.end(); ++it )
|
||||||
|
{
|
||||||
|
for (StyleMap::iterator it2(it->second->begin()) ; it2 != it->second->end() ; ++it2)
|
||||||
|
{
|
||||||
|
if (it2->second._fontName != NULL)
|
||||||
|
delete [] it2->second._fontName;
|
||||||
|
}
|
||||||
|
delete it->second;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
virtual void destroy()
|
virtual void destroy()
|
||||||
@ -581,27 +593,24 @@ protected:
|
|||||||
|
|
||||||
SCINTILLA_FUNC _pScintillaFunc;
|
SCINTILLA_FUNC _pScintillaFunc;
|
||||||
SCINTILLA_PTR _pScintillaPtr;
|
SCINTILLA_PTR _pScintillaPtr;
|
||||||
|
|
||||||
static WNDPROC _scintillaDefaultProc;
|
static WNDPROC _scintillaDefaultProc;
|
||||||
CallWindowProcFunc _callWindowProc;
|
CallWindowProcFunc _callWindowProc;
|
||||||
|
|
||||||
BufferID attachDefaultDoc();
|
BufferID attachDefaultDoc();
|
||||||
|
|
||||||
//Store the current buffer so it can be retrieved later
|
//Store the current buffer so it can be retrieved later
|
||||||
BufferID _currentBufferID;
|
BufferID _currentBufferID;
|
||||||
Buffer * _currentBuffer;
|
Buffer * _currentBuffer;
|
||||||
|
|
||||||
folderStyle _folderStyle;
|
folderStyle _folderStyle;
|
||||||
|
|
||||||
NppParameters *_pParameter;
|
NppParameters *_pParameter;
|
||||||
|
|
||||||
int _codepage;
|
int _codepage;
|
||||||
int _oemCodepage;
|
int _oemCodepage;
|
||||||
|
|
||||||
bool _lineNumbersShown;
|
bool _lineNumbersShown;
|
||||||
|
|
||||||
bool _wrapRestoreNeeded;
|
bool _wrapRestoreNeeded;
|
||||||
|
|
||||||
|
typedef std::map<int, Style> StyleMap;
|
||||||
|
typedef std::map<BufferID, StyleMap*> BufferStyleMap;
|
||||||
|
BufferStyleMap _hotspotStyles;
|
||||||
|
|
||||||
//Lexers and Styling
|
//Lexers and Styling
|
||||||
void defineDocType(LangType typeDoc); //setup stylers for active document
|
void defineDocType(LangType typeDoc); //setup stylers for active document
|
||||||
void restyleBuffer();
|
void restyleBuffer();
|
||||||
@ -609,9 +618,10 @@ protected:
|
|||||||
void setKeywords(LangType langType, const char *keywords, int index);
|
void setKeywords(LangType langType, const char *keywords, int index);
|
||||||
void setLexer(int lexerID, LangType langType, int whichList);
|
void setLexer(int lexerID, LangType langType, int whichList);
|
||||||
inline void makeStyle(LangType langType, const TCHAR **keywordArray = NULL);
|
inline void makeStyle(LangType langType, const TCHAR **keywordArray = NULL);
|
||||||
|
void setHotspotStyle(Style& styleToSet);
|
||||||
void setStyle(Style styleToSet); //NOT by reference (style edited)
|
void setStyle(Style styleToSet); //NOT by reference (style edited)
|
||||||
void setSpecialStyle(Style & styleToSet); //by reference
|
void setSpecialStyle(const Style & styleToSet); //by reference
|
||||||
void setSpecialIndicator(Style & styleToSet) {
|
void setSpecialIndicator(const Style & styleToSet) {
|
||||||
execute(SCI_INDICSETFORE, styleToSet._styleID, styleToSet._bgColor);
|
execute(SCI_INDICSETFORE, styleToSet._styleID, styleToSet._bgColor);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
//#include "..\..\resource.h"
|
//#include "..\..\resource.h"
|
||||||
#include "ToolBar.h"
|
#include "ToolBar.h"
|
||||||
#include "Shortcut.h"
|
#include "Shortcut.h"
|
||||||
|
#include "Parameters.h"
|
||||||
|
|
||||||
const int WS_TOOLBARSTYLE = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TBSTYLE_TOOLTIPS |TBSTYLE_FLAT | CCS_TOP | BTNS_AUTOSIZE | CCS_NOPARENTALIGN | CCS_NORESIZE | CCS_NODIVIDER;
|
const int WS_TOOLBARSTYLE = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TBSTYLE_TOOLTIPS |TBSTYLE_FLAT | CCS_TOP | BTNS_AUTOSIZE | CCS_NOPARENTALIGN | CCS_NORESIZE | CCS_NODIVIDER;
|
||||||
|
|
||||||
@ -259,8 +260,18 @@ void ToolBar::addToRebar(ReBar * rebar) {
|
|||||||
return;
|
return;
|
||||||
_pRebar = rebar;
|
_pRebar = rebar;
|
||||||
|
|
||||||
ZeroMemory(&_rbBand, sizeof(REBARBANDINFO));
|
winVer winVersion = (NppParameters::getInstance())->getWinVersion();
|
||||||
_rbBand.cbSize = sizeof(REBARBANDINFO);
|
if (winVersion <= WV_ME)
|
||||||
|
{
|
||||||
|
ZeroMemory(&_rbBand, sizeof(REBARBANDINFO));
|
||||||
|
_rbBand.cbSize = sizeof(REBARBANDINFO);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ZeroMemory(&_rbBand, REBARBANDINFO_V3_SIZE);
|
||||||
|
_rbBand.cbSize = REBARBANDINFO_V3_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
_rbBand.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE |
|
_rbBand.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE |
|
||||||
RBBIM_SIZE | RBBIM_IDEALSIZE | RBBIM_ID;
|
RBBIM_SIZE | RBBIM_IDEALSIZE | RBBIM_ID;
|
||||||
|
|
||||||
@ -296,7 +307,8 @@ void ReBar::init(HINSTANCE hInst, HWND hPere)
|
|||||||
::SendMessage(_hSelf, RB_SETBARINFO, 0, (LPARAM)&rbi);
|
::SendMessage(_hSelf, RB_SETBARINFO, 0, (LPARAM)&rbi);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReBar::addBand(REBARBANDINFO * rBand, bool useID) {
|
bool ReBar::addBand(REBARBANDINFO * rBand, bool useID)
|
||||||
|
{
|
||||||
if (rBand->fMask & RBBIM_STYLE)
|
if (rBand->fMask & RBBIM_STYLE)
|
||||||
rBand->fStyle |= RBBS_GRIPPERALWAYS;
|
rBand->fStyle |= RBBS_GRIPPERALWAYS;
|
||||||
else
|
else
|
||||||
@ -313,24 +325,39 @@ bool ReBar::addBand(REBARBANDINFO * rBand, bool useID) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReBar::reNew(int id, REBARBANDINFO * rBand) {
|
void ReBar::reNew(int id, REBARBANDINFO * rBand)
|
||||||
|
{
|
||||||
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||||
::SendMessage(_hSelf, RB_SETBANDINFO, (WPARAM)index, (LPARAM)rBand);
|
::SendMessage(_hSelf, RB_SETBANDINFO, (WPARAM)index, (LPARAM)rBand);
|
||||||
};
|
};
|
||||||
|
|
||||||
void ReBar::removeBand(int id) {
|
void ReBar::removeBand(int id)
|
||||||
|
{
|
||||||
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||||
if (id >= REBAR_BAR_EXTERNAL)
|
if (id >= REBAR_BAR_EXTERNAL)
|
||||||
releaseID(id);
|
releaseID(id);
|
||||||
::SendMessage(_hSelf, RB_DELETEBAND, (WPARAM)index, (LPARAM)0);
|
::SendMessage(_hSelf, RB_DELETEBAND, (WPARAM)index, (LPARAM)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReBar::setIDVisible(int id, bool show) {
|
void ReBar::setIDVisible(int id, bool show)
|
||||||
|
{
|
||||||
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||||
if (index == -1 )
|
if (index == -1 )
|
||||||
return; //error
|
return; //error
|
||||||
|
|
||||||
REBARBANDINFO rbBand;
|
REBARBANDINFO rbBand;
|
||||||
rbBand.cbSize = sizeof(rbBand);
|
winVer winVersion = (NppParameters::getInstance())->getWinVersion();
|
||||||
|
if (winVersion <= WV_ME)
|
||||||
|
{
|
||||||
|
ZeroMemory(&rbBand, sizeof(REBARBANDINFO));
|
||||||
|
rbBand.cbSize = sizeof(REBARBANDINFO);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ZeroMemory(&rbBand, REBARBANDINFO_V3_SIZE);
|
||||||
|
rbBand.cbSize = REBARBANDINFO_V3_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
rbBand.fMask = RBBIM_STYLE;
|
rbBand.fMask = RBBIM_STYLE;
|
||||||
::SendMessage(_hSelf, RB_GETBANDINFO, (WPARAM)index, (LPARAM)&rbBand);
|
::SendMessage(_hSelf, RB_GETBANDINFO, (WPARAM)index, (LPARAM)&rbBand);
|
||||||
if (show)
|
if (show)
|
||||||
@ -340,28 +367,46 @@ void ReBar::setIDVisible(int id, bool show) {
|
|||||||
::SendMessage(_hSelf, RB_SETBANDINFO, (WPARAM)index, (LPARAM)&rbBand);
|
::SendMessage(_hSelf, RB_SETBANDINFO, (WPARAM)index, (LPARAM)&rbBand);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReBar::getIDVisible(int id) {
|
bool ReBar::getIDVisible(int id)
|
||||||
|
{
|
||||||
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||||
if (index == -1 )
|
if (index == -1 )
|
||||||
return false; //error
|
return false; //error
|
||||||
REBARBANDINFO rbBand;
|
REBARBANDINFO rbBand;
|
||||||
rbBand.cbSize = sizeof(rbBand);
|
winVer winVersion = (NppParameters::getInstance())->getWinVersion();
|
||||||
|
if (winVersion <= WV_ME)
|
||||||
|
{
|
||||||
|
ZeroMemory(&rbBand, sizeof(REBARBANDINFO));
|
||||||
|
rbBand.cbSize = sizeof(REBARBANDINFO);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ZeroMemory(&rbBand, REBARBANDINFO_V3_SIZE);
|
||||||
|
rbBand.cbSize = REBARBANDINFO_V3_SIZE;
|
||||||
|
}
|
||||||
rbBand.fMask = RBBIM_STYLE;
|
rbBand.fMask = RBBIM_STYLE;
|
||||||
::SendMessage(_hSelf, RB_GETBANDINFO, (WPARAM)index, (LPARAM)&rbBand);
|
::SendMessage(_hSelf, RB_GETBANDINFO, (WPARAM)index, (LPARAM)&rbBand);
|
||||||
return ((rbBand.fStyle & RBBS_HIDDEN) == 0);
|
return ((rbBand.fStyle & RBBS_HIDDEN) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ReBar::getNewID() {
|
int ReBar::getNewID()
|
||||||
|
{
|
||||||
int idToUse = REBAR_BAR_EXTERNAL;
|
int idToUse = REBAR_BAR_EXTERNAL;
|
||||||
int curVal = 0;
|
int curVal = 0;
|
||||||
size_t size = usedIDs.size();
|
size_t size = usedIDs.size();
|
||||||
for(size_t i = 0; i < size; i++) {
|
for(size_t i = 0; i < size; i++)
|
||||||
|
{
|
||||||
curVal = usedIDs.at(i);
|
curVal = usedIDs.at(i);
|
||||||
if (curVal < idToUse) {
|
if (curVal < idToUse)
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
} else if (curVal == idToUse) {
|
}
|
||||||
|
else if (curVal == idToUse)
|
||||||
|
{
|
||||||
idToUse++;
|
idToUse++;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
break; //found gap
|
break; //found gap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -370,20 +415,26 @@ int ReBar::getNewID() {
|
|||||||
return idToUse;
|
return idToUse;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReBar::releaseID(int id) {
|
void ReBar::releaseID(int id)
|
||||||
|
{
|
||||||
size_t size = usedIDs.size();
|
size_t size = usedIDs.size();
|
||||||
for(size_t i = 0; i < size; i++) {
|
for(size_t i = 0; i < size; i++)
|
||||||
if (usedIDs.at(i) == id) {
|
{
|
||||||
|
if (usedIDs.at(i) == id)
|
||||||
|
{
|
||||||
usedIDs.erase(usedIDs.begin()+i);
|
usedIDs.erase(usedIDs.begin()+i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReBar::isIDTaken(int id) {
|
bool ReBar::isIDTaken(int id)
|
||||||
|
{
|
||||||
size_t size = usedIDs.size();
|
size_t size = usedIDs.size();
|
||||||
for(size_t i = 0; i < size; i++) {
|
for(size_t i = 0; i < size; i++)
|
||||||
if (usedIDs.at(i) == id) {
|
{
|
||||||
|
if (usedIDs.at(i) == id)
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
#ifndef RESOURCE_H
|
#ifndef RESOURCE_H
|
||||||
#define RESOURCE_H
|
#define RESOURCE_H
|
||||||
|
|
||||||
#define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v5.4.2")
|
#define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v5.4.3")
|
||||||
#define VERSION_VALUE TEXT("5.42\0") // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
#define VERSION_VALUE TEXT("5.43\0") // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
||||||
#define VERSION_DIGITALVALUE 5, 4, 2, 0
|
#define VERSION_DIGITALVALUE 5, 4, 3, 0
|
||||||
|
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
#define UNICODE_ANSI_MODE TEXT("(UNICODE)")
|
#define UNICODE_ANSI_MODE TEXT("(UNICODE)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user