[UPDATE] Implement file switcher feature (in progress).
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@760 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
1e441838a4
commit
1309f8fa8e
@ -45,13 +45,13 @@ void Notepad_plus::command(int id)
|
||||
case IDM_FILE_NEW:
|
||||
{
|
||||
fileNew();
|
||||
//launchFileSwitcherPanel();
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_FILE_OPEN:
|
||||
{
|
||||
fileOpen();
|
||||
//launchFileSwitcherPanel();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user