Skip to content

Commit

Permalink
[UPDATE] Implement file switcher feature (in progress).
Browse files Browse the repository at this point in the history
- Notepad-plus svn trunk @ 760
  • Loading branch information
donho committed May 22, 2011
1 parent a187787 commit 02b3846
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion PowerEditor/src/NppCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ void Notepad_plus::command(int id)
case IDM_FILE_NEW:
{
fileNew();
//launchFileSwitcherPanel();
}
break;

case IDM_FILE_OPEN:
{
fileOpen();
//launchFileSwitcherPanel();
}
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,33 @@ BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPA

return TRUE;
}
/*

case WM_NOTIFY:
{
switch (((LPNMHDR)lParam)->code)
{
case NM_DBLCLK:
case NM_CLICK:
{
LPNMITEMACTIVATE lpnmitem = (LPNMITEMACTIVATE) lParam;
int i = lpnmitem->iItem;

if (i == -1)
return TRUE;
//printInt(i);
//printStr(TEXT("OK"));

int view2set = _fileListView.getViewInfoFromIndex(i);
int index2Switch = _fileListView.getDocIndexInfoFromIndex(i);
::SendMessage(_hParent, NPPM_ACTIVATEDOC, view2set, index2Switch);

return TRUE;
}
default:
break;
}
}
return TRUE;
*/

case WM_SIZE:
{
int width = LOWORD(lParam);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,15 @@ void VerticalFileSwitcherListView::initList()
ListView_InsertItem(_hSelf, &item);
}
}
//{}
int VerticalFileSwitcherListView::getViewInfoFromIndex(int index) const {
if (index < 0 || index >= int(_taskListInfo._tlfsLst.size()))
return -1;
return _taskListInfo._tlfsLst[index]._iView;
}

int VerticalFileSwitcherListView::getDocIndexInfoFromIndex(int index) const {
if (index < 0 || index >= int(_taskListInfo._tlfsLst.size()))
return -1;
return _taskListInfo._tlfsLst[index]._docIndex;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class VerticalFileSwitcherListView : public Window
virtual void init(HINSTANCE hInst, HWND parent, HIMAGELIST hImaLst);
virtual void destroy();
void initList();
int getViewInfoFromIndex(int index) const;
int getDocIndexInfoFromIndex(int index) const;

protected:
TaskListInfo _taskListInfo;
Expand Down

0 comments on commit 02b3846

Please sign in to comment.