Contents Up Previous Next

wxDataViewRenderer

This class is used by wxDataViewCtrl to render the individual cells. One instance of a renderer class is owned by wxDataViewColumn. There is a number of ready-to-use renderers provided: wxDataViewTextRenderer, wxDataViewToggleRenderer, wxDataViewProgressRenderer, wxDataViewBitmapRenderer, wxDataViewDateRenderer.

Additionally, the user can write own renderers by deriving from wxDataViewCustomRenderer.

These flags control the behaviour of the renderer and they are used for controlling in what mode the renderer shall render its contents:

enum wxDataViewCellMode
{
    wxDATAVIEW_CELL_INERT,
    wxDATAVIEW_CELL_ACTIVATABLE,
    wxDATAVIEW_CELL_EDITABLE
};

enum wxDataViewCellRenderState
{
    wxDATAVIEW_CELL_SELECTED    = 1,
    wxDATAVIEW_CELL_PRELIT      = 2,
    wxDATAVIEW_CELL_INSENSITIVE = 4,
    wxDATAVIEW_CELL_FOCUSED     = 8
};

Derived from

wxObject

Include files

<wx/dataview.h>

wxDataViewRenderer::wxDataViewRenderer
wxDataViewRenderer::GetMode
wxDataViewRenderer::GetOwner
wxDataViewRenderer::GetValue
wxDataViewRenderer::GetVariantType
wxDataViewRenderer::SetOwner
wxDataViewRenderer::SetValue
wxDataViewRenderer::Validate


wxDataViewRenderer::wxDataViewRenderer

wxDataViewRenderer(const wxString& varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT)

Constructor.


wxDataViewRenderer::GetMode

virtual wxDataViewCellMode GetMode()

Returns the cell mode.


wxDataViewRenderer::GetOwner

virtual wxDataViewColumn* GetOwner()

Returns pointer to the owning wxDataViewColumn.


wxDataViewRenderer::GetValue

virtual bool GetValue(wxVariant& value)

This methods retrieves the value from the renderer in order to transfer the value back to the data model. Returns false on failure.


wxDataViewRenderer::GetVariantType

virtual wxString GetVariantType()

Returns a string with the type of the wxVariant supported by this renderer.


wxDataViewRenderer::SetOwner

virtual void SetOwner(wxDataViewColumn* owner)

Sets the owning wxDataViewColumn. This is usually called from within wxDataViewColumn.


wxDataViewRenderer::SetValue

virtual bool SetValue(const wxVariant& value)

Set the value of the renderer (and thus its cell) to value. The internal code will then render this cell with this data.


wxDataViewRenderer::Validate

virtual bool Validate(wxVariant& value)

To be implemented.