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 int DrawHeaderButton(wxWindow
* WXUNUSED(win
),
33 int WXUNUSED(flags
) = 0,
34 wxHeaderSortIconType
WXUNUSED(sortArrow
) = wxHDR_SORT_ICON_NONE
,
35 wxHeaderButtonParams
* WXUNUSED(params
) = NULL
)
37 dc
.SetBrush(*wxCYAN_BRUSH
);
38 dc
.SetTextForeground(*wxRED
);
39 dc
.DrawRoundedRectangle(rect
, 10);
40 dc
.DrawLabel("MyDllRenderer", wxNullBitmap
, rect
, wxALIGN_CENTER
);
42 return dc
.GetTextExtent("MyDllRenderer").x
;
45 virtual wxRendererVersion
GetVersion() const
47 return wxRendererVersion(wxRendererVersion::Current_Version
,
48 wxRendererVersion::Current_Age
);
51 #if 0 // just for debugging
54 wxMessageBox(wxT("Creating MyDllRenderer"), wxT("Renderer Sample"));
57 virtual ~MyDllRenderer()
59 wxMessageBox(wxT("Deleting MyDllRenderer"), wxT("Renderer Sample"));
65 WXEXPORT wxRendererNative
*wxCreateRenderer()
67 return new MyDllRenderer
;