]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/gizmos/splittree.cpp
Some more tests and mouse events for wxCanvas.
[wxWidgets.git] / contrib / src / gizmos / splittree.cpp
index d5b968f0e6645f0780cc85db035bf3423dbf3742..b7197607b553d4f7d55826b82874b0a63383ac0b 100644 (file)
@@ -19,7 +19,7 @@
 // headers
 // ----------------------------------------------------------------------------
 #ifdef __GNUG__
-    #pragma interface "splittree.cpp"
+    #pragma implementation "splittree.h"
 #endif
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -106,6 +106,26 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPer
     }
 }
 
+// In case we're using the generic tree control.
+int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const
+{
+    wxScrolledWindow* scrolledWindow = GetScrolledWindow();
+
+    if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
+    {
+        wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
+
+        if (orient == wxHORIZONTAL)
+            return win->wxGenericTreeCtrl::GetScrollPos(orient);
+        else
+        {
+            return scrolledWindow->GetScrollPos(orient);
+        }
+    }
+    return 0;
+}
+
+
 // In case we're using the generic tree control.
 // Get the view start
 void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
@@ -277,7 +297,7 @@ void wxRemotelyScrolledTreeCtrl::CalcTreeSize(wxRect& rect)
        CalcTreeSize(GetRootItem(), rect);
 }
 
-void wxRemotelyScrolledTreeCtrl::CalcTreeSize(wxTreeItemId& id, wxRect& rect)
+void wxRemotelyScrolledTreeCtrl::CalcTreeSize(const wxTreeItemId& id, wxRect& rect)
 {
        // TODO: implement GetFirst/NextVisibleItem
        // for wxGenericTreeCtrl, plus GetBoundingRect.
@@ -383,7 +403,7 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event)
     if (!m_treeCtrl)
         return;
 
-       wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
+        wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
        dc.SetPen(pen);
        dc.SetBrush(* wxTRANSPARENT_BRUSH);
        wxFont font(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
@@ -400,11 +420,11 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event)
                        cy = itemRect.GetTop();
                        wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight());
 
-                       dc.DrawLine(0, cy, clientSize.x, cy);
                        lastH = h;
 
                        // Draw the actual item
                        DrawItem(dc, h, drawItemRect);
+                       dc.DrawLine(0, cy, clientSize.x, cy);
                }
        }
        if (m_treeCtrl->GetBoundingRect(lastH, itemRect))