X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6eec70b984525aac09528c32411f19113620e284..ff46415213f7435aa64ab4f5b7dfdbb7b31f3796:/include/wx/gtk/dvrenderer.h?ds=sidebyside diff --git a/include/wx/gtk/dvrenderer.h b/include/wx/gtk/dvrenderer.h index 9513104c1c..58209e3100 100644 --- a/include/wx/gtk/dvrenderer.h +++ b/include/wx/gtk/dvrenderer.h @@ -3,7 +3,7 @@ // Purpose: wxDataViewRenderer for GTK wxDataViewCtrl implementation // Author: Robert Roebling, Vadim Zeitlin // Created: 2009-11-07 (extracted from wx/gtk/dataview.h) -// RCS-ID: $Id: wxhead.h,v 1.11 2009-06-29 10:23:04 zeitlin Exp $ +// RCS-ID: $Id$ // Copyright: (c) 2006 Robert Roebling // (c) 2009 Vadim Zeitlin // Licence: wxWindows licence @@ -12,6 +12,7 @@ #ifndef _WX_GTK_DVRENDERER_H_ #define _WX_GTK_DVRENDERER_H_ +typedef struct _GtkCellRendererText GtkCellRendererText; typedef struct _GtkTreeViewColumn GtkTreeViewColumn; // ---------------------------------------------------------------------------- @@ -53,9 +54,30 @@ public: void GtkInitHandlers(); void GtkUpdateAlignment(); + // should be overridden to return true if the renderer supports properties + // corresponding to wxDataViewItemAttr field, see wxGtkTreeCellDataFunc() + // for details + virtual bool GtkSupportsAttrs() const { return false; } + + // if GtkSupportsAttrs() returns true, this function will be called to + // effectively set the attribute to use for rendering the next item + // + // it should return true if the attribute had any non-default properties + virtual bool GtkSetAttr(const wxDataViewItemAttr& WXUNUSED(attr)) + { return false; } + + + // these functions are only called if GtkSupportsAttrs() returns true and + // are used to remember whether the renderer currently uses the default + // attributes or if we changed (and not reset them) bool GtkIsUsingDefaultAttrs() const { return m_usingDefaultAttrs; } void GtkSetUsingDefaultAttrs(bool def) { m_usingDefaultAttrs = def; } + // return the text renderer used by this renderer for setting text cell + // specific attributes: can return NULL if this renderer doesn't render any + // text + virtual GtkCellRendererText *GtkGetTextRenderer() const { return NULL; } + protected: virtual void GtkOnCellChanged(const wxVariant& value, const wxDataViewItem& item,