X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..fe282c0878bcb08efa406689986a1c8135a2cdd7:/src/univ/ctrlrend.cpp diff --git a/src/univ/ctrlrend.cpp b/src/univ/ctrlrend.cpp index a3fb8739bc..56e99ae7dd 100644 --- a/src/univ/ctrlrend.cpp +++ b/src/univ/ctrlrend.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: univ/ctrlrend.cpp +// Name: src/univ/ctrlrend.cpp // Purpose: wxControlRenderer implementation // Author: Vadim Zeitlin // Modified by: @@ -17,10 +17,6 @@ // headers // --------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "renderer.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -35,19 +31,15 @@ #include "wx/listbox.h" #include "wx/scrolbar.h" #include "wx/dc.h" + #include "wx/log.h" + #include "wx/gauge.h" + #include "wx/image.h" #endif // WX_PRECOMP -#include "wx/image.h" -#include "wx/log.h" - #include "wx/univ/theme.h" #include "wx/univ/renderer.h" #include "wx/univ/colschem.h" -#if wxUSE_GAUGE -#include "wx/gauge.h" -#endif - // ============================================================================ // implementation // ============================================================================ @@ -134,6 +126,8 @@ void wxRenderer::StandardDrawTextLine(wxDC& dc, // wxRenderer: scrollbar geometry // ---------------------------------------------------------------------------- +#if wxUSE_SCROLLBAR + /* static */ void wxRenderer::StandardScrollBarThumbSize(wxCoord length, int thumbPos, @@ -177,7 +171,8 @@ wxRect wxRenderer::StandardGetScrollbarRect(const wxScrollBar *scrollbar, } wxSize sizeTotal = scrollbar->GetClientSize(); - wxCoord *start, *width, length, arrow; + wxCoord *start, *width; + wxCoord length, arrow; wxRect rect; if ( scrollbar->IsVertical() ) { @@ -392,6 +387,8 @@ wxHitTest wxRenderer::StandardHitTestScrollbar(const wxScrollBar *scrollbar, } } +#endif // wxUSE_SCROLLBAR + wxRenderer::~wxRenderer() { } @@ -506,11 +503,13 @@ void wxControlRenderer::DrawBitmap(wxDC &dc, } } } +#if wxUSE_IMAGE else if ( stretch & wxEXPAND ) { // stretch bitmap to fill the entire control bmp = wxBitmap(wxImage(bmp.ConvertToImage()).Scale(rect.width, rect.height)); } +#endif // wxUSE_IMAGE else // not stretched, not tiled { if ( alignment & wxALIGN_RIGHT ) @@ -541,9 +540,11 @@ void wxControlRenderer::DrawBitmap(wxDC &dc, } // do draw it - dc.DrawBitmap(bmp, x, y, TRUE /* use mask */); + dc.DrawBitmap(bmp, x, y, true /* use mask */); } +#if wxUSE_SCROLLBAR + void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, int WXUNUSED(thumbPosOld)) { @@ -561,7 +562,7 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, rectUpdate.GetBottom()); #if 0 //def WXDEBUG_SCROLLBAR - static bool s_refreshDebug = FALSE; + static bool s_refreshDebug = false; if ( s_refreshDebug ) { wxClientDC dc(wxConstCast(scrollbar, wxScrollBar)); @@ -628,7 +629,7 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, (wxScrollArrows::Arrow)nArrow, m_dc, rectArrow, - TRUE // draw a scrollbar arrow, not just an arrow + true // draw a scrollbar arrow, not just an arrow ); } } @@ -654,6 +655,8 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, } } +#endif // wxUSE_SCROLLBAR + void wxControlRenderer::DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) { wxASSERT_MSG( x1 == x2 || y1 == y2, @@ -675,7 +678,11 @@ void wxControlRenderer::DrawItems(const wxListBox *lbox, void wxControlRenderer::DoDrawItems(const wxListBox *lbox, size_t itemFirst, size_t itemLast, +#if wxUSE_CHECKLISTBOX bool isCheckLbox) +#else + bool WXUNUSED(isCheckLbox)) +#endif { // prepare for the drawing: calc the initial position wxCoord lineHeight = lbox->GetLineHeight(); @@ -746,7 +753,7 @@ void wxControlRenderer::DoDrawItems(const wxListBox *lbox, void wxControlRenderer::DrawCheckItems(const wxCheckListBox *lbox, size_t itemFirst, size_t itemLast) { - DoDrawItems(lbox, itemFirst, itemLast, TRUE); + DoDrawItems(lbox, itemFirst, itemLast, true); } #endif // wxUSE_CHECKLISTBOX @@ -809,7 +816,8 @@ void wxControlRenderer::DrawProgressBar(const wxGauge *gauge) int steps = ((lenTotal + step - 1) * pos) / (max * step); // calc the coords of one small rect - wxCoord *px, dx, dy; + wxCoord *px; + wxCoord dx, dy; if ( gauge->IsVertical() ) { // draw from bottom to top: so first set y to the bottom @@ -866,4 +874,3 @@ void wxControlRenderer::DrawProgressBar(const wxGauge *gauge) } #endif // wxUSE_GAUGE -