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