Implement text ellipsizing for wxDataViewCustomRenderer in wxGTK.
Add another virtual function (GtkGetTextRenderer()) to the base class which allows us to reuse the same code setting the "ellipsize" property that we already used for wxDataViewTextRenderer for wxDataViewCustomRenderer as well. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62608 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#ifndef _WX_GTK_DVRENDERER_H_
|
||||
#define _WX_GTK_DVRENDERER_H_
|
||||
|
||||
typedef struct _GtkCellRendererText GtkCellRendererText;
|
||||
typedef struct _GtkTreeViewColumn GtkTreeViewColumn;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -72,6 +73,11 @@ 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; }
|
||||
|
||||
protected:
|
||||
virtual void GtkOnCellChanged(const wxVariant& value,
|
||||
const wxDataViewItem& item,
|
||||
|
@@ -13,7 +13,6 @@
|
||||
#define _WX_GTK_DVRENDERERS_H_
|
||||
|
||||
typedef struct _GdkRectangle GdkRectangle;
|
||||
typedef struct _GtkCellRendererText GtkCellRendererText;
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewTextRenderer
|
||||
@@ -47,6 +46,8 @@ public:
|
||||
virtual bool GtkSupportsAttrs() const { return true; }
|
||||
virtual bool GtkSetAttr(const wxDataViewItemAttr& attr);
|
||||
|
||||
virtual GtkCellRendererText *GtkGetTextRenderer() const;
|
||||
|
||||
protected:
|
||||
// implementation of Set/GetValue()
|
||||
bool SetTextValue(const wxString& str);
|
||||
@@ -140,6 +141,8 @@ public:
|
||||
return !attr.IsDefault();
|
||||
}
|
||||
|
||||
virtual GtkCellRendererText *GtkGetTextRenderer() const;
|
||||
|
||||
protected:
|
||||
bool Init(wxDataViewCellMode mode, int align);
|
||||
|
||||
|
Reference in New Issue
Block a user