]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/gizmos/splittree.cpp
don't use wxStaticCast to wxBookCtrlBase -- it doesn't work
[wxWidgets.git] / contrib / src / gizmos / splittree.cpp
index 5f189b2235a08be990d57cb90798d8f6c6f5380a..0eaed896c243caef4188feebe72157f32e6745bc 100644 (file)
@@ -18,9 +18,6 @@
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
-#ifdef __GNUG__
-    #pragma implementation "splittree.h"
-#endif
 
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
@@ -144,8 +141,8 @@ int wxRemotelyScrolledTreeCtrl::GetScrollPos(
 {
 
 #if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
-    // this condition fixes extsitence of warning but 
-    wxScrolledWindow* scrolledWindow = 
+    // this condition fixes extsitence of warning but
+    wxScrolledWindow* scrolledWindow =
     // but GetScrolledWindow is still executed in case internally does something
 #endif
                                        GetScrolledWindow();
@@ -197,7 +194,7 @@ void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
 }
 
 // In case we're using the generic tree control.
-void wxRemotelyScrolledTreeCtrl::PrepareDC( 
+void wxRemotelyScrolledTreeCtrl::PrepareDC(
                                             #if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
                                                 wxDC& dc
                                             #else
@@ -232,7 +229,7 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVer
 #ifdef __WXMSW__
 #if USE_GENERIC_TREECTRL
     if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
-#endif
+#endif // USE_GENERIC_TREECTRL
     {
         UINT sbCode = SB_THUMBPOSITION;
         HWND vertScrollBar = 0;
@@ -240,8 +237,8 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVer
     }
 #if USE_GENERIC_TREECTRL
     else
-#endif
-#endif
+#endif // USE_GENERIC_TREECTRL
+#endif // __WXMSW__
 #if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     {
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
@@ -256,7 +253,8 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVer
         }
         */
     }
-#endif
+#endif // USE_GENERIC_TREECTRL || !defined(__WXMSW__)
+    wxUnusedVar(posVert);
 }
 
 void wxRemotelyScrolledTreeCtrl::OnSize(wxSizeEvent& event)
@@ -299,7 +297,9 @@ void wxRemotelyScrolledTreeCtrl::OnPaint(wxPaintEvent& event)
     wxSize clientSize = GetClientSize();
     wxRect itemRect;
     wxTreeItemId h, lastH;
-    for(h=GetFirstVisibleItem();h;h=GetNextVisible(h))
+    for (h=GetFirstVisibleItem();
+         h.IsOk();
+         h=GetNextVisible(h))
     {
         if (GetBoundingRect(h, itemRect))
         {
@@ -307,6 +307,8 @@ void wxRemotelyScrolledTreeCtrl::OnPaint(wxPaintEvent& event)
             dc.DrawLine(0, cy, clientSize.x, cy);
             lastH = h;
         }
+        if (! IsVisible(h))
+            break;
     }
     if (lastH.IsOk() && GetBoundingRect(lastH, itemRect))
     {
@@ -508,7 +510,9 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
     wxSize clientSize = GetClientSize();
     wxRect itemRect;
     wxTreeItemId h, lastH;
-    for(h=m_treeCtrl->GetFirstVisibleItem();h;h=m_treeCtrl->GetNextVisible(h))
+    for (h=m_treeCtrl->GetFirstVisibleItem();
+         h.IsOk();
+         h=m_treeCtrl->GetNextVisible(h))
     {
         if (m_treeCtrl->GetBoundingRect(h, itemRect))
         {
@@ -521,6 +525,8 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
             DrawItem(dc, h, drawItemRect);
             dc.DrawLine(0, cy, clientSize.x, cy);
         }
+        if (! m_treeCtrl->IsVisible(h))
+            break;
     }
     if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect))
     {
@@ -737,4 +743,3 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
 
     inOnScroll = false;
 }
-