[NEW_FEDATURE] Add contextMenu in VerticalFileSwitcher panel.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@779 f5eea248-9336-0410-98b8-ebc06183d4e3remotes/trunk
parent
61b3183593
commit
daaaabe744
|
@ -281,6 +281,10 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||||
else if (notification->nmhdr.hwndFrom == _subDocTab.getHSelf())
|
else if (notification->nmhdr.hwndFrom == _subDocTab.getHSelf())
|
||||||
{
|
{
|
||||||
switchEditViewTo(SUB_VIEW);
|
switchEditViewTo(SUB_VIEW);
|
||||||
|
}
|
||||||
|
else if (_pFileSwitcherPanel && notification->nmhdr.hwndFrom == _pFileSwitcherPanel->getHSelf())
|
||||||
|
{
|
||||||
|
// Already switched, so do nothing here.
|
||||||
}
|
}
|
||||||
else // From tool bar or Status Bar
|
else // From tool bar or Status Bar
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -26,7 +26,6 @@ BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPA
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG :
|
case WM_INITDIALOG :
|
||||||
{
|
{
|
||||||
|
|
||||||
_fileListView.init(_hInst, _hSelf, _hImaLst);
|
_fileListView.init(_hInst, _hSelf, _hImaLst);
|
||||||
_fileListView.initList();
|
_fileListView.initList();
|
||||||
_fileListView.display();
|
_fileListView.display();
|
||||||
|
@ -50,6 +49,24 @@ BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPA
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NM_RCLICK :
|
||||||
|
{
|
||||||
|
// Switch to the right document
|
||||||
|
LPNMITEMACTIVATE lpnmitem = (LPNMITEMACTIVATE) lParam;
|
||||||
|
int i = lpnmitem->iItem;
|
||||||
|
if (i == -1)
|
||||||
|
return TRUE;
|
||||||
|
activateDoc(i);
|
||||||
|
|
||||||
|
// Redirect NM_RCLICK message to Notepad_plus handle
|
||||||
|
NMHDR nmhdr;
|
||||||
|
nmhdr.code = NM_RCLICK;
|
||||||
|
nmhdr.hwndFrom = _hSelf;
|
||||||
|
nmhdr.idFrom = ::GetDlgCtrlID(nmhdr.hwndFrom);
|
||||||
|
::SendMessage(_hParent, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case LVN_KEYDOWN:
|
case LVN_KEYDOWN:
|
||||||
{
|
{
|
||||||
switch (((LPNMLVKEYDOWN)lParam)->wVKey)
|
switch (((LPNMLVKEYDOWN)lParam)->wVKey)
|
||||||
|
|
|
@ -102,7 +102,7 @@ void VerticalFileSwitcherListView::initList()
|
||||||
ListView_InsertItem(_hSelf, &item);
|
ListView_InsertItem(_hSelf, &item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//{}
|
|
||||||
int VerticalFileSwitcherListView::getBufferIDFromIndex(int index) const {
|
int VerticalFileSwitcherListView::getBufferIDFromIndex(int index) const {
|
||||||
if (index < 0 || index >= int(_taskListInfo._tlfsLst.size()))
|
if (index < 0 || index >= int(_taskListInfo._tlfsLst.size()))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue