1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: Example of a renderer implemented in a DLL
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #include "wx/wxprec.h"
17 #include "wx/renderer.h"
23 // derive from wxDelegateRendererNative and not wxRendererNative itself to be
24 // able to only reimplement the methods we want to show and not all of them
25 class MyDllRenderer
: public wxDelegateRendererNative
28 // draw the header control button (used by wxListCtrl)
29 virtual int DrawHeaderButton(wxWindow
* WXUNUSED(win
),
32 int WXUNUSED(flags
) = 0,
33 wxHeaderSortIconType
WXUNUSED(sortArrow
) = wxHDR_SORT_ICON_NONE
,
34 wxHeaderButtonParams
* WXUNUSED(params
) = NULL
)
36 dc
.SetBrush(*wxCYAN_BRUSH
);
37 dc
.SetTextForeground(*wxRED
);
38 dc
.DrawRoundedRectangle(rect
, 10);
39 dc
.DrawLabel("MyDllRenderer", wxNullBitmap
, rect
, wxALIGN_CENTER
);
41 return dc
.GetTextExtent("MyDllRenderer").x
;
44 virtual wxRendererVersion
GetVersion() const
46 return wxRendererVersion(wxRendererVersion::Current_Version
,
47 wxRendererVersion::Current_Age
);
50 #if 0 // just for debugging
53 wxMessageBox(wxT("Creating MyDllRenderer"), wxT("Renderer Sample"));
56 virtual ~MyDllRenderer()
58 wxMessageBox(wxT("Deleting MyDllRenderer"), wxT("Renderer Sample"));
64 WXEXPORT wxRendererNative
*wxCreateRenderer()
66 return new MyDllRenderer
;