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 // derive from wxDelegateRendererNative and not wxRendererNative itself to be
25 // able to only reimplement the methods we want to show and not all of them
26 class MyDllRenderer
: public wxDelegateRendererNative
29 // draw the header control button (used by wxListCtrl)
30 virtual void DrawHeaderButton(wxWindow
* WXUNUSED(win
),
33 int WXUNUSED(flags
) = 0)
35 dc
.SetBrush(*wxCYAN_BRUSH
);
36 dc
.SetTextForeground(*wxRED
);
37 dc
.DrawRoundedRectangle(rect
, 10);
38 dc
.DrawLabel(_T("MyDllRenderer"), wxNullBitmap
, rect
, wxALIGN_CENTER
);
41 virtual wxRendererVersion
GetVersion() const
43 return wxRendererVersion(wxRendererVersion::Current_Version
,
44 wxRendererVersion::Current_Age
);
47 #if 0 // just for debugging
50 wxMessageBox(_T("Creating MyDllRenderer"), _T("Renderer Sample"));
53 virtual ~MyDllRenderer()
55 wxMessageBox(_T("Deleting MyDllRenderer"), _T("Renderer Sample"));
61 WXEXPORT wxRendererNative
*wxCreateRenderer()
63 return new MyDllRenderer
;