call DoDirtyProcessing() from OnIdle() instead of using wxYield() (patch 1518119)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -341,6 +341,8 @@ protected:
|
|||||||
void UnselectAllChildren( wxGenericTreeItem *item );
|
void UnselectAllChildren( wxGenericTreeItem *item );
|
||||||
void ChildrenClosing(wxGenericTreeItem* item);
|
void ChildrenClosing(wxGenericTreeItem* item);
|
||||||
|
|
||||||
|
void DoDirtyProcessing();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl)
|
DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl)
|
||||||
|
@@ -1962,7 +1962,7 @@ void wxGenericTreeCtrl::ScrollTo(const wxTreeItemId &item)
|
|||||||
#if defined( __WXMSW__ ) || defined(__WXMAC__)
|
#if defined( __WXMSW__ ) || defined(__WXMAC__)
|
||||||
Update();
|
Update();
|
||||||
#else
|
#else
|
||||||
wxYieldIfNeeded();
|
DoDirtyProcessing();
|
||||||
#endif
|
#endif
|
||||||
wxGenericTreeItem *gitem = (wxGenericTreeItem*) item.m_pItem;
|
wxGenericTreeItem *gitem = (wxGenericTreeItem*) item.m_pItem;
|
||||||
|
|
||||||
@@ -2906,7 +2906,7 @@ wxTextCtrl *wxGenericTreeCtrl::EditLabel(const wxTreeItemId& item,
|
|||||||
#if defined( __WXMSW__ ) || defined(__WXMAC__)
|
#if defined( __WXMSW__ ) || defined(__WXMAC__)
|
||||||
Update();
|
Update();
|
||||||
#else
|
#else
|
||||||
wxYieldIfNeeded();
|
DoDirtyProcessing();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: use textCtrlClass here to create the control of correct class
|
// TODO: use textCtrlClass here to create the control of correct class
|
||||||
@@ -3293,17 +3293,10 @@ void wxGenericTreeCtrl::OnInternalIdle()
|
|||||||
SelectItem(GetRootItem());
|
SelectItem(GetRootItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* after all changes have been done to the tree control,
|
// after all changes have been done to the tree control,
|
||||||
* we actually redraw the tree when everything is over */
|
// actually redraw the tree when everything is over
|
||||||
|
if (m_dirty)
|
||||||
if (!m_dirty) return;
|
DoDirtyProcessing();
|
||||||
if (m_freezeCount) return;
|
|
||||||
|
|
||||||
m_dirty = false;
|
|
||||||
|
|
||||||
CalculatePositions();
|
|
||||||
Refresh();
|
|
||||||
AdjustMyScrollbars();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericTreeCtrl::CalculateSize( wxGenericTreeItem *item, wxDC &dc )
|
void wxGenericTreeCtrl::CalculateSize( wxGenericTreeItem *item, wxDC &dc )
|
||||||
@@ -3550,4 +3543,16 @@ void wxGenericTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image
|
|||||||
|
|
||||||
#endif // WXWIN_COMPATIBILITY_2_4
|
#endif // WXWIN_COMPATIBILITY_2_4
|
||||||
|
|
||||||
|
void wxGenericTreeCtrl::DoDirtyProcessing()
|
||||||
|
{
|
||||||
|
if (m_freezeCount)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_dirty = false;
|
||||||
|
|
||||||
|
CalculatePositions();
|
||||||
|
Refresh();
|
||||||
|
AdjustMyScrollbars();
|
||||||
|
}
|
||||||
|
|
||||||
#endif // wxUSE_TREECTRL
|
#endif // wxUSE_TREECTRL
|
||||||
|
Reference in New Issue
Block a user