Make wxTreeCtrl::EnsureVisible() work while frozen in wxMSW

Scrolling the item into view to make it visible didn't work since the
changes of badf6bc300, which suppressed
scrolling completely while frozen, any longer.

Work around it by remembering the item to make visible and actually
doing it when the control is thawed.

Also add menu item to call Freeze()/Thaw() on wxTreeCtrl in the sample
to make testing this and similar problems easier.

Closes #18435.
This commit is contained in:
Vadim Zeitlin
2019-07-09 23:00:11 +02:00
parent 1cdba2b5ab
commit e8712b3c56
4 changed files with 35 additions and 0 deletions

View File

@@ -315,6 +315,9 @@ private:
// Virtual root item, if wxTR_HIDE_ROOT is set.
void* m_pVirtualRoot;
// Item to call EnsureVisible() on when the tree is thawed, if necessary.
wxTreeItemId m_htEnsureVisibleOnThaw;
// the starting item for selection with Shift
wxTreeItemId m_htSelStart, m_htClickedItem;
wxPoint m_ptClick;