]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp
DisplayAvailable renamed
[wxWidgets.git] / wxPython / contrib / gizmos / wxCode / src / treelistctrl.cpp
index 3345ac6e5af5127f38fc5c4cc9dfc80dc558d1de..2d07d6b2d3c5a37822759a741adcaaf1cb66792f 100644 (file)
@@ -568,6 +568,8 @@ public:
     // implementation helpers
     void SendDeleteEvent(wxTreeListItem *itemBeingDeleted);
 
     // implementation helpers
     void SendDeleteEvent(wxTreeListItem *itemBeingDeleted);
 
+    void DoDirtyProcessing();
+    
     void DrawBorder(const wxTreeItemId& item);
     void DrawLine(const wxTreeItemId& item, bool below);
 
     void DrawBorder(const wxTreeItemId& item);
     void DrawLine(const wxTreeItemId& item, bool below);
 
@@ -1124,7 +1126,7 @@ void wxTreeListHeaderWindow::DoDrawRect( wxDC *dc, int x, int y, int w, int h )
     GtkStateType state = m_parent->IsEnabled() ? GTK_STATE_NORMAL
                                                : GTK_STATE_INSENSITIVE;
 
     GtkStateType state = m_parent->IsEnabled() ? GTK_STATE_NORMAL
                                                : GTK_STATE_INSENSITIVE;
 
-    x = dc->XLOG2DEV( x );
+    x = dc->LogicalToDeviceX( x );
 
     gtk_paint_box (m_wxwindow->style, GTK_PIZZA(m_wxwindow)->bin_window,
                    state, GTK_SHADOW_OUT,
 
     gtk_paint_box (m_wxwindow->style, GTK_PIZZA(m_wxwindow)->bin_window,
                    state, GTK_SHADOW_OUT,
@@ -1197,22 +1199,18 @@ void wxTreeListHeaderWindow::OnEraseBackground( wxEraseEvent& event )
 void wxTreeListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
 {
 #ifdef __WXGTK__
 void wxTreeListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
 {
 #ifdef __WXGTK__
-    wxClientDC real_dc( this );
+    wxClientDC dc( this );
 #else
 #else
-    wxPaintDC real_dc( this );
+    wxPaintDC dc( this );
 #endif
 
 #endif
 
-    AdjustDC( real_dc );
+    AdjustDC( dc );
 
     // width and height of the entire header window
     int w, h;
     GetClientSize( &w, &h );
     m_owner->CalcUnscrolledPosition(w, 0, &w, NULL);
 
 
     // width and height of the entire header window
     int w, h;
     GetClientSize( &w, &h );
     m_owner->CalcUnscrolledPosition(w, 0, &w, NULL);
 
-    // Setup double buffering to eliminate the flicker
-    wxMemoryDC dc;
-    wxBitmap   buffer(w, h);
-    dc.SelectObject(buffer);
     dc.SetBackground(wxBrush(GetBackgroundColour()));
     dc.Clear();
     
     dc.SetBackground(wxBrush(GetBackgroundColour()));
     dc.Clear();
     
@@ -1304,10 +1302,6 @@ void wxTreeListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
             this, dc, wxRect(x, HEADER_OFFSET_Y, more_w, h-2),
             m_parent->IsEnabled() ? 0 : wxCONTROL_DISABLED);
     }
             this, dc, wxRect(x, HEADER_OFFSET_Y, more_w, h-2),
             m_parent->IsEnabled() ? 0 : wxCONTROL_DISABLED);
     }
-
-    // Finish up by drawing the buffer to the real dc
-    dc.SelectObject(wxNullBitmap);
-    real_dc.DrawBitmap(buffer, 0, 0, false);
 }
 
 void wxTreeListHeaderWindow::DrawCurrent()
 }
 
 void wxTreeListHeaderWindow::DrawCurrent()
@@ -3016,7 +3010,8 @@ void wxTreeListMainWindow::ScrollTo(const wxTreeItemId &item)
     // We have to call this here because the label in
     // question might just have been added and no screen
     // update taken place.
     // We have to call this here because the label in
     // question might just have been added and no screen
     // update taken place.
-    if (m_dirty) wxYieldIfNeeded();
+    if (m_dirty) 
+        DoDirtyProcessing();
 
     wxTreeListItem *gitem = (wxTreeListItem*) item.m_pItem;
 
 
     wxTreeListItem *gitem = (wxTreeListItem*) item.m_pItem;
 
@@ -4076,7 +4071,8 @@ void wxTreeListMainWindow::Edit( const wxTreeItemId& item )
     // We have to call this here because the label in
     // question might just have been added and no screen
     // update taken place.
     // We have to call this here because the label in
     // question might just have been added and no screen
     // update taken place.
-    if (m_dirty) wxYieldIfNeeded();
+    if (m_dirty) 
+        DoDirtyProcessing();
 
     wxString s = m_currentEdit->GetText(/*ALB*/m_main_column);
     int x = m_currentEdit->GetX() + m_imgWidth2;
 
     wxString s = m_currentEdit->GetText(/*ALB*/m_main_column);
     int x = m_currentEdit->GetX() + m_imgWidth2;
@@ -4263,7 +4259,7 @@ void wxTreeListMainWindow::OnMouse( wxMouseEvent &event )
             // highlight the current drop target if any
             DrawDropEffect(m_dropTarget);
 
             // highlight the current drop target if any
             DrawDropEffect(m_dropTarget);
 
-            wxYieldIfNeeded();
+            DoDirtyProcessing();
         }
     }
     else if ( (event.LeftUp() || event.RightUp()) && m_isDragging )
         }
     }
     else if ( (event.LeftUp() || event.RightUp()) && m_isDragging )
@@ -4294,7 +4290,7 @@ void wxTreeListMainWindow::OnMouse( wxMouseEvent &event )
 
         SetCursor(m_oldCursor);
 
 
         SetCursor(m_oldCursor);
 
-        wxYieldIfNeeded();
+        DoDirtyProcessing();
     }
     else
     {
     }
     else
     {
@@ -4397,6 +4393,11 @@ void wxTreeListMainWindow::OnMouse( wxMouseEvent &event )
 }
 
 void wxTreeListMainWindow::OnIdle( wxIdleEvent &WXUNUSED(event) )
 }
 
 void wxTreeListMainWindow::OnIdle( wxIdleEvent &WXUNUSED(event) )
+{
+    DoDirtyProcessing();
+}
+
+void wxTreeListMainWindow::DoDirtyProcessing()
 {
     /* after all changes have been done to the tree control,
      * we actually redraw the tree when everything is over */
 {
     /* after all changes have been done to the tree control,
      * we actually redraw the tree when everything is over */