X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c80cde00014a3d0f21dbd24500a22b4a1f4d0208..8e77fd8bca165aab9709649d79a7cbc6a172d4e1:/include/wx/gtk/dvrenderer.h diff --git a/include/wx/gtk/dvrenderer.h b/include/wx/gtk/dvrenderer.h index 72f1d4a106..1c1bc50d6d 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; // ---------------------------------------------------------------------------- @@ -47,11 +48,11 @@ public: // // it validates the new value and notifies the model about the change by // calling GtkOnCellChanged() if it was accepted - void GtkOnTextEdited(const gchar *itempath, const wxString& value); + virtual void GtkOnTextEdited(const char *itempath, const wxString& value); GtkCellRenderer* GetGtkHandle() { return m_renderer; } void GtkInitHandlers(); - void GtkUpdateAlignment(); + void GtkUpdateAlignment() { GtkApplyAlignment(m_renderer); } // should be overridden to return true if the renderer supports properties // corresponding to wxDataViewItemAttr field, see wxGtkTreeCellDataFunc() @@ -72,14 +73,25 @@ public: 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; } + + wxDataViewCellMode GtkGetMode() { return m_mode; } + protected: virtual void GtkOnCellChanged(const wxVariant& value, const wxDataViewItem& item, unsigned col); + // Apply our effective alignment (i.e. m_alignment if specified or the + // associated column alignment by default) to the given renderer. + void GtkApplyAlignment(GtkCellRenderer *renderer); - GtkCellRenderer *m_renderer; - int m_alignment; + GtkCellRenderer *m_renderer; + int m_alignment; + wxDataViewCellMode m_mode; // true if we hadn't changed any visual attributes or restored them since // doing this