diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 79868eea4..84f62a87b 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -108,7 +108,8 @@ ToolBarButtonUnit toolBarIcons[] = { Notepad_plus::Notepad_plus(): _mainWindowStatus(0), _pDocTab(NULL), _pEditView(NULL), _pMainSplitter(NULL), - _recordingMacro(false), _pTrayIco(NULL), _isUDDocked(false), _pFileSwitcherPanel(NULL), _pProjectPanel(NULL), + _recordingMacro(false), _pTrayIco(NULL), _isUDDocked(false), _pFileSwitcherPanel(NULL), + _pProjectPanel_1(NULL), _pProjectPanel_2(NULL), _pProjectPanel_3(NULL), _linkTriggered(true), _isDocModifing(false), _isHotspotDblClicked(false), _sysMenuEntering(false), _autoCompleteMain(&_mainEditView), _autoCompleteSub(&_subEditView), _smartHighlighter(&_findReplaceDlg), _isFileOpening(false), _rememberThisSession(true), _pAnsiCharPanel(NULL), _pClipboardHistoryPanel(NULL) @@ -158,9 +159,20 @@ Notepad_plus::~Notepad_plus() if (_pFileSwitcherPanel) delete _pFileSwitcherPanel; - if (_pProjectPanel) + if (_pProjectPanel_1) { - delete _pProjectPanel; + _pProjectPanel_1->destroy(); + delete _pProjectPanel_1; + } + if (_pProjectPanel_2) + { + _pProjectPanel_2->destroy(); + delete _pProjectPanel_2; + } + if (_pProjectPanel_3) + { + _pProjectPanel_3->destroy(); + delete _pProjectPanel_3; } } @@ -4662,17 +4674,17 @@ void Notepad_plus::launchAnsiCharPanel() _pAnsiCharPanel->display(); } -void Notepad_plus::launchProjectPanel() +void Notepad_plus::launchProjectPanel(int cmdID, ProjectPanel ** pProjPanel) { - if (!_pProjectPanel) + if (!*pProjPanel) { - _pProjectPanel = new ProjectPanel; - _pProjectPanel->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf()); + *pProjPanel = new ProjectPanel; + (*pProjPanel)->init(_pPublicInterface->getHinst(), (*pProjPanel)->getHSelf()); tTbData data = {0}; - _pProjectPanel->create(&data); + (*pProjPanel)->create(&data); - ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, (WPARAM)_pProjectPanel->getHSelf()); + ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, (WPARAM)(*pProjPanel)->getHSelf()); // define the default docking behaviour data.uMask = DWS_DF_CONT_LEFT | DWS_ICONTAB; //data.hIconTab = (HICON)::LoadImage(_pPublicInterface->getHinst(), MAKEINTRESOURCE(IDI_FIND_RESULT_ICON), IMAGE_ICON, 0, 0, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); @@ -4681,8 +4693,8 @@ void Notepad_plus::launchProjectPanel() // the dlgDlg should be the index of funcItem where the current function pointer is // in this case is DOCKABLE_DEMO_INDEX // In the case of Notepad++ internal function, it'll be the command ID which triggers this dialog - data.dlgID = IDM_VIEW_PROJECT_PANEL; + data.dlgID = cmdID; ::SendMessage(_pPublicInterface->getHSelf(), NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data); } - _pProjectPanel->display(); + (*pProjPanel)->display(); } \ No newline at end of file diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index 3ab98d64b..1cd1932b3 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -400,7 +400,9 @@ private: AnsiCharPanel *_pAnsiCharPanel; ClipboardHistoryPanel *_pClipboardHistoryPanel; VerticalFileSwitcher *_pFileSwitcherPanel; - ProjectPanel *_pProjectPanel; + ProjectPanel *_pProjectPanel_1; + ProjectPanel *_pProjectPanel_2; + ProjectPanel *_pProjectPanel_3; BOOL notify(SCNotification *notification); void specialCmd(int id); @@ -587,7 +589,7 @@ private: void launchAnsiCharPanel(); void launchClipboardHistoryPanel(); void launchFileSwitcherPanel(); - void launchProjectPanel(); + void launchProjectPanel(int cmdID, ProjectPanel ** pProjPanel); }; diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index 6f63b2ab2..47d48781d 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -425,9 +425,17 @@ BEGIN MENUITEM "7", IDM_VIEW_UNFOLD_7 MENUITEM "8", IDM_VIEW_UNFOLD_8 END + MENUITEM SEPARATOR MENUITEM "Summary...", IDM_VIEW_SUMMARY MENUITEM SEPARATOR + POPUP "Project" + BEGIN + MENUITEM "Project Panel 1", IDM_VIEW_PROJECT_PANEL_1 + MENUITEM "Project Panel 2", IDM_VIEW_PROJECT_PANEL_2 + MENUITEM "Project Panel 3", IDM_VIEW_PROJECT_PANEL_3 + END + MENUITEM SEPARATOR MENUITEM "Synchronize Vertical Scrolling", IDM_VIEW_SYNSCROLLV MENUITEM "Synchronize Horizontal Scrolling", IDM_VIEW_SYNSCROLLH MENUITEM SEPARATOR diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 77e4e9ad5..792a83e8f 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -44,8 +44,8 @@ void Notepad_plus::command(int id) { case IDM_FILE_NEW: { - //fileNew(); - launchProjectPanel(); + fileNew(); + //launchProjectPanel(); } break; @@ -298,9 +298,19 @@ void Notepad_plus::command(int id) } break; - case IDM_VIEW_PROJECT_PANEL: + case IDM_VIEW_PROJECT_PANEL_1: { - launchProjectPanel(); + launchProjectPanel(id, &_pProjectPanel_1); + } + break; + case IDM_VIEW_PROJECT_PANEL_2: + { + launchProjectPanel(id, &_pProjectPanel_2); + } + break; + case IDM_VIEW_PROJECT_PANEL_3: + { + launchProjectPanel(id, &_pProjectPanel_3); } break; diff --git a/PowerEditor/src/menuCmdID.h b/PowerEditor/src/menuCmdID.h index 043589098..b874322ac 100644 --- a/PowerEditor/src/menuCmdID.h +++ b/PowerEditor/src/menuCmdID.h @@ -243,15 +243,19 @@ #define IDM_VIEW_UNFOLD_8 (IDM_VIEW_UNFOLD + 8) #define IDM_VIEW_FILESWITCHER_PANEL (IDM_VIEW + 70) - #define IDM_VIEW_PROJECT_PANEL (IDM_VIEW + 80) + #define IDM_VIEW_SWITCHTO_OTHER_VIEW (IDM_VIEW + 72) + + //#define IDM_VIEW_LAUNCH_PROJECT_PANEL (IDM_VIEW + 80) + #define IDM_VIEW_PROJECT_PANEL_1 (IDM_VIEW + 81) + #define IDM_VIEW_PROJECT_PANEL_2 (IDM_VIEW + 82) + #define IDM_VIEW_PROJECT_PANEL_3 (IDM_VIEW + 83) #define IDM_VIEW_GOTO_ANOTHER_VIEW 10001 #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002 #define IDM_VIEW_GOTO_NEW_INSTANCE 10003 #define IDM_VIEW_LOAD_IN_NEW_INSTANCE 10004 - #define IDM_VIEW_SWITCHTO_OTHER_VIEW (IDM_VIEW + 72) - + #define IDM_FORMAT (IDM + 5000) #define IDM_FORMAT_TODOS (IDM_FORMAT + 1) #define IDM_FORMAT_TOUNIX (IDM_FORMAT + 2)