Skip to content

Commit

Permalink
[NEW_FEDATURE] Add contextMenu in VerticalFileSwitcher panel.
Browse files Browse the repository at this point in the history
- Notepad-plus svn trunk @ 779
  • Loading branch information
donho committed Jun 22, 2011
1 parent 6bd466e commit 4d2bc76
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions PowerEditor/src/NppNotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4d2bc76

Please sign in to comment.