[NEW_FEATURE] (Author: Andreas Jonsson) Make Document map togglable via menu.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@931 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2012-07-21 00:46:03 +00:00
parent dbd2df8571
commit 8d4f1a36c5
5 changed files with 24 additions and 1 deletions

View File

@ -1881,6 +1881,12 @@ 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

@ -327,8 +327,18 @@ void Notepad_plus::command(int id)
case IDM_VIEW_DOC_MAP:
{
if(_pDocMap && _pDocMap->isVisible())
{
_pDocMap->display(false);
_pDocMap->vzDlgDisplay(false);
checkMenuItem(IDM_VIEW_DOC_MAP, false);
}
else
{
checkMenuItem(IDM_VIEW_DOC_MAP, true);
launchDocMap();
}
}
break;
case IDM_EDIT_DELETE:

View File

@ -309,6 +309,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);
return TRUE;
}
@ -322,6 +323,7 @@ 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

@ -114,6 +114,10 @@ public:
_hParent = parent2set;
};
void vzDlgDisplay(bool toShow = true) {
_vzDlg.display(toShow);
}
void reloadMap();
void wrapMap();
void initWrapMap();

View File

@ -375,6 +375,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)
//wParam: 0
//lParam: document new index