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