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