]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
Make IsOfClass out-of-line to defend against gcc 3.4.[56] bug:
[wxWidgets.git] / src / generic / treectlg.cpp
index 31b1d054a66d0f089c623b84c343ee9aa3077fa0..c0b0ca5d1a4c772c11158fd1fa144c14422ac75f 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        treectlg.cpp
+// Name:        src/generic/treectlg.cpp
 // Purpose:     generic tree control implementation
 // Author:      Robert Roebling
 // Created:     01/02/97
 
 #if wxUSE_TREECTRL
 
-#include "wx/treebase.h"
 #include "wx/treectrl.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/dcclient.h"
+    #include "wx/timer.h"
+    #include "wx/settings.h"
+    #include "wx/listbox.h"
+    #include "wx/textctrl.h"
+#endif
+
 #include "wx/generic/treectlg.h"
-#include "wx/timer.h"
-#include "wx/textctrl.h"
 #include "wx/imaglist.h"
-#include "wx/settings.h"
-#include "wx/dcclient.h"
 
 #include "wx/renderer.h"
 
@@ -2323,7 +2327,7 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
 
     if (IsExposed(exposed_x, exposed_y, 10000, h))  // 10000 = very much
     {
-        wxPen *pen =
+        const wxPen *pen =
 #ifndef __WXMAC__
             // don't draw rect outline if we already have the
             // background color under Mac
@@ -2848,11 +2852,9 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
     }
 }
 
-wxTreeItemId wxGenericTreeCtrl::DoTreeHitTest(const wxPoint& point, int& flags)
+wxTreeItemId
+wxGenericTreeCtrl::DoTreeHitTest(const wxPoint& point, int& flags) const
 {
-    // JACS: removed wxYieldIfNeeded() because it can cause the window
-    // to be deleted from under us if a close window event is pending
-
     int w, h;
     GetSize(&w, &h);
     flags=0;
@@ -2909,11 +2911,7 @@ bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
     rect.height = GetLineHeight(i);
 
     // we have to return the logical coordinates, not physical ones
-    int startX, startY;
-    GetViewStart(& startX, & startY);
-
-    rect.x -= startX*PIXELS_PER_UNIT;
-    rect.y -= startY*PIXELS_PER_UNIT;
+    rect.SetTopLeft(CalcScrolledPosition(rect.GetTopLeft()));
 
     return true;
 }
@@ -3567,10 +3565,6 @@ void wxGenericTreeCtrl::OnGetToolTip( wxTreeEvent &event )
 // be removed, as well as the #else case below.
 #define _USE_VISATTR 0
 
-#if _USE_VISATTR
-#include "wx/listbox.h"
-#endif
-
 //static
 wxVisualAttributes
 #if _USE_VISATTR