1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: Example of a renderer implemented in a DLL
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
18 #include "wx/renderer.h"
24 class MyDllRenderer
: public wxRendererNative
27 // draw the header control button (used by wxListCtrl)
28 virtual void DrawHeaderButton(wxWindow
*win
,
33 dc
.SetBrush(*wxCYAN_BRUSH
);
34 dc
.SetTextForeground(*wxRED
);
35 dc
.DrawRoundedRectangle(rect
, 10);
36 dc
.DrawLabel(_T("MyDllRenderer"), wxNullBitmap
, rect
, wxALIGN_CENTER
);
39 // draw the expanded/collapsed icon for a tree control item
40 virtual void DrawTreeItemButton(wxWindow
*win
,
48 virtual void DrawCheckButton(wxWindow
*win
,
56 virtual void DrawPushButton(wxWindow
*win
,
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
,
72 // draw a (vertical) sash
73 virtual void DrawSplitterSash(wxWindow
*win
,
82 // draw a combobox dropdown button
84 // flags may only use wxCONTROL_PRESSED
85 virtual void DrawComboBoxDropButton(wxWindow
*win
,
92 // draw a dropdown arrow
94 // flags may use wxCONTROL_PRESSED and wxCONTROL_CURRENT
95 virtual void DrawDropArrow(wxWindow
*win
,
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
)
106 return wxSplitterRenderParams(0, 0, 0);
109 virtual wxRendererVersion
GetVersion() const
111 return wxRendererVersion(wxRendererVersion::Current_Version
,
112 wxRendererVersion::Current_Age
);
115 #if 0 // just for debugging
118 wxMessageBox(_T("Creating MyDllRenderer"), _T("Renderer Sample"));
121 virtual ~MyDllRenderer()
123 wxMessageBox(_T("Deleting MyDllRenderer"), _T("Renderer Sample"));
129 WXEXPORT wxRendererNative
*wxCreateRenderer()
131 return new MyDllRenderer
;