| Version: 3.3.1

Public Member Functions | Static Public Member Functions | List of all members
wxDataViewTextRenderer Class Reference
Class List by Category » wxDataViewCtrl Related Classes

`#include <wx/dataview.h>`

Inheritance diagram for wxDataViewTextRenderer:
[legend]

## Detailed Description

wxDataViewTextRenderer is used for rendering text.

It supports in-place editing if desired.

##

Library: wxCore
Category: wxDataViewCtrl Related Classes

## Public Member Functions
| wxDataViewTextRenderer (const wxString &varianttype=GetDefaultType(), wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT)
| The ctor. More...
void | EnableMarkup (bool enable=true)
| Enable interpretation of markup in the item data. More...
Public Member Functions inherited from wxDataViewRenderer
| wxDataViewRenderer (const wxString &varianttype, wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT)
| Constructor. More...
void | EnableEllipsize (wxEllipsizeMode mode=wxELLIPSIZE_MIDDLE)
| Enable or disable replacing parts of the item text with ellipsis to make it fit the column width. More...
void | DisableEllipsize ()
| Disable replacing parts of the item text with ellipsis. More...
virtual wxString | GetAccessibleDescription () const =0
| This method returns a string describing the content of the renderer to the class implementing accessibility features in wxDataViewCtrl. More...
virtual int | GetAlignment () const
| Returns the alignment. More...
wxEllipsizeMode | GetEllipsizeMode () const
| Returns the ellipsize mode used by the renderer. More...
virtual wxDataViewCellMode | GetMode () const
| Returns the cell mode. More...
wxDataViewColumn * | GetOwner () const
| Returns pointer to the owning wxDataViewColumn. More...
virtual bool | GetValue (wxVariant &value) const =0
| This methods retrieves the value from the renderer in order to transfer the value back to the data model. More...
wxString | GetVariantType () const
| Returns a string with the type of the wxVariant supported by this renderer. More...
virtual bool | IsCompatibleVariantType (const wxString &variantType) const
| Check if the given variant type is compatible with the type expected by this renderer. More...
virtual void | SetAlignment (int align)
| Sets the alignment of the renderer's content. More...
void | SetOwner (wxDataViewColumn *owner)
| Sets the owning wxDataViewColumn. More...
virtual bool | SetValue (const wxVariant &value)=0
| Set the value of the renderer (and thus its cell) to value. More...
void | SetValueAdjuster (wxDataViewValueAdjuster *transformer)
| Set the transformer object to be used to customize values before they are rendered. More...
virtual bool | Validate (wxVariant &value)
| Before data is committed to the data model, it is passed to this method where it can be checked for validity. More...
virtual bool | HasEditorCtrl () const
virtual wxWindow * | CreateEditorCtrl (wxWindow *parent, wxRect labelRect, const wxVariant &value)
virtual bool | GetValueFromEditorCtrl (wxWindow *editor, wxVariant &value)
virtual bool | StartEditing (const wxDataViewItem &item, wxRect labelRect)
virtual void | CancelEditing ()
virtual bool | FinishEditing ()
wxWindow * | GetEditorCtrl ()
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to nullptr the internal reference data. More...
| wxObject (const wxObject &other)
| Copy ctor. More...
virtual | ~wxObject ()
| Destructor. More...
virtual wxClassInfo * | GetClassInfo () const
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class. More...
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj. More...
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone. More...
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer. More...
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
void | UnShare ()
| This is the same of AllocExclusive() but this method is public. More...
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...
void * | operator new (size_t size, const wxString &filename=nullptr, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...

## Static Public Member Functions
static wxString | GetDefaultType ()
| Returns the wxVariant type used with this renderer. More...

## Additional Inherited Members
Protected Member Functions inherited from wxDataViewRenderer
wxDataViewCtrl * | GetView () const
Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object. More...
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
virtual wxObjectRefData * | CloneRefData (const wxObjectRefData *data) const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data. More...

## Constructor & Destructor Documentation

## ◆ wxDataViewTextRenderer()

wxDataViewTextRenderer::wxDataViewTextRenderer | ( | const wxString & | varianttype = `GetDefaultType()`,
|  | wxDataViewCellMode | mode = `wxDATAVIEW_CELL_INERT`,
|  | int | align = `wxDVR_DEFAULT_ALIGNMENT`
| ) |  |

The ctor.

## Member Function Documentation

## ◆ EnableMarkup()

void wxDataViewTextRenderer::EnableMarkup | ( | bool | enable = `true` | ) |

Enable interpretation of markup in the item data.

If this method is called with true argument, markup (wxControl::SetLabelMarkup()) in the data of the items in this column will be interpreted, which can be used for a more fine-grained appearance control than just setting an attribute, which affects all of the item text.

For example, as shown in the wxDataViewCtrl Sample, after creating a column using a markup-enabled renderer:

wxDataViewTextRenderer* renderer = new wxDataViewTextRenderer();
renderer->EnableMarkup();
dataViewCtrl->AppendColumn(new wxDataViewColumn("title", renderer, 0));
wxDataViewColumn
This class represents a column in a wxDataViewCtrl.
Definition: dataview.h:2803
wxDataViewTextRenderer
wxDataViewTextRenderer is used for rendering text.
Definition: dataview.h:2165
wxDataViewTextRenderer::EnableMarkup
void EnableMarkup(bool enable=true)
Enable interpretation of markup in the item data.
wxDataViewTextRenderer::wxDataViewTextRenderer
wxDataViewTextRenderer(const wxString &varianttype=GetDefaultType(), wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT)
The ctor.

The overridden model wxDataViewModel::GetValue() method may return values containing markup for this column:

void MyModel::GetValue(wxVariant& variant,
const wxDataViewItem& item,
unsigned int col) const
{
if ( col == 0 && item == ... )
{
variant = "<span color=\"#87ceeb\">light</span> and "
"<span color=\"#000080\">dark</span> blue";
}
...
}
wxDataViewItem
wxDataViewItem is a small opaque class that represents an item in a wxDataViewCtrl in a persistent wa...
Definition: dataview.h:807
wxVariant
The wxVariant class represents a container for any type.
Definition: variant.h:170

Note
  Currently wxDataViewIconTextRenderer only provides EnableMarkup() EnableMarkup() in wxGTK, but not under the other platforms, so you should only use it for plain wxDataViewTextRenderer columns, without icons, in portable code.

Since
  3.1.1

## ◆ GetDefaultType()

static wxString wxDataViewTextRenderer::GetDefaultType | ( |  | ) |
| static

Returns the wxVariant type used with this renderer.

Since
  3.1.0