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