From: Vadim Zeitlin Date: Mon, 5 Oct 2009 22:56:31 +0000 (+0000) Subject: Correct custom renderer method override example in the sample. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/34456d33dc89cea4e7ba96837eccb88b0defb958?ds=sidebyside Correct custom renderer method override example in the sample. The implementation of DrawHeaderButton() in MyRenderer should restore the text foreground colour and brush to avoid messing up drawing done after it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62289 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/render/render.cpp b/samples/render/render.cpp index 0233d24bce..89461121d6 100644 --- a/samples/render/render.cpp +++ b/samples/render/render.cpp @@ -66,8 +66,8 @@ public: wxHeaderSortIconType WXUNUSED(sortArrow) = wxHDR_SORT_ICON_NONE, wxHeaderButtonParams* WXUNUSED(params) = NULL) { - dc.SetBrush(*wxBLUE_BRUSH); - dc.SetTextForeground(*wxWHITE); + wxDCBrushChanger setBrush(dc, *wxBLUE_BRUSH); + wxDCTextColourChanger setFgCol(dc, *wxWHITE); dc.DrawRoundedRectangle(rect, 5); dc.DrawLabel(wxT("MyRenderer"), wxNullBitmap, rect, wxALIGN_CENTER); return rect.width;