From 8c70585f27638b4bd1faa128d7c35b39e43d72bb Mon Sep 17 00:00:00 2001 From: donho Date: Sun, 7 Sep 2008 18:56:59 +0000 Subject: [PATCH] [TUNE] vc2008 -> vc2005 git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@308 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/MISC/SysMsg/SysMsg.h | 3 +- PowerEditor/src/Notepad_plus.cpp | 15 ++--- .../src/ScitillaComponent/FindReplaceDlg.cpp | 15 +---- .../ScitillaComponent/ScintillaEditView.cpp | 1 - .../src/WinControls/Preference/preference.rc | 65 +++++++++---------- .../WinControls/Preference/preference_rc.h | 2 + PowerEditor/src/winmain.cpp | 4 +- PowerEditor/visual.net/notepadPlus.vcproj | 18 ++--- 8 files changed, 54 insertions(+), 69 deletions(-) diff --git a/PowerEditor/src/MISC/SysMsg/SysMsg.h b/PowerEditor/src/MISC/SysMsg/SysMsg.h index 22b126d0..d3ee2ebd 100644 --- a/PowerEditor/src/MISC/SysMsg/SysMsg.h +++ b/PowerEditor/src/MISC/SysMsg/SysMsg.h @@ -90,7 +90,8 @@ public: const char * wchar2char(const wchar_t* wcStr, UINT codepage); protected: - WcharMbcsConvertor() : _multiByteStr(NULL), _wideCharStr(NULL), _multiByteAllocLen(0), _wideCharAllocLen(0), initSize(1024) {}; + WcharMbcsConvertor() : _multiByteStr(NULL), _wideCharStr(NULL), _multiByteAllocLen(0), _wideCharAllocLen(0), initSize(1024) { + }; ~WcharMbcsConvertor() { if (_multiByteStr) delete [] _multiByteStr; diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 1a0b1fbe..a858698d 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -79,7 +79,6 @@ Notepad_plus::Notepad_plus(): Window(), _mainWindowStatus(0), _pDocTab(NULL), _p ZeroMemory(&_prevSelectedRange, sizeof(_prevSelectedRange)); _winVersion = (NppParameters::getInstance())->getWinVersion(); - TiXmlDocument *nativeLangDocRoot = (NppParameters::getInstance())->getNativeLang(); if (nativeLangDocRoot) { @@ -192,7 +191,7 @@ Notepad_plus::~Notepad_plus() } void Notepad_plus::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLine, CmdLineParams *cmdLineParams) -{ +{ Window::init(hInst, parent); WNDCLASS nppClass; @@ -293,6 +292,7 @@ void Notepad_plus::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLine, CmdL scnN.nmhdr.hwndFrom = _hSelf; scnN.nmhdr.idFrom = 0; _pluginsManager.notify(&scnN); + } @@ -475,7 +475,6 @@ bool Notepad_plus::loadSession(Session & session) { bool allSessionFilesLoaded = true; BufferID lastOpened = BUFFER_INVALID; - size_t i = 0; showView(MAIN_VIEW); switchEditViewTo(MAIN_VIEW); //open files in main @@ -600,7 +599,6 @@ bool Notepad_plus::loadSession(Session & session) hideView(otherView()); else if (canHideView(currentView())) hideView(currentView()); - return allSessionFilesLoaded; } @@ -1399,10 +1397,7 @@ bool Notepad_plus::replaceAllFiles() { if (nbTotal < 0) lstrcpy(result, TEXT("The regular expression to search is formed badly")); else - { - wsprintf(result, TEXT("%d"), nbTotal); - lstrcat(result, TEXT(" tokens are replaced.")); - } + wsprintf(result, TEXT("%d occurrences were replaced."), nbTotal); ::MessageBox(_hSelf, result, TEXT(""), MB_OK); @@ -6179,7 +6174,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa _subEditView.execute(SCI_SETZOOM, svp2._zoom); TabBarPlus::doDragNDrop(true); - + if (_toReduceTabBar) { HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT); @@ -6203,7 +6198,6 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa TabBarPlus::setVertical((tabBarStatus & TAB_VERTICAL) != 0); drawTabbarColoursFromStylerArray(); - //--Splitter Section--// bool isVertical = (nppGUI._splitterPos == POS_VERTICAL); @@ -6493,7 +6487,6 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa ContainerTabInfo & cti = dmd._containerTabInfo[i]; _dockingManager.setActiveTab(cti._cont, cti._activeTab); } - //Load initial docs into doctab loadBufferIntoView(_mainEditView.getCurrentBufferID(), MAIN_VIEW); loadBufferIntoView(_subEditView.getCurrentBufferID(), SUB_VIEW); diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 849b3ea3..2d7472d0 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -620,10 +620,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP if (nbReplaced < 0) lstrcpy(result, TEXT("The regular expression to search is formed badly")); else - { - wsprintf(result, TEXT("%d"), nbReplaced); - lstrcat(result, TEXT(" tokens are replaced.")); - } + wsprintf(result, TEXT("%d occurrences were replaced."), nbReplaced); ::MessageBox(_hSelf, result, TEXT(""), MB_OK); } } @@ -638,10 +635,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP if (nbCounted < 0) lstrcpy(result, TEXT("The regular expression to search is formed badly.\r\nIs it resulting in nothing?")); else - { - wsprintf(result, TEXT("%d"), nbCounted); - lstrcat(result, TEXT(" tokens are found.")); - } + wsprintf(result, TEXT("%d match(es) to occurrence(s)"), nbCounted); ::MessageBox(_hSelf, result, TEXT(""), MB_OK); } } @@ -658,10 +652,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP if (nbMarked < 0) lstrcpy(result, TEXT("The regular expression to search is formed badly.\r\nIs it resulting in nothing?")); else - { - wsprintf(result, TEXT("%d"), nbMarked); - lstrcat(result, TEXT(" tokens are found.")); - } + wsprintf(result, TEXT("%d match(es) to occurrence(s)"), nbMarked); ::MessageBox(_hSelf, result, TEXT(""), MB_OK); } } diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 3c359fa7..0e08d3c3 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1849,7 +1849,6 @@ TCHAR * int2str(TCHAR *str, int strLen, int number, int base, int nbChiffre, boo fStr[0] = 'o'; else if (base == 2) { - //printInt(nbChiffre); const unsigned int MASK_ULONG_BITFORT = 0x80000000; int nbBits = sizeof(unsigned int) * 8; int nbBit2Shift = (nbChiffre >= nbBits)?nbBits:(nbBits - nbChiffre); diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 0a142f54..aa83ec18 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -95,40 +95,39 @@ END IDD_PREFERENCE_SETTING_BOX DIALOGEX 0, 0, 370, 180 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, TEXT("MS Shell Dlg"), 0, 0, 0x1 +FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "History File Setting",IDC_HISTORY_GB_STATIC,15,4,150,39,BS_CENTER - CONTROL "Don't check at launch time",IDC_CHECK_DONTCHECKHISTORY, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,27,133,10 - RTEXT "Max number history file :",IDC_MAXNBFILE_STATIC,18,14,112,8 - LTEXT "0",IDC_MAXNBFILEVAL_STATIC,137,14,15,8 - CONTROL "Enable",IDC_CHECK_CLICKABLELINK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,15,98,10 - GROUPBOX "Clickable link setting",IDC_CLICKABLELINK_STATIC,193,4,150,39,BS_CENTER - CONTROL "Don't draw underline",IDC_CHECK_CLICKABLELINK_NOUNDERLINE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,28,119,10 - EDITTEXT IDC_EDIT_SESSIONFILEEXT,298,162,67,14,ES_AUTOHSCROLL - LTEXT "Session file ext:",IDC_SESSIONFILEEXT_STATIC,300,150,66,8 - CONTROL "Enable",IDC_CHECK_ENABLEDOCSWITCHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,59,69,10 - CONTROL "Enable MRU behaviour",IDC_CHECK_STYLEMRU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,72,134,10 - GROUPBOX "Document switcher (Ctrl+TAB)",IDC_DOCUMENTSWITCHER_STATIC,15,48,150,39,BS_CENTER - CONTROL "Enable",IDC_CHECK_FILEAUTODETECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,57,98,10 - GROUPBOX "File Status Auto-detection",IDC_FILEAUTODETECTION_STATIC,193,47,150,50,BS_CENTER - CONTROL "Update silently",IDC_CHECK_UPDATESILENTLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,69,103,10 - CONTROL "Scroll to the last line after update",IDC_CHECK_UPDATEGOTOEOF, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,81,141,10 - CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,16,101,150,10 - CONTROL "Smart highlighting",IDC_CHECK_ENABLSMARTHILITE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,201,102,141,10 - CONTROL "Auto-indent",IDC_CHECK_MAINTAININDENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,115,130,10 - CONTROL "Minimize to sys tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,129,130,10 - CONTROL "Remember the last operation directory",IDC_CHECK_KEEPINSAMEDIR, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,143,210,10 - CONTROL "Remember the current session for next launch",IDC_CHECK_REMEMBERSESSION, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,157,217,10 - CONTROL "Highlight matching tags",IDC_CHECK_ENABLTAGSMATCHHILITE, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,201,117,131,10 - CONTROL "Highlight tag attributes",IDC_CHECK_ENABLTAGATTRHILITE, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,214,131,131,10 + GROUPBOX "History File Setting",IDC_HISTORY_GB_STATIC,15,4,150,39,BS_CENTER + CONTROL "Don't check at launch time",IDC_CHECK_DONTCHECKHISTORY, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,27,133,10 + RTEXT "Max number history file :",IDC_MAXNBFILE_STATIC,18,14,112,8 + LTEXT "0",IDC_MAXNBFILEVAL_STATIC,137,14,15,8 + CONTROL "Enable",IDC_CHECK_CLICKABLELINK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,15,98,10 + GROUPBOX "Clickable link setting",IDC_CLICKABLELINK_STATIC,193,4,150,39,BS_CENTER + CONTROL "Don't draw underline",IDC_CHECK_CLICKABLELINK_NOUNDERLINE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,28,119,10 + EDITTEXT IDC_EDIT_SESSIONFILEEXT,298,164,67,14,ES_AUTOHSCROLL + LTEXT "Session file ext:",IDC_SESSIONFILEEXT_STATIC,300,152,66,8 + CONTROL "Enable",IDC_CHECK_ENABLEDOCSWITCHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,59,69,10 + CONTROL "Enable MRU behaviour",IDC_CHECK_STYLEMRU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,72,134,10 + GROUPBOX "Document switcher (Ctrl+TAB)",IDC_DOCUMENTSWITCHER_STATIC,15,48,150,39,BS_CENTER + CONTROL "Enable",IDC_CHECK_FILEAUTODETECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,57,98,10 + GROUPBOX "File Status Auto-detection",IDC_FILEAUTODETECTION_STATIC,193,47,150,50,BS_CENTER + CONTROL "Update silently",IDC_CHECK_UPDATESILENTLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,69,103,10 + CONTROL "Scroll to the last line after update",IDC_CHECK_UPDATEGOTOEOF, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,81,141,10 + CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,16,93,150,10 + CONTROL "Smart highlighting",IDC_CHECK_ENABLSMARTHILITE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,16,164,141,10 + CONTROL "Auto-indent",IDC_CHECK_MAINTAININDENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,107,130,10 + CONTROL "Minimize to sys tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,121,130,10 + CONTROL "Remember the last operation directory",IDC_CHECK_KEEPINSAMEDIR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,135,217,10 + CONTROL "Remember the current session for next launch",IDC_CHECK_REMEMBERSESSION, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,149,217,10 + GROUPBOX "Highlight matching tags",IDC_TAGMATCHEDHILITE_STATIC,193,101,150,50,BS_CENTER + CONTROL "Enable",IDC_CHECK_ENABLTAGSMATCHHILITE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,201,111,131,10 + CONTROL "Highlight tag attributes",IDC_CHECK_ENABLTAGATTRHILITE, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,202,123,131,10 + CONTROL "Highlight php/asp zone",IDC_CHECK_HIGHLITENONEHTMLZONE, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,202,136,131,10 END IDD_PREFERENCE_NEWDOCSETTING_BOX DIALOGEX 0, 0, 370, 180 diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index 805a2804..30d47f9f 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -103,6 +103,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define IDC_CHECK_ENABLSMARTHILITE (IDD_PREFERENCE_SETTING_BOX + 26) #define IDC_CHECK_ENABLTAGSMATCHHILITE (IDD_PREFERENCE_SETTING_BOX + 27) #define IDC_CHECK_ENABLTAGATTRHILITE (IDD_PREFERENCE_SETTING_BOX + 28) + #define IDC_TAGMATCHEDHILITE_STATIC (IDD_PREFERENCE_SETTING_BOX + 29) + #define IDC_CHECK_HIGHLITENONEHTMLZONE (IDD_PREFERENCE_SETTING_BOX + 30) #define IDD_PREFERENCE_NEWDOCSETTING_BOX 6400 //(IDD_PREFERENCE_BOX + 400) #define IDC_FORMAT_GB_STATIC (IDD_PREFERENCE_NEWDOCSETTING_BOX + 1) diff --git a/PowerEditor/src/winmain.cpp b/PowerEditor/src/winmain.cpp index 4bd2264a..6d5b660f 100644 --- a/PowerEditor/src/winmain.cpp +++ b/PowerEditor/src/winmain.cpp @@ -133,7 +133,6 @@ int WINAPI NppMainEntry(HINSTANCE hInstance, HINSTANCE, TCHAR * cmdLine, int nCm ParamVector params; parseCommandLine(cmdLine, params); - CmdLineParams cmdLineParams; bool isMultiInst = isInList(FLAG_MULTI_INSTANCE, params); cmdLineParams._isNoTab = isInList(FLAG_NOTABBAR, params); @@ -142,7 +141,7 @@ int WINAPI NppMainEntry(HINSTANCE hInstance, HINSTANCE, TCHAR * cmdLine, int nCm cmdLineParams._isNoSession = isInList(FLAG_NOSESSION, params); cmdLineParams._langType = getLangTypeFromParam(params); cmdLineParams._line2go = getLn2GoFromParam(params); - + NppParameters *pNppParameters = NppParameters::getInstance(); // override the settings if notepad style is present if (pNppParameters->asNotepadStyle()) @@ -157,6 +156,7 @@ int WINAPI NppMainEntry(HINSTANCE hInstance, HINSTANCE, TCHAR * cmdLine, int nCm size_t nrFilesToOpen = params.size(); const TCHAR * currentFile; TCHAR fullFileName[MAX_PATH]; + //TODO: try merging the flenames and see if it exists, user may have typed a single spaced filename without quotes for(size_t i = 0; i < nrFilesToOpen; i++) { diff --git a/PowerEditor/visual.net/notepadPlus.vcproj b/PowerEditor/visual.net/notepadPlus.vcproj index 0775c11b..86d16184 100644 --- a/PowerEditor/visual.net/notepadPlus.vcproj +++ b/PowerEditor/visual.net/notepadPlus.vcproj @@ -1,12 +1,11 @@ + +