Merge branch 'master' of https://github.com/chcg/notepad-plus-plus into GWLP_648
This commit is contained in:
commit
e1d8e055c8
@ -129,16 +129,11 @@ BOOL Process::run()
|
|||||||
|
|
||||||
void Process::listenerStdOut()
|
void Process::listenerStdOut()
|
||||||
{
|
{
|
||||||
//BOOL Result = 0;
|
|
||||||
//DWORD size = 0;
|
|
||||||
DWORD bytesAvail = 0;
|
DWORD bytesAvail = 0;
|
||||||
BOOL result = 0;
|
BOOL result = 0;
|
||||||
HANDLE hListenerEvent = ::OpenEvent(EVENT_ALL_ACCESS, FALSE, TEXT("listenerEvent"));
|
HANDLE hListenerEvent = ::OpenEvent(EVENT_ALL_ACCESS, FALSE, TEXT("listenerEvent"));
|
||||||
//FILE *fp = NULL;
|
|
||||||
|
|
||||||
int taille = 0;
|
|
||||||
TCHAR bufferOut[MAX_LINE_LENGTH + 1];
|
TCHAR bufferOut[MAX_LINE_LENGTH + 1];
|
||||||
//TCHAR bufferErr[MAX_LINE_LENGTH + 1];
|
|
||||||
|
|
||||||
int nExitCode = STILL_ACTIVE;
|
int nExitCode = STILL_ACTIVE;
|
||||||
|
|
||||||
@ -150,8 +145,7 @@ void Process::listenerStdOut()
|
|||||||
while (goOn)
|
while (goOn)
|
||||||
{ // got data
|
{ // got data
|
||||||
memset(bufferOut,0x00,MAX_LINE_LENGTH + 1);
|
memset(bufferOut,0x00,MAX_LINE_LENGTH + 1);
|
||||||
//memset(bufferErr,0x00,MAX_LINE_LENGTH + 1);
|
int taille = sizeof(bufferOut) - sizeof(TCHAR);
|
||||||
taille = sizeof(bufferOut) - sizeof(TCHAR);
|
|
||||||
|
|
||||||
Sleep(50);
|
Sleep(50);
|
||||||
|
|
||||||
@ -171,7 +165,7 @@ void Process::listenerStdOut()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//outbytesRead = strlen(bufferOut);
|
|
||||||
bufferOut[outbytesRead] = '\0';
|
bufferOut[outbytesRead] = '\0';
|
||||||
generic_string s;
|
generic_string s;
|
||||||
s.assign(bufferOut);
|
s.assign(bufferOut);
|
||||||
@ -198,19 +192,13 @@ void Process::listenerStdOut()
|
|||||||
|
|
||||||
void Process::listenerStdErr()
|
void Process::listenerStdErr()
|
||||||
{
|
{
|
||||||
//BOOL Result = 0;
|
|
||||||
//DWORD size = 0;
|
|
||||||
DWORD bytesAvail = 0;
|
DWORD bytesAvail = 0;
|
||||||
BOOL result = 0;
|
BOOL result = 0;
|
||||||
HANDLE hListenerEvent = ::OpenEvent(EVENT_ALL_ACCESS, FALSE, TEXT("listenerStdErrEvent"));
|
HANDLE hListenerEvent = ::OpenEvent(EVENT_ALL_ACCESS, FALSE, TEXT("listenerStdErrEvent"));
|
||||||
|
|
||||||
int taille = 0;
|
int taille = 0;
|
||||||
//TCHAR bufferOut[MAX_LINE_LENGTH + 1];
|
|
||||||
TCHAR bufferErr[MAX_LINE_LENGTH + 1];
|
TCHAR bufferErr[MAX_LINE_LENGTH + 1];
|
||||||
|
|
||||||
int nExitCode = STILL_ACTIVE;
|
int nExitCode = STILL_ACTIVE;
|
||||||
|
|
||||||
DWORD errbytesRead;
|
|
||||||
|
|
||||||
::ResumeThread(_hProcessThread);
|
::ResumeThread(_hProcessThread);
|
||||||
|
|
||||||
@ -221,7 +209,7 @@ void Process::listenerStdErr()
|
|||||||
taille = sizeof(bufferErr) - sizeof(TCHAR);
|
taille = sizeof(bufferErr) - sizeof(TCHAR);
|
||||||
|
|
||||||
Sleep(50);
|
Sleep(50);
|
||||||
|
DWORD errbytesRead;
|
||||||
if (!::PeekNamedPipe(_hPipeErrR, bufferErr, taille, &errbytesRead, &bytesAvail, NULL))
|
if (!::PeekNamedPipe(_hPipeErrR, bufferErr, taille, &errbytesRead, &bytesAvail, NULL))
|
||||||
{
|
{
|
||||||
bytesAvail = 0;
|
bytesAvail = 0;
|
||||||
@ -238,7 +226,6 @@ void Process::listenerStdErr()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//outbytesRead = strlen(bufferOut);
|
|
||||||
bufferErr[errbytesRead] = '\0';
|
bufferErr[errbytesRead] = '\0';
|
||||||
generic_string s;
|
generic_string s;
|
||||||
s.assign(bufferErr);
|
s.assign(bufferErr);
|
||||||
|
@ -956,12 +956,12 @@ int Notepad_plus::getHtmlXmlEncoding(const TCHAR *fileName) const
|
|||||||
if (posFound != -1 && posFound != -2)
|
if (posFound != -1 && posFound != -2)
|
||||||
{
|
{
|
||||||
const char *encodingBlockRegExpr = "encoding[ \\t]*=[ \\t]*\"[^\".]+\"";
|
const char *encodingBlockRegExpr = "encoding[ \\t]*=[ \\t]*\"[^\".]+\"";
|
||||||
posFound = _invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(encodingBlockRegExpr), (LPARAM)encodingBlockRegExpr);
|
_invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(encodingBlockRegExpr), (LPARAM)encodingBlockRegExpr);
|
||||||
|
|
||||||
const char *encodingRegExpr = "\".+\"";
|
const char *encodingRegExpr = "\".+\"";
|
||||||
posFound = _invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(encodingRegExpr), (LPARAM)encodingRegExpr);
|
_invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(encodingRegExpr), (LPARAM)encodingRegExpr);
|
||||||
|
|
||||||
posFound = _invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(encodingAliasRegExpr), (LPARAM)encodingAliasRegExpr);
|
_invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(encodingAliasRegExpr), (LPARAM)encodingAliasRegExpr);
|
||||||
|
|
||||||
startPos = int(_invisibleEditView.execute(SCI_GETTARGETSTART));
|
startPos = int(_invisibleEditView.execute(SCI_GETTARGETSTART));
|
||||||
endPos = int(_invisibleEditView.execute(SCI_GETTARGETEND));
|
endPos = int(_invisibleEditView.execute(SCI_GETTARGETEND));
|
||||||
@ -998,9 +998,9 @@ int Notepad_plus::getHtmlXmlEncoding(const TCHAR *fileName) const
|
|||||||
if (posFound == -1 || posFound == -2)
|
if (posFound == -1 || posFound == -2)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
posFound = _invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(charsetBlock), (LPARAM)charsetBlock);
|
_invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(charsetBlock), (LPARAM)charsetBlock);
|
||||||
posFound = _invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(intermediaire), (LPARAM)intermediaire);
|
_invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(intermediaire), (LPARAM)intermediaire);
|
||||||
posFound = _invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(encodingStrRE), (LPARAM)encodingStrRE);
|
_invisibleEditView.execute(SCI_SEARCHINTARGET, strlen(encodingStrRE), (LPARAM)encodingStrRE);
|
||||||
|
|
||||||
startPos = int(_invisibleEditView.execute(SCI_GETTARGETSTART));
|
startPos = int(_invisibleEditView.execute(SCI_GETTARGETSTART));
|
||||||
endPos = int(_invisibleEditView.execute(SCI_GETTARGETEND));
|
endPos = int(_invisibleEditView.execute(SCI_GETTARGETEND));
|
||||||
@ -6074,7 +6074,8 @@ void Notepad_plus::showQuote(const char *quote, const char *quoter, bool doTroll
|
|||||||
void Notepad_plus::launchDocumentBackupTask()
|
void Notepad_plus::launchDocumentBackupTask()
|
||||||
{
|
{
|
||||||
HANDLE hThread = ::CreateThread(NULL, 0, backupDocument, NULL, 0, NULL);
|
HANDLE hThread = ::CreateThread(NULL, 0, backupDocument, NULL, 0, NULL);
|
||||||
::CloseHandle(hThread);
|
if (hThread)
|
||||||
|
::CloseHandle(hThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI Notepad_plus::backupDocument(void * /*param*/)
|
DWORD WINAPI Notepad_plus::backupDocument(void * /*param*/)
|
||||||
@ -6150,7 +6151,6 @@ bool Notepad_plus::undoStreamComment()
|
|||||||
generic_string white_space(TEXT(" "));
|
generic_string white_space(TEXT(" "));
|
||||||
int start_comment_length = start_comment.length();
|
int start_comment_length = start_comment.length();
|
||||||
int end_comment_length = end_comment.length();
|
int end_comment_length = end_comment.length();
|
||||||
int startCommentLength, endCommentLength;
|
|
||||||
|
|
||||||
do { // do as long as stream-comments are within selection
|
do { // do as long as stream-comments are within selection
|
||||||
|
|
||||||
@ -6166,7 +6166,7 @@ bool Notepad_plus::undoStreamComment()
|
|||||||
|
|
||||||
//-- First, search all start_comment and end_comment before and after the selectionStart and selectionEnd position.
|
//-- First, search all start_comment and end_comment before and after the selectionStart and selectionEnd position.
|
||||||
const int iSelStart=0, iSelEnd=1;
|
const int iSelStart=0, iSelEnd=1;
|
||||||
#define N_CMNT 2
|
const size_t N_CMNT = 2;
|
||||||
int posStartCommentBefore[N_CMNT], posEndCommentBefore[N_CMNT], posStartCommentAfter[N_CMNT], posEndCommentAfter[N_CMNT];
|
int posStartCommentBefore[N_CMNT], posEndCommentBefore[N_CMNT], posStartCommentAfter[N_CMNT], posEndCommentAfter[N_CMNT];
|
||||||
bool blnStartCommentBefore[N_CMNT], blnEndCommentBefore[N_CMNT], blnStartCommentAfter[N_CMNT], blnEndCommentAfter[N_CMNT];
|
bool blnStartCommentBefore[N_CMNT], blnEndCommentBefore[N_CMNT], blnStartCommentAfter[N_CMNT], blnEndCommentAfter[N_CMNT];
|
||||||
int posStartComment, posEndComment;
|
int posStartComment, posEndComment;
|
||||||
@ -6238,8 +6238,8 @@ bool Notepad_plus::undoStreamComment()
|
|||||||
//-- Ok, there are valid start-comment and valid end-comment around the caret-position.
|
//-- Ok, there are valid start-comment and valid end-comment around the caret-position.
|
||||||
// Now, un-comment stream-comment:
|
// Now, un-comment stream-comment:
|
||||||
retVal = true;
|
retVal = true;
|
||||||
startCommentLength = start_comment_length;
|
int startCommentLength = start_comment_length;
|
||||||
endCommentLength = end_comment_length;
|
int endCommentLength = end_comment_length;
|
||||||
//-- First delete end-comment, so that posStartCommentBefore does not change!
|
//-- First delete end-comment, so that posStartCommentBefore does not change!
|
||||||
//-- Get character before end-comment to decide, if there is a white character before the end-comment, which will be removed too!
|
//-- Get character before end-comment to decide, if there is a white character before the end-comment, which will be removed too!
|
||||||
_pEditView->getGenericText(charbuf, charbufLen, posEndComment-1, posEndComment);
|
_pEditView->getGenericText(charbuf, charbufLen, posEndComment-1, posEndComment);
|
||||||
|
@ -606,7 +606,7 @@ private:
|
|||||||
int getLangFromMenuName(const TCHAR * langName);
|
int getLangFromMenuName(const TCHAR * langName);
|
||||||
generic_string getLangFromMenu(const Buffer * buf);
|
generic_string getLangFromMenu(const Buffer * buf);
|
||||||
|
|
||||||
generic_string Notepad_plus::exts2Filters(generic_string exts) const;
|
generic_string exts2Filters(generic_string exts) const;
|
||||||
int setFileOpenSaveDlgFilters(FileDialog & fDlg, int langType = -1);
|
int setFileOpenSaveDlgFilters(FileDialog & fDlg, int langType = -1);
|
||||||
void markSelectedTextInc(bool enable);
|
void markSelectedTextInc(bool enable);
|
||||||
Style * getStyleFromName(const TCHAR *styleName);
|
Style * getStyleFromName(const TCHAR *styleName);
|
||||||
|
@ -61,7 +61,7 @@ notepad++ [--help] [-multiInst] [-noPlugin] [-lLanguage] [-LlangCode] [-nLineNum
|
|||||||
|
|
||||||
class Notepad_plus_Window : public Window {
|
class Notepad_plus_Window : public Window {
|
||||||
public:
|
public:
|
||||||
Notepad_plus_Window() {};
|
Notepad_plus_Window() : _isPrelaunch(false), _disablePluginsManager(false) {};
|
||||||
void init(HINSTANCE, HWND, const TCHAR *cmdLine, CmdLineParams *cmdLineParams);
|
void init(HINSTANCE, HWND, const TCHAR *cmdLine, CmdLineParams *cmdLineParams);
|
||||||
|
|
||||||
bool isDlgsMsg(MSG *msg) const;
|
bool isDlgsMsg(MSG *msg) const;
|
||||||
@ -86,7 +86,7 @@ public:
|
|||||||
::DestroyWindow(_hSelf);
|
::DestroyWindow(_hSelf);
|
||||||
};
|
};
|
||||||
|
|
||||||
static const TCHAR * Notepad_plus_Window::getClassName() {
|
static const TCHAR * getClassName() {
|
||||||
return _className;
|
return _className;
|
||||||
};
|
};
|
||||||
static HWND gNppHWND; //static handle to Notepad++ window, NULL if non-existant
|
static HWND gNppHWND; //static handle to Notepad++ window, NULL if non-existant
|
||||||
|
@ -1489,10 +1489,10 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SCNotification scnN;
|
SCNotification scnN;
|
||||||
scnN.nmhdr.code = NPPN_BEFORESHUTDOWN;
|
scnN.nmhdr.code = NPPN_BEFORESHUTDOWN;
|
||||||
scnN.nmhdr.hwndFrom = _pPublicInterface->getHSelf();
|
scnN.nmhdr.hwndFrom = _pPublicInterface->getHSelf();
|
||||||
scnN.nmhdr.idFrom = 0;
|
scnN.nmhdr.idFrom = 0;
|
||||||
_pluginsManager.notify(&scnN);
|
_pluginsManager.notify(&scnN);
|
||||||
|
|
||||||
if (_pTrayIco)
|
if (_pTrayIco)
|
||||||
@ -1522,7 +1522,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
|||||||
if (!allClosed)
|
if (!allClosed)
|
||||||
{
|
{
|
||||||
//User cancelled the shutdown
|
//User cancelled the shutdown
|
||||||
scnN.nmhdr.code = NPPN_CANCELSHUTDOWN;
|
scnN.nmhdr.code = NPPN_CANCELSHUTDOWN;
|
||||||
_pluginsManager.notify(&scnN);
|
_pluginsManager.notify(&scnN);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -306,7 +306,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe
|
|||||||
if (isWow64Off)
|
if (isWow64Off)
|
||||||
{
|
{
|
||||||
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
||||||
isWow64Off = false;
|
//isWow64Off = false;
|
||||||
}
|
}
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
@ -439,7 +439,7 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup)
|
|||||||
if (isWow64Off)
|
if (isWow64Off)
|
||||||
{
|
{
|
||||||
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
||||||
isWow64Off = false;
|
//isWow64Off = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -860,15 +860,14 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
|||||||
if (_rebarBottom.getHSelf() == lpnm->hdr.hwndFrom)
|
if (_rebarBottom.getHSelf() == lpnm->hdr.hwndFrom)
|
||||||
notifRebar = &_rebarBottom;
|
notifRebar = &_rebarBottom;
|
||||||
//If N++ ID, use proper object
|
//If N++ ID, use proper object
|
||||||
switch(lpnm->wID) {
|
if (lpnm->wID == REBAR_BAR_TOOLBAR)
|
||||||
case REBAR_BAR_TOOLBAR: {
|
{
|
||||||
POINT pt;
|
POINT pt;
|
||||||
pt.x = lpnm->rc.left;
|
pt.x = lpnm->rc.left;
|
||||||
pt.y = lpnm->rc.bottom;
|
pt.y = lpnm->rc.bottom;
|
||||||
ClientToScreen(notifRebar->getHSelf(), &pt);
|
ClientToScreen(notifRebar->getHSelf(), &pt);
|
||||||
_toolBar.doPopop(pt);
|
_toolBar.doPopop(pt);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break; }
|
|
||||||
}
|
}
|
||||||
//Else forward notification to window of rebarband
|
//Else forward notification to window of rebarband
|
||||||
REBARBANDINFO rbBand;
|
REBARBANDINFO rbBand;
|
||||||
|
@ -207,7 +207,7 @@ struct CmdLineParams {
|
|||||||
|
|
||||||
CmdLineParams() : _isNoPlugin(false), _isReadOnly(false), _isNoSession(false), _isNoTab(false),_showLoadingTime(false),\
|
CmdLineParams() : _isNoPlugin(false), _isReadOnly(false), _isNoSession(false), _isNoTab(false),_showLoadingTime(false),\
|
||||||
_isPreLaunch(false), _line2go(-1), _column2go(-1), _langType(L_EXTERNAL), _isPointXValid(false), _isPointYValid(false),\
|
_isPreLaunch(false), _line2go(-1), _column2go(-1), _langType(L_EXTERNAL), _isPointXValid(false), _isPointYValid(false),\
|
||||||
_localizationPath(TEXT("")), _easterEggName(TEXT("")), _quoteType(0)
|
_alwaysOnTop(false), _localizationPath(TEXT("")), _easterEggName(TEXT("")), _quoteType(0)
|
||||||
{
|
{
|
||||||
_point.x = 0;
|
_point.x = 0;
|
||||||
_point.y = 0;
|
_point.y = 0;
|
||||||
|
@ -222,7 +222,6 @@ static bool getPathsForPathCompletion(generic_string input, generic_string &rawP
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
locale loc;
|
|
||||||
size_t last_occurrence = rawPath.rfind(L"\\");
|
size_t last_occurrence = rawPath.rfind(L"\\");
|
||||||
if(last_occurrence == std::string::npos) // No match.
|
if(last_occurrence == std::string::npos) // No match.
|
||||||
return false;
|
return false;
|
||||||
@ -765,10 +764,10 @@ bool AutoCompletion::setLanguage(LangType language) {
|
|||||||
//Cache the keywords
|
//Cache the keywords
|
||||||
//Iterate through all keywords
|
//Iterate through all keywords
|
||||||
TiXmlElement *funcNode = _pXmlKeyword;
|
TiXmlElement *funcNode = _pXmlKeyword;
|
||||||
const TCHAR * name = NULL;
|
|
||||||
for (; funcNode; funcNode = funcNode->NextSiblingElement(TEXT("KeyWord")) )
|
for (; funcNode; funcNode = funcNode->NextSiblingElement(TEXT("KeyWord")) )
|
||||||
{
|
{
|
||||||
name = funcNode->Attribute(TEXT("name"));
|
const TCHAR *name = funcNode->Attribute(TEXT("name"));
|
||||||
if (name)
|
if (name)
|
||||||
{
|
{
|
||||||
size_t len = lstrlen(name);
|
size_t len = lstrlen(name);
|
||||||
|
@ -217,7 +217,7 @@ bool Buffer::checkFileState() { //returns true if the status has been changed (i
|
|||||||
if (isWow64Off)
|
if (isWow64Off)
|
||||||
{
|
{
|
||||||
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
pNppParam->safeWow64EnableWow64FsRedirection(TRUE);
|
||||||
isWow64Off = false;
|
//isWow64Off = false;
|
||||||
}
|
}
|
||||||
return isOK;
|
return isOK;
|
||||||
}
|
}
|
||||||
@ -1121,12 +1121,11 @@ BufferID FileManager::bufferFromDocument(Document doc, bool dontIncrease, bool d
|
|||||||
|
|
||||||
int FileManager::detectCodepage(char* buf, size_t len)
|
int FileManager::detectCodepage(char* buf, size_t len)
|
||||||
{
|
{
|
||||||
int codepage = -1;
|
|
||||||
uchardet_t ud = uchardet_new();
|
uchardet_t ud = uchardet_new();
|
||||||
uchardet_handle_data(ud, buf, len);
|
uchardet_handle_data(ud, buf, len);
|
||||||
uchardet_data_end(ud);
|
uchardet_data_end(ud);
|
||||||
const char* cs = uchardet_get_charset(ud);
|
const char* cs = uchardet_get_charset(ud);
|
||||||
codepage = EncodingMapper::getInstance()->getEncodingFromString(cs);
|
int codepage = EncodingMapper::getInstance()->getEncodingFromString(cs);
|
||||||
uchardet_delete(ud);
|
uchardet_delete(ud);
|
||||||
return codepage;
|
return codepage;
|
||||||
}
|
}
|
||||||
@ -1203,7 +1202,7 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, Utf8_16_Rea
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
lenFile = fread(data+incompleteMultibyteChar, 1, blockSize-incompleteMultibyteChar, fp) + incompleteMultibyteChar;
|
lenFile = fread(data+incompleteMultibyteChar, 1, blockSize-incompleteMultibyteChar, fp) + incompleteMultibyteChar;
|
||||||
if (lenFile <= 0) break;
|
if (lenFile == 0) break;
|
||||||
|
|
||||||
// check if file contain any BOM
|
// check if file contain any BOM
|
||||||
if (isFirstTime)
|
if (isFirstTime)
|
||||||
|
@ -38,19 +38,22 @@ FindOption FindReplaceDlg::_options;
|
|||||||
#define SHIFTED 0x8000
|
#define SHIFTED 0x8000
|
||||||
|
|
||||||
|
|
||||||
int Searching::convertExtendedToString(const TCHAR * query, TCHAR * result, int length) { //query may equal to result, since it always gets smaller
|
int Searching::convertExtendedToString(const TCHAR * query, TCHAR * result, int length)
|
||||||
|
{ //query may equal to result, since it always gets smaller
|
||||||
int i = 0, j = 0;
|
int i = 0, j = 0;
|
||||||
int charLeft = length;
|
int charLeft = length;
|
||||||
bool isGood = true;
|
|
||||||
TCHAR current;
|
TCHAR current;
|
||||||
while(i < length) { //because the backslash escape quences always reduce the size of the generic_string, no overflow checks have to be made for target, assuming parameters are correct
|
while (i < length)
|
||||||
|
{ //because the backslash escape quences always reduce the size of the generic_string, no overflow checks have to be made for target, assuming parameters are correct
|
||||||
current = query[i];
|
current = query[i];
|
||||||
--charLeft;
|
--charLeft;
|
||||||
if (current == '\\' && charLeft) { //possible escape sequence
|
if (current == '\\' && charLeft)
|
||||||
|
{ //possible escape sequence
|
||||||
++i;
|
++i;
|
||||||
--charLeft;
|
--charLeft;
|
||||||
current = query[i];
|
current = query[i];
|
||||||
switch(current) {
|
switch(current)
|
||||||
|
{
|
||||||
case 'r':
|
case 'r':
|
||||||
result[j] = '\r';
|
result[j] = '\r';
|
||||||
break;
|
break;
|
||||||
@ -70,38 +73,54 @@ int Searching::convertExtendedToString(const TCHAR * query, TCHAR * result, int
|
|||||||
case 'd':
|
case 'd':
|
||||||
case 'o':
|
case 'o':
|
||||||
case 'x':
|
case 'x':
|
||||||
case 'u': {
|
case 'u':
|
||||||
|
{
|
||||||
int size = 0, base = 0;
|
int size = 0, base = 0;
|
||||||
if (current == 'b') { //11111111
|
if (current == 'b')
|
||||||
|
{ //11111111
|
||||||
size = 8, base = 2;
|
size = 8, base = 2;
|
||||||
} else if (current == 'o') { //377
|
}
|
||||||
|
else if (current == 'o')
|
||||||
|
{ //377
|
||||||
size = 3, base = 8;
|
size = 3, base = 8;
|
||||||
} else if (current == 'd') { //255
|
}
|
||||||
|
else if (current == 'd')
|
||||||
|
{ //255
|
||||||
size = 3, base = 10;
|
size = 3, base = 10;
|
||||||
} else if (current == 'x') { //0xFF
|
}
|
||||||
|
else if (current == 'x')
|
||||||
|
{ //0xFF
|
||||||
size = 2, base = 16;
|
size = 2, base = 16;
|
||||||
} else if (current == 'u') { //0xCDCD
|
}
|
||||||
|
else if (current == 'u')
|
||||||
|
{ //0xCDCD
|
||||||
size = 4, base = 16;
|
size = 4, base = 16;
|
||||||
}
|
}
|
||||||
if (charLeft >= size) {
|
|
||||||
|
if (charLeft >= size)
|
||||||
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
if (Searching::readBase(query+(i+1), &res, base, size)) {
|
if (Searching::readBase(query+(i+1), &res, base, size))
|
||||||
|
{
|
||||||
result[j] = (TCHAR)res;
|
result[j] = (TCHAR)res;
|
||||||
i+=size;
|
i += size;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//not enough chars to make parameter, use default method as fallback
|
//not enough chars to make parameter, use default method as fallback
|
||||||
}
|
}
|
||||||
default: { //unknown sequence, treat as regular text
|
|
||||||
|
default:
|
||||||
|
{ //unknown sequence, treat as regular text
|
||||||
result[j] = '\\';
|
result[j] = '\\';
|
||||||
++j;
|
++j;
|
||||||
result[j] = current;
|
result[j] = current;
|
||||||
isGood = false;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
result[j] = query[i];
|
result[j] = query[i];
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
|
@ -269,14 +269,17 @@ bool FunctionCallTip::getCursorFunction()
|
|||||||
/*
|
/*
|
||||||
Find function in XML structure and parse it
|
Find function in XML structure and parse it
|
||||||
*/
|
*/
|
||||||
bool FunctionCallTip::loadFunction() {
|
bool FunctionCallTip::loadFunction()
|
||||||
|
{
|
||||||
reset(); //set everything back to 0
|
reset(); //set everything back to 0
|
||||||
//The functions should be ordered, but linear search because we cant access like array
|
//The functions should be ordered, but linear search because we cant access like array
|
||||||
_curFunction = NULL;
|
_curFunction = NULL;
|
||||||
//Iterate through all keywords and find the correct function keyword
|
//Iterate through all keywords and find the correct function keyword
|
||||||
TiXmlElement *funcNode = _pXmlKeyword;
|
TiXmlElement *funcNode = _pXmlKeyword;
|
||||||
const TCHAR * name = NULL;
|
|
||||||
for (; funcNode; funcNode = funcNode->NextSiblingElement(TEXT("KeyWord")) ) {
|
for (; funcNode; funcNode = funcNode->NextSiblingElement(TEXT("KeyWord")) )
|
||||||
|
{
|
||||||
|
const TCHAR * name = NULL;
|
||||||
name = funcNode->Attribute(TEXT("name"));
|
name = funcNode->Attribute(TEXT("name"));
|
||||||
if (!name) //malformed node
|
if (!name) //malformed node
|
||||||
continue;
|
continue;
|
||||||
@ -356,9 +359,9 @@ void FunctionCallTip::showCalltip()
|
|||||||
|
|
||||||
//Check if the current overload still holds. If the current param exceeds amounti n overload, see if another one fits better (enough params)
|
//Check if the current overload still holds. If the current param exceeds amounti n overload, see if another one fits better (enough params)
|
||||||
stringVec & params = _overloads.at(_currentOverload);
|
stringVec & params = _overloads.at(_currentOverload);
|
||||||
size_t psize = params.size()+1, osize;
|
size_t psize = params.size()+1;
|
||||||
if ((size_t)_currentParam >= psize) {
|
if ((size_t)_currentParam >= psize) {
|
||||||
osize = _overloads.size();
|
size_t osize = _overloads.size();
|
||||||
for(size_t i = 0; i < osize; ++i) {
|
for(size_t i = 0; i < osize; ++i) {
|
||||||
psize = _overloads.at(i).size()+1;
|
psize = _overloads.at(i).size()+1;
|
||||||
if ((size_t)_currentParam < psize) {
|
if ((size_t)_currentParam < psize) {
|
||||||
|
@ -47,7 +47,7 @@ class Printer
|
|||||||
public :
|
public :
|
||||||
Printer(){};
|
Printer(){};
|
||||||
void init(HINSTANCE hInst, HWND hwnd, ScintillaEditView *pSEView, bool showDialog, int startPos, int endPos);
|
void init(HINSTANCE hInst, HWND hwnd, ScintillaEditView *pSEView, bool showDialog, int startPos, int endPos);
|
||||||
size_t Printer::doPrint() {
|
size_t doPrint() {
|
||||||
if (!::PrintDlg(&_pdlg))
|
if (!::PrintDlg(&_pdlg))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -1561,11 +1561,11 @@ BOOL CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
|
|
||||||
::SetProp(hwnd, TEXT("Styler dialog prop"), (HANDLE)lParam);
|
::SetProp(hwnd, TEXT("Styler dialog prop"), (HANDLE)lParam);
|
||||||
dlg = (StylerDlg *)::GetProp(hwnd, TEXT("Styler dialog prop"));
|
dlg = (StylerDlg *)::GetProp(hwnd, TEXT("Styler dialog prop"));
|
||||||
Style & style = SharedParametersDialog::_pUserLang->_styleArray.getStyler(dlg->stylerIndex);
|
Style & style = SharedParametersDialog::_pUserLang->_styleArray.getStyler(dlg->_stylerIndex);
|
||||||
|
|
||||||
// move dialog over UDL GUI (position 0,0 of UDL window) so it wouldn't cover the code
|
// move dialog over UDL GUI (position 0,0 of UDL window) so it wouldn't cover the code
|
||||||
RECT wrc;
|
RECT wrc;
|
||||||
::GetWindowRect(dlg->parent, &wrc);
|
::GetWindowRect(dlg->_parent, &wrc);
|
||||||
wrc.left = wrc.left < 0 ? 200 : wrc.left; // if outside of visible area
|
wrc.left = wrc.left < 0 ? 200 : wrc.left; // if outside of visible area
|
||||||
wrc.top = wrc.top < 0 ? 200 : wrc.top;
|
wrc.top = wrc.top < 0 ? 200 : wrc.top;
|
||||||
::SetWindowPos(hwnd, HWND_TOP, wrc.left, wrc.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
|
::SetWindowPos(hwnd, HWND_TOP, wrc.left, wrc.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
|
||||||
@ -1612,10 +1612,10 @@ BOOL CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
if (style._bgColor == COLORREF(-1))
|
if (style._bgColor == COLORREF(-1))
|
||||||
style._bgColor = white;
|
style._bgColor = white;
|
||||||
|
|
||||||
dlg->pFgColour->init(dlg->hInst, hwnd);
|
dlg->_pFgColour->init(dlg->_hInst, hwnd);
|
||||||
dlg->pFgColour->setColour(style._fgColor);
|
dlg->_pFgColour->setColour(style._fgColor);
|
||||||
dlg->pBgColour->init(dlg->hInst, hwnd);
|
dlg->_pBgColour->init(dlg->_hInst, hwnd);
|
||||||
dlg->pBgColour->setColour(style._bgColor);
|
dlg->_pBgColour->setColour(style._bgColor);
|
||||||
|
|
||||||
POINT p1, p2;
|
POINT p1, p2;
|
||||||
RECT rc1, rc2;
|
RECT rc1, rc2;
|
||||||
@ -1635,24 +1635,24 @@ BOOL CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
p1.x += 10; p2.x += 10;
|
p1.x += 10; p2.x += 10;
|
||||||
p1.y -= 6; p2.y -= 6;
|
p1.y -= 6; p2.y -= 6;
|
||||||
|
|
||||||
::MoveWindow(dlg->pFgColour->getHSelf(), p1.x, p1.y, 30, 30, TRUE);
|
::MoveWindow(dlg->_pFgColour->getHSelf(), p1.x, p1.y, 30, 30, TRUE);
|
||||||
::MoveWindow(dlg->pBgColour->getHSelf(), p2.x, p2.y, 30, 30, TRUE);
|
::MoveWindow(dlg->_pBgColour->getHSelf(), p2.x, p2.y, 30, 30, TRUE);
|
||||||
|
|
||||||
dlg->pFgColour->display();
|
dlg->_pFgColour->display();
|
||||||
dlg->pBgColour->display();
|
dlg->_pBgColour->display();
|
||||||
|
|
||||||
map<int, int>::iterator iter = globalMappper().nestingMapper.begin();
|
map<int, int>::iterator iter = globalMappper().nestingMapper.begin();
|
||||||
for (; iter != globalMappper().nestingMapper.end(); ++iter)
|
for (; iter != globalMappper().nestingMapper.end(); ++iter)
|
||||||
{
|
{
|
||||||
::SendDlgItemMessage(hwnd, iter->first, BM_SETCHECK, style._nesting & iter->second, 0);
|
::SendDlgItemMessage(hwnd, iter->first, BM_SETCHECK, style._nesting & iter->second, 0);
|
||||||
::EnableWindow(::GetDlgItem(hwnd, iter->first), dlg->enabledNesters & iter->second);
|
::EnableWindow(::GetDlgItem(hwnd, iter->first), dlg->_enabledNesters & iter->second);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_COMMAND :
|
case WM_COMMAND :
|
||||||
{
|
{
|
||||||
Style & style = SharedParametersDialog::_pUserLang->_styleArray.getStyler(dlg->stylerIndex);
|
Style & style = SharedParametersDialog::_pUserLang->_styleArray.getStyler(dlg->_stylerIndex);
|
||||||
if (HIWORD(wParam) == CBN_SELCHANGE)
|
if (HIWORD(wParam) == CBN_SELCHANGE)
|
||||||
{
|
{
|
||||||
int i = ::SendDlgItemMessage(hwnd, LOWORD(wParam), CB_GETCURSEL, 0, 0);
|
int i = ::SendDlgItemMessage(hwnd, LOWORD(wParam), CB_GETCURSEL, 0, 0);
|
||||||
@ -1691,7 +1691,7 @@ BOOL CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
{
|
{
|
||||||
if (wParam == IDCANCEL)
|
if (wParam == IDCANCEL)
|
||||||
{
|
{
|
||||||
style = dlg->initialStyle;
|
style = dlg->_initialStyle;
|
||||||
|
|
||||||
// show changes to user, re-color document
|
// show changes to user, re-color document
|
||||||
if (SharedParametersDialog::_pScintilla->getCurrentBuffer()->getLangType() == L_USER)
|
if (SharedParametersDialog::_pScintilla->getCurrentBuffer()->getLangType() == L_USER)
|
||||||
@ -1709,14 +1709,14 @@ BOOL CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
style._fgColor = dlg->pFgColour->getColour();
|
style._fgColor = dlg->_pFgColour->getColour();
|
||||||
style._bgColor = dlg->pBgColour->getColour();
|
style._bgColor = dlg->_pBgColour->getColour();
|
||||||
|
|
||||||
if (dlg->pFgColour->isEnabled())
|
if (dlg->_pFgColour->isEnabled())
|
||||||
style._colorStyle |= COLORSTYLE_FOREGROUND;
|
style._colorStyle |= COLORSTYLE_FOREGROUND;
|
||||||
else
|
else
|
||||||
style._colorStyle &= ~COLORSTYLE_FOREGROUND;
|
style._colorStyle &= ~COLORSTYLE_FOREGROUND;
|
||||||
if (dlg->pBgColour->isEnabled())
|
if (dlg->_pBgColour->isEnabled())
|
||||||
style._colorStyle |= COLORSTYLE_BACKGROUND;
|
style._colorStyle |= COLORSTYLE_BACKGROUND;
|
||||||
else
|
else
|
||||||
style._colorStyle &= ~COLORSTYLE_BACKGROUND;
|
style._colorStyle &= ~COLORSTYLE_BACKGROUND;
|
||||||
|
@ -279,6 +279,7 @@ protected :
|
|||||||
bool setPropertyByCheck(HWND hwnd, WPARAM id, bool & bool2set);
|
bool setPropertyByCheck(HWND hwnd, WPARAM id, bool & bool2set);
|
||||||
virtual void setKeywords2List(int ctrlID) = 0;
|
virtual void setKeywords2List(int ctrlID) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FolderStyleDialog : public SharedParametersDialog
|
class FolderStyleDialog : public SharedParametersDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -292,6 +293,7 @@ private :
|
|||||||
void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const;
|
void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const;
|
||||||
URLCtrl _pageLink;
|
URLCtrl _pageLink;
|
||||||
};
|
};
|
||||||
|
|
||||||
class KeyWordsStyleDialog : public SharedParametersDialog
|
class KeyWordsStyleDialog : public SharedParametersDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -301,6 +303,7 @@ protected :
|
|||||||
BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||||
void setKeywords2List(int id);
|
void setKeywords2List(int id);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CommentStyleDialog : public SharedParametersDialog
|
class CommentStyleDialog : public SharedParametersDialog
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
@ -313,6 +316,7 @@ private :
|
|||||||
void convertTo(TCHAR *dest, const TCHAR *toConvert, TCHAR *prefix) const;
|
void convertTo(TCHAR *dest, const TCHAR *toConvert, TCHAR *prefix) const;
|
||||||
void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const;
|
void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SymbolsStyleDialog : public SharedParametersDialog
|
class SymbolsStyleDialog : public SharedParametersDialog
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
@ -325,6 +329,7 @@ private :
|
|||||||
void convertTo(TCHAR *dest, const TCHAR *toConvert, TCHAR *prefix) const;
|
void convertTo(TCHAR *dest, const TCHAR *toConvert, TCHAR *prefix) const;
|
||||||
void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const;
|
void retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *prefix) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UserDefineDialog : public SharedParametersDialog
|
class UserDefineDialog : public SharedParametersDialog
|
||||||
{
|
{
|
||||||
friend class ScintillaEditView;
|
friend class ScintillaEditView;
|
||||||
@ -411,6 +416,7 @@ protected :
|
|||||||
void setKeywords2List(int){};
|
void setKeywords2List(int){};
|
||||||
void updateDlg();
|
void updateDlg();
|
||||||
};
|
};
|
||||||
|
|
||||||
class StringDlg : public StaticDialog
|
class StringDlg : public StaticDialog
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
@ -434,34 +440,36 @@ private :
|
|||||||
generic_string _static;
|
generic_string _static;
|
||||||
int _txtLen;
|
int _txtLen;
|
||||||
};
|
};
|
||||||
|
|
||||||
class StylerDlg
|
class StylerDlg
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StylerDlg( HINSTANCE hInst, HWND parent, int stylerIndex = 0, int enabledNesters = -1):
|
StylerDlg( HINSTANCE hInst, HWND parent, int stylerIndex = 0, int enabledNesters = -1):
|
||||||
hInst(hInst), parent(parent), stylerIndex(stylerIndex), enabledNesters(enabledNesters)
|
_hInst(hInst), _parent(parent), _stylerIndex(stylerIndex), _enabledNesters(enabledNesters) {
|
||||||
{
|
_pFgColour = new ColourPicker;
|
||||||
pFgColour = new ColourPicker;
|
_pBgColour = new ColourPicker;
|
||||||
pBgColour = new ColourPicker;
|
_initialStyle = SharedParametersDialog::_pUserLang->_styleArray.getStyler(stylerIndex);
|
||||||
initialStyle = SharedParametersDialog::_pUserLang->_styleArray.getStyler(stylerIndex);
|
|
||||||
};
|
};
|
||||||
~StylerDlg()
|
|
||||||
{
|
~StylerDlg() {
|
||||||
pFgColour->destroy();
|
_pFgColour->destroy();
|
||||||
pBgColour->destroy();
|
_pBgColour->destroy();
|
||||||
delete pFgColour;
|
delete _pFgColour;
|
||||||
delete pBgColour;
|
delete _pBgColour;
|
||||||
}
|
};
|
||||||
|
|
||||||
long doDialog() {
|
long doDialog() {
|
||||||
return long (::DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_STYLER_POPUP_DLG), parent, (DLGPROC)dlgProc, (LPARAM)this));
|
return long (::DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_STYLER_POPUP_DLG), _parent, (DLGPROC)dlgProc, (LPARAM)this));
|
||||||
};
|
};
|
||||||
|
|
||||||
static BOOL CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
static BOOL CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
public:
|
public:
|
||||||
HINSTANCE hInst;
|
HINSTANCE _hInst;
|
||||||
HWND parent;
|
HWND _parent;
|
||||||
int stylerIndex;
|
int _stylerIndex;
|
||||||
int enabledNesters;
|
int _enabledNesters;
|
||||||
ColourPicker * pFgColour;
|
ColourPicker * _pFgColour;
|
||||||
ColourPicker * pBgColour;
|
ColourPicker * _pBgColour;
|
||||||
Style initialStyle;
|
Style _initialStyle;
|
||||||
};
|
};
|
||||||
#endif //USER_DEFINE_H
|
#endif //USER_DEFINE_H
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual BOOL CALLBACK AnsiCharPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScintillaEditView **_ppEditView;
|
ScintillaEditView **_ppEditView;
|
||||||
|
@ -99,7 +99,7 @@ public:
|
|||||||
void drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
void drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual BOOL CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScintillaEditView **_ppEditView;
|
ScintillaEditView **_ppEditView;
|
||||||
|
@ -678,10 +678,9 @@ void DockingManager::setActiveTab(int iCont, int iItem)
|
|||||||
|
|
||||||
void DockingManager::showDockableDlg(HWND hDlg, BOOL view)
|
void DockingManager::showDockableDlg(HWND hDlg, BOOL view)
|
||||||
{
|
{
|
||||||
tTbData *pTbData = NULL;
|
|
||||||
for (size_t i = 0, len = _vContainer.size(); i < len; ++i)
|
for (size_t i = 0, len = _vContainer.size(); i < len; ++i)
|
||||||
{
|
{
|
||||||
pTbData = _vContainer[i]->findToolbarByWnd(hDlg);
|
tTbData *pTbData = _vContainer[i]->findToolbarByWnd(hDlg);
|
||||||
if (pTbData != NULL)
|
if (pTbData != NULL)
|
||||||
{
|
{
|
||||||
_vContainer[i]->showToolbar(pTbData, view);
|
_vContainer[i]->showToolbar(pTbData, view);
|
||||||
|
@ -457,7 +457,7 @@ void Gripper::doTabReordering(POINT pt)
|
|||||||
|
|
||||||
_iItem = iItem;
|
_iItem = iItem;
|
||||||
}
|
}
|
||||||
else if ((hTab != _hTab) || (_iItem == -1))
|
else if (_hTab && ((hTab != _hTab) || (_iItem == -1)))
|
||||||
{
|
{
|
||||||
/* test if cusor points after last tab */
|
/* test if cusor points after last tab */
|
||||||
int iLastItem = ::SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0) - 1;
|
int iLastItem = ::SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0) - 1;
|
||||||
@ -501,7 +501,7 @@ void Gripper::doTabReordering(POINT pt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* insert new entry when mouse doesn't point to current hovered tab */
|
/* insert new entry when mouse doesn't point to current hovered tab */
|
||||||
if ((_hTab != hTabOld) || (_iItem != iItemOld))
|
if (_hTab && ((_hTab != hTabOld) || (_iItem != iItemOld)))
|
||||||
{
|
{
|
||||||
_tcItem.mask = TCIF_PARAM | (_hTab == _hTabSource ? TCIF_TEXT : 0);
|
_tcItem.mask = TCIF_PARAM | (_hTab == _hTabSource ? TCIF_TEXT : 0);
|
||||||
::SendMessage(_hTab, TCM_INSERTITEM, _iItem, (LPARAM)&_tcItem);
|
::SendMessage(_hTab, TCM_INSERTITEM, _iItem, (LPARAM)&_tcItem);
|
||||||
|
@ -37,7 +37,7 @@ struct foundInfo {
|
|||||||
generic_string _data2;
|
generic_string _data2;
|
||||||
int _pos;
|
int _pos;
|
||||||
int _pos2;
|
int _pos2;
|
||||||
//foundInfo(): /*_data(TEXT("")), _data2(TEXT("")), _pos(-1) _pos2(-1) */{};
|
foundInfo(): _data(TEXT("")), _data2(TEXT("")), _pos(-1), _pos2(-1) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
class FunctionParser {
|
class FunctionParser {
|
||||||
|
@ -257,7 +257,7 @@ bool PreferenceDlg::renameDialogTitle(const TCHAR *internalName, const TCHAR *ne
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
const size_t lenMax = 256;
|
const size_t lenMax = 256;
|
||||||
TCHAR oldName[lenMax];
|
TCHAR oldName[lenMax] = {0};
|
||||||
size_t txtLen = ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXTLEN, i, 0);
|
size_t txtLen = ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXTLEN, i, 0);
|
||||||
if (txtLen >= lenMax)
|
if (txtLen >= lenMax)
|
||||||
return false;
|
return false;
|
||||||
|
@ -134,7 +134,7 @@ protected:
|
|||||||
void setWorkSpaceDirty(bool isDirty);
|
void setWorkSpaceDirty(bool isDirty);
|
||||||
void popupMenuCmd(int cmdID);
|
void popupMenuCmd(int cmdID);
|
||||||
POINT getMenuDisplyPoint(int iButton);
|
POINT getMenuDisplyPoint(int iButton);
|
||||||
virtual BOOL CALLBACK ProjectPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
bool buildTreeFrom(TiXmlNode *projectRoot, HTREEITEM hParentItem);
|
bool buildTreeFrom(TiXmlNode *projectRoot, HTREEITEM hParentItem);
|
||||||
void notified(LPNMHDR notification);
|
void notified(LPNMHDR notification);
|
||||||
void showContextMenu(int x, int y);
|
void showContextMenu(int x, int y);
|
||||||
|
@ -49,7 +49,8 @@ void StaticDialog::display(bool toShow) const
|
|||||||
if (toShow) {
|
if (toShow) {
|
||||||
// If the user has switched from a dual monitor to a single monitor since we last
|
// If the user has switched from a dual monitor to a single monitor since we last
|
||||||
// displayed the dialog, then ensure that it's still visible on the single monitor.
|
// displayed the dialog, then ensure that it's still visible on the single monitor.
|
||||||
RECT workAreaRect, rc;
|
RECT workAreaRect = {0};
|
||||||
|
RECT rc = {0};
|
||||||
::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0);
|
::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0);
|
||||||
::GetWindowRect(_hSelf, &rc);
|
::GetWindowRect(_hSelf, &rc);
|
||||||
int newLeft = rc.left;
|
int newLeft = rc.left;
|
||||||
@ -77,9 +78,17 @@ HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplat
|
|||||||
{
|
{
|
||||||
// Get Dlg Template resource
|
// Get Dlg Template resource
|
||||||
HRSRC hDialogRC = ::FindResource(_hInst, MAKEINTRESOURCE(dialogID), RT_DIALOG);
|
HRSRC hDialogRC = ::FindResource(_hInst, MAKEINTRESOURCE(dialogID), RT_DIALOG);
|
||||||
|
if (!hDialogRC)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
HGLOBAL hDlgTemplate = ::LoadResource(_hInst, hDialogRC);
|
HGLOBAL hDlgTemplate = ::LoadResource(_hInst, hDialogRC);
|
||||||
|
if (!hDlgTemplate)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
DLGTEMPLATE *pDlgTemplate = (DLGTEMPLATE *)::LockResource(hDlgTemplate);
|
DLGTEMPLATE *pDlgTemplate = (DLGTEMPLATE *)::LockResource(hDlgTemplate);
|
||||||
|
if (!pDlgTemplate)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
// Duplicate Dlg Template resource
|
// Duplicate Dlg Template resource
|
||||||
unsigned long sizeDlg = ::SizeofResource(_hInst, hDialogRC);
|
unsigned long sizeDlg = ::SizeofResource(_hInst, hDialogRC);
|
||||||
HGLOBAL hMyDlgTemplate = ::GlobalAlloc(GPTR, sizeDlg);
|
HGLOBAL hMyDlgTemplate = ::GlobalAlloc(GPTR, sizeDlg);
|
||||||
|
@ -53,7 +53,7 @@ public :
|
|||||||
_isVertical = isVertical;
|
_isVertical = isVertical;
|
||||||
TabBar::init(hInst, hwnd, false, isTraditional, isMultiLine);
|
TabBar::init(hInst, hwnd, false, isTraditional, isMultiLine);
|
||||||
};
|
};
|
||||||
void ControlsTab::createTabs(WindowVector & winVector);
|
void createTabs(WindowVector & winVector);
|
||||||
|
|
||||||
void destroy() {
|
void destroy() {
|
||||||
TabBar::destroy();
|
TabBar::destroy();
|
||||||
|
@ -104,7 +104,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VerticalFileSwitcherListView _fileListView;
|
VerticalFileSwitcherListView _fileListView;
|
||||||
|
@ -546,7 +546,7 @@ void Accelerator::updateShortcuts()
|
|||||||
tmpAccelArray[i] = IFAcc[i];
|
tmpAccelArray[i] = IFAcc[i];
|
||||||
}
|
}
|
||||||
_hIncFindAccTab = ::CreateAcceleratorTable(tmpAccelArray, nb);
|
_hIncFindAccTab = ::CreateAcceleratorTable(tmpAccelArray, nb);
|
||||||
delete tmpAccelArray;
|
delete [] tmpAccelArray;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
KeyCombo getKeyComboByIndex(int index) const;
|
KeyCombo getKeyComboByIndex(int index) const;
|
||||||
void ScintillaKeyMap::setKeyComboByIndex(int index, KeyCombo combo);
|
void setKeyComboByIndex(int index, KeyCombo combo);
|
||||||
void removeKeyComboByIndex(int index);
|
void removeKeyComboByIndex(int index);
|
||||||
void clearDups() {
|
void clearDups() {
|
||||||
if (size > 1)
|
if (size > 1)
|
||||||
|
@ -82,7 +82,6 @@ generic_string NativeLangSpeaker::getSpecialMenuEntryName(const char *entryName)
|
|||||||
if (!mainMenu) return TEXT("");
|
if (!mainMenu) return TEXT("");
|
||||||
TiXmlNodeA *entriesRoot = mainMenu->FirstChild("Entries");
|
TiXmlNodeA *entriesRoot = mainMenu->FirstChild("Entries");
|
||||||
if (!entriesRoot) return TEXT("");
|
if (!entriesRoot) return TEXT("");
|
||||||
const char *idName = NULL;
|
|
||||||
|
|
||||||
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
|
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
|
||||||
|
|
||||||
@ -92,7 +91,7 @@ generic_string NativeLangSpeaker::getSpecialMenuEntryName(const char *entryName)
|
|||||||
{
|
{
|
||||||
TiXmlElementA *element = childNode->ToElement();
|
TiXmlElementA *element = childNode->ToElement();
|
||||||
|
|
||||||
idName = element->Attribute("idName");
|
const char *idName = element->Attribute("idName");
|
||||||
if (idName)
|
if (idName)
|
||||||
{
|
{
|
||||||
const char *name = element->Attribute("name");
|
const char *name = element->Attribute("name");
|
||||||
@ -397,11 +396,12 @@ void NativeLangSpeaker::changeLangTabDrapContextMenu(HMENU hCM)
|
|||||||
{
|
{
|
||||||
const int POS_GO2VIEW = 0;
|
const int POS_GO2VIEW = 0;
|
||||||
const int POS_CLONE2VIEW = 1;
|
const int POS_CLONE2VIEW = 1;
|
||||||
const char *goToViewA = NULL;
|
|
||||||
const char *cloneToViewA = NULL;
|
|
||||||
|
|
||||||
if (_nativeLangA)
|
if (_nativeLangA)
|
||||||
{
|
{
|
||||||
|
const char *goToViewA = NULL;
|
||||||
|
const char *cloneToViewA = NULL;
|
||||||
|
|
||||||
TiXmlNodeA *tabBarMenu = _nativeLangA->FirstChild("Menu");
|
TiXmlNodeA *tabBarMenu = _nativeLangA->FirstChild("Menu");
|
||||||
if (tabBarMenu)
|
if (tabBarMenu)
|
||||||
tabBarMenu = tabBarMenu->FirstChild("TabBar");
|
tabBarMenu = tabBarMenu->FirstChild("TabBar");
|
||||||
|
@ -315,11 +315,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
|||||||
generic_string quotFileName = TEXT("");
|
generic_string quotFileName = TEXT("");
|
||||||
// tell the running instance the FULL path to the new files to load
|
// tell the running instance the FULL path to the new files to load
|
||||||
size_t nrFilesToOpen = params.size();
|
size_t nrFilesToOpen = params.size();
|
||||||
const TCHAR * currentFile;
|
|
||||||
|
|
||||||
for(size_t i = 0; i < nrFilesToOpen; ++i)
|
for(size_t i = 0; i < nrFilesToOpen; ++i)
|
||||||
{
|
{
|
||||||
currentFile = params.at(i);
|
const TCHAR * currentFile = params.at(i);
|
||||||
if (currentFile[0])
|
if (currentFile[0])
|
||||||
{
|
{
|
||||||
//check if relative or full path. Relative paths dont have a colon for driveletter
|
//check if relative or full path. Relative paths dont have a colon for driveletter
|
||||||
@ -496,7 +495,7 @@ DEVOMER*/
|
|||||||
} catch (const Win32Exception & ex) {
|
} catch (const Win32Exception & ex) {
|
||||||
TCHAR message[1024]; //TODO: sane number
|
TCHAR message[1024]; //TODO: sane number
|
||||||
wsprintf(message, TEXT("An exception occured. Notepad++ cannot recover and must be shut down.\r\nThe exception details are as follows:\r\n")
|
wsprintf(message, TEXT("An exception occured. Notepad++ cannot recover and must be shut down.\r\nThe exception details are as follows:\r\n")
|
||||||
TEXT("Code:\t0x%08X\r\nType:\t%S\r\nException address: 0x%08X"), ex.code(), ex.what(), ex.where());
|
TEXT("Code:\t0x%08X\r\nType:\t%S\r\nException address: 0x%08X"), ex.code(), ex.what(), (long)ex.where());
|
||||||
::MessageBox(Notepad_plus_Window::gNppHWND, message, TEXT("Win32Exception"), MB_OK | MB_ICONERROR);
|
::MessageBox(Notepad_plus_Window::gNppHWND, message, TEXT("Win32Exception"), MB_OK | MB_ICONERROR);
|
||||||
mdump.writeDump(ex.info());
|
mdump.writeDump(ex.info());
|
||||||
doException(notepad_plus_plus);
|
doException(notepad_plus_plus);
|
||||||
|
Loading…
Reference in New Issue
Block a user