From daf42f1d62fbec3909e817b1cd0061d9eb41e874 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sat, 25 Oct 2014 19:44:57 +0000 Subject: [PATCH] [BUG_FIXED] Fix document list panel has no selection while start up. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1280 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/NppBigSwitch.cpp | 12 +++++++++++- .../VerticalFileSwitcherListView.cpp | 8 ++------ PowerEditor/visual.net/notepadPlus.vcxproj | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index b89c2222..4be8006a 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -747,8 +747,18 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa getTaskListInfo(tli); if (lParam != 0) + { + for (int idx = 0; idx < (int)tli->_tlfsLst.size(); ++idx) + { + if (tli->_tlfsLst[idx]._iView == currentView() && + tli->_tlfsLst[idx]._docIndex == _pDocTab->getCurrentTabIndex()) + { + tli->_currentIndex = idx; + break; + } + } return TRUE; - + } if (NppParameters::getInstance()->getNppGUI()._styleMRU) { tli->_currentIndex = 0; diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp index fa7d2263..e9070299 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp @@ -72,7 +72,6 @@ void VerticalFileSwitcherListView::init(HINSTANCE hInst, HWND parent, HIMAGELIST ListView_SetExtendedListViewStyle(_hSelf, LVS_EX_FULLROWSELECT | LVS_EX_BORDERSELECT | LVS_EX_INFOTIP); ListView_SetItemCountEx(_hSelf, 50, LVSICF_NOSCROLL); ListView_SetImageList(_hSelf, _hImaLst, LVSIL_SMALL); - ListView_SetItemState(_hSelf, 0, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED); } void VerticalFileSwitcherListView::destroy() @@ -141,6 +140,7 @@ void VerticalFileSwitcherListView::initList() ListView_SetItemText(_hSelf, i, 1, (LPTSTR)::PathFindExtension(fileNameStatus._fn.c_str())); } } + ListView_SetItemState(_hSelf, taskListInfo._currentIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); } void VerticalFileSwitcherListView::reload() @@ -243,11 +243,7 @@ void VerticalFileSwitcherListView::activateItem(int bufferID, int iView) for (int i = 0; i < nbItem; ++i) ListView_SetItemState(_hSelf, i, 0, LVIS_FOCUSED|LVIS_SELECTED); - int i = find(bufferID, iView); - if (i == -1) - { - newItem(bufferID, iView); - } + int i = newItem(bufferID, iView); ListView_SetItemState(_hSelf, i, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED); } diff --git a/PowerEditor/visual.net/notepadPlus.vcxproj b/PowerEditor/visual.net/notepadPlus.vcxproj index 63fc48e9..abf91bc8 100644 --- a/PowerEditor/visual.net/notepadPlus.vcxproj +++ b/PowerEditor/visual.net/notepadPlus.vcxproj @@ -74,7 +74,7 @@ /fixed:no %(AdditionalOptions) comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;%(AdditionalDependencies) LinkVerboseLib - $(OutDir)notepadPlus_Debug.exe + $(OutDir)notepad++.exe 1.0 /TLBID 5