X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3c71b9e4320cbd6af73a37140de75c4b6588ed7..65fb4b3a4f18e1d8b58ac92d50d4cc7f81f03783:/samples/render/renddll.cpp diff --git a/samples/render/renddll.cpp b/samples/render/renddll.cpp index 51983bd6f0..3789822551 100644 --- a/samples/render/renddll.cpp +++ b/samples/render/renddll.cpp @@ -21,73 +21,25 @@ #include "wx/dc.h" #endif -class MyDllRenderer : public wxRendererNative +// derive from wxDelegateRendererNative and not wxRendererNative itself to be +// able to only reimplement the methods we want to show and not all of them +class MyDllRenderer : public wxDelegateRendererNative { public: // draw the header control button (used by wxListCtrl) - virtual void DrawHeaderButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) + virtual int DrawHeaderButton(wxWindow * WXUNUSED(win), + wxDC& dc, + const wxRect& rect, + int WXUNUSED(flags) = 0, + wxHeaderSortIconType WXUNUSED(sortArrow) = wxHDR_SORT_ICON_NONE, + wxHeaderButtonParams* WXUNUSED(params) = NULL) { dc.SetBrush(*wxCYAN_BRUSH); dc.SetTextForeground(*wxRED); dc.DrawRoundedRectangle(rect, 10); - dc.DrawLabel(_T("MyDllRenderer"), wxNullBitmap, rect, wxALIGN_CENTER); - } - - // draw the expanded/collapsed icon for a tree control item - virtual void DrawTreeItemButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) - { - } - - // draw the border for sash window: this border must be such that the sash - // drawn by DrawSash() blends into it well - virtual void DrawSplitterBorder(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) - { - } - - // draw a (vertical) sash - virtual void DrawSplitterSash(wxWindow *win, - wxDC& dc, - const wxSize& size, - wxCoord position, - wxOrientation orient, - int flags = 0) - { - } + dc.DrawLabel("MyDllRenderer", wxNullBitmap, rect, wxALIGN_CENTER); - // draw a combobox dropdown button - // - // flags may only use wxCONTROL_PRESSED - virtual void DrawComboBoxDropButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) - { - } - - // draw a dropdown arrow - // - // flags may use wxCONTROL_PRESSED and wxCONTROL_CURRENT - virtual void DrawDropArrow(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) - { - } - - // get the splitter parameters: the x field of the returned point is the - // sash width and the y field is the border width - virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win) - { - return wxSplitterRenderParams(0, 0, 0); + return dc.GetTextExtent("MyDllRenderer").x; } virtual wxRendererVersion GetVersion() const @@ -99,12 +51,12 @@ public: #if 0 // just for debugging MyDllRenderer() { - wxMessageBox(_T("Creating MyDllRenderer"), _T("Renderer Sample")); + wxMessageBox(wxT("Creating MyDllRenderer"), wxT("Renderer Sample")); } virtual ~MyDllRenderer() { - wxMessageBox(_T("Deleting MyDllRenderer"), _T("Renderer Sample")); + wxMessageBox(wxT("Deleting MyDllRenderer"), wxT("Renderer Sample")); } #endif // 0 }; @@ -114,4 +66,3 @@ WXEXPORT wxRendererNative *wxCreateRenderer() { return new MyDllRenderer; } -