]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/gizmos/splittree.cpp
don't use wxTheXXXList in wxXXX ctor/dtor, only objects explicitly created
[wxWidgets.git] / contrib / src / gizmos / splittree.cpp
index 86d7b720606b72a6b7130eafec337443b215baf3..1dfd6de5980ead129cded193be918d4c90fef803 100644 (file)
@@ -40,8 +40,6 @@
 #include "wx/msw/winundef.h"
 #endif
 
-#include "wx/generic/treectlg.h"
-
 #include "wx/gizmos/splittree.h"
 #include <math.h>
 
@@ -79,7 +77,7 @@ wxRemotelyScrolledTreeCtrl::~wxRemotelyScrolledTreeCtrl()
 
 void wxRemotelyScrolledTreeCtrl::HideVScrollbar()
 {
-#ifdef __WXMSW__
+#if defined(__WXMSW__) && USE_GENERIC_TREECTRL
     if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
         ::ShowScrollBar((HWND) GetHWND(), SB_VERT, FALSE);
@@ -99,6 +97,7 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPer
                              int xPos, int yPos,
                              bool noRefresh)
 {
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
@@ -110,6 +109,7 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPer
             scrolledWindow->SetScrollbars(0, pixelsPerUnitY, 0, noUnitsY, 0, yPos, noRefresh);
         }
     }
+#endif
 }
 
 // In case we're using the generic tree control.
@@ -117,6 +117,7 @@ int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const
 {
     wxScrolledWindow* scrolledWindow = GetScrolledWindow();
 
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
@@ -128,6 +129,7 @@ int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const
             return scrolledWindow->GetScrollPos(orient);
         }
     }
+#endif
     return 0;
 }
 
@@ -138,6 +140,7 @@ void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
 {
     wxScrolledWindow* scrolledWindow = GetScrolledWindow();
 
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
 
@@ -152,6 +155,7 @@ void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
         * y = y2;
     }
        else
+#endif
        {
                // x is wrong since the horizontal scrollbar is controlled by the
                // tree control, but we probably don't need it.
@@ -162,6 +166,7 @@ void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
 // In case we're using the generic tree control.
 void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc)
 {
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
            wxScrolledWindow* scrolledWindow = GetScrolledWindow();
@@ -178,6 +183,7 @@ void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc)
         dc.SetDeviceOrigin( -startX * xppu1, -startY * yppu2 );
         // dc.SetUserScale( win->GetScaleX(), win->GetScaleY() );
     }
+#endif
 }
 
 // Scroll to the given line (in scroll units where each unit is
@@ -185,14 +191,19 @@ void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc)
 void wxRemotelyScrolledTreeCtrl::ScrollToLine(int posHoriz, int posVert)
 {
 #ifdef __WXMSW__
+#if USE_GENERIC_TREECTRL
     if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
+#endif
     {
            UINT sbCode = SB_THUMBPOSITION;
            HWND vertScrollBar = 0;
            MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXHWND) vertScrollBar);
     }
+#if USE_GENERIC_TREECTRL
     else
 #endif
+#endif
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     {
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
                win->Refresh();
@@ -206,6 +217,7 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int posHoriz, int posVert)
                }
                */
     }
+#endif
 }
 
 void wxRemotelyScrolledTreeCtrl::OnSize(wxSizeEvent& event)
@@ -232,6 +244,7 @@ void wxRemotelyScrolledTreeCtrl::OnExpand(wxTreeEvent& event)
 // Adjust the containing wxScrolledWindow's scrollbars appropriately
 void wxRemotelyScrolledTreeCtrl::AdjustRemoteScrollbars()
 {
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
        {
                // This is for the generic tree control.
@@ -242,6 +255,7 @@ void wxRemotelyScrolledTreeCtrl::AdjustRemoteScrollbars()
         return;
        }
        else
+#endif
        {
                // This is for the wxMSW tree control
                wxScrolledWindow* scrolledWindow = GetScrolledWindow();