Build fix after DrawPushButton introduction.
[wxWidgets.git] / samples / render / renddll.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: renddll.cpp
3 // Purpose: Example of a renderer implemented in a DLL
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 04.08.03
7 // RCS-ID: $Id$
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wxprec.h"
13
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17
18 #include "wx/renderer.h"
19
20 #ifndef WX_PRECOMP
21 #include "wx/dc.h"
22 #endif
23
24 class MyDllRenderer : public wxRendererNative
25 {
26 public:
27 // draw the header control button (used by wxListCtrl)
28 virtual void DrawHeaderButton(wxWindow *win,
29 wxDC& dc,
30 const wxRect& rect,
31 int flags = 0)
32 {
33 dc.SetBrush(*wxCYAN_BRUSH);
34 dc.SetTextForeground(*wxRED);
35 dc.DrawRoundedRectangle(rect, 10);
36 dc.DrawLabel(_T("MyDllRenderer"), wxNullBitmap, rect, wxALIGN_CENTER);
37 }
38
39 // draw the expanded/collapsed icon for a tree control item
40 virtual void DrawTreeItemButton(wxWindow *win,
41 wxDC& dc,
42 const wxRect& rect,
43 int flags = 0)
44 {
45 }
46
47 // draw check button
48 virtual void DrawCheckButton(wxWindow *win,
49 wxDC& dc,
50 const wxRect& rect,
51 int flags = 0)
52 {
53 }
54
55 // draw blank button
56 virtual void DrawPushButton(wxWindow *win,
57 wxDC& dc,
58 const wxRect& rect,
59 int flags = 0)
60 {
61 }
62
63 // draw the border for sash window: this border must be such that the sash
64 // drawn by DrawSash() blends into it well
65 virtual void DrawSplitterBorder(wxWindow *win,
66 wxDC& dc,
67 const wxRect& rect,
68 int flags = 0)
69 {
70 }
71
72 // draw a (vertical) sash
73 virtual void DrawSplitterSash(wxWindow *win,
74 wxDC& dc,
75 const wxSize& size,
76 wxCoord position,
77 wxOrientation orient,
78 int flags = 0)
79 {
80 }
81
82 // draw a combobox dropdown button
83 //
84 // flags may only use wxCONTROL_PRESSED
85 virtual void DrawComboBoxDropButton(wxWindow *win,
86 wxDC& dc,
87 const wxRect& rect,
88 int flags = 0)
89 {
90 }
91
92 // draw a dropdown arrow
93 //
94 // flags may use wxCONTROL_PRESSED and wxCONTROL_CURRENT
95 virtual void DrawDropArrow(wxWindow *win,
96 wxDC& dc,
97 const wxRect& rect,
98 int flags = 0)
99 {
100 }
101
102 // get the splitter parameters: the x field of the returned point is the
103 // sash width and the y field is the border width
104 virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win)
105 {
106 return wxSplitterRenderParams(0, 0, 0);
107 }
108
109 virtual wxRendererVersion GetVersion() const
110 {
111 return wxRendererVersion(wxRendererVersion::Current_Version,
112 wxRendererVersion::Current_Age);
113 }
114
115 #if 0 // just for debugging
116 MyDllRenderer()
117 {
118 wxMessageBox(_T("Creating MyDllRenderer"), _T("Renderer Sample"));
119 }
120
121 virtual ~MyDllRenderer()
122 {
123 wxMessageBox(_T("Deleting MyDllRenderer"), _T("Renderer Sample"));
124 }
125 #endif // 0
126 };
127
128 extern "C"
129 WXEXPORT wxRendererNative *wxCreateRenderer()
130 {
131 return new MyDllRenderer;
132 }