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:
Vadim Zeitlin
2006-07-24 18:12:23 +00:00
parent 97757cee26
commit 27f8357f3c
2 changed files with 20 additions and 13 deletions

View File

@@ -1962,7 +1962,7 @@ void wxGenericTreeCtrl::ScrollTo(const wxTreeItemId &item)
#if defined( __WXMSW__ ) || defined(__WXMAC__)
Update();
#else
wxYieldIfNeeded();
DoDirtyProcessing();
#endif
wxGenericTreeItem *gitem = (wxGenericTreeItem*) item.m_pItem;
@@ -2906,7 +2906,7 @@ wxTextCtrl *wxGenericTreeCtrl::EditLabel(const wxTreeItemId& item,
#if defined( __WXMSW__ ) || defined(__WXMAC__)
Update();
#else
wxYieldIfNeeded();
DoDirtyProcessing();
#endif
// TODO: use textCtrlClass here to create the control of correct class
@@ -3293,17 +3293,10 @@ void wxGenericTreeCtrl::OnInternalIdle()
SelectItem(GetRootItem());
}
/* after all changes have been done to the tree control,
* we actually redraw the tree when everything is over */
if (!m_dirty) return;
if (m_freezeCount) return;
m_dirty = false;
CalculatePositions();
Refresh();
AdjustMyScrollbars();
// after all changes have been done to the tree control,
// actually redraw the tree when everything is over
if (m_dirty)
DoDirtyProcessing();
}
void wxGenericTreeCtrl::CalculateSize( wxGenericTreeItem *item, wxDC &dc )
@@ -3550,4 +3543,16 @@ void wxGenericTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image
#endif // WXWIN_COMPATIBILITY_2_4
void wxGenericTreeCtrl::DoDirtyProcessing()
{
if (m_freezeCount)
return;
m_dirty = false;
CalculatePositions();
Refresh();
AdjustMyScrollbars();
}
#endif // wxUSE_TREECTRL