[NEW] Add FunctionList toolbar button.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1054 f5eea248-9336-0410-98b8-ebc06183d4e3
remotes/trunk
Don Ho 2013-06-04 23:46:24 +00:00
parent 02086c9c0c
commit 3b9f24ba51
9 changed files with 31 additions and 23 deletions

View File

@ -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},

View File

@ -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

View File

@ -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
//

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -307,7 +307,10 @@ void FunctionListPanel::notified(LPNMHDR notification)
}
}
else if (notification->code == DMN_CLOSE)
{
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_FUNC_LIST, 0);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -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