]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/render/renddll.cpp
fixes potential crash under gatekeeper
[wxWidgets.git] / samples / render / renddll.cpp
index a45d820c811f44322373925e8db26034684c2bd2..3789822551ff1d1c1f56dd2994f9448703d3140e 100644 (file)
@@ -27,17 +27,19 @@ class MyDllRenderer : public wxDelegateRendererNative
 {
 public:
     // draw the header control button (used by wxListCtrl)
 {
 public:
     // draw the header control button (used by wxListCtrl)
-    virtual void DrawHeaderButton(wxWindow * WXUNUSED(win),
-                                  wxDC& dc,
-                                  const wxRect& rect,
-                                  int WXUNUSED(flags) = 0,
-                                  wxHeaderSortIconType WXUNUSED(sortArrow) = wxHDR_SORT_ICON_NONE,
-                                  wxHeaderButtonParams* WXUNUSED(params) = NULL)
+    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.SetBrush(*wxCYAN_BRUSH);
         dc.SetTextForeground(*wxRED);
         dc.DrawRoundedRectangle(rect, 10);
-        dc.DrawLabel(_T("MyDllRenderer"), wxNullBitmap, rect, wxALIGN_CENTER);
+        dc.DrawLabel("MyDllRenderer", wxNullBitmap, rect, wxALIGN_CENTER);
+
+        return dc.GetTextExtent("MyDllRenderer").x;
     }
 
     virtual wxRendererVersion GetVersion() const
     }
 
     virtual wxRendererVersion GetVersion() const
@@ -49,12 +51,12 @@ public:
 #if 0 // just for debugging
     MyDllRenderer()
     {
 #if 0 // just for debugging
     MyDllRenderer()
     {
-        wxMessageBox(_T("Creating MyDllRenderer"), _T("Renderer Sample"));
+        wxMessageBox(wxT("Creating MyDllRenderer"), wxT("Renderer Sample"));
     }
 
     virtual ~MyDllRenderer()
     {
     }
 
     virtual ~MyDllRenderer()
     {
-        wxMessageBox(_T("Deleting MyDllRenderer"), _T("Renderer Sample"));
+        wxMessageBox(wxT("Deleting MyDllRenderer"), wxT("Renderer Sample"));
     }
 #endif // 0
 };
     }
 #endif // 0
 };