+ // Helper which can be used by Render() implementation in the derived
+ // classes: it will draw the text in the same manner as the standard
+ // renderers do.
+ virtual void RenderText(const wxString& text,
+ int xoffset,
+ wxRect cell,
+ wxDC *dc,
+ int state);
+
+
+ // Override the base class virtual method to simply store the attribute so
+ // that it can be accessed using GetAttr() from Render() if needed.
+ virtual void SetAttr(const wxDataViewItemAttr& attr) { m_attr = attr; }
+ const wxDataViewItemAttr& GetAttr() const { return m_attr; }
+
+ // Store the enabled state of the item so that it can be accessed from
+ // Render() via GetEnabled() if needed.
+ virtual void SetEnabled(bool enabled) { m_enabled = enabled; }
+ bool GetEnabled() const { return m_enabled; }
+
+
+ // Implementation only from now on
+
+ // Retrieve the DC to use for drawing. This is implemented in derived
+ // platform-specific classes.
+ virtual wxDC *GetDC() = 0;
+
+ // Prepare DC to use attributes and call Render().
+ void WXCallRender(wxRect rect, wxDC *dc, int state);
+
+protected:
+ // helper for GetSize() implementations, respects attributes
+ wxSize GetTextExtent(const wxString& str) const;
+