]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/render/renddll.cpp
Don't document private event handlers in doc/view frame classes.
[wxWidgets.git] / samples / render / renddll.cpp
index 8d31e25e8ac988a6807b50cc544be14c0c7a41bd..3789822551ff1d1c1f56dd2994f9448703d3140e 100644 (file)
@@ -5,72 +5,58 @@
 // Modified by:
 // Created:     04.08.03
 // RCS-ID:      $Id$
-// Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
+// Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
 
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
 #include "wx/renderer.h"
 
-class MyDllRenderer : public wxRendererNative
+#ifndef WX_PRECOMP
+    #include "wx/dc.h"
+#endif
+
+// 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);
-    }
+        dc.DrawLabel("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)
-    {
+        return dc.GetTextExtent("MyDllRenderer").x;
     }
 
-    // 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)
+    virtual wxRendererVersion GetVersion() const
     {
-    }
-
-    // draw a (vertical) sash
-    virtual void DrawSplitterSash(wxWindow *win,
-                                  wxDC& dc,
-                                  const wxSize& size,
-                                  wxCoord position,
-                                  wxOrientation orient,
-                                  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 wxRendererVersion(wxRendererVersion::Current_Version,
+                                 wxRendererVersion::Current_Age);
     }
 
 #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
 };
@@ -80,4 +66,3 @@ WXEXPORT wxRendererNative *wxCreateRenderer()
 {
     return new MyDllRenderer;
 }
-