]> git.saurik.com Git - wxWidgets.git/blob - src/univ/themes/mono.cpp
removed stubs for frame decorations drawing
[wxWidgets.git] / src / univ / themes / mono.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/themes/mono.cpp
3 // Purpose: wxUniversal theme for monochrome displays
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 2006-08-27
7 // RCS-ID: $Id$
8 // Copyright: (c) 2006 REA Elektronik GmbH
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 // ===========================================================================
13 // declarations
14 // ===========================================================================
15
16 // ---------------------------------------------------------------------------
17 // headers
18 // ---------------------------------------------------------------------------
19
20 // for compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
22
23 #ifdef __BORLANDC__
24 #pragma hdrstop
25 #endif
26
27 #ifndef WX_PRECOMP
28 #endif // WX_PRECOMP
29
30 #include "wx/artprov.h"
31 #include "wx/univ/stdrend.h"
32 #include "wx/univ/inphand.h"
33 #include "wx/univ/colschem.h"
34 #include "wx/univ/theme.h"
35
36 class wxMonoColourScheme;
37
38 #define wxMONO_BG_COL (*wxWHITE)
39 #define wxMONO_FG_COL (*wxBLACK)
40
41 // ----------------------------------------------------------------------------
42 // wxMonoRenderer: draw the GUI elements in simplest possible way
43 // ----------------------------------------------------------------------------
44
45 // Warning: many of the methods here are not implemented, the code won't work
46 // if any but a few wxUSE_XXXs are on
47 class wxMonoRenderer : public wxStdRenderer
48 {
49 public:
50 wxMonoRenderer(const wxColourScheme *scheme);
51
52 virtual void DrawButtonLabel(wxDC& dc,
53 const wxString& label,
54 const wxBitmap& image,
55 const wxRect& rect,
56 int flags = 0,
57 int alignment = wxALIGN_LEFT | wxALIGN_TOP,
58 int indexAccel = -1,
59 wxRect *rectBounds = NULL);
60
61 virtual void DrawBorder(wxDC& dc,
62 wxBorder border,
63 const wxRect& rect,
64 int flags = 0,
65 wxRect *rectIn = NULL);
66
67 virtual void DrawButtonBorder(wxDC& dc,
68 const wxRect& rect,
69 int flags = 0,
70 wxRect *rectIn = NULL);
71
72 virtual void DrawHorizontalLine(wxDC& dc,
73 wxCoord y, wxCoord x1, wxCoord x2);
74
75 virtual void DrawVerticalLine(wxDC& dc,
76 wxCoord x, wxCoord y1, wxCoord y2);
77
78 virtual void DrawArrow(wxDC& dc,
79 wxDirection dir,
80 const wxRect& rect,
81 int flags = 0);
82 virtual void DrawScrollbarThumb(wxDC& dc,
83 wxOrientation orient,
84 const wxRect& rect,
85 int flags = 0);
86 virtual void DrawScrollbarShaft(wxDC& dc,
87 wxOrientation orient,
88 const wxRect& rect,
89 int flags = 0);
90
91 #if wxUSE_TOOLBAR
92 virtual void DrawToolBarButton(wxDC& dc,
93 const wxString& label,
94 const wxBitmap& bitmap,
95 const wxRect& rect,
96 int flags = 0,
97 long style = 0,
98 int tbarStyle = 0);
99 #endif // wxUSE_TOOLBAR
100
101 #if wxUSE_NOTEBOOK
102 virtual void DrawTab(wxDC& dc,
103 const wxRect& rect,
104 wxDirection dir,
105 const wxString& label,
106 const wxBitmap& bitmap = wxNullBitmap,
107 int flags = 0,
108 int indexAccel = -1);
109 #endif // wxUSE_NOTEBOOK
110
111 #if wxUSE_SLIDER
112 virtual void DrawSliderShaft(wxDC& dc,
113 const wxRect& rect,
114 int lenThumb,
115 wxOrientation orient,
116 int flags = 0,
117 long style = 0,
118 wxRect *rectShaft = NULL);
119
120 virtual void DrawSliderThumb(wxDC& dc,
121 const wxRect& rect,
122 wxOrientation orient,
123 int flags = 0,
124 long style = 0);
125
126 virtual void DrawSliderTicks(wxDC& dc,
127 const wxRect& rect,
128 int lenThumb,
129 wxOrientation orient,
130 int start,
131 int end,
132 int step = 1,
133 int flags = 0,
134 long style = 0);
135 #endif // wxUSE_SLIDER
136
137 #if wxUSE_MENUS
138 virtual void DrawMenuBarItem(wxDC& dc,
139 const wxRect& rect,
140 const wxString& label,
141 int flags = 0,
142 int indexAccel = -1);
143
144 virtual void DrawMenuItem(wxDC& dc,
145 wxCoord y,
146 const wxMenuGeometryInfo& geometryInfo,
147 const wxString& label,
148 const wxString& accel,
149 const wxBitmap& bitmap = wxNullBitmap,
150 int flags = 0,
151 int indexAccel = -1);
152
153 virtual void DrawMenuSeparator(wxDC& dc,
154 wxCoord y,
155 const wxMenuGeometryInfo& geomInfo);
156 #endif // wxUSE_MENUS
157
158 #if wxUSE_COMBOBOX
159 virtual void GetComboBitmaps(wxBitmap *bmpNormal,
160 wxBitmap *bmpFocus,
161 wxBitmap *bmpPressed,
162 wxBitmap *bmpDisabled);
163 #endif // wxUSE_COMBOBOX
164
165
166 virtual wxRect GetBorderDimensions(wxBorder border) const;
167
168 #if wxUSE_SCROLLBAR
169 virtual wxSize GetScrollbarArrowSize() const { return GetStdBmpSize(); }
170 #endif // wxUSE_SCROLLBAR
171
172 virtual wxSize GetCheckBitmapSize() const { return GetStdBmpSize(); }
173 virtual wxSize GetRadioBitmapSize() const { return GetStdBmpSize(); }
174
175 #if wxUSE_TOOLBAR
176 virtual wxSize GetToolBarButtonSize(wxCoord *separator) const;
177
178 virtual wxSize GetToolBarMargin() const;
179 #endif // wxUSE_TOOLBAR
180
181 #if wxUSE_NOTEBOOK
182 virtual wxSize GetTabIndent() const;
183
184 virtual wxSize GetTabPadding() const;
185 #endif // wxUSE_NOTEBOOK
186
187 #if wxUSE_SLIDER
188 virtual wxCoord GetSliderDim() const;
189
190 virtual wxCoord GetSliderTickLen() const;
191
192 virtual wxRect GetSliderShaftRect(const wxRect& rect,
193 int lenThumb,
194 wxOrientation orient,
195 long style = 0) const;
196
197 virtual wxSize GetSliderThumbSize(const wxRect& rect,
198 int lenThumb,
199 wxOrientation orient) const;
200 #endif // wxUSE_SLIDER
201
202 virtual wxSize GetProgressBarStep() const;
203
204 #if wxUSE_MENUS
205 virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const;
206
207 virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
208 const wxMenu& menu) const;
209 #endif // wxUSE_MENUS
210
211 protected:
212 // override base class border drawing routines: we always draw just a
213 // single simple border
214 void DrawSimpleBorder(wxDC& dc, wxRect *rect)
215 { DrawRect(dc, rect, m_penFg); }
216
217 virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect)
218 { DrawSimpleBorder(dc, rect); }
219 virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect)
220 { DrawSimpleBorder(dc, rect); }
221 virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect)
222 { DrawSimpleBorder(dc, rect); }
223 virtual void DrawFrameBorder(wxDC& dc, wxRect *rect)
224 { DrawSimpleBorder(dc, rect); }
225
226 // all our XPMs are of this size
227 static wxSize GetStdBmpSize() { return wxSize(8, 8); }
228
229 wxBitmap GetIndicator(IndicatorType indType, int flags);
230 virtual wxBitmap GetCheckBitmap(int flags)
231 { return GetIndicator(IndicatorType_Check, flags); }
232 virtual wxBitmap GetRadioBitmap(int flags)
233 { return GetIndicator(IndicatorType_Radio, flags); }
234
235 virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type);
236
237 private:
238 // the bitmaps returned by GetIndicator()
239 wxBitmap m_bmpIndicators[IndicatorType_MaxCtrl]
240 [IndicatorState_MaxCtrl]
241 [IndicatorStatus_Max];
242
243 static const char **ms_xpmIndicators[IndicatorType_MaxCtrl]
244 [IndicatorState_MaxCtrl]
245 [IndicatorStatus_Max];
246
247 // the arrow bitmaps used by DrawArrow()
248 wxBitmap m_bmpArrows[Arrow_Max];
249
250 static const char **ms_xpmArrows[Arrow_Max];
251
252 // the close bitmap for the frame for GetFrameButtonBitmap()
253 wxBitmap m_bmpFrameClose;
254
255 // pen used for foreground drawing
256 wxPen m_penFg;
257 };
258
259 // ----------------------------------------------------------------------------
260 // standard bitmaps
261 // ----------------------------------------------------------------------------
262
263 static const char *xpmUnchecked[] = {
264 /* columns rows colors chars-per-pixel */
265 "8 8 2 1",
266 " c white",
267 "X c black",
268 /* pixels */
269 "XXXXXXXX",
270 "X X",
271 "X X",
272 "X X",
273 "X X",
274 "X X",
275 "X X",
276 "XXXXXXXX",
277 };
278
279 static const char *xpmChecked[] = {
280 /* columns rows colors chars-per-pixel */
281 "8 8 2 1",
282 " c white",
283 "X c black",
284 /* pixels */
285 "XXXXXXXX",
286 "X X",
287 "X X X X",
288 "X XX X",
289 "X XX X",
290 "X X X X",
291 "X X",
292 "XXXXXXXX",
293 };
294
295 static const char *xpmUndeterminate[] = {
296 /* columns rows colors chars-per-pixel */
297 "8 8 2 1",
298 " c white",
299 "X c black",
300 /* pixels */
301 "XXXXXXXX",
302 "X X X XX",
303 "XX X X X",
304 "X X X XX",
305 "XX X X X",
306 "X X X XX",
307 "XX X X X",
308 "XXXXXXXX",
309 };
310
311 static const char *xpmRadioUnchecked[] = {
312 /* columns rows colors chars-per-pixel */
313 "8 8 2 1",
314 " c white",
315 "X c black",
316 /* pixels */
317 "XXXXXXXX",
318 "X X",
319 "X XX X",
320 "X X X X",
321 "X X X X",
322 "X XX X",
323 "X X",
324 "XXXXXXXX",
325 };
326
327 static const char *xpmRadioChecked[] = {
328 /* columns rows colors chars-per-pixel */
329 "8 8 2 1",
330 " c white",
331 "X c black",
332 /* pixels */
333 "XXXXXXXX",
334 "X X",
335 "X XX X",
336 "X XXXX X",
337 "X XXXX X",
338 "X XX X",
339 "X X",
340 "XXXXXXXX",
341 };
342
343 const char **wxMonoRenderer::ms_xpmIndicators[IndicatorType_MaxCtrl]
344 [IndicatorState_MaxCtrl]
345 [IndicatorStatus_Max] =
346 {
347 // checkboxes first
348 {
349 // normal state
350 { xpmChecked, xpmUnchecked, xpmUndeterminate },
351
352 // pressed state
353 { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate },
354
355 // disabled state
356 { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate },
357 },
358
359 // radio
360 {
361 // normal state
362 { xpmRadioChecked, xpmRadioUnchecked, xpmUndeterminate },
363
364 // pressed state
365 { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate },
366
367 // disabled state
368 { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate },
369 },
370 };
371
372 static const char *xpmLeftArrow[] = {
373 /* columns rows colors chars-per-pixel */
374 "8 8 2 1",
375 " c white",
376 "X c black",
377 /* pixels */
378 " X ",
379 " XX ",
380 " XXX ",
381 "XXXX ",
382 "XXXX ",
383 " XXX ",
384 " XX ",
385 " X ",
386 };
387
388 static const char *xpmRightArrow[] = {
389 /* columns rows colors chars-per-pixel */
390 "8 8 2 1",
391 " c white",
392 "X c black",
393 /* pixels */
394 " X ",
395 " XX ",
396 " XXX ",
397 " XXXX",
398 " XXXX",
399 " XXX ",
400 " XX ",
401 " X ",
402 };
403
404 static const char *xpmUpArrow[] = {
405 /* columns rows colors chars-per-pixel */
406 "8 8 2 1",
407 " c white",
408 "X c black",
409 /* pixels */
410 " ",
411 " XX ",
412 " XXXX ",
413 " XXXXXX ",
414 "XXXXXXXX",
415 " ",
416 " ",
417 " ",
418 };
419
420 static const char *xpmDownArrow[] = {
421 /* columns rows colors chars-per-pixel */
422 "8 8 2 1",
423 " c white",
424 "X c black",
425 /* pixels */
426 " ",
427 " ",
428 " ",
429 "XXXXXXXX",
430 " XXXXXX ",
431 " XXXX ",
432 " XX ",
433 " ",
434 };
435
436 const char **wxMonoRenderer::ms_xpmArrows[Arrow_Max] =
437 {
438 xpmLeftArrow, xpmRightArrow, xpmUpArrow, xpmDownArrow,
439 };
440
441 // ----------------------------------------------------------------------------
442 // wxMonoColourScheme: uses just white and black
443 // ----------------------------------------------------------------------------
444
445 class wxMonoColourScheme : public wxColourScheme
446 {
447 public:
448 // we use only 2 colours, white and black, but we avoid referring to them
449 // like this, instead use the functions below
450 wxColour GetFg() const { return wxMONO_FG_COL; }
451 wxColour GetBg() const { return wxMONO_BG_COL; }
452
453 // implement base class pure virtuals
454 virtual wxColour Get(StdColour col) const;
455 virtual wxColour GetBackground(wxWindow *win) const;
456 };
457
458 // ----------------------------------------------------------------------------
459 // wxMonoArtProvider
460 // ----------------------------------------------------------------------------
461
462 class wxMonoArtProvider : public wxArtProvider
463 {
464 protected:
465 virtual wxBitmap CreateBitmap(const wxArtID& id,
466 const wxArtClient& client,
467 const wxSize& size);
468 };
469
470 // ----------------------------------------------------------------------------
471 // wxMonoTheme
472 // ----------------------------------------------------------------------------
473
474 class wxMonoTheme : public wxTheme
475 {
476 public:
477 wxMonoTheme();
478 virtual ~wxMonoTheme();
479
480 virtual wxRenderer *GetRenderer();
481 virtual wxArtProvider *GetArtProvider();
482 virtual wxInputHandler *GetInputHandler(const wxString& control,
483 wxInputConsumer *consumer);
484 virtual wxColourScheme *GetColourScheme();
485
486 private:
487 wxMonoRenderer *m_renderer;
488 wxMonoArtProvider *m_artProvider;
489 wxMonoColourScheme *m_scheme;
490
491 WX_DECLARE_THEME(mono)
492 };
493
494 // ============================================================================
495 // implementation
496 // ============================================================================
497
498 WX_IMPLEMENT_THEME(wxMonoTheme, mono, wxTRANSLATE("Simple monochrome theme"));
499
500 // ----------------------------------------------------------------------------
501 // wxMonoTheme
502 // ----------------------------------------------------------------------------
503
504 wxMonoTheme::wxMonoTheme()
505 {
506 m_scheme = NULL;
507 m_renderer = NULL;
508 m_artProvider = NULL;
509 }
510
511 wxMonoTheme::~wxMonoTheme()
512 {
513 delete m_renderer;
514 delete m_scheme;
515 wxArtProvider::RemoveProvider(m_artProvider);
516 }
517
518 wxRenderer *wxMonoTheme::GetRenderer()
519 {
520 if ( !m_renderer )
521 {
522 m_renderer = new wxMonoRenderer(GetColourScheme());
523 }
524
525 return m_renderer;
526 }
527
528 wxArtProvider *wxMonoTheme::GetArtProvider()
529 {
530 if ( !m_artProvider )
531 {
532 m_artProvider = new wxMonoArtProvider;
533 }
534
535 return m_artProvider;
536 }
537
538 wxColourScheme *wxMonoTheme::GetColourScheme()
539 {
540 if ( !m_scheme )
541 {
542 m_scheme = new wxMonoColourScheme;
543 }
544
545 return m_scheme;
546 }
547
548 wxInputHandler *wxMonoTheme::GetInputHandler(const wxString& WXUNUSED(control),
549 wxInputConsumer *consumer)
550 {
551 // no special input handlers so far
552 return consumer->DoGetStdInputHandler(NULL);
553 }
554
555 // ============================================================================
556 // wxMonoColourScheme
557 // ============================================================================
558
559 wxColour wxMonoColourScheme::GetBackground(wxWindow *win) const
560 {
561 wxColour col;
562 if ( win->UseBgCol() )
563 {
564 // use the user specified colour
565 col = win->GetBackgroundColour();
566 }
567
568 // doesn't depend on the state
569 if ( !col.Ok() )
570 {
571 col = GetBg();
572 }
573
574 return col;
575 }
576
577 wxColour wxMonoColourScheme::Get(wxMonoColourScheme::StdColour col) const
578 {
579 switch ( col )
580 {
581 case WINDOW:
582 case CONTROL:
583 case CONTROL_PRESSED:
584 case CONTROL_CURRENT:
585 case SCROLLBAR:
586 case SCROLLBAR_PRESSED:
587 case GAUGE:
588 case HIGHLIGHT:
589 case TITLEBAR:
590 case TITLEBAR_ACTIVE:
591 case DESKTOP:
592 return GetBg();
593
594 case MAX:
595 default:
596 wxFAIL_MSG(_T("invalid standard colour"));
597 // fall through
598
599 case SHADOW_DARK:
600 case SHADOW_HIGHLIGHT:
601 case SHADOW_IN:
602 case SHADOW_OUT:
603 case CONTROL_TEXT:
604 case CONTROL_TEXT_DISABLED:
605 case CONTROL_TEXT_DISABLED_SHADOW:
606 case HIGHLIGHT_TEXT:
607 case TITLEBAR_TEXT:
608 case TITLEBAR_ACTIVE_TEXT:
609 return GetFg();
610
611 }
612 }
613
614 // ============================================================================
615 // wxMonoRenderer
616 // ============================================================================
617
618 // ----------------------------------------------------------------------------
619 // construction
620 // ----------------------------------------------------------------------------
621
622 wxMonoRenderer::wxMonoRenderer(const wxColourScheme *scheme)
623 : wxStdRenderer(scheme)
624 {
625 m_penFg = wxPen(wxMONO_FG_COL);
626 }
627
628 // ----------------------------------------------------------------------------
629 // borders
630 // ----------------------------------------------------------------------------
631
632 wxRect wxMonoRenderer::GetBorderDimensions(wxBorder border) const
633 {
634 wxCoord width;
635 switch ( border )
636 {
637 case wxBORDER_SIMPLE:
638 case wxBORDER_STATIC:
639 case wxBORDER_RAISED:
640 case wxBORDER_SUNKEN:
641 width = 1;
642 break;
643
644 case wxBORDER_DOUBLE:
645 width = 2;
646 break;
647
648 default:
649 wxFAIL_MSG(_T("unknown border type"));
650 // fall through
651
652 case wxBORDER_DEFAULT:
653 case wxBORDER_NONE:
654 width = 0;
655 break;
656 }
657
658 wxRect rect;
659 rect.x =
660 rect.y =
661 rect.width =
662 rect.height = width;
663
664 return rect;
665 }
666
667 void wxMonoRenderer::DrawBorder(wxDC& dc,
668 wxBorder border,
669 const wxRect& rectTotal,
670 int WXUNUSED(flags),
671 wxRect *rectIn)
672 {
673 wxRect rect = rectTotal;
674
675 switch ( border )
676 {
677 case wxBORDER_DOUBLE:
678 DrawSimpleBorder(dc, &rect);
679 // fall through
680
681 case wxBORDER_SUNKEN:
682 case wxBORDER_STATIC:
683 case wxBORDER_RAISED:
684 case wxBORDER_SIMPLE:
685 DrawSimpleBorder(dc, &rect);
686 break;
687
688 default:
689 wxFAIL_MSG(_T("unknown border type"));
690 // fall through
691
692 case wxBORDER_DEFAULT:
693 case wxBORDER_NONE:
694 break;
695 }
696
697 if ( rectIn )
698 *rectIn = rect;
699 }
700
701 void wxMonoRenderer::DrawButtonBorder(wxDC& dc,
702 const wxRect& rect,
703 int flags,
704 wxRect *rectIn)
705 {
706 DrawBorder(dc, wxBORDER_SIMPLE, rect, flags, rectIn);
707 }
708
709 // ----------------------------------------------------------------------------
710 // lines and frames
711 // ----------------------------------------------------------------------------
712
713 void
714 wxMonoRenderer::DrawHorizontalLine(wxDC& dc, wxCoord y, wxCoord x1, wxCoord x2)
715 {
716 dc.SetPen(m_penFg);
717 dc.DrawLine(x1, y, x2 + 1, y);
718 }
719
720 void
721 wxMonoRenderer::DrawVerticalLine(wxDC& dc, wxCoord x, wxCoord y1, wxCoord y2)
722 {
723 dc.SetPen(m_penFg);
724 dc.DrawLine(x, y1, x, y2 + 1);
725 }
726
727 // ----------------------------------------------------------------------------
728 // label
729 // ----------------------------------------------------------------------------
730
731 void wxMonoRenderer::DrawButtonLabel(wxDC& dc,
732 const wxString& label,
733 const wxBitmap& image,
734 const wxRect& rect,
735 int flags,
736 int alignment,
737 int indexAccel,
738 wxRect *rectBounds)
739 {
740 dc.SetTextForeground(m_penFg.GetColour());
741 dc.DrawLabel(label, image, rect, alignment, indexAccel, rectBounds);
742
743 if ( flags & wxCONTROL_DISABLED )
744 {
745 // this is ugly but I don't know how to show disabled button visually
746 // in monochrome theme otherwise, so cross it out
747 dc.SetPen(m_penFg);
748 dc.DrawLine(rect.GetTopLeft(), rect.GetBottomRight());
749 dc.DrawLine(rect.GetTopRight(), rect.GetBottomLeft());
750 }
751 }
752
753 // ----------------------------------------------------------------------------
754 // bitmaps
755 // ----------------------------------------------------------------------------
756
757 wxBitmap wxMonoRenderer::GetIndicator(IndicatorType indType, int flags)
758 {
759 IndicatorState indState;
760 IndicatorStatus indStatus;
761 GetIndicatorsFromFlags(flags, indState, indStatus);
762
763 wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus];
764 if ( !bmp.Ok() )
765 {
766 const char **xpm = ms_xpmIndicators[indType][indState][indStatus];
767 if ( xpm )
768 {
769 // create and cache it
770 bmp = wxBitmap(xpm);
771 }
772 }
773
774 return bmp;
775 }
776
777 wxBitmap wxMonoRenderer::GetFrameButtonBitmap(FrameButtonType type)
778 {
779 if ( type == FrameButton_Close )
780 {
781 if ( !m_bmpFrameClose.Ok() )
782 {
783 static const char *xpmFrameClose[] = {
784 /* columns rows colors chars-per-pixel */
785 "8 8 2 1",
786 " c white",
787 "X c black",
788 /* pixels */
789 " ",
790 " XX XX ",
791 " X X ",
792 " XX ",
793 " XX ",
794 " X X ",
795 " XX XX ",
796 " ",
797 };
798
799 m_bmpFrameClose = wxBitmap(xpmFrameClose);
800 }
801
802 return m_bmpFrameClose;
803 }
804
805 // we don't show any other buttons than close
806 return wxNullBitmap;
807 }
808
809 // ----------------------------------------------------------------------------
810 // toolbar
811 // ----------------------------------------------------------------------------
812
813 #if wxUSE_TOOLBAR
814
815 void wxMonoRenderer::DrawToolBarButton(wxDC& dc,
816 const wxString& label,
817 const wxBitmap& bitmap,
818 const wxRect& rect,
819 int flags,
820 long style,
821 int tbarStyle)
822 {
823 wxFAIL_MSG(_T("TODO"));
824 }
825
826 wxSize wxMonoRenderer::GetToolBarButtonSize(wxCoord *separator) const
827 {
828 wxFAIL_MSG(_T("TODO"));
829
830 return wxSize();
831 }
832
833 wxSize wxMonoRenderer::GetToolBarMargin() const
834 {
835 wxFAIL_MSG(_T("TODO"));
836
837 return wxSize();
838 }
839
840 #endif // wxUSE_TOOLBAR
841
842 // ----------------------------------------------------------------------------
843 // notebook
844 // ----------------------------------------------------------------------------
845
846 #if wxUSE_NOTEBOOK
847
848 void wxMonoRenderer::DrawTab(wxDC& dc,
849 const wxRect& rect,
850 wxDirection dir,
851 const wxString& label,
852 const wxBitmap& bitmap,
853 int flags,
854 int indexAccel)
855 {
856 wxFAIL_MSG(_T("TODO"));
857 }
858
859 wxSize wxMonoRenderer::GetTabIndent() const
860 {
861 wxFAIL_MSG(_T("TODO"));
862
863 return wxSize();
864 }
865
866 wxSize wxMonoRenderer::GetTabPadding() const
867 {
868 wxFAIL_MSG(_T("TODO"));
869
870 return wxSize();
871 }
872
873 #endif // wxUSE_NOTEBOOK
874
875 // ----------------------------------------------------------------------------
876 // combobox
877 // ----------------------------------------------------------------------------
878
879 #if wxUSE_COMBOBOX
880
881 void wxMonoRenderer::GetComboBitmaps(wxBitmap *bmpNormal,
882 wxBitmap *bmpFocus,
883 wxBitmap *bmpPressed,
884 wxBitmap *bmpDisabled)
885 {
886 wxFAIL_MSG(_T("TODO"));
887 }
888
889 #endif // wxUSE_COMBOBOX
890
891 // ----------------------------------------------------------------------------
892 // menus
893 // ----------------------------------------------------------------------------
894
895 #if wxUSE_MENUS
896
897 void wxMonoRenderer::DrawMenuBarItem(wxDC& dc,
898 const wxRect& rect,
899 const wxString& label,
900 int flags,
901 int indexAccel)
902 {
903 wxFAIL_MSG(_T("TODO"));
904 }
905
906 void wxMonoRenderer::DrawMenuItem(wxDC& dc,
907 wxCoord y,
908 const wxMenuGeometryInfo& geometryInfo,
909 const wxString& label,
910 const wxString& accel,
911 const wxBitmap& bitmap,
912 int flags,
913 int indexAccel)
914 {
915 wxFAIL_MSG(_T("TODO"));
916 }
917
918 void wxMonoRenderer::DrawMenuSeparator(wxDC& dc,
919 wxCoord y,
920 const wxMenuGeometryInfo& geomInfo)
921 {
922 wxFAIL_MSG(_T("TODO"));
923 }
924
925 wxSize wxMonoRenderer::GetMenuBarItemSize(const wxSize& sizeText) const
926 {
927 wxFAIL_MSG(_T("TODO"));
928
929 return wxSize();
930 }
931
932 wxMenuGeometryInfo *wxMonoRenderer::GetMenuGeometry(wxWindow *win,
933 const wxMenu& menu) const
934 {
935 wxFAIL_MSG(_T("TODO"));
936
937 return NULL;
938 }
939
940 #endif // wxUSE_MENUS
941
942 // ----------------------------------------------------------------------------
943 // slider
944 // ----------------------------------------------------------------------------
945
946 #if wxUSE_SLIDER
947
948 void wxMonoRenderer::DrawSliderShaft(wxDC& dc,
949 const wxRect& rect,
950 int lenThumb,
951 wxOrientation orient,
952 int flags,
953 long style,
954 wxRect *rectShaft)
955 {
956 wxFAIL_MSG(_T("TODO"));
957 }
958
959
960 void wxMonoRenderer::DrawSliderThumb(wxDC& dc,
961 const wxRect& rect,
962 wxOrientation orient,
963 int flags,
964 long style)
965 {
966 wxFAIL_MSG(_T("TODO"));
967 }
968
969 void wxMonoRenderer::DrawSliderTicks(wxDC& dc,
970 const wxRect& rect,
971 int lenThumb,
972 wxOrientation orient,
973 int start,
974 int end,
975 int step,
976 int flags,
977 long style)
978 {
979 wxFAIL_MSG(_T("TODO"));
980 }
981
982 wxCoord wxMonoRenderer::GetSliderDim() const
983 {
984 wxFAIL_MSG(_T("TODO"));
985
986 return 0;
987 }
988
989 wxCoord wxMonoRenderer::GetSliderTickLen() const
990 {
991 wxFAIL_MSG(_T("TODO"));
992
993 return 0;
994 }
995
996
997 wxRect wxMonoRenderer::GetSliderShaftRect(const wxRect& rect,
998 int lenThumb,
999 wxOrientation orient,
1000 long style) const
1001 {
1002 wxFAIL_MSG(_T("TODO"));
1003
1004 return wxRect();
1005 }
1006
1007 wxSize wxMonoRenderer::GetSliderThumbSize(const wxRect& rect,
1008 int lenThumb,
1009 wxOrientation orient) const
1010 {
1011 wxFAIL_MSG(_T("TODO"));
1012
1013 return wxSize();
1014 }
1015
1016 #endif // wxUSE_SLIDER
1017
1018 wxSize wxMonoRenderer::GetProgressBarStep() const
1019 {
1020 wxFAIL_MSG(_T("TODO"));
1021
1022 return wxSize();
1023 }
1024
1025
1026 // ----------------------------------------------------------------------------
1027 // scrollbar
1028 // ----------------------------------------------------------------------------
1029
1030 void wxMonoRenderer::DrawArrow(wxDC& dc,
1031 wxDirection dir,
1032 const wxRect& rect,
1033 int WXUNUSED(flags))
1034 {
1035 ArrowDirection arrowDir = GetArrowDirection(dir);
1036 wxCHECK_RET( arrowDir != Arrow_Max, _T("invalid arrow direction") );
1037
1038 wxBitmap& bmp = m_bmpArrows[arrowDir];
1039 if ( !bmp.Ok() )
1040 {
1041 bmp = wxBitmap(ms_xpmArrows[arrowDir]);
1042 }
1043
1044 wxRect rectArrow(0, 0, bmp.GetWidth(), bmp.GetHeight());
1045 dc.DrawBitmap(bmp, rectArrow.CentreIn(rect).GetPosition(), true /* use mask */);
1046 }
1047
1048 void wxMonoRenderer::DrawScrollbarThumb(wxDC& dc,
1049 wxOrientation WXUNUSED(orient),
1050 const wxRect& rect,
1051 int WXUNUSED(flags))
1052 {
1053 DrawSolidRect(dc, wxMONO_FG_COL, rect);
1054 }
1055
1056 void wxMonoRenderer::DrawScrollbarShaft(wxDC& dc,
1057 wxOrientation WXUNUSED(orient),
1058 const wxRect& rect,
1059 int WXUNUSED(flags))
1060 {
1061 DrawSolidRect(dc, wxMONO_BG_COL, rect);
1062 }
1063
1064 // ----------------------------------------------------------------------------
1065 // top level windows
1066 // ----------------------------------------------------------------------------
1067
1068
1069 // ----------------------------------------------------------------------------
1070 // wxMonoArtProvider
1071 // ----------------------------------------------------------------------------
1072
1073 wxBitmap wxMonoArtProvider::CreateBitmap(const wxArtID& WXUNUSED(id),
1074 const wxArtClient& WXUNUSED(client),
1075 const wxSize& WXUNUSED(size))
1076 {
1077 return wxNullBitmap;
1078 }
1079