]> git.saurik.com Git - wxWidgets.git/commitdiff
call DoDirtyProcessing() from OnIdle() instead of using wxYield() (patch 1518119)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 24 Jul 2006 18:12:23 +0000 (18:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 24 Jul 2006 18:12:23 +0000 (18:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/treectlg.h
src/generic/treectlg.cpp

index f72b8fc4656abb10f4e5191c281c1caba7881263..ccaa5fbdb02689af6f4ec0ccde4dfb754de16602 100644 (file)
@@ -341,6 +341,8 @@ protected:
     void UnselectAllChildren( wxGenericTreeItem *item );
     void ChildrenClosing(wxGenericTreeItem* item);
 
     void UnselectAllChildren( wxGenericTreeItem *item );
     void ChildrenClosing(wxGenericTreeItem* item);
 
+    void DoDirtyProcessing();
+
 private:
     DECLARE_EVENT_TABLE()
     DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl)
 private:
     DECLARE_EVENT_TABLE()
     DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl)
index eaea98d3badbac9859ed6d47ed595cbaeb8ecf06..0c37bbbc46da058f64871a1edea1a8ccd1e1a848 100644 (file)
@@ -1962,7 +1962,7 @@ void wxGenericTreeCtrl::ScrollTo(const wxTreeItemId &item)
 #if defined( __WXMSW__ ) || defined(__WXMAC__)
         Update();
 #else
 #if defined( __WXMSW__ ) || defined(__WXMAC__)
         Update();
 #else
-        wxYieldIfNeeded();
+        DoDirtyProcessing();
 #endif
     wxGenericTreeItem *gitem = (wxGenericTreeItem*) item.m_pItem;
 
 #endif
     wxGenericTreeItem *gitem = (wxGenericTreeItem*) item.m_pItem;
 
@@ -2906,7 +2906,7 @@ wxTextCtrl *wxGenericTreeCtrl::EditLabel(const wxTreeItemId& item,
 #if defined( __WXMSW__ ) || defined(__WXMAC__)
         Update();
 #else
 #if defined( __WXMSW__ ) || defined(__WXMAC__)
         Update();
 #else
-        wxYieldIfNeeded();
+        DoDirtyProcessing();
 #endif
 
     // TODO: use textCtrlClass here to create the control of correct class
 #endif
 
     // 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,
-     * 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 )
 }
 
 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