1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/renderer.h
3 // Purpose: wxRenderer class declaration
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
13 wxRenderer class is used to draw all wxWindows controls. This is an ABC and
14 the look of the application is determined by the concrete derivation of
15 wxRenderer used in the program.
17 It also contains a few static methods which may be used by the concrete
18 renderers and provide the functionality which is often similar or identical
19 in all renderers (using inheritance here would be more restrictive as the
20 given concrete renderer may need an arbitrary subset of the base class
25 #pragma interface "renderer.h"
28 #ifndef _WX_UNIV_RENDERER_H_
29 #define _WX_UNIV_RENDERER_H_
31 class WXDLLEXPORT wxDC
;
32 class WXDLLEXPORT wxCheckListBox
;
33 class WXDLLEXPORT wxListBox
;
34 class WXDLLEXPORT wxMenu
;
35 class WXDLLEXPORT wxMenuGeometryInfo
;
36 class WXDLLEXPORT wxScrollBar
;
37 class WXDLLEXPORT wxTextCtrl
;
38 class WXDLLEXPORT wxWindow
;
40 class WXDLLEXPORT wxGauge
;
43 #include "wx/string.h"
44 #include "wx/gdicmn.h"
45 #include "wx/scrolbar.h" // for wxScrollBar::Element
47 // ----------------------------------------------------------------------------
48 // wxRenderer: abstract renderers interface
49 // ----------------------------------------------------------------------------
51 class WXDLLEXPORT wxRenderer
57 // draw the controls background
58 virtual void DrawBackground(wxDC
& dc
,
63 // draw the label inside the given rectangle with the specified alignment
64 // and optionally emphasize the character with the given index
65 virtual void DrawLabel(wxDC
& dc
,
66 const wxString
& label
,
69 int alignment
= wxALIGN_LEFT
| wxALIGN_TOP
,
71 wxRect
*rectBounds
= NULL
) = 0;
73 // same but also draw a bitmap if it is valid
74 virtual void DrawButtonLabel(wxDC
& dc
,
75 const wxString
& label
,
76 const wxBitmap
& image
,
79 int alignment
= wxALIGN_LEFT
| wxALIGN_TOP
,
81 wxRect
*rectBounds
= NULL
) = 0;
83 // draw the border and optionally return the rectangle containing the
84 // region inside the border
85 virtual void DrawBorder(wxDC
& dc
,
89 wxRect
*rectIn
= (wxRect
*)NULL
) = 0;
91 // draw text control border (I hate to have a separate method for this but
92 // it is needed to accomodate GTK+)
93 virtual void DrawTextBorder(wxDC
& dc
,
97 wxRect
*rectIn
= (wxRect
*)NULL
) = 0;
99 // draw push button border and return the rectangle left for the label
100 virtual void DrawButtonBorder(wxDC
& dc
,
103 wxRect
*rectIn
= (wxRect
*)NULL
) = 0;
105 // draw a horizontal line
106 virtual void DrawHorizontalLine(wxDC
& dc
,
107 wxCoord y
, wxCoord x1
, wxCoord x2
) = 0;
109 // draw a vertical line
110 virtual void DrawVerticalLine(wxDC
& dc
,
111 wxCoord x
, wxCoord y1
, wxCoord y2
) = 0;
113 // draw a frame with the label (horizontal alignment can be specified)
114 virtual void DrawFrame(wxDC
& dc
,
115 const wxString
& label
,
118 int alignment
= wxALIGN_LEFT
,
119 int indexAccel
= -1) = 0;
121 // draw an arrow in the given direction
122 virtual void DrawArrow(wxDC
& dc
,
127 // draw a scrollbar arrow (may be the same as arrow but may be not)
128 virtual void DrawScrollbarArrow(wxDC
& dc
,
133 // draw the scrollbar thumb
134 virtual void DrawScrollbarThumb(wxDC
& dc
,
135 wxOrientation orient
,
139 // draw a (part of) scrollbar shaft
140 virtual void DrawScrollbarShaft(wxDC
& dc
,
141 wxOrientation orient
,
145 // draw the rectangle in the corner between two scrollbars
146 virtual void DrawScrollCorner(wxDC
& dc
,
147 const wxRect
& rect
) = 0;
149 // draw an item of a wxListBox
150 virtual void DrawItem(wxDC
& dc
,
151 const wxString
& label
,
155 // draw an item of a wxCheckListBox
156 virtual void DrawCheckItem(wxDC
& dc
,
157 const wxString
& label
,
158 const wxBitmap
& bitmap
,
162 // draw a checkbutton (bitmap may be invalid to use default one)
163 virtual void DrawCheckButton(wxDC
& dc
,
164 const wxString
& label
,
165 const wxBitmap
& bitmap
,
168 wxAlignment align
= wxALIGN_LEFT
,
169 int indexAccel
= -1) = 0;
171 // draw a radio button
172 virtual void DrawRadioButton(wxDC
& dc
,
173 const wxString
& label
,
174 const wxBitmap
& bitmap
,
177 wxAlignment align
= wxALIGN_LEFT
,
178 int indexAccel
= -1) = 0;
180 // draw a (part of) line in the text control
181 virtual void DrawTextLine(wxDC
& dc
,
182 const wxString
& text
,
188 // draw a line wrap indicator
189 virtual void DrawLineWrapMark(wxDC
& dc
, const wxRect
& rect
) = 0;
191 // draw a notebook tab
192 virtual void DrawTab(wxDC
& dc
,
195 const wxString
& label
,
196 const wxBitmap
& bitmap
= wxNullBitmap
,
198 int indexAccel
= -1) = 0;
200 // draw the slider shaft
201 virtual void DrawSliderShaft(wxDC
& dc
,
203 wxOrientation orient
,
205 wxRect
*rectShaft
= NULL
) = 0;
207 // draw the slider thumb
208 virtual void DrawSliderThumb(wxDC
& dc
,
210 wxOrientation orient
,
213 // draw the slider ticks
214 virtual void DrawSliderTicks(wxDC
& dc
,
216 const wxSize
& sizeThumb
,
217 wxOrientation orient
,
224 // draw a menu bar item
225 virtual void DrawMenuBarItem(wxDC
& dc
,
227 const wxString
& label
,
229 int indexAccel
= -1) = 0;
231 // draw a menu item (also used for submenus if flags has ISSUBMENU flag)
233 // the geometryInfo is calculated by GetMenuGeometry() function from below
234 virtual void DrawMenuItem(wxDC
& dc
,
236 const wxMenuGeometryInfo
& geometryInfo
,
237 const wxString
& label
,
238 const wxString
& accel
,
239 const wxBitmap
& bitmap
= wxNullBitmap
,
241 int indexAccel
= -1) = 0;
243 // draw a menu bar separator
244 virtual void DrawMenuSeparator(wxDC
& dc
,
246 const wxMenuGeometryInfo
& geomInfo
) = 0;
251 // return the bitmaps to use for combobox button
252 virtual void GetComboBitmaps(wxBitmap
*bmpNormal
,
253 wxBitmap
*bmpPressed
,
254 wxBitmap
*bmpDisabled
) = 0;
256 // geometry functions
257 // ------------------
259 // get the dimensions of the border: rect.x/y contain the width/height of
260 // the left/top side, width/heigh - of the right/bottom one
261 virtual wxRect
GetBorderDimensions(wxBorder border
) const = 0;
263 // the scrollbars may be drawn either inside the window border or outside
264 // it - this function is used to decide how to draw them
265 virtual bool AreScrollbarsInsideBorder() const = 0;
267 // adjust the size of the control of the given class: for most controls,
268 // this just takes into account the border, but for some (buttons, for
269 // example) it is more complicated - the result being, in any case, that
270 // the control looks "nice" if it uses the adjusted rectangle
271 virtual void AdjustSize(wxSize
*size
, const wxWindow
*window
) = 0;
273 // get the size of a scrollbar arrow
274 virtual wxSize
GetScrollbarArrowSize() const = 0;
276 // gets the bounding box for a scrollbar element for the given (by default
277 // - current) thumb position
278 virtual wxRect
GetScrollbarRect(const wxScrollBar
*scrollbar
,
279 wxScrollBar::Element elem
,
280 int thumbPos
= -1) const = 0;
282 // returns the size of the scrollbar shaft excluding the arrows
283 virtual wxCoord
GetScrollbarSize(const wxScrollBar
*scrollbar
) = 0;
285 // returns one of wxHT_SCROLLBAR_XXX constants
286 virtual wxHitTest
HitTestScrollbar(const wxScrollBar
*scrollbar
,
287 const wxPoint
& pt
) const = 0;
289 // translate the scrollbar position (in logical units) into physical
290 // coordinate (in pixels) and the other way round
291 virtual wxCoord
ScrollbarToPixel(const wxScrollBar
*scrollbar
,
292 int thumbPos
= -1) = 0;
293 virtual int PixelToScrollbar(const wxScrollBar
*scrollbar
,
296 // get the height of a listbox item from the base font height
297 virtual wxCoord
GetListboxItemHeight(wxCoord fontHeight
) = 0;
299 // get the size of a checkbox/radio button bitmap
300 virtual wxSize
GetCheckBitmapSize() const = 0;
301 virtual wxSize
GetRadioBitmapSize() const = 0;
302 virtual wxCoord
GetCheckItemMargin() const = 0;
304 // convert between text rectangle and client rectangle for text controls:
305 // the former is typicall smaller to leave margins around text
306 virtual wxRect
GetTextTotalArea(const wxTextCtrl
*text
,
307 const wxRect
& rectText
) = 0;
309 // extra space is for line indicators
310 virtual wxRect
GetTextClientArea(const wxTextCtrl
*text
,
311 const wxRect
& rectTotal
,
312 wxCoord
*extraSpaceBeyond
) = 0;
314 // get the overhang of a selected tab
315 virtual wxSize
GetTabIndent() const = 0;
317 // get the padding around the text in a tab
318 virtual wxSize
GetTabPadding() const = 0;
320 // get the default size of the slider in lesser dimension (i.e. height of a
321 // horizontal slider or width of a vertical one)
322 virtual wxCoord
GetSliderDim() const = 0;
324 // get the length of the slider ticks displayed along side slider
325 virtual wxCoord
GetSliderTickLen() const = 0;
327 // get the slider shaft rect from the total slider rect
328 virtual wxRect
GetSliderShaftRect(const wxRect
& rect
,
329 wxOrientation orient
) const = 0;
331 // get the size of the slider thumb for the given total slider rect
332 virtual wxSize
GetSliderThumbSize(const wxRect
& rect
,
333 wxOrientation orient
) const = 0;
335 // get the size of one progress bar step (in horz and vertical directions)
336 virtual wxSize
GetProgressBarStep() const = 0;
339 // get the size of rectangle to use in the menubar for the given text rect
340 virtual wxSize
GetMenuBarItemSize(const wxSize
& sizeText
) const = 0;
342 // get the struct storing all layout info needed to draw all menu items
343 // (this can't be calculated for each item separately as they should be
346 // the returned pointer must be deleted by the caller
347 virtual wxMenuGeometryInfo
*GetMenuGeometry(wxWindow
*win
,
348 const wxMenu
& menu
) const = 0;
350 // virtual dtor for any base class
351 virtual ~wxRenderer();
354 // draw a frame around rectFrame rectangle but not touching the rectLabel
355 // one: this is used by DrawFrame()
356 void StandardDrawFrame(wxDC
& dc
,
357 const wxRect
& rectFrame
,
358 const wxRect
& rectLabel
);
360 // standard text line drawing: just use DrawText() and highlight the
362 static void StandardDrawTextLine(wxDC
& dc
,
363 const wxString
& text
,
365 int selStart
, int selEnd
,
368 // standard scrollbar hit testing: this assumes that it only has 2 arrows
369 // and a thumb, so the themes which have more complicated scrollbars (e.g.
370 // BeOS) can't use this method
371 static wxRect
StandardGetScrollbarRect(const wxScrollBar
*scrollbar
,
372 wxScrollBar::Element elem
,
374 const wxSize
& sizeArrow
);
375 static wxHitTest
StandardHitTestScrollbar(const wxScrollBar
*scrollbar
,
377 const wxSize
& sizeArrow
);
378 static wxCoord
StandardScrollbarToPixel(const wxScrollBar
*scrollbar
,
380 const wxSize
& sizeArrow
);
381 static int StandardPixelToScrollbar(const wxScrollBar
*scrollbar
,
383 const wxSize
& sizeArrow
);
384 static wxCoord
StandardScrollBarSize(const wxScrollBar
*scrollbar
,
385 const wxSize
& sizeArrow
);
386 static void StandardScrollBarThumbSize(wxCoord lenBar
,
394 // ----------------------------------------------------------------------------
395 // wxDelegateRenderer: it is impossible to inherit from any of standard
396 // renderers as their declarations are in private code, but you can use this
397 // class to override only some of the Draw() functions - all the other ones
398 // will be left to the original renderer
399 // ----------------------------------------------------------------------------
401 class WXDLLEXPORT wxDelegateRenderer
: public wxRenderer
404 wxDelegateRenderer(wxRenderer
*renderer
) : m_renderer(renderer
) { }
406 virtual void DrawBackground(wxDC
& dc
,
410 { m_renderer
->DrawBackground(dc
, col
, rect
, flags
); }
411 virtual void DrawLabel(wxDC
& dc
,
412 const wxString
& label
,
415 int align
= wxALIGN_LEFT
| wxALIGN_TOP
,
417 wxRect
*rectBounds
= NULL
)
418 { m_renderer
->DrawLabel(dc
, label
, rect
,
419 flags
, align
, indexAccel
, rectBounds
); }
420 virtual void DrawButtonLabel(wxDC
& dc
,
421 const wxString
& label
,
422 const wxBitmap
& image
,
425 int align
= wxALIGN_LEFT
| wxALIGN_TOP
,
427 wxRect
*rectBounds
= NULL
)
428 { m_renderer
->DrawButtonLabel(dc
, label
, image
, rect
,
429 flags
, align
, indexAccel
, rectBounds
); }
430 virtual void DrawBorder(wxDC
& dc
,
434 wxRect
*rectIn
= (wxRect
*)NULL
)
435 { m_renderer
->DrawBorder(dc
, border
, rect
, flags
, rectIn
); }
436 virtual void DrawTextBorder(wxDC
& dc
,
440 wxRect
*rectIn
= (wxRect
*)NULL
)
441 { m_renderer
->DrawTextBorder(dc
, border
, rect
, flags
, rectIn
); }
442 virtual void DrawButtonBorder(wxDC
& dc
,
445 wxRect
*rectIn
= (wxRect
*)NULL
)
446 { m_renderer
->DrawButtonBorder(dc
, rect
, flags
, rectIn
); }
447 virtual void DrawFrame(wxDC
& dc
,
448 const wxString
& label
,
451 int align
= wxALIGN_LEFT
,
453 { m_renderer
->DrawFrame(dc
, label
, rect
, flags
, align
, indexAccel
); }
454 virtual void DrawHorizontalLine(wxDC
& dc
,
455 wxCoord y
, wxCoord x1
, wxCoord x2
)
456 { m_renderer
->DrawHorizontalLine(dc
, y
, x1
, x2
); }
457 virtual void DrawVerticalLine(wxDC
& dc
,
458 wxCoord x
, wxCoord y1
, wxCoord y2
)
459 { m_renderer
->DrawVerticalLine(dc
, x
, y1
, y2
); }
460 virtual void DrawArrow(wxDC
& dc
,
464 { m_renderer
->DrawArrow(dc
, dir
, rect
, flags
); }
465 virtual void DrawScrollbarArrow(wxDC
& dc
,
469 { m_renderer
->DrawScrollbarArrow(dc
, dir
, rect
, flags
); }
470 virtual void DrawScrollbarThumb(wxDC
& dc
,
471 wxOrientation orient
,
474 { m_renderer
->DrawScrollbarThumb(dc
, orient
, rect
, flags
); }
475 virtual void DrawScrollbarShaft(wxDC
& dc
,
476 wxOrientation orient
,
479 { m_renderer
->DrawScrollbarShaft(dc
, orient
, rect
, flags
); }
480 virtual void DrawScrollCorner(wxDC
& dc
,
482 { m_renderer
->DrawScrollCorner(dc
, rect
); }
483 virtual void DrawItem(wxDC
& dc
,
484 const wxString
& label
,
487 { m_renderer
->DrawItem(dc
, label
, rect
, flags
); }
488 virtual void DrawCheckItem(wxDC
& dc
,
489 const wxString
& label
,
490 const wxBitmap
& bitmap
,
493 { m_renderer
->DrawCheckItem(dc
, label
, bitmap
, rect
, flags
); }
494 virtual void DrawCheckButton(wxDC
& dc
,
495 const wxString
& label
,
496 const wxBitmap
& bitmap
,
499 wxAlignment align
= wxALIGN_LEFT
,
501 { m_renderer
->DrawCheckButton(dc
, label
, bitmap
, rect
,
502 flags
, align
, indexAccel
); }
503 virtual void DrawRadioButton(wxDC
& dc
,
504 const wxString
& label
,
505 const wxBitmap
& bitmap
,
508 wxAlignment align
= wxALIGN_LEFT
,
510 { m_renderer
->DrawRadioButton(dc
, label
, bitmap
, rect
,
511 flags
, align
, indexAccel
); }
512 virtual void DrawTextLine(wxDC
& dc
,
513 const wxString
& text
,
517 { m_renderer
->DrawTextLine(dc
, text
, rect
, selStart
, selEnd
); }
518 virtual void DrawLineWrapMark(wxDC
& dc
, const wxRect
& rect
)
519 { m_renderer
->DrawLineWrapMark(dc
, rect
); }
521 virtual void DrawTab(wxDC
& dc
,
524 const wxString
& label
,
525 const wxBitmap
& bitmap
= wxNullBitmap
,
528 { m_renderer
->DrawTab(dc
, rect
, dir
, label
, bitmap
, flags
, accel
); }
530 virtual void DrawSliderShaft(wxDC
& dc
,
532 wxOrientation orient
,
534 wxRect
*rectShaft
= NULL
)
535 { m_renderer
->DrawSliderShaft(dc
, rect
, orient
, flags
, rectShaft
); }
536 virtual void DrawSliderThumb(wxDC
& dc
,
538 wxOrientation orient
,
540 { m_renderer
->DrawSliderThumb(dc
, rect
, orient
, flags
); }
541 virtual void DrawSliderTicks(wxDC
& dc
,
543 const wxSize
& sizeThumb
,
544 wxOrientation orient
,
549 { m_renderer
->DrawSliderTicks(dc
, rect
, sizeThumb
, orient
,
550 start
, end
, start
, flags
); }
553 virtual void DrawMenuBarItem(wxDC
& dc
,
555 const wxString
& label
,
558 { m_renderer
->DrawMenuBarItem(dc
, rect
, label
, flags
, indexAccel
); }
559 virtual void DrawMenuItem(wxDC
& dc
,
561 const wxMenuGeometryInfo
& gi
,
562 const wxString
& label
,
563 const wxString
& accel
,
564 const wxBitmap
& bitmap
= wxNullBitmap
,
567 { m_renderer
->DrawMenuItem(dc
, y
, gi
, label
, accel
,
568 bitmap
, flags
, indexAccel
); }
569 virtual void DrawMenuSeparator(wxDC
& dc
,
571 const wxMenuGeometryInfo
& geomInfo
)
572 { m_renderer
->DrawMenuSeparator(dc
, y
, geomInfo
); }
574 virtual void GetComboBitmaps(wxBitmap
*bmpNormal
,
575 wxBitmap
*bmpPressed
,
576 wxBitmap
*bmpDisabled
)
577 { m_renderer
->GetComboBitmaps(bmpNormal
, bmpPressed
, bmpDisabled
); }
579 virtual void AdjustSize(wxSize
*size
, const wxWindow
*window
)
580 { m_renderer
->AdjustSize(size
, window
); }
581 virtual wxRect
GetBorderDimensions(wxBorder border
) const
582 { return m_renderer
->GetBorderDimensions(border
); }
583 virtual bool AreScrollbarsInsideBorder() const
584 { return m_renderer
->AreScrollbarsInsideBorder(); }
586 virtual wxSize
GetScrollbarArrowSize() const
587 { return m_renderer
->GetScrollbarArrowSize(); }
588 virtual wxRect
GetScrollbarRect(const wxScrollBar
*scrollbar
,
589 wxScrollBar::Element elem
,
590 int thumbPos
= -1) const
591 { return m_renderer
->GetScrollbarRect(scrollbar
, elem
, thumbPos
); }
592 virtual wxCoord
GetScrollbarSize(const wxScrollBar
*scrollbar
)
593 { return m_renderer
->GetScrollbarSize(scrollbar
); }
594 virtual wxHitTest
HitTestScrollbar(const wxScrollBar
*scrollbar
,
595 const wxPoint
& pt
) const
596 { return m_renderer
->HitTestScrollbar(scrollbar
, pt
); }
597 virtual wxCoord
ScrollbarToPixel(const wxScrollBar
*scrollbar
,
599 { return m_renderer
->ScrollbarToPixel(scrollbar
, thumbPos
); }
600 virtual int PixelToScrollbar(const wxScrollBar
*scrollbar
,
602 { return m_renderer
->PixelToScrollbar(scrollbar
, coord
); }
603 virtual wxCoord
GetListboxItemHeight(wxCoord fontHeight
)
604 { return m_renderer
->GetListboxItemHeight(fontHeight
); }
605 virtual wxSize
GetCheckBitmapSize() const
606 { return m_renderer
->GetCheckBitmapSize(); }
607 virtual wxSize
GetRadioBitmapSize() const
608 { return m_renderer
->GetRadioBitmapSize(); }
609 virtual wxCoord
GetCheckItemMargin() const
610 { return m_renderer
->GetCheckItemMargin(); }
612 virtual wxRect
GetTextTotalArea(const wxTextCtrl
*text
, const wxRect
& rect
)
613 { return m_renderer
->GetTextTotalArea(text
, rect
); }
614 virtual wxRect
GetTextClientArea(const wxTextCtrl
*text
,
616 wxCoord
*extraSpaceBeyond
)
617 { return m_renderer
->GetTextClientArea(text
, rect
, extraSpaceBeyond
); }
619 virtual wxSize
GetTabIndent() const { return m_renderer
->GetTabIndent(); }
620 virtual wxSize
GetTabPadding() const { return m_renderer
->GetTabPadding(); }
622 virtual wxCoord
GetSliderDim() const
623 { return m_renderer
->GetSliderDim(); }
624 virtual wxCoord
GetSliderTickLen() const
625 { return m_renderer
->GetSliderTickLen(); }
626 virtual wxRect
GetSliderShaftRect(const wxRect
& rect
,
627 wxOrientation orient
) const
628 { return GetSliderShaftRect(rect
, orient
); }
629 virtual wxSize
GetSliderThumbSize(const wxRect
& rect
,
630 wxOrientation orient
) const
631 { return m_renderer
->GetSliderThumbSize(rect
, orient
); }
632 virtual wxSize
GetProgressBarStep() const
633 { return m_renderer
->GetProgressBarStep(); }
635 virtual wxSize
GetMenuBarItemSize(const wxSize
& sizeText
) const
636 { return m_renderer
->GetMenuBarItemSize(sizeText
); }
637 virtual wxMenuGeometryInfo
*GetMenuGeometry(wxWindow
*win
,
638 const wxMenu
& menu
) const
639 { return m_renderer
->GetMenuGeometry(win
, menu
); }
642 wxRenderer
*m_renderer
;
645 // ----------------------------------------------------------------------------
646 // wxControlRenderer: wraps the wxRenderer functions in a form easy to use from
648 // ----------------------------------------------------------------------------
650 class WXDLLEXPORT wxControlRenderer
653 // create a renderer for this dc with this "fundamental" renderer
654 wxControlRenderer(wxWindow
*control
, wxDC
& dc
, wxRenderer
*renderer
);
657 void DrawLabel(const wxBitmap
& bitmap
= wxNullBitmap
,
658 wxCoord marginX
= 0, wxCoord marginY
= 0);
660 void DrawItems(const wxListBox
*listbox
,
661 size_t itemFirst
, size_t itemLast
);
662 #endif // wxUSE_LISTBOX
663 #if wxUSE_CHECKLISTBOX
664 void DrawCheckItems(const wxCheckListBox
*listbox
,
665 size_t itemFirst
, size_t itemLast
);
666 #endif // wxUSE_CHECKLISTBOX
667 void DrawButtonBorder();
668 // the line must be either horizontal or vertical
669 void DrawLine(wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
);
671 void DrawBitmap(const wxBitmap
& bitmap
);
672 void DrawBackgroundBitmap();
673 void DrawScrollbar(const wxScrollBar
*scrollbar
, int thumbPosOld
);
675 void DrawProgressBar(const wxGauge
*gauge
);
676 #endif // wxUSE_GAUGE
679 wxWindow
*GetWindow() const { return m_window
; }
680 wxRenderer
*GetRenderer() const { return m_renderer
; }
682 wxDC
& GetDC() { return m_dc
; }
684 const wxRect
& GetRect() const { return m_rect
; }
685 wxRect
& GetRect() { return m_rect
; }
688 static void DrawBitmap(wxDC
&dc
,
689 const wxBitmap
& bitmap
,
691 int alignment
= wxALIGN_CENTRE
|
692 wxALIGN_CENTRE_VERTICAL
,
693 wxStretch stretch
= wxSTRETCH_NOT
);
696 // common part of DrawItems() and DrawCheckItems()
697 void DoDrawItems(const wxListBox
*listbox
,
698 size_t itemFirst
, size_t itemLast
,
699 bool isCheckLbox
= FALSE
);
702 wxRenderer
*m_renderer
;
707 #endif // _WX_UNIV_RENDERER_H_