- col1 = wxSCHEME_COLOUR(m_scheme, SHADOW_DARK);
- col2 = wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED);
- }
- else
- {
- col1 = wxSCHEME_COLOUR(m_scheme, SHADOW_DARK);
- col2 = wxSCHEME_COLOUR(m_scheme, SHADOW_IN);
- }
-
- dc.SetPen(*wxTRANSPARENT_PEN);
- dc.SetBrush(wxBrush(col1, wxSOLID));
- dc.DrawRectangle(rect);
- rect.Deflate(1);
- dc.SetBrush(wxBrush(col2, wxSOLID));
- dc.DrawRectangle(rect);
-}
-
-void wxMonoRenderer::DrawUncheckBitmap(wxDC& dc,
- const wxRect& rectTotal,
- bool isPressed)
-{
- wxRect rect = rectTotal;
- DrawAntiRaisedBorder(dc, &rect);
-
- wxColour col = wxSCHEME_COLOUR(m_scheme, SHADOW_IN);
- dc.SetPen(wxPen(col, 0, wxSOLID));
- dc.DrawPoint(rect.GetRight() - 1, rect.GetBottom() - 1);
-
- if ( isPressed )
- col = wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED);
- //else: it is SHADOW_IN, leave as is
-
- dc.SetPen(*wxTRANSPARENT_PEN);
- dc.SetBrush(wxBrush(col, wxSOLID));
- dc.DrawRectangle(rect);
-}
-
-void wxMonoRenderer::DrawCheckBitmap(wxDC& dc, const wxRect& rectTotal)
-{
- wxRect rect = rectTotal;
- DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight);
- DrawShadedRect(dc, &rect, m_penBlack, m_penLightGrey);
-
- dc.SetPen(*wxTRANSPARENT_PEN);
- dc.SetBrush(wxBrush(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), wxSOLID));
- dc.DrawRectangle(rect);
-}
-
-void wxMonoRenderer::DrawRadioBitmap(wxDC& dc,
- const wxRect& rect,
- int flags)
-{
- wxCoord x = rect.x,
- y = rect.y,
- xRight = rect.GetRight(),
- yBottom = rect.GetBottom();
-
- wxCoord yMid = (y + yBottom) / 2;
-
- // this looks ugly when the background colour of the control is not the
- // same ours - radiobox is not transparent as it should be
-#if 0
- // first fill the middle: as FloodFill() is not implemented on all
- // platforms, this is the only thing to do
- wxColour colBg = flags & wxCONTROL_CURRENT
- ? wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT)
- : wxSCHEME_COLOUR(m_scheme, SHADOW_IN);
- dc.SetBrush(wxBrush(colBg, wxSOLID));
- dc.SetPen(*wxTRANSPARENT_PEN);
- dc.DrawRectangle(rect);
-#endif // 0
-
- // then draw the upper half
- dc.SetPen(flags & wxCONTROL_CHECKED ? m_penDarkGrey : m_penHighlight);
- DrawUpZag(dc, x, xRight, yMid, y);
- DrawUpZag(dc, x + 1, xRight - 1, yMid, y + 1);
-
- bool drawIt = true;
- if ( flags & wxCONTROL_CHECKED )
- dc.SetPen(m_penBlack);
- else if ( flags & wxCONTROL_PRESSED )
- dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID));
- else // unchecked and unpressed
- drawIt = false;
-
- if ( drawIt )
- DrawUpZag(dc, x + 2, xRight - 2, yMid, y + 2);
-
- // and then the lower one
- dc.SetPen(flags & wxCONTROL_CHECKED ? m_penHighlight : m_penBlack);
- DrawDownZag(dc, x, xRight, yMid, yBottom);
- if ( !(flags & wxCONTROL_CHECKED) )
- dc.SetPen(m_penDarkGrey);
- DrawDownZag(dc, x + 1, xRight - 1, yMid, yBottom - 1);
-
- if ( !(flags & wxCONTROL_CHECKED) )
- drawIt = true; // with the same pen
- else if ( flags & wxCONTROL_PRESSED )
- {
- dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID));
- drawIt = true;
- }
- else // checked and unpressed
- drawIt = false;
-
- if ( drawIt )
- DrawDownZag(dc, x + 2, xRight - 2, yMid, yBottom - 2);
-}
-
-void wxMonoRenderer::DrawUpZag(wxDC& dc,
- wxCoord x1,
- wxCoord x2,
- wxCoord y1,
- wxCoord y2)
-{
- wxCoord xMid = (x1 + x2) / 2;
- dc.DrawLine(x1, y1, xMid, y2);
- dc.DrawLine(xMid, y2, x2 + 1, y1 + 1);
-}
-
-void wxMonoRenderer::DrawDownZag(wxDC& dc,
- wxCoord x1,
- wxCoord x2,
- wxCoord y1,
- wxCoord y2)
-{
- wxCoord xMid = (x1 + x2) / 2;
- dc.DrawLine(x1 + 1, y1 + 1, xMid, y2);
- dc.DrawLine(xMid, y2, x2, y1);
-}
-
-wxBitmap wxMonoRenderer::GetCheckBitmap(int flags)
-{
- if ( !m_bitmapsCheckbox[0][0].Ok() )
- {
- // init the bitmaps once only
- wxRect rect;
- wxSize size = GetCheckBitmapSize();
- rect.width = size.x;
- rect.height = size.y;
- for ( int i = 0; i < 2; i++ )