- int flags)
-{
- wxRect rectIn;
-
- if ( flags & wxCONTROL_ISDEFAULT )
- {
- // draw the size grip: it is a normal rect except that in the lower
- // right corner we have several bands which may be used for dragging
- // the status bar corner
- //
- // each band consists of 4 stripes: m_penHighlight, double
- // m_penDarkGrey and transparent one
- wxCoord x2 = rect.GetRight(),
- y2 = rect.GetBottom();
-
- // draw the upper left part of the rect normally
- dc.SetPen(m_penDarkGrey);
- dc.DrawLine(rect.GetLeft(), rect.GetTop(), rect.GetLeft(), y2);
- dc.DrawLine(rect.GetLeft() + 1, rect.GetTop(), x2, rect.GetTop());
-
- // draw the grey stripes of the grip
- size_t n;
- wxCoord ofs = WIDTH_STATUSBAR_GRIP_BAND - 1;
- for ( n = 0; n < NUM_STATUSBAR_GRIP_BANDS; n++, ofs += WIDTH_STATUSBAR_GRIP_BAND )
- {
- dc.DrawLine(x2 - ofs + 1, y2 - 1, x2, y2 - ofs);
- dc.DrawLine(x2 - ofs, y2 - 1, x2, y2 - ofs - 1);
- }
-
- // draw the white stripes
- dc.SetPen(m_penHighlight);
- ofs = WIDTH_STATUSBAR_GRIP_BAND + 1;
- for ( n = 0; n < NUM_STATUSBAR_GRIP_BANDS; n++, ofs += WIDTH_STATUSBAR_GRIP_BAND )
- {
- dc.DrawLine(x2 - ofs + 1, y2 - 1, x2, y2 - ofs);
- }
-
- // draw the remaining rect boundaries
- ofs -= WIDTH_STATUSBAR_GRIP_BAND;
- dc.DrawLine(x2, rect.GetTop(), x2, y2 - ofs + 1);
- dc.DrawLine(rect.GetLeft(), y2, x2 - ofs + 1, y2);
-
- rectIn = rect;
- rectIn.Deflate(1);
-
- rectIn.width -= STATUSBAR_GRIP_SIZE;
- }
- else // normal pane
- {
- DrawBorder(dc, wxBORDER_STATIC, rect, flags, &rectIn);
- }
-
- rectIn.Deflate(STATBAR_BORDER_X, STATBAR_BORDER_Y);
-
- wxDCClipper clipper(dc, rectIn);
- DrawLabel(dc, label, rectIn, flags, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
-}
-
-// ----------------------------------------------------------------------------
-// combobox
-// ----------------------------------------------------------------------------
-
-void wxWin32Renderer::GetComboBitmaps(wxBitmap *bmpNormal,
- wxBitmap *bmpFocus,
- wxBitmap *bmpPressed,
- wxBitmap *bmpDisabled)
-{
- static const wxCoord widthCombo = 16;
- static const wxCoord heightCombo = 17;
-
- wxMemoryDC dcMem;
-
- if ( bmpNormal )
- {
- bmpNormal->Create(widthCombo, heightCombo);
- dcMem.SelectObject(*bmpNormal);
- DrawArrowButton(dcMem, wxRect(0, 0, widthCombo, heightCombo),
- Arrow_Down, Arrow_Normal);
- }
-
- if ( bmpPressed )
- {
- bmpPressed->Create(widthCombo, heightCombo);
- dcMem.SelectObject(*bmpPressed);
- DrawArrowButton(dcMem, wxRect(0, 0, widthCombo, heightCombo),
- Arrow_Down, Arrow_Pressed);
- }
-
- if ( bmpDisabled )
- {
- bmpDisabled->Create(widthCombo, heightCombo);
- dcMem.SelectObject(*bmpDisabled);
- DrawArrowButton(dcMem, wxRect(0, 0, widthCombo, heightCombo),
- Arrow_Down, Arrow_Disabled);
- }
-}
-
-// ----------------------------------------------------------------------------
-// background
-// ----------------------------------------------------------------------------
-
-void wxWin32Renderer::DoDrawBackground(wxDC& dc,
- const wxColour& col,
- const wxRect& rect,
- wxWindow *window )
-{
- wxBrush brush(col, wxSOLID);
- dc.SetBrush(brush);
- dc.SetPen(*wxTRANSPARENT_PEN);
- dc.DrawRectangle(rect);
-}
-
-void wxWin32Renderer::DrawBackground(wxDC& dc,
- const wxColour& col,
- const wxRect& rect,
- int flags,
- wxWindow *window )
-{
- // just fill it with the given or default bg colour
- wxColour colBg = col.Ok() ? col : wxSCHEME_COLOUR(m_scheme, CONTROL);
- DoDrawBackground(dc, colBg, rect, window );
-}
-
-// ----------------------------------------------------------------------------
-// scrollbar
-// ----------------------------------------------------------------------------
-
-void wxWin32Renderer::DrawArrow(wxDC& dc,
- wxDirection dir,
- const wxRect& rect,
- int flags)
-{
- // get the bitmap for this arrow
- wxArrowDirection arrowDir;
- switch ( dir )
- {
- case wxLEFT: arrowDir = Arrow_Left; break;
- case wxRIGHT: arrowDir = Arrow_Right; break;
- case wxUP: arrowDir = Arrow_Up; break;
- case wxDOWN: arrowDir = Arrow_Down; break;
-
- default:
- wxFAIL_MSG(_T("unknown arrow direction"));
- return;
- }
-
- wxArrowStyle arrowStyle;
- if ( flags & wxCONTROL_PRESSED )
- {
- // can't be pressed and disabled
- arrowStyle = Arrow_Pressed;
- }
- else
- {
- arrowStyle = flags & wxCONTROL_DISABLED ? Arrow_Disabled : Arrow_Normal;
- }
-
- DrawArrowButton(dc, rect, arrowDir, arrowStyle);
-}
-
-void wxWin32Renderer::DrawArrow(wxDC& dc,
- const wxRect& rect,
- wxArrowDirection arrowDir,
- wxArrowStyle arrowStyle)
-{
- const wxBitmap& bmp = m_bmpArrows[arrowStyle][arrowDir];
-
- // under Windows the arrows always have the same size so just centre it in
- // the provided rectangle
- wxCoord x = rect.x + (rect.width - bmp.GetWidth()) / 2,
- y = rect.y + (rect.height - bmp.GetHeight()) / 2;
-
- // Windows does it like this...
- if ( arrowDir == Arrow_Left )
- x--;
-
- // draw it
- dc.DrawBitmap(bmp, x, y, TRUE /* use mask */);
-}
-
-void wxWin32Renderer::DrawArrowButton(wxDC& dc,
- const wxRect& rectAll,
- wxArrowDirection arrowDir,
- wxArrowStyle arrowStyle)
-{
- wxRect rect = rectAll;
- DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect);
- DrawArrowBorder(dc, &rect, arrowStyle == Arrow_Pressed);
- DrawArrow(dc, rect, arrowDir, arrowStyle);
-}
-
-void wxWin32Renderer::DrawScrollbarThumb(wxDC& dc,
- wxOrientation orient,
- const wxRect& rect,
- int flags)
-{
- // we don't use the flags, the thumb never changes appearance
- wxRect rectThumb = rect;
- DrawArrowBorder(dc, &rectThumb);
- DrawBackground(dc, wxNullColour, rectThumb);
-}
-
-void wxWin32Renderer::DrawScrollbarShaft(wxDC& dc,
- wxOrientation orient,
- const wxRect& rectBar,
- int flags)
-{
- wxColourScheme::StdColour col = flags & wxCONTROL_PRESSED
- ? wxColourScheme::SCROLLBAR_PRESSED
- : wxColourScheme::SCROLLBAR;
- DoDrawBackground(dc, m_scheme->Get(col), rectBar);
-}
-
-void wxWin32Renderer::DrawScrollCorner(wxDC& dc, const wxRect& rect)
-{
- DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect);
-}
-
-wxRect wxWin32Renderer::GetScrollbarRect(const wxScrollBar *scrollbar,
- wxScrollBar::Element elem,
- int thumbPos) const
-{
- return StandardGetScrollbarRect(scrollbar, elem,
- thumbPos, m_sizeScrollbarArrow);
-}
-
-wxCoord wxWin32Renderer::GetScrollbarSize(const wxScrollBar *scrollbar)
-{
- return StandardScrollBarSize(scrollbar, m_sizeScrollbarArrow);
-}
-
-wxHitTest wxWin32Renderer::HitTestScrollbar(const wxScrollBar *scrollbar,
- const wxPoint& pt) const
-{
- return StandardHitTestScrollbar(scrollbar, pt, m_sizeScrollbarArrow);
-}
-
-wxCoord wxWin32Renderer::ScrollbarToPixel(const wxScrollBar *scrollbar,
- int thumbPos)
-{
- return StandardScrollbarToPixel(scrollbar, thumbPos, m_sizeScrollbarArrow);
-}
-
-int wxWin32Renderer::PixelToScrollbar(const wxScrollBar *scrollbar,
- wxCoord coord)
-{
- return StandardPixelToScrollbar(scrollbar, coord, m_sizeScrollbarArrow);
-}
-
-// ----------------------------------------------------------------------------
-// top level windows
-// ----------------------------------------------------------------------------
-
-int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int flags) const