]> git.saurik.com Git - wxWidgets.git/blob - src/univ/themes/mono.cpp
fix TLW borders width in mono theme
[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 #include "wx/dc.h"
29 #endif // WX_PRECOMP
30
31 #include "wx/artprov.h"
32 #include "wx/univ/stdrend.h"
33 #include "wx/univ/inphand.h"
34 #include "wx/univ/colschem.h"
35 #include "wx/univ/theme.h"
36
37 class wxMonoColourScheme;
38
39 #define wxMONO_BG_COL (*wxWHITE)
40 #define wxMONO_FG_COL (*wxBLACK)
41
42 // ----------------------------------------------------------------------------
43 // wxMonoRenderer: draw the GUI elements in simplest possible way
44 // ----------------------------------------------------------------------------
45
46 // Warning: many of the methods here are not implemented, the code won't work
47 // if any but a few wxUSE_XXXs are on
48 class wxMonoRenderer : public wxStdRenderer
49 {
50 public:
51 wxMonoRenderer(const wxColourScheme *scheme);
52
53 virtual void DrawButtonLabel(wxDC& dc,
54 const wxString& label,
55 const wxBitmap& image,
56 const wxRect& rect,
57 int flags = 0,
58 int alignment = wxALIGN_LEFT | wxALIGN_TOP,
59 int indexAccel = -1,
60 wxRect *rectBounds = NULL);
61
62 virtual void DrawButtonBorder(wxDC& dc,
63 const wxRect& rect,
64 int flags = 0,
65 wxRect *rectIn = NULL);
66
67 virtual void DrawHorizontalLine(wxDC& dc,
68 wxCoord y, wxCoord x1, wxCoord x2);
69
70 virtual void DrawVerticalLine(wxDC& dc,
71 wxCoord x, wxCoord y1, wxCoord y2);
72
73 virtual void DrawArrow(wxDC& dc,
74 wxDirection dir,
75 const wxRect& rect,
76 int flags = 0);
77 virtual void DrawScrollbarThumb(wxDC& dc,
78 wxOrientation orient,
79 const wxRect& rect,
80 int flags = 0);
81 virtual void DrawScrollbarShaft(wxDC& dc,
82 wxOrientation orient,
83 const wxRect& rect,
84 int flags = 0);
85
86 #if wxUSE_TOOLBAR
87 virtual void DrawToolBarButton(wxDC& dc,
88 const wxString& label,
89 const wxBitmap& bitmap,
90 const wxRect& rect,
91 int flags = 0,
92 long style = 0,
93 int tbarStyle = 0);
94 #endif // wxUSE_TOOLBAR
95
96 #if wxUSE_NOTEBOOK
97 virtual void DrawTab(wxDC& dc,
98 const wxRect& rect,
99 wxDirection dir,
100 const wxString& label,
101 const wxBitmap& bitmap = wxNullBitmap,
102 int flags = 0,
103 int indexAccel = -1);
104 #endif // wxUSE_NOTEBOOK
105
106 #if wxUSE_SLIDER
107 virtual void DrawSliderShaft(wxDC& dc,
108 const wxRect& rect,
109 int lenThumb,
110 wxOrientation orient,
111 int flags = 0,
112 long style = 0,
113 wxRect *rectShaft = NULL);
114
115 virtual void DrawSliderThumb(wxDC& dc,
116 const wxRect& rect,
117 wxOrientation orient,
118 int flags = 0,
119 long style = 0);
120
121 virtual void DrawSliderTicks(wxDC& dc,
122 const wxRect& rect,
123 int lenThumb,
124 wxOrientation orient,
125 int start,
126 int end,
127 int step = 1,
128 int flags = 0,
129 long style = 0);
130 #endif // wxUSE_SLIDER
131
132 #if wxUSE_MENUS
133 virtual void DrawMenuBarItem(wxDC& dc,
134 const wxRect& rect,
135 const wxString& label,
136 int flags = 0,
137 int indexAccel = -1);
138
139 virtual void DrawMenuItem(wxDC& dc,
140 wxCoord y,
141 const wxMenuGeometryInfo& geometryInfo,
142 const wxString& label,
143 const wxString& accel,
144 const wxBitmap& bitmap = wxNullBitmap,
145 int flags = 0,
146 int indexAccel = -1);
147
148 virtual void DrawMenuSeparator(wxDC& dc,
149 wxCoord y,
150 const wxMenuGeometryInfo& geomInfo);
151 #endif // wxUSE_MENUS
152
153 #if wxUSE_COMBOBOX
154 virtual void GetComboBitmaps(wxBitmap *bmpNormal,
155 wxBitmap *bmpFocus,
156 wxBitmap *bmpPressed,
157 wxBitmap *bmpDisabled);
158 #endif // wxUSE_COMBOBOX
159
160
161 virtual wxRect GetBorderDimensions(wxBorder border) const;
162
163 #if wxUSE_SCROLLBAR
164 virtual wxSize GetScrollbarArrowSize() const { return GetStdBmpSize(); }
165 #endif // wxUSE_SCROLLBAR
166
167 virtual wxSize GetCheckBitmapSize() const { return GetStdBmpSize(); }
168 virtual wxSize GetRadioBitmapSize() const { return GetStdBmpSize(); }
169
170 #if wxUSE_TOOLBAR
171 virtual wxSize GetToolBarButtonSize(wxCoord *separator) const;
172
173 virtual wxSize GetToolBarMargin() const;
174 #endif // wxUSE_TOOLBAR
175
176 #if wxUSE_NOTEBOOK
177 virtual wxSize GetTabIndent() const;
178
179 virtual wxSize GetTabPadding() const;
180 #endif // wxUSE_NOTEBOOK
181
182 #if wxUSE_SLIDER
183 virtual wxCoord GetSliderDim() const;
184
185 virtual wxCoord GetSliderTickLen() const;
186
187 virtual wxRect GetSliderShaftRect(const wxRect& rect,
188 int lenThumb,
189 wxOrientation orient,
190 long style = 0) const;
191
192 virtual wxSize GetSliderThumbSize(const wxRect& rect,
193 int lenThumb,
194 wxOrientation orient) const;
195 #endif // wxUSE_SLIDER
196
197 virtual wxSize GetProgressBarStep() const;
198
199 #if wxUSE_MENUS
200 virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const;
201
202 virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
203 const wxMenu& menu) const;
204 #endif // wxUSE_MENUS
205
206 protected:
207 // override base class border drawing routines: we always draw just a
208 // single simple border
209 void DrawSimpleBorder(wxDC& dc, wxRect *rect)
210 { DrawRect(dc, rect, m_penFg); }
211
212 virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect)
213 { DrawSimpleBorder(dc, rect); }
214 virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect)
215 { DrawSimpleBorder(dc, rect); }
216 virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect)
217 { DrawSimpleBorder(dc, rect); }
218 virtual void DrawBoxBorder(wxDC& dc, wxRect *rect)
219 { DrawSimpleBorder(dc, rect); }
220 virtual void DrawStaticBorder(wxDC& dc, wxRect *rect)
221 { DrawSimpleBorder(dc, rect); }
222 virtual void DrawExtraBorder(wxDC& WXUNUSED(dc), wxRect * WXUNUSED(rect))
223 { /* no extra borders for us */ }
224
225 // all our XPMs are of this size
226 static wxSize GetStdBmpSize() { return wxSize(8, 8); }
227
228 wxBitmap GetIndicator(IndicatorType indType, int flags);
229 virtual wxBitmap GetCheckBitmap(int flags)
230 { return GetIndicator(IndicatorType_Check, flags); }
231 virtual wxBitmap GetRadioBitmap(int flags)
232 { return GetIndicator(IndicatorType_Radio, flags); }
233
234 virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type);
235 virtual int GetFrameBorderWidth(int flags) const;
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 delete 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 TITLEBAR:
589 case TITLEBAR_ACTIVE:
590 case HIGHLIGHT_TEXT:
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 TITLEBAR_TEXT:
607 case TITLEBAR_ACTIVE_TEXT:
608 case HIGHLIGHT:
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::DrawButtonBorder(wxDC& dc,
668 const wxRect& rect,
669 int flags,
670 wxRect *rectIn)
671 {
672 DrawBorder(dc, wxBORDER_SIMPLE, rect, flags, rectIn);
673 }
674
675 // ----------------------------------------------------------------------------
676 // lines and frames
677 // ----------------------------------------------------------------------------
678
679 void
680 wxMonoRenderer::DrawHorizontalLine(wxDC& dc, wxCoord y, wxCoord x1, wxCoord x2)
681 {
682 dc.SetPen(m_penFg);
683 dc.DrawLine(x1, y, x2 + 1, y);
684 }
685
686 void
687 wxMonoRenderer::DrawVerticalLine(wxDC& dc, wxCoord x, wxCoord y1, wxCoord y2)
688 {
689 dc.SetPen(m_penFg);
690 dc.DrawLine(x, y1, x, y2 + 1);
691 }
692
693 // ----------------------------------------------------------------------------
694 // label
695 // ----------------------------------------------------------------------------
696
697 void wxMonoRenderer::DrawButtonLabel(wxDC& dc,
698 const wxString& label,
699 const wxBitmap& image,
700 const wxRect& rect,
701 int flags,
702 int alignment,
703 int indexAccel,
704 wxRect *rectBounds)
705 {
706 dc.SetTextForeground(m_penFg.GetColour());
707 dc.DrawLabel(label, image, rect, alignment, indexAccel, rectBounds);
708
709 if ( flags & wxCONTROL_DISABLED )
710 {
711 // this is ugly but I don't know how to show disabled button visually
712 // in monochrome theme otherwise, so cross it out
713 dc.SetPen(m_penFg);
714 dc.DrawLine(rect.GetTopLeft(), rect.GetBottomRight());
715 dc.DrawLine(rect.GetTopRight(), rect.GetBottomLeft());
716 }
717 }
718
719 // ----------------------------------------------------------------------------
720 // bitmaps
721 // ----------------------------------------------------------------------------
722
723 wxBitmap wxMonoRenderer::GetIndicator(IndicatorType indType, int flags)
724 {
725 IndicatorState indState;
726 IndicatorStatus indStatus;
727 GetIndicatorsFromFlags(flags, indState, indStatus);
728
729 wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus];
730 if ( !bmp.Ok() )
731 {
732 const char **xpm = ms_xpmIndicators[indType][indState][indStatus];
733 if ( xpm )
734 {
735 // create and cache it
736 bmp = wxBitmap(xpm);
737 }
738 }
739
740 return bmp;
741 }
742
743 wxBitmap wxMonoRenderer::GetFrameButtonBitmap(FrameButtonType type)
744 {
745 if ( type == FrameButton_Close )
746 {
747 if ( !m_bmpFrameClose.Ok() )
748 {
749 static const char *xpmFrameClose[] = {
750 /* columns rows colors chars-per-pixel */
751 "8 8 2 1",
752 " c white",
753 "X c black",
754 /* pixels */
755 " ",
756 " XX XX ",
757 " X X ",
758 " XX ",
759 " XX ",
760 " X X ",
761 " XX XX ",
762 " ",
763 };
764
765 m_bmpFrameClose = wxBitmap(xpmFrameClose);
766 }
767
768 return m_bmpFrameClose;
769 }
770
771 // we don't show any other buttons than close
772 return wxNullBitmap;
773 }
774
775 // ----------------------------------------------------------------------------
776 // toolbar
777 // ----------------------------------------------------------------------------
778
779 #if wxUSE_TOOLBAR
780
781 void wxMonoRenderer::DrawToolBarButton(wxDC& dc,
782 const wxString& label,
783 const wxBitmap& bitmap,
784 const wxRect& rect,
785 int flags,
786 long style,
787 int tbarStyle)
788 {
789 wxFAIL_MSG(_T("TODO"));
790 }
791
792 wxSize wxMonoRenderer::GetToolBarButtonSize(wxCoord *separator) const
793 {
794 wxFAIL_MSG(_T("TODO"));
795
796 return wxSize();
797 }
798
799 wxSize wxMonoRenderer::GetToolBarMargin() const
800 {
801 wxFAIL_MSG(_T("TODO"));
802
803 return wxSize();
804 }
805
806 #endif // wxUSE_TOOLBAR
807
808 // ----------------------------------------------------------------------------
809 // notebook
810 // ----------------------------------------------------------------------------
811
812 #if wxUSE_NOTEBOOK
813
814 void wxMonoRenderer::DrawTab(wxDC& dc,
815 const wxRect& rect,
816 wxDirection dir,
817 const wxString& label,
818 const wxBitmap& bitmap,
819 int flags,
820 int indexAccel)
821 {
822 wxFAIL_MSG(_T("TODO"));
823 }
824
825 wxSize wxMonoRenderer::GetTabIndent() const
826 {
827 wxFAIL_MSG(_T("TODO"));
828
829 return wxSize();
830 }
831
832 wxSize wxMonoRenderer::GetTabPadding() const
833 {
834 wxFAIL_MSG(_T("TODO"));
835
836 return wxSize();
837 }
838
839 #endif // wxUSE_NOTEBOOK
840
841 // ----------------------------------------------------------------------------
842 // combobox
843 // ----------------------------------------------------------------------------
844
845 #if wxUSE_COMBOBOX
846
847 void wxMonoRenderer::GetComboBitmaps(wxBitmap *bmpNormal,
848 wxBitmap *bmpFocus,
849 wxBitmap *bmpPressed,
850 wxBitmap *bmpDisabled)
851 {
852 wxFAIL_MSG(_T("TODO"));
853 }
854
855 #endif // wxUSE_COMBOBOX
856
857 // ----------------------------------------------------------------------------
858 // menus
859 // ----------------------------------------------------------------------------
860
861 #if wxUSE_MENUS
862
863 void wxMonoRenderer::DrawMenuBarItem(wxDC& dc,
864 const wxRect& rect,
865 const wxString& label,
866 int flags,
867 int indexAccel)
868 {
869 wxFAIL_MSG(_T("TODO"));
870 }
871
872 void wxMonoRenderer::DrawMenuItem(wxDC& dc,
873 wxCoord y,
874 const wxMenuGeometryInfo& geometryInfo,
875 const wxString& label,
876 const wxString& accel,
877 const wxBitmap& bitmap,
878 int flags,
879 int indexAccel)
880 {
881 wxFAIL_MSG(_T("TODO"));
882 }
883
884 void wxMonoRenderer::DrawMenuSeparator(wxDC& dc,
885 wxCoord y,
886 const wxMenuGeometryInfo& geomInfo)
887 {
888 wxFAIL_MSG(_T("TODO"));
889 }
890
891 wxSize wxMonoRenderer::GetMenuBarItemSize(const wxSize& sizeText) const
892 {
893 wxFAIL_MSG(_T("TODO"));
894
895 return wxSize();
896 }
897
898 wxMenuGeometryInfo *wxMonoRenderer::GetMenuGeometry(wxWindow *win,
899 const wxMenu& menu) const
900 {
901 wxFAIL_MSG(_T("TODO"));
902
903 return NULL;
904 }
905
906 #endif // wxUSE_MENUS
907
908 // ----------------------------------------------------------------------------
909 // slider
910 // ----------------------------------------------------------------------------
911
912 #if wxUSE_SLIDER
913
914 void wxMonoRenderer::DrawSliderShaft(wxDC& dc,
915 const wxRect& rect,
916 int lenThumb,
917 wxOrientation orient,
918 int flags,
919 long style,
920 wxRect *rectShaft)
921 {
922 wxFAIL_MSG(_T("TODO"));
923 }
924
925
926 void wxMonoRenderer::DrawSliderThumb(wxDC& dc,
927 const wxRect& rect,
928 wxOrientation orient,
929 int flags,
930 long style)
931 {
932 wxFAIL_MSG(_T("TODO"));
933 }
934
935 void wxMonoRenderer::DrawSliderTicks(wxDC& dc,
936 const wxRect& rect,
937 int lenThumb,
938 wxOrientation orient,
939 int start,
940 int end,
941 int step,
942 int flags,
943 long style)
944 {
945 wxFAIL_MSG(_T("TODO"));
946 }
947
948 wxCoord wxMonoRenderer::GetSliderDim() const
949 {
950 wxFAIL_MSG(_T("TODO"));
951
952 return 0;
953 }
954
955 wxCoord wxMonoRenderer::GetSliderTickLen() const
956 {
957 wxFAIL_MSG(_T("TODO"));
958
959 return 0;
960 }
961
962
963 wxRect wxMonoRenderer::GetSliderShaftRect(const wxRect& rect,
964 int lenThumb,
965 wxOrientation orient,
966 long style) const
967 {
968 wxFAIL_MSG(_T("TODO"));
969
970 return wxRect();
971 }
972
973 wxSize wxMonoRenderer::GetSliderThumbSize(const wxRect& rect,
974 int lenThumb,
975 wxOrientation orient) const
976 {
977 wxFAIL_MSG(_T("TODO"));
978
979 return wxSize();
980 }
981
982 #endif // wxUSE_SLIDER
983
984 wxSize wxMonoRenderer::GetProgressBarStep() const
985 {
986 wxFAIL_MSG(_T("TODO"));
987
988 return wxSize();
989 }
990
991
992 // ----------------------------------------------------------------------------
993 // scrollbar
994 // ----------------------------------------------------------------------------
995
996 void wxMonoRenderer::DrawArrow(wxDC& dc,
997 wxDirection dir,
998 const wxRect& rect,
999 int WXUNUSED(flags))
1000 {
1001 ArrowDirection arrowDir = GetArrowDirection(dir);
1002 wxCHECK_RET( arrowDir != Arrow_Max, _T("invalid arrow direction") );
1003
1004 wxBitmap& bmp = m_bmpArrows[arrowDir];
1005 if ( !bmp.Ok() )
1006 {
1007 bmp = wxBitmap(ms_xpmArrows[arrowDir]);
1008 }
1009
1010 wxRect rectArrow(0, 0, bmp.GetWidth(), bmp.GetHeight());
1011 dc.DrawBitmap(bmp, rectArrow.CentreIn(rect).GetPosition(), true /* use mask */);
1012 }
1013
1014 void wxMonoRenderer::DrawScrollbarThumb(wxDC& dc,
1015 wxOrientation WXUNUSED(orient),
1016 const wxRect& rect,
1017 int WXUNUSED(flags))
1018 {
1019 DrawSolidRect(dc, wxMONO_FG_COL, rect);
1020 }
1021
1022 void wxMonoRenderer::DrawScrollbarShaft(wxDC& dc,
1023 wxOrientation WXUNUSED(orient),
1024 const wxRect& rect,
1025 int WXUNUSED(flags))
1026 {
1027 DrawSolidRect(dc, wxMONO_BG_COL, rect);
1028 }
1029
1030 // ----------------------------------------------------------------------------
1031 // top level windows
1032 // ----------------------------------------------------------------------------
1033
1034 int wxMonoRenderer::GetFrameBorderWidth(int WXUNUSED(flags)) const
1035 {
1036 // all our borders are simple
1037 return 1;
1038 }
1039
1040 // ----------------------------------------------------------------------------
1041 // wxMonoArtProvider
1042 // ----------------------------------------------------------------------------
1043
1044 wxBitmap wxMonoArtProvider::CreateBitmap(const wxArtID& WXUNUSED(id),
1045 const wxArtClient& WXUNUSED(client),
1046 const wxSize& WXUNUSED(size))
1047 {
1048 return wxNullBitmap;
1049 }