Disable scrollbars for frozen wxTreeCtrl in MSW

Replace the hack with resizing the control to the minimal possible size
while it's frozen with just disabling its scrollbars in the frozen
state. This should also fix the original problem (of scrollbar jumping
around wildly as the items are added), but without different problems
due to the control being resized unexpectedly.

Unfortunately we don't have a reproducer for the original problem, which
the commits 6754c300cf ("Freeze wxTreeCtrl
in wxMSW by hiding it") and 4e1e8dc51b
("Change wxMSW wxTreeCtrl::DoFreeze() to not hide the tree any more" --
but resize it instead) tried to fix, so it's difficult to be sure that
it really doesn't exist any more, but it does seem like it ought to be
as the comment added back then spoke of the problem with scrollbar
updating and this really shouldn't happen if scrollbars are completely
disabled.

See https://github.com/wxWidgets/wxWidgets/pull/375
This commit is contained in:
Vadim Zeitlin
2017-12-09 22:36:08 +01:00
parent aa4d51d579
commit badf6bc300
2 changed files with 9 additions and 40 deletions

View File

@@ -207,10 +207,6 @@ protected:
virtual void DoFreeze() wxOVERRIDE;
virtual void DoThaw() wxOVERRIDE;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) wxOVERRIDE;
virtual bool MSWShouldSetDefaultFont() const wxOVERRIDE { return false; }
// SetImageList helper
@@ -336,9 +332,6 @@ private:
// whether we need to deselect other items on mouse up
bool m_mouseUpDeselect;
// The size to restore the control to when it is thawed, see DoThaw().
wxSize m_thawnSize;
friend class wxTreeItemIndirectData;
friend class wxTreeSortHelper;