Moved EnsureVisible to avoid spurious selection of root during idle processing
(via ScrollTo/wxYieldIfNeeded) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1858,8 +1858,6 @@ void wxGenericTreeCtrl::DoSelectItem(const wxTreeItemId& itemId,
|
|||||||
parent = GetItemParent( parent );
|
parent = GetItemParent( parent );
|
||||||
}
|
}
|
||||||
|
|
||||||
EnsureVisible( itemId );
|
|
||||||
|
|
||||||
// ctrl press
|
// ctrl press
|
||||||
if (unselect_others)
|
if (unselect_others)
|
||||||
{
|
{
|
||||||
@@ -1891,6 +1889,11 @@ void wxGenericTreeCtrl::DoSelectItem(const wxTreeItemId& itemId,
|
|||||||
RefreshLine( m_current );
|
RefreshLine( m_current );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This can cause idle processing to select the root
|
||||||
|
// if no item is selected, so it must be after the
|
||||||
|
// selection is set
|
||||||
|
EnsureVisible( itemId );
|
||||||
|
|
||||||
event.SetEventType(wxEVT_COMMAND_TREE_SEL_CHANGED);
|
event.SetEventType(wxEVT_COMMAND_TREE_SEL_CHANGED);
|
||||||
GetEventHandler()->ProcessEvent( event );
|
GetEventHandler()->ProcessEvent( event );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user