]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/utils/wxrcedit/splittree.cpp
removed src/gtk/eggtrayicon.h
[wxWidgets.git] / contrib / utils / wxrcedit / splittree.cpp
index cb4ab5f7c2ccedbbd68d9e4cffce8ad9000ab343..ace263423c94bdd16589a3f05405e7cf995e96b1 100644 (file)
@@ -18,7 +18,7 @@
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(__APPLE__)
     #pragma implementation "splittree.h"
 #endif
 
     #pragma implementation "splittree.h"
 #endif
 
 #endif
 
 // for all others, include the necessary headers (this file is usually all you
 #endif
 
 // for all others, include the necessary headers (this file is usually all you
-// need because it includes almost all "standard" wxWindows headers)
+// need because it includes almost all "standard" wxWidgets headers)
 #ifndef WX_PRECOMP
     #include "wx/wx.h"
 #endif
 
 #ifndef WX_PRECOMP
     #include "wx/wx.h"
 #endif
 
-#include "wx/generic/treectlg.h"
+#ifdef __WXMSW__
+#include <windows.h>
+#include "wx/msw/winundef.h"
+#endif
 
 
-#include "splittree.h"
+#include "wx/gizmos/splittree.h"
+#include <math.h>
 
 /*
  * wxRemotelyScrolledTreeCtrl
 
 /*
  * wxRemotelyScrolledTreeCtrl
@@ -54,17 +58,17 @@ BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxGenericTreeCtrl)
 #else
 BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxTreeCtrl)
 #endif
 #else
 BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxTreeCtrl)
 #endif
-       EVT_SIZE(wxRemotelyScrolledTreeCtrl::OnSize)
-       EVT_TREE_ITEM_EXPANDED(-1, wxRemotelyScrolledTreeCtrl::OnExpand)
-       EVT_TREE_ITEM_COLLAPSED(-1, wxRemotelyScrolledTreeCtrl::OnExpand)
-       EVT_SCROLLWIN(wxRemotelyScrolledTreeCtrl::OnScroll)
+    EVT_SIZE(wxRemotelyScrolledTreeCtrl::OnSize)
+    EVT_TREE_ITEM_EXPANDED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
+    EVT_TREE_ITEM_COLLAPSED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
+    EVT_SCROLLWIN(wxRemotelyScrolledTreeCtrl::OnScroll)
 END_EVENT_TABLE()
 
 wxRemotelyScrolledTreeCtrl::wxRemotelyScrolledTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt,
         const wxSize& sz, long style):
         wxTreeCtrl(parent, id, pt, sz, style)
 {
 END_EVENT_TABLE()
 
 wxRemotelyScrolledTreeCtrl::wxRemotelyScrolledTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt,
         const wxSize& sz, long style):
         wxTreeCtrl(parent, id, pt, sz, style)
 {
-       m_companionWindow = NULL;
+    m_companionWindow = NULL;
 }
 
 wxRemotelyScrolledTreeCtrl::~wxRemotelyScrolledTreeCtrl()
 }
 
 wxRemotelyScrolledTreeCtrl::~wxRemotelyScrolledTreeCtrl()
@@ -73,10 +77,10 @@ wxRemotelyScrolledTreeCtrl::~wxRemotelyScrolledTreeCtrl()
 
 void wxRemotelyScrolledTreeCtrl::HideVScrollbar()
 {
 
 void wxRemotelyScrolledTreeCtrl::HideVScrollbar()
 {
-#ifdef __WXMSW__
+#if defined(__WXMSW__) && USE_GENERIC_TREECTRL
     if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
     if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
-        ::ShowScrollBar((HWND) GetHWND(), SB_VERT, FALSE);
+        ::ShowScrollBar((HWND) GetHWND(), SB_VERT, false);
     }
     else
 #endif
     }
     else
 #endif
@@ -88,6 +92,7 @@ void wxRemotelyScrolledTreeCtrl::HideVScrollbar()
 // Number of pixels per user unit (0 or -1 for no scrollbar)
 // Length of virtual canvas in user units
 // Length of page in user units
 // Number of pixels per user unit (0 or -1 for no scrollbar)
 // Length of virtual canvas in user units
 // Length of page in user units
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
 void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
                              int noUnitsX, int noUnitsY,
                              int xPos, int yPos,
 void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
                              int noUnitsX, int noUnitsY,
                              int xPos, int yPos,
@@ -98,15 +103,23 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPer
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
         win->wxGenericTreeCtrl::SetScrollbars(pixelsPerUnitX, 0, noUnitsX, 0, xPos, 0, noRefresh);
 
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
         win->wxGenericTreeCtrl::SetScrollbars(pixelsPerUnitX, 0, noUnitsX, 0, xPos, 0, noRefresh);
 
-           wxScrolledWindow* scrolledWindow = GetScrolledWindow();
-           if (scrolledWindow)
-           {
+        wxScrolledWindow* scrolledWindow = GetScrolledWindow();
+        if (scrolledWindow)
+        {
             scrolledWindow->SetScrollbars(0, pixelsPerUnitY, 0, noUnitsY, 0, yPos, noRefresh);
         }
     }
             scrolledWindow->SetScrollbars(0, pixelsPerUnitY, 0, noUnitsY, 0, yPos, noRefresh);
         }
     }
+#else
+void wxRemotelyScrolledTreeCtrl::SetScrollbars(int WXUNUSED(pixelsPerUnitX), int WXUNUSED(pixelsPerUnitY),
+                             int WXUNUSED(noUnitsX), int WXUNUSED(noUnitsY),
+                             int WXUNUSED(xPos), int WXUNUSED(yPos),
+                             bool WXUNUSED(noRefresh))
+{
+#endif
 }
 
 // In case we're using the generic tree control.
 }
 
 // In case we're using the generic tree control.
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
 int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const
 {
     wxScrolledWindow* scrolledWindow = GetScrolledWindow();
 int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const
 {
     wxScrolledWindow* scrolledWindow = GetScrolledWindow();
@@ -122,6 +135,10 @@ int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const
             return scrolledWindow->GetScrollPos(orient);
         }
     }
             return scrolledWindow->GetScrollPos(orient);
         }
     }
+#else
+int wxRemotelyScrolledTreeCtrl::GetScrollPos(int WXUNUSED(orient)) const
+{
+#endif
     return 0;
 }
 
     return 0;
 }
 
@@ -132,6 +149,7 @@ void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
 {
     wxScrolledWindow* scrolledWindow = GetScrolledWindow();
 
 {
     wxScrolledWindow* scrolledWindow = GetScrolledWindow();
 
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
 
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
 
@@ -145,20 +163,22 @@ void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
         scrolledWindow->GetViewStart(& x2, & y2);
         * y = y2;
     }
         scrolledWindow->GetViewStart(& x2, & y2);
         * y = y2;
     }
-       else
-       {
-               // x is wrong since the horizontal scrollbar is controlled by the
-               // tree control, but we probably don't need it.
+    else
+#endif
+    {
+        // x is wrong since the horizontal scrollbar is controlled by the
+        // tree control, but we probably don't need it.
         scrolledWindow->GetViewStart(x, y);
         scrolledWindow->GetViewStart(x, y);
-       }
+    }
 }
 
 // In case we're using the generic tree control.
 }
 
 // In case we're using the generic tree control.
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
 void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc)
 {
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
 void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc)
 {
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
-           wxScrolledWindow* scrolledWindow = GetScrolledWindow();
+        wxScrolledWindow* scrolledWindow = GetScrolledWindow();
 
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
 
 
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
 
@@ -170,102 +190,118 @@ void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc)
         scrolledWindow->GetScrollPixelsPerUnit(& xppu2, & yppu2);
 
         dc.SetDeviceOrigin( -startX * xppu1, -startY * yppu2 );
         scrolledWindow->GetScrollPixelsPerUnit(& xppu2, & yppu2);
 
         dc.SetDeviceOrigin( -startX * xppu1, -startY * yppu2 );
-        dc.SetUserScale( win->GetScaleX(), win->GetScaleY() );
+        // dc.SetUserScale( win->GetScaleX(), win->GetScaleY() );
     }
     }
+#else
+void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& WXUNUSED(dc))
+{
+#endif
 }
 
 // Scroll to the given line (in scroll units where each unit is
 // the height of an item)
 }
 
 // Scroll to the given line (in scroll units where each unit is
 // the height of an item)
-void wxRemotelyScrolledTreeCtrl::ScrollToLine(int posHoriz, int posVert)
+void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVert)
 {
 #ifdef __WXMSW__
 {
 #ifdef __WXMSW__
+#if USE_GENERIC_TREECTRL
     if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
+#endif
     {
     {
-           UINT sbCode = SB_THUMBPOSITION;
-           HWND vertScrollBar = 0;
-           MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXHWND) vertScrollBar);
+        UINT sbCode = SB_THUMBPOSITION;
+        HWND vertScrollBar = 0;
+        MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXLPARAM) vertScrollBar);
     }
     }
+#if USE_GENERIC_TREECTRL
     else
 #endif
     else
 #endif
+#endif
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     {
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
     {
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
-               win->Refresh();
-               /* Doesn't work yet because scrolling is ignored by Scroll
+        win->Refresh();
+        /* Doesn't work yet because scrolling is ignored by Scroll
         int xppu, yppu;
         int xppu, yppu;
-           wxScrolledWindow* scrolledWindow = GetScrolledWindow();
-           if (scrolledWindow)
-           {
-                       scrolledWindow->GetScrollPixelsPerUnit(& xppu, & yppu);
-                       win->Scroll(-1, posVert*yppu);
-               }
-               */
+        wxScrolledWindow* scrolledWindow = GetScrolledWindow();
+        if (scrolledWindow)
+        {
+            scrolledWindow->GetScrollPixelsPerUnit(& xppu, & yppu);
+            win->Scroll(-1, posVert*yppu);
+        }
+        */
     }
     }
+#endif
 }
 
 void wxRemotelyScrolledTreeCtrl::OnSize(wxSizeEvent& event)
 {
 }
 
 void wxRemotelyScrolledTreeCtrl::OnSize(wxSizeEvent& event)
 {
-       HideVScrollbar();
-       AdjustRemoteScrollbars();
-       event.Skip();
+    HideVScrollbar();
+    AdjustRemoteScrollbars();
+    event.Skip();
 }
 
 void wxRemotelyScrolledTreeCtrl::OnExpand(wxTreeEvent& event)
 {
 }
 
 void wxRemotelyScrolledTreeCtrl::OnExpand(wxTreeEvent& event)
 {
-       AdjustRemoteScrollbars();
-       event.Skip();
+    AdjustRemoteScrollbars();
+    event.Skip();
 
     // If we don't have this, we get some bits of lines still remaining
     if (event.GetEventType() == wxEVT_COMMAND_TREE_ITEM_COLLAPSED)
         Refresh();
 
 
     // If we don't have this, we get some bits of lines still remaining
     if (event.GetEventType() == wxEVT_COMMAND_TREE_ITEM_COLLAPSED)
         Refresh();
 
-       // Pass on the event
-       if (m_companionWindow)
-               m_companionWindow->GetEventHandler()->ProcessEvent(event);
+    // Pass on the event
+    if (m_companionWindow)
+        m_companionWindow->GetEventHandler()->ProcessEvent(event);
 }
 
 // Adjust the containing wxScrolledWindow's scrollbars appropriately
 void wxRemotelyScrolledTreeCtrl::AdjustRemoteScrollbars()
 {
 }
 
 // Adjust the containing wxScrolledWindow's scrollbars appropriately
 void wxRemotelyScrolledTreeCtrl::AdjustRemoteScrollbars()
 {
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
-       {
-               // This is for the generic tree control.
-               // It calls SetScrollbars which has been overridden
-               // to adjust the parent scrolled window vertical
-               // scrollbar.
-               ((wxGenericTreeCtrl*) this)->AdjustMyScrollbars();
+    {
+        // This is for the generic tree control.
+        // It calls SetScrollbars which has been overridden
+        // to adjust the parent scrolled window vertical
+        // scrollbar.
+        ((wxGenericTreeCtrl*) this)->AdjustMyScrollbars();
         return;
         return;
-       }
-       else
-       {
-               // This is for the wxMSW tree control
-               wxScrolledWindow* scrolledWindow = GetScrolledWindow();
-               if (scrolledWindow)
-               {
-                       wxRect itemRect;
-                       if (GetBoundingRect(GetRootItem(), itemRect))
-                       {
-                               int itemHeight = itemRect.GetHeight();
-                               
-                               int w, h;
-                               GetClientSize(&w, &h);
-                               
-                               wxRect rect(0, 0, 0, 0);
-                               CalcTreeSize(rect);
-                               int treeViewHeight = rect.GetHeight()/itemHeight;
-                               
-                               int scrollPixelsPerLine = itemHeight;
-                               int scrollPos = - (itemRect.y / itemHeight);
-                               
-                               scrolledWindow->SetScrollbars(0, scrollPixelsPerLine, 0, treeViewHeight, 0, scrollPos);
-                               
-                               // Ensure that when a scrollbar becomes hidden or visible,
-                               // the contained window sizes are right.
-                               // Problem: this is called too early (?)
-                               wxSizeEvent event(scrolledWindow->GetSize(), scrolledWindow->GetId());
-                               scrolledWindow->GetEventHandler()->ProcessEvent(event);
-                       }
-               }
-       }
+    }
+    else
+#endif
+    {
+        // This is for the wxMSW tree control
+        wxScrolledWindow* scrolledWindow = GetScrolledWindow();
+        if (scrolledWindow)
+        {
+            wxRect itemRect;
+            if (GetBoundingRect(GetRootItem(), itemRect))
+            {
+                // Actually, the real height seems to be 1 less than reported
+                // (e.g. 16 instead of 16)
+                int itemHeight = itemRect.GetHeight() - 1;
+
+                int w, h;
+                GetClientSize(&w, &h);
+
+                wxRect rect(0, 0, 0, 0);
+                CalcTreeSize(rect);
+
+                double f = ((double) (rect.GetHeight()) / (double) itemHeight)  ;
+                int treeViewHeight = (int) ceil(f);
+
+                int scrollPixelsPerLine = itemHeight;
+                int scrollPos = - (itemRect.y / itemHeight);
+
+                scrolledWindow->SetScrollbars(0, scrollPixelsPerLine, 0, treeViewHeight, 0, scrollPos);
+
+                // Ensure that when a scrollbar becomes hidden or visible,
+                // the contained window sizes are right.
+                // Problem: this is called too early (?)
+                wxSizeEvent event(scrolledWindow->GetSize(), scrolledWindow->GetId());
+                scrolledWindow->GetEventHandler()->ProcessEvent(event);
+            }
+        }
+    }
 }
 
 
 }
 
 
@@ -278,10 +314,10 @@ static wxRect CombineRectangles(const wxRect& rect1, const wxRect& rect2)
     int bottom1 = rect1.GetBottom();
     int right2 = rect2.GetRight();
     int bottom2 = rect2.GetBottom();
     int bottom1 = rect1.GetBottom();
     int right2 = rect2.GetRight();
     int bottom2 = rect2.GetBottom();
-    
+
     wxPoint topLeft = wxPoint(wxMin(rect1.x, rect2.x), wxMin(rect1.y, rect2.y));
     wxPoint bottomRight = wxPoint(wxMax(right1, right2), wxMax(bottom1, bottom2));
     wxPoint topLeft = wxPoint(wxMin(rect1.x, rect2.x), wxMin(rect1.y, rect2.y));
     wxPoint bottomRight = wxPoint(wxMax(right1, right2), wxMax(bottom1, bottom2));
-    
+
     rect.x = topLeft.x; rect.y = topLeft.y;
     rect.SetRight(bottomRight.x);
     rect.SetBottom(bottomRight.y);
     rect.x = topLeft.x; rect.y = topLeft.y;
     rect.SetRight(bottomRight.x);
     rect.SetBottom(bottomRight.y);
@@ -294,43 +330,40 @@ static wxRect CombineRectangles(const wxRect& rect1, const wxRect& rect2)
 // correctly
 void wxRemotelyScrolledTreeCtrl::CalcTreeSize(wxRect& rect)
 {
 // correctly
 void wxRemotelyScrolledTreeCtrl::CalcTreeSize(wxRect& rect)
 {
-       CalcTreeSize(GetRootItem(), rect);
+    CalcTreeSize(GetRootItem(), rect);
 }
 
 void wxRemotelyScrolledTreeCtrl::CalcTreeSize(const wxTreeItemId& id, wxRect& rect)
 {
 }
 
 void wxRemotelyScrolledTreeCtrl::CalcTreeSize(const wxTreeItemId& id, wxRect& rect)
 {
-       // TODO: implement GetFirst/NextVisibleItem
-       // for wxGenericTreeCtrl, plus GetBoundingRect.
-
-       // More efficient implementation would be to find the last item (but how?)
-       // Q: is the bounding rect relative to the top of the virtual tree workspace
-       // or the top of the window? How would we convert?
-       wxRect itemSize;
-       if (GetBoundingRect(id, itemSize))
-       {
-               rect = CombineRectangles(rect, itemSize);
-       }
-
-       long cookie;
-       wxTreeItemId childId = GetFirstChild(id, cookie);
-       while (childId != 0)
-       {
-               CalcTreeSize(childId, rect);
-               childId = GetNextChild(childId, cookie);
-       }
+    // More efficient implementation would be to find the last item (but how?)
+    // Q: is the bounding rect relative to the top of the virtual tree workspace
+    // or the top of the window? How would we convert?
+    wxRect itemSize;
+    if (GetBoundingRect(id, itemSize))
+    {
+        rect = CombineRectangles(rect, itemSize);
+    }
+
+    void* cookie;
+    wxTreeItemId childId = GetFirstChild(id, cookie);
+    while (childId)
+    {
+        CalcTreeSize(childId, rect);
+        childId = GetNextChild(childId, cookie);
+    }
 }
 
 // Find the scrolled window that contains this control
 wxScrolledWindow* wxRemotelyScrolledTreeCtrl::GetScrolledWindow() const
 {
 }
 
 // Find the scrolled window that contains this control
 wxScrolledWindow* wxRemotelyScrolledTreeCtrl::GetScrolledWindow() const
 {
-       wxWindow* parent = wxWindow::GetParent();
-       while (parent)
-       {
-               if (parent->IsKindOf(CLASSINFO(wxScrolledWindow)))
-                       return (wxScrolledWindow*) parent;
-               parent = parent->GetParent();
-       }
-       return NULL;
+    wxWindow* parent = wxWindow::GetParent();
+    while (parent)
+    {
+        if (parent->IsKindOf(CLASSINFO(wxScrolledWindow)))
+            return (wxScrolledWindow*) parent;
+        parent = parent->GetParent();
+    }
+    return NULL;
 }
 
 void wxRemotelyScrolledTreeCtrl::OnScroll(wxScrollWinEvent& event)
 }
 
 void wxRemotelyScrolledTreeCtrl::OnScroll(wxScrollWinEvent& event)
@@ -360,78 +393,77 @@ void wxRemotelyScrolledTreeCtrl::OnScroll(wxScrollWinEvent& event)
 IMPLEMENT_CLASS(wxTreeCompanionWindow, wxWindow)
 
 BEGIN_EVENT_TABLE(wxTreeCompanionWindow, wxWindow)
 IMPLEMENT_CLASS(wxTreeCompanionWindow, wxWindow)
 
 BEGIN_EVENT_TABLE(wxTreeCompanionWindow, wxWindow)
-       EVT_PAINT(wxTreeCompanionWindow::OnPaint)
-       EVT_SCROLLWIN(wxTreeCompanionWindow::OnScroll)
-       EVT_TREE_ITEM_EXPANDED(-1, wxTreeCompanionWindow::OnExpand)
-       EVT_TREE_ITEM_COLLAPSED(-1, wxTreeCompanionWindow::OnExpand)
+    EVT_PAINT(wxTreeCompanionWindow::OnPaint)
+    EVT_SCROLLWIN(wxTreeCompanionWindow::OnScroll)
+    EVT_TREE_ITEM_EXPANDED(wxID_ANY, wxTreeCompanionWindow::OnExpand)
+    EVT_TREE_ITEM_COLLAPSED(wxID_ANY, wxTreeCompanionWindow::OnExpand)
 END_EVENT_TABLE()
 
 wxTreeCompanionWindow::wxTreeCompanionWindow(wxWindow* parent, wxWindowID id,
       const wxPoint& pos,
       const wxSize& sz,
       long style):
 END_EVENT_TABLE()
 
 wxTreeCompanionWindow::wxTreeCompanionWindow(wxWindow* parent, wxWindowID id,
       const wxPoint& pos,
       const wxSize& sz,
       long style):
-       wxWindow(parent, id, pos, sz, style)
+    wxWindow(parent, id, pos, sz, style)
 {
 {
-       m_treeCtrl = NULL;
+    m_treeCtrl = NULL;
 }
 
 void wxTreeCompanionWindow::DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect)
 {
 }
 
 void wxTreeCompanionWindow::DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect)
 {
-       // TEST CODE
+    // TEST CODE
 #if 1
 #if 1
-       if (m_treeCtrl)
-       {
-               wxString text = m_treeCtrl->GetItemText(id);
-               dc.SetTextForeground(* wxBLACK);
-               dc.SetBackgroundMode(wxTRANSPARENT);
+    if (m_treeCtrl)
+    {
+        wxString text = m_treeCtrl->GetItemText(id);
+        dc.SetTextForeground(* wxBLACK);
+        dc.SetBackgroundMode(wxTRANSPARENT);
 
 
-               int textW, textH;
-               dc.GetTextExtent(text, & textW, & textH);
+        int textW, textH;
+        dc.GetTextExtent(text, & textW, & textH);
 
 
-               int x = 5;
-               int y = rect.GetY() + wxMax(0, (rect.GetHeight() - textH) / 2);
+        int x = 5;
+        int y = rect.GetY() + wxMax(0, (rect.GetHeight() - textH) / 2);
 
 
-               dc.DrawText(text, x, y);
-       }
+        dc.DrawText(text, x, y);
+    }
 #endif
 }
 
 #endif
 }
 
-void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event)
+void wxTreeCompanionWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
 {
-       wxPaintDC dc(this);
+    wxPaintDC dc(this);
 
     if (!m_treeCtrl)
         return;
 
 
     if (!m_treeCtrl)
         return;
 
-        wxPen pen(wxColour(_T("BLACK")), 1, wxSOLID);
-       dc.SetPen(pen);
-       dc.SetBrush(* wxTRANSPARENT_BRUSH);
-       wxFont font(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
-       dc.SetFont(font);
+    wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
+    dc.SetPen(pen);
+    dc.SetBrush(* wxTRANSPARENT_BRUSH);
+    wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+    dc.SetFont(font);
 
     wxSize clientSize = GetClientSize();
 
     wxSize clientSize = GetClientSize();
-       wxRect itemRect;
-       int cy=0;
-       wxTreeItemId h, lastH;
-       for(h=m_treeCtrl->GetFirstVisibleItem();h;h=m_treeCtrl->GetNextVisible(h))
-       {
-               if (m_treeCtrl->GetBoundingRect(h, itemRect))
-               {
-                       cy = itemRect.GetTop();
-                       wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight());
-
-                       lastH = h;
-
-                       // Draw the actual item
-                       DrawItem(dc, h, drawItemRect);
-                       dc.DrawLine(0, cy, clientSize.x, cy);
-               }
-       }
-       if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect))
-       {
-               cy = itemRect.GetBottom();
-               dc.DrawLine(0, cy, clientSize.x, cy);
-       }
+    wxRect itemRect;
+    wxTreeItemId h, lastH;
+    for(h=m_treeCtrl->GetFirstVisibleItem();h;h=m_treeCtrl->GetNextVisible(h))
+    {
+        if (m_treeCtrl->GetBoundingRect(h, itemRect))
+        {
+            int cy = itemRect.GetTop();
+            wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight());
+
+            lastH = h;
+
+            // Draw the actual item
+            DrawItem(dc, h, drawItemRect);
+            dc.DrawLine(0, cy, clientSize.x, cy);
+        }
+    }
+    if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect))
+    {
+        int cy = itemRect.GetBottom();
+        dc.DrawLine(0, cy, clientSize.x, cy);
+    }
 }
 
 void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event)
 }
 
 void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event)
@@ -445,15 +477,15 @@ void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event)
     if (!m_treeCtrl)
         return;
 
     if (!m_treeCtrl)
         return;
 
-       // TODO: scroll the window physically instead of just refreshing.
-       Refresh(TRUE);
+    // TODO: scroll the window physically instead of just refreshing.
+    Refresh(true);
 }
 
 }
 
-void wxTreeCompanionWindow::OnExpand(wxTreeEvent& event)
+void wxTreeCompanionWindow::OnExpand(wxTreeEvent& WXUNUSED(event))
 {
 {
-       // TODO: something more optimized than simply refresh the whole
-       // window when the tree is expanded/collapsed. Tricky.
-       Refresh();
+    // TODO: something more optimized than simply refresh the whole
+    // window when the tree is expanded/collapsed. Tricky.
+    Refresh();
 }
 
 /*
 }
 
 /*
@@ -463,7 +495,7 @@ void wxTreeCompanionWindow::OnExpand(wxTreeEvent& event)
 IMPLEMENT_CLASS(wxThinSplitterWindow, wxSplitterWindow)
 
 BEGIN_EVENT_TABLE(wxThinSplitterWindow, wxSplitterWindow)
 IMPLEMENT_CLASS(wxThinSplitterWindow, wxSplitterWindow)
 
 BEGIN_EVENT_TABLE(wxThinSplitterWindow, wxSplitterWindow)
-       EVT_SIZE(wxThinSplitterWindow::OnSize)
+    EVT_SIZE(wxThinSplitterWindow::OnSize)
 END_EVENT_TABLE()
 
 wxThinSplitterWindow::wxThinSplitterWindow(wxWindow* parent, wxWindowID id,
 END_EVENT_TABLE()
 
 wxThinSplitterWindow::wxThinSplitterWindow(wxWindow* parent, wxWindowID id,
@@ -474,24 +506,28 @@ wxThinSplitterWindow::wxThinSplitterWindow(wxWindow* parent, wxWindowID id,
 {
 }
 
 {
 }
 
+wxThinSplitterWindow::~wxThinSplitterWindow()
+{
+}
+
 void wxThinSplitterWindow::SizeWindows()
 {
 void wxThinSplitterWindow::SizeWindows()
 {
-       // The client size may have changed inbetween
-       // the sizing of the first window and the sizing of
-       // the second. So repeat SizeWindows.
+    // The client size may have changed inbetween
+    // the sizing of the first window and the sizing of
+    // the second. So repeat SizeWindows.
     wxSplitterWindow::SizeWindows();
     wxSplitterWindow::SizeWindows();
 }
 
 // Tests for x, y over sash
     wxSplitterWindow::SizeWindows();
     wxSplitterWindow::SizeWindows();
 }
 
 // Tests for x, y over sash
-bool wxThinSplitterWindow::SashHitTest(int x, int y, int tolerance)
+bool wxThinSplitterWindow::SashHitTest(int x, int y, int WXUNUSED(tolerance))
 {
 {
-       return wxSplitterWindow::SashHitTest(x, y, 4);
+    return wxSplitterWindow::SashHitTest(x, y, 4);
 }
 
 void wxThinSplitterWindow::DrawSash(wxDC& dc)
 {
 }
 
 void wxThinSplitterWindow::DrawSash(wxDC& dc)
 {
-    if ( m_sashPosition == 0 || !m_windowTwo)
+    if ( GetSashPosition() == 0 || !m_windowTwo)
         return;
     if (GetWindowStyle() & wxSP_NOSASH)
         return;
         return;
     if (GetWindowStyle() & wxSP_NOSASH)
         return;
@@ -499,42 +535,42 @@ void wxThinSplitterWindow::DrawSash(wxDC& dc)
     int w, h;
     GetClientSize(&w, &h);
 
     int w, h;
     GetClientSize(&w, &h);
 
-       if ( m_splitMode == wxSPLIT_VERTICAL )
-       {
-               dc.SetPen(* m_facePen);
-               dc.SetBrush(* m_faceBrush);
-               int h1 = h-1;
-               int y1 = 0;
-               if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
-                       h1 += 1; // Not sure why this is necessary...
-               if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
-               {
-                       y1 = 2; h1 -= 3;
-               }
-               dc.DrawRectangle(m_sashPosition, y1, m_sashSize, h1);
-       }
-       else
-       {
-               dc.SetPen(* m_facePen);
-               dc.SetBrush(* m_faceBrush);
-               int w1 = w-1;
-               int x1 = 0;
-               if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
-                       w1 ++;
-               if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
-               {
-                       x1 = 2; w1 -= 3;
-               }
-               dc.DrawRectangle(x1, m_sashPosition, w1, m_sashSize);
-       }
-       
+    if ( m_splitMode == wxSPLIT_VERTICAL )
+    {
+        dc.SetPen(* m_facePen);
+        dc.SetBrush(* m_faceBrush);
+        int h1 = h-1;
+        int y1 = 0;
+        if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
+            h1 += 1; // Not sure why this is necessary...
+        if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
+        {
+            y1 = 2; h1 -= 3;
+        }
+        dc.DrawRectangle(GetSashPosition(), y1, GetSashSize(), h1);
+    }
+    else
+    {
+        dc.SetPen(* m_facePen);
+        dc.SetBrush(* m_faceBrush);
+        int w1 = w-1;
+        int x1 = 0;
+        if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER && (GetWindowStyleFlag() & wxSP_3DBORDER) != wxSP_3DBORDER )
+            w1 ++;
+        if ( (GetWindowStyleFlag() & wxSP_3DBORDER) == wxSP_3DBORDER)
+        {
+            x1 = 2; w1 -= 3;
+        }
+        dc.DrawRectangle(x1, GetSashPosition(), w1, GetSashSize());
+    }
+
     dc.SetPen(wxNullPen);
     dc.SetBrush(wxNullBrush);
 }
 
 void wxThinSplitterWindow::OnSize(wxSizeEvent& event)
 {
     dc.SetPen(wxNullPen);
     dc.SetBrush(wxNullBrush);
 }
 
 void wxThinSplitterWindow::OnSize(wxSizeEvent& event)
 {
-       wxSplitterWindow::OnSize(event);
+    wxSplitterWindow::OnSize(event);
 }
 
 /*
 }
 
 /*
@@ -544,8 +580,8 @@ void wxThinSplitterWindow::OnSize(wxSizeEvent& event)
 IMPLEMENT_CLASS(wxSplitterScrolledWindow, wxScrolledWindow)
 
 BEGIN_EVENT_TABLE(wxSplitterScrolledWindow, wxScrolledWindow)
 IMPLEMENT_CLASS(wxSplitterScrolledWindow, wxScrolledWindow)
 
 BEGIN_EVENT_TABLE(wxSplitterScrolledWindow, wxScrolledWindow)
-       EVT_SCROLLWIN(wxSplitterScrolledWindow::OnScroll)
-       EVT_SIZE(wxSplitterScrolledWindow::OnSize)
+    EVT_SCROLLWIN(wxSplitterScrolledWindow::OnScroll)
+    EVT_SIZE(wxSplitterScrolledWindow::OnSize)
 END_EVENT_TABLE()
 
 wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id,
 END_EVENT_TABLE()
 
 wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id,
@@ -556,47 +592,50 @@ wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID
 {
 }
 
 {
 }
 
-void wxSplitterScrolledWindow::OnSize(wxSizeEvent& event)
+void wxSplitterScrolledWindow::OnSize(wxSizeEvent& WXUNUSED(event))
 {
 {
-       wxSize sz = GetClientSize();
-       if (GetChildren().First())
-       {
-               ((wxWindow*) GetChildren().First()->Data())->SetSize(0, 0, sz.x, sz.y);
-       }
+    wxSize sz = GetClientSize();
+    if (GetChildren().GetFirst())
+    {
+        ((wxWindow*) GetChildren().GetFirst()->GetData())->SetSize(0, 0, sz.x, sz.y);
+    }
 }
 
 void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
 {
     // Ensure that events being propagated back up the window hierarchy
     // don't cause an infinite loop
 }
 
 void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
 {
     // Ensure that events being propagated back up the window hierarchy
     // don't cause an infinite loop
-    static bool inOnScroll = FALSE;
+    static bool inOnScroll = false;
     if (inOnScroll)
     if (inOnScroll)
+    {
+        event.Skip();
         return;
         return;
-    inOnScroll = TRUE;
+    }
+    inOnScroll = true;
 
     int orient = event.GetOrientation();
 
     int nScrollInc = CalcScrollInc(event);
     if (nScrollInc == 0)
     {
 
     int orient = event.GetOrientation();
 
     int nScrollInc = CalcScrollInc(event);
     if (nScrollInc == 0)
     {
-        inOnScroll = FALSE;
+        inOnScroll = false;
         return;
     }
 
     if (orient == wxHORIZONTAL)
     {
         return;
     }
 
     if (orient == wxHORIZONTAL)
     {
-        inOnScroll = FALSE;
+        inOnScroll = false;
         event.Skip();
         return;
 #if 0
         int newPos = m_xScrollPosition + nScrollInc;
         event.Skip();
         return;
 #if 0
         int newPos = m_xScrollPosition + nScrollInc;
-        SetScrollPos(wxHORIZONTAL, newPos, TRUE );
+        SetScrollPos(wxHORIZONTAL, newPos, true );
 #endif
     }
     else
     {
         int newPos = m_yScrollPosition + nScrollInc;
 #endif
     }
     else
     {
         int newPos = m_yScrollPosition + nScrollInc;
-        SetScrollPos(wxVERTICAL, newPos, TRUE );
+        SetScrollPos(wxVERTICAL, newPos, true );
     }
 
     if (orient == wxHORIZONTAL)
     }
 
     if (orient == wxHORIZONTAL)
@@ -609,10 +648,10 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
     }
 
     // Find targets in splitter window and send the event to them
     }
 
     // Find targets in splitter window and send the event to them
-    wxNode* node = GetChildren().First();
+    wxNode* node = (wxNode *)GetChildren().GetFirst();
     while (node)
     {
     while (node)
     {
-        wxWindow* child = (wxWindow*) node->Data();
+        wxWindow* child = (wxWindow*) node->GetData();
         if (child->IsKindOf(CLASSINFO(wxSplitterWindow)))
         {
             wxSplitterWindow* splitter = (wxSplitterWindow*) child;
         if (child->IsKindOf(CLASSINFO(wxSplitterWindow)))
         {
             wxSplitterWindow* splitter = (wxSplitterWindow*) child;
@@ -622,13 +661,13 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
                 splitter->GetWindow2()->ProcessEvent(event);
             break;
         }
                 splitter->GetWindow2()->ProcessEvent(event);
             break;
         }
-        node = node->Next();
+        node = node->GetNext();
     }
 
 #ifdef __WXMAC__
     m_targetWindow->MacUpdateImmediately() ;
 #endif
 
     }
 
 #ifdef __WXMAC__
     m_targetWindow->MacUpdateImmediately() ;
 #endif
 
-    inOnScroll = FALSE;
+    inOnScroll = false;
 }
 
 }