From 3b9f24ba512f49e6d9775db7aebbd6d046263dd3 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 4 Jun 2013 23:46:24 +0000 Subject: [PATCH] [NEW] Add FunctionList toolbar button. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1054 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 1 + PowerEditor/src/Notepad_plus.rc | 3 +-- PowerEditor/src/NppBigSwitch.cpp | 6 ----- PowerEditor/src/NppCommands.cpp | 23 ++++++++++-------- .../DockingWnd/DockingDlgInterface.h | 9 +++++++ .../WinControls/DocumentMap/documentMap.cpp | 4 +-- .../FunctionList/functionListPanel.cpp | 5 +++- PowerEditor/src/icons/functionList.bmp | Bin 0 -> 1334 bytes PowerEditor/src/resource.h | 3 ++- 9 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 PowerEditor/src/icons/functionList.bmp diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index df7c3fb20..f6aa13f7f 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -106,6 +106,7 @@ ToolBarButtonUnit toolBarIcons[] = { {IDM_VIEW_INDENT_GUIDE, IDI_VIEW_INDENT_OFF_ICON, IDI_VIEW_INDENT_ON_ICON, IDI_VIEW_INDENT_OFF_ICON, IDR_INDENTGUIDE}, {IDM_LANG_USER_DLG, IDI_VIEW_UD_DLG_OFF_ICON, IDI_VIEW_UD_DLG_ON_ICON, IDI_VIEW_UD_DLG_OFF_ICON, IDR_SHOWPANNEL}, {IDM_VIEW_DOC_MAP, IDI_VIEW_UD_DLG_OFF_ICON, IDI_VIEW_UD_DLG_ON_ICON, IDI_VIEW_UD_DLG_OFF_ICON, IDR_DOCMAP}, + {IDM_VIEW_FUNC_LIST, IDI_VIEW_UD_DLG_OFF_ICON, IDI_VIEW_UD_DLG_ON_ICON, IDI_VIEW_UD_DLG_OFF_ICON, IDR_FUNC_LIST}, //-------------------------------------------------------------------------------------// {0, IDI_SEPARATOR_ICON, IDI_SEPARATOR_ICON, IDI_SEPARATOR_ICON, IDI_SEPARATOR_ICON}, diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index b11d1bbc1..4cf4c4b4e 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -156,7 +156,7 @@ IDR_CLOSETAB_INACT BITMAP "icons\\closeTabButton_inact.bmp" IDR_CLOSETAB_HOVER BITMAP "icons\\closeTabButton_hover.bmp" IDR_CLOSETAB_PUSH BITMAP "icons\\closeTabButton_push.bmp" IDR_DOCMAP BITMAP "icons\\docMap.bmp" - +IDR_FUNC_LIST BITMAP "icons\\functionList.bmp" IDI_STARTRECORD_OFF_ICON ICON "icons\\startrecord_off.ico" IDI_STARTRECORD_ON_ICON ICON "icons\\startrecord_on.ico" IDI_STARTRECORD_DISABLE_ICON ICON "icons\\startrecord_dis.ico" @@ -454,7 +454,6 @@ BEGIN END MENUITEM "Document Map", IDM_VIEW_DOC_MAP - MENUITEM "Function List", IDM_VIEW_FUNC_LIST MENUITEM SEPARATOR MENUITEM "Synchronize Vertical Scrolling", IDM_VIEW_SYNSCROLLV diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 903bf4406..07f033b99 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1900,12 +1900,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa return FALSE; } - case NPPM_INTERNAL_SETDOCMAPCHECK: - { - checkMenuItem(IDM_VIEW_DOC_MAP, lParam == TRUE ? true : false); - return TRUE; - } - // // These are sent by Preferences Dialog // diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index a63364cab..b83869773 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -34,6 +34,7 @@ #include "clipboardFormats.h" #include "VerticalFileSwitcher.h" #include "documentMap.h" +#include "functionListPanel.h" void Notepad_plus::macroPlayback(Macro macro) { @@ -344,10 +345,11 @@ void Notepad_plus::command(int id) case IDM_VIEW_DOC_MAP: { - if(_pDocMap && _pDocMap->isVisible()) + if (_pDocMap && (!_pDocMap->isClosed())) { _pDocMap->display(false); _pDocMap->vzDlgDisplay(false); + _pDocMap->setClosed(true); checkMenuItem(IDM_VIEW_DOC_MAP, false); _toolBar.setCheck(IDM_VIEW_DOC_MAP, false); } @@ -356,26 +358,27 @@ void Notepad_plus::command(int id) checkMenuItem(IDM_VIEW_DOC_MAP, true); _toolBar.setCheck(IDM_VIEW_DOC_MAP, true); launchDocMap(); + _pDocMap->setClosed(false); } } break; case IDM_VIEW_FUNC_LIST: { - launchFunctionList(); - /* - if(_pDocMap && _pDocMap->isVisible()) + if (_pFuncList && (!_pFuncList->isClosed())) { - _pDocMap->display(false); - _pDocMap->vzDlgDisplay(false); - checkMenuItem(IDM_VIEW_DOC_MAP, false); + _pFuncList->display(false); + _pFuncList->setClosed(true); + checkMenuItem(IDM_VIEW_FUNC_LIST, false); + _toolBar.setCheck(IDM_VIEW_FUNC_LIST, false); } else { - checkMenuItem(IDM_VIEW_DOC_MAP, true); - launchDocMap(); + checkMenuItem(IDM_VIEW_FUNC_LIST, true); + _toolBar.setCheck(IDM_VIEW_FUNC_LIST, true); + launchFunctionList(); + _pFuncList->setClosed(false); } - */ } break; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h index 522eeebf1..8936d97ad 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h @@ -79,6 +79,14 @@ public: ::SendMessage(_hParent, toShow?NPPM_DMMSHOW:NPPM_DMMHIDE, 0, (LPARAM)_hSelf); }; + bool isClosed() const { + return _isClosed; + }; + + void setClosed(bool toClose) { + _isClosed = toClose; + }; + const TCHAR * getPluginFileName() const { return _moduleName.c_str(); }; @@ -131,6 +139,7 @@ protected : int _iDockedPos; generic_string _moduleName; generic_string _pluginName; + bool _isClosed; }; #endif // DOCKINGDLGINTERFACE_H diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp index f19914638..f3a1f2f18 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp @@ -311,8 +311,7 @@ BOOL CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara { case DMN_CLOSE: { - ::SendMessage(_hParent, NPPM_INTERNAL_SETDOCMAPCHECK, 0, FALSE); - _vzDlg.display(false); + ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DOC_MAP, 0); return TRUE; } @@ -325,7 +324,6 @@ BOOL CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara case DMN_SWITCHOFF: { - ::SendMessage(_hParent, NPPM_INTERNAL_SETDOCMAPCHECK, 0, FALSE); _vzDlg.display(false); return TRUE; } diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index 62e5d20c8..c34a4ffa4 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -307,7 +307,10 @@ void FunctionListPanel::notified(LPNMHDR notification) } } - + else if (notification->code == DMN_CLOSE) + { + ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_FUNC_LIST, 0); + } } diff --git a/PowerEditor/src/icons/functionList.bmp b/PowerEditor/src/icons/functionList.bmp new file mode 100644 index 0000000000000000000000000000000000000000..142ebe1cb8f2078e5c719c9bb7f6fbea2de619b9 GIT binary patch literal 1334 zcmZY7KXTSU42NN52F58lf=W)1T0;+ITt-LHO`_r(d=1r{fkHP(DyN`W-t~qV7;HcL zv+VVswfD={hmUeC4)$Hfe>y5l9qT zOn6OE%+(P{6nYI!l{7d4i9)Yoo00}cAW`V`NnA;TBakTc`dp!;!4XIldVR`N(%=Xr z3cWsaDQR#75{15gfwhtbM<7vX3C16ym?L-0HBo2@6(|gjK%&s=x0#X#M<7w?^-Enz zgCmeA^!nXAB*NebBnrKzLMmx+1QLZ_)1;I%I0A`6UsEVrNrNMhD6|ygFHsmAfy7*U zO)XW@;0PoNy{4ThX>bG*gD{k&fXHrlswd*r|| zyKgja=WW{_kNxF5w^?&Dw*A=mV_fIQtdHZEHTUQG`Mf7C828(`-Cy;f12^aC=c>=A oLUO&$9!WHvzrgQqS_wcxLBW{yko*-wTZIa{vGU literal 0 HcmV?d00001 diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index a0384050f..17f608072 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -186,6 +186,7 @@ #define IDR_REDO 1525 #define IDR_M_PLAYRECORD 1526 #define IDR_DOCMAP 1527 +#define IDR_FUNC_LIST 1528 #define IDR_CLOSETAB 1530 #define IDR_CLOSETAB_INACT 1531 @@ -384,7 +385,7 @@ #define NPPM_INTERNAL_RECENTFILELIST_UPDATE (NOTEPADPLUS_USER_INTERNAL + 35) #define NPPM_INTERNAL_RECENTFILELIST_SWITCH (NOTEPADPLUS_USER_INTERNAL + 36) #define NPPM_INTERNAL_GETSCINTEDTVIEW (NOTEPADPLUS_USER_INTERNAL + 37) - #define NPPM_INTERNAL_SETDOCMAPCHECK (NOTEPADPLUS_USER_INTERNAL + 38) + //#define NPPM_INTERNAL_SETDOCMAPCHECK (NOTEPADPLUS_USER_INTERNAL + 38) //wParam: 0 //lParam: document new index