[NEW_FEDATURE] Add contextMenu in VerticalFileSwitcher panel.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@779 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2011-06-22 00:12:36 +00:00
parent 61b3183593
commit daaaabe744
3 changed files with 23 additions and 2 deletions

View File

@ -282,6 +282,10 @@ BOOL Notepad_plus::notify(SCNotification *notification)
{
switchEditViewTo(SUB_VIEW);
}
else if (_pFileSwitcherPanel && notification->nmhdr.hwndFrom == _pFileSwitcherPanel->getHSelf())
{
// Already switched, so do nothing here.
}
else // From tool bar or Status Bar
return TRUE;
//break;

View File

@ -26,7 +26,6 @@ BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPA
{
case WM_INITDIALOG :
{
_fileListView.init(_hInst, _hSelf, _hImaLst);
_fileListView.initList();
_fileListView.display();
@ -50,6 +49,24 @@ BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPA
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:
{
switch (((LPNMLVKEYDOWN)lParam)->wVKey)

View File

@ -102,7 +102,7 @@ void VerticalFileSwitcherListView::initList()
ListView_InsertItem(_hSelf, &item);
}
}
//{}
int VerticalFileSwitcherListView::getBufferIDFromIndex(int index) const {
if (index < 0 || index >= int(_taskListInfo._tlfsLst.size()))
return -1;