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