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 000000000..142ebe1cb Binary files /dev/null and b/PowerEditor/src/icons/functionList.bmp differ 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