X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6495f2dd5d718b9daea8c5fc37858299111d8496..a0086878b09ea394de9f5746a5e8f066a3d12dec:/contrib/utils/wxrcedit/splittree.cpp diff --git a/contrib/utils/wxrcedit/splittree.cpp b/contrib/utils/wxrcedit/splittree.cpp index 1dfd6de598..e5eedeec2c 100644 --- a/contrib/utils/wxrcedit/splittree.cpp +++ b/contrib/utils/wxrcedit/splittree.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma implementation "splittree.h" #endif @@ -92,12 +92,12 @@ 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 +#if USE_GENERIC_TREECTRL || !defined(__WXMSW__) void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, int noUnitsX, int noUnitsY, int xPos, int yPos, bool noRefresh) { -#if USE_GENERIC_TREECTRL || !defined(__WXMSW__) if (IsKindOf(CLASSINFO(wxGenericTreeCtrl))) { wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this; @@ -109,15 +109,21 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPer 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. +#if USE_GENERIC_TREECTRL || !defined(__WXMSW__) int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const { wxScrolledWindow* scrolledWindow = GetScrolledWindow(); -#if USE_GENERIC_TREECTRL || !defined(__WXMSW__) if (IsKindOf(CLASSINFO(wxGenericTreeCtrl))) { wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this; @@ -129,6 +135,9 @@ int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const return scrolledWindow->GetScrollPos(orient); } } +#else +int wxRemotelyScrolledTreeCtrl::GetScrollPos(int WXUNUSED(orient)) const +{ #endif return 0; } @@ -164,9 +173,9 @@ void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const } // In case we're using the generic tree control. +#if USE_GENERIC_TREECTRL || !defined(__WXMSW__) void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc) { -#if USE_GENERIC_TREECTRL || !defined(__WXMSW__) if (IsKindOf(CLASSINFO(wxGenericTreeCtrl))) { wxScrolledWindow* scrolledWindow = GetScrolledWindow(); @@ -183,12 +192,15 @@ void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc) dc.SetDeviceOrigin( -startX * xppu1, -startY * yppu2 ); // 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) -void wxRemotelyScrolledTreeCtrl::ScrollToLine(int posHoriz, int posVert) +void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVert) { #ifdef __WXMSW__ #if USE_GENERIC_TREECTRL @@ -197,7 +209,7 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int posHoriz, int posVert) { UINT sbCode = SB_THUMBPOSITION; HWND vertScrollBar = 0; - MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXHWND) vertScrollBar); + MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXLPARAM) vertScrollBar); } #if USE_GENERIC_TREECTRL else @@ -332,9 +344,9 @@ void wxRemotelyScrolledTreeCtrl::CalcTreeSize(const wxTreeItemId& id, wxRect& re rect = CombineRectangles(rect, itemSize); } - long cookie; + void* cookie; wxTreeItemId childId = GetFirstChild(id, cookie); - while (childId != 0) + while (childId) { CalcTreeSize(childId, rect); childId = GetNextChild(childId, cookie); @@ -417,28 +429,27 @@ void wxTreeCompanionWindow::DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& re #endif } -void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event) +void wxTreeCompanionWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); if (!m_treeCtrl) return; - wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); + wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); dc.SetPen(pen); dc.SetBrush(* wxTRANSPARENT_BRUSH); - wxFont font(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); + wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); dc.SetFont(font); 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(); + int cy = itemRect.GetTop(); wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight()); lastH = h; @@ -450,7 +461,7 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event) } if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect)) { - cy = itemRect.GetBottom(); + int cy = itemRect.GetBottom(); dc.DrawLine(0, cy, clientSize.x, cy); } } @@ -470,7 +481,7 @@ void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event) 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. @@ -495,6 +506,10 @@ wxThinSplitterWindow::wxThinSplitterWindow(wxWindow* parent, wxWindowID id, { } +wxThinSplitterWindow::~wxThinSplitterWindow() +{ +} + void wxThinSplitterWindow::SizeWindows() { // The client size may have changed inbetween @@ -505,14 +520,14 @@ void wxThinSplitterWindow::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); } void wxThinSplitterWindow::DrawSash(wxDC& dc) { - if ( m_sashPosition == 0 || !m_windowTwo) + if ( GetSashPosition() == 0 || !m_windowTwo) return; if (GetWindowStyle() & wxSP_NOSASH) return; @@ -532,7 +547,7 @@ void wxThinSplitterWindow::DrawSash(wxDC& dc) { y1 = 2; h1 -= 3; } - dc.DrawRectangle(m_sashPosition, y1, m_sashSize, h1); + dc.DrawRectangle(GetSashPosition(), y1, GetSashSize(), h1); } else { @@ -546,7 +561,7 @@ void wxThinSplitterWindow::DrawSash(wxDC& dc) { x1 = 2; w1 -= 3; } - dc.DrawRectangle(x1, m_sashPosition, w1, m_sashSize); + dc.DrawRectangle(x1, GetSashPosition(), w1, GetSashSize()); } dc.SetPen(wxNullPen); @@ -577,12 +592,12 @@ wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID { } -void wxSplitterScrolledWindow::OnSize(wxSizeEvent& event) +void wxSplitterScrolledWindow::OnSize(wxSizeEvent& WXUNUSED(event)) { wxSize sz = GetClientSize(); - if (GetChildren().First()) + if (GetChildren().GetFirst()) { - ((wxWindow*) GetChildren().First()->Data())->SetSize(0, 0, sz.x, sz.y); + ((wxWindow*) GetChildren().GetFirst()->GetData())->SetSize(0, 0, sz.x, sz.y); } } @@ -633,10 +648,10 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event) } // Find targets in splitter window and send the event to them - wxNode* node = GetChildren().First(); + wxNode* node = (wxNode *)GetChildren().GetFirst(); while (node) { - wxWindow* child = (wxWindow*) node->Data(); + wxWindow* child = (wxWindow*) node->GetData(); if (child->IsKindOf(CLASSINFO(wxSplitterWindow))) { wxSplitterWindow* splitter = (wxSplitterWindow*) child; @@ -646,7 +661,7 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event) splitter->GetWindow2()->ProcessEvent(event); break; } - node = node->Next(); + node = node->GetNext(); } #ifdef __WXMAC__