diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index a7bc4100..d1b834cb 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -45,13 +45,13 @@ void Notepad_plus::command(int id) case IDM_FILE_NEW: { fileNew(); - //launchFileSwitcherPanel(); } break; case IDM_FILE_OPEN: { fileOpen(); + //launchFileSwitcherPanel(); } break; diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp index bdfbc934..3799b9ca 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp @@ -33,13 +33,25 @@ 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: @@ -47,7 +59,7 @@ BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPA } } return TRUE; -*/ + case WM_SIZE: { int width = LOWORD(lParam); diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp index dd07eac4..7c0c564d 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp @@ -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; +} \ No newline at end of file diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h index 0bcd95b4..5651c7eb 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h @@ -30,6 +30,8 @@ public: 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;