Fix Functions list scrolling to the top on file save
Retain Functions list scrollbar position on reload. Fix #9659, close #10183pull/10237/head
parent
3482673fd8
commit
46a264e2db
|
@ -315,6 +315,13 @@ bool FunctionListPanel::serialize(const generic_string & outputFilename)
|
||||||
|
|
||||||
void FunctionListPanel::reload()
|
void FunctionListPanel::reload()
|
||||||
{
|
{
|
||||||
|
bool isScrollBarOn = GetWindowLongPtr(_treeView.getHSelf(), GWL_STYLE) & WS_VSCROLL;
|
||||||
|
//get scroll position
|
||||||
|
if (isScrollBarOn)
|
||||||
|
{
|
||||||
|
GetScrollInfo(_treeView.getHSelf(), SB_VERT, &si);
|
||||||
|
}
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
_findLine = -1;
|
_findLine = -1;
|
||||||
_findEndLine = -1;
|
_findEndLine = -1;
|
||||||
|
@ -396,6 +403,12 @@ void FunctionListPanel::reload()
|
||||||
|
|
||||||
// invalidate the editor rect
|
// invalidate the editor rect
|
||||||
::InvalidateRect(_hSearchEdit, NULL, TRUE);
|
::InvalidateRect(_hSearchEdit, NULL, TRUE);
|
||||||
|
|
||||||
|
//set scroll position
|
||||||
|
if (isScrollBarOn)
|
||||||
|
{
|
||||||
|
SetScrollInfo(_treeView.getHSelf(), SB_VERT, &si, TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FunctionListPanel::markEntry()
|
void FunctionListPanel::markEntry()
|
||||||
|
@ -498,6 +511,11 @@ void FunctionListPanel::init(HINSTANCE hInst, HWND hPere, ScintillaEditView **pp
|
||||||
_funcParserMgr.init(funcListDefaultXmlPath, funcListDefaultXmlPath, ppEditView);
|
_funcParserMgr.init(funcListDefaultXmlPath, funcListDefaultXmlPath, ppEditView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//init scrollinfo structure
|
||||||
|
ZeroMemory(&si, sizeof(si));
|
||||||
|
si.cbSize = sizeof(si);
|
||||||
|
si.fMask = SIF_POS;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FunctionListPanel::openSelection(const TreeView & treeView)
|
bool FunctionListPanel::openSelection(const TreeView & treeView)
|
||||||
|
|
|
@ -109,6 +109,7 @@ private:
|
||||||
TreeView _treeView;
|
TreeView _treeView;
|
||||||
TreeView _treeViewSearchResult;
|
TreeView _treeViewSearchResult;
|
||||||
|
|
||||||
|
SCROLLINFO si;
|
||||||
long _findLine = -1;
|
long _findLine = -1;
|
||||||
long _findEndLine = -1;
|
long _findEndLine = -1;
|
||||||
HTREEITEM _findItem;
|
HTREEITEM _findItem;
|
||||||
|
|
Loading…
Reference in New Issue