#include <wx/dataview.h>
This is a specialized renderer for rendering integer values.
It supports modifying the values in-place by using a wxSpinCtrl. The renderer only support variants of type long.
Public Member Functions | |
wxDataViewSpinRenderer (int min, int max, wxDataViewCellMode mode=wxDATAVIEW_CELL_EDITABLE, int align=wxDVR_DEFAULT_ALIGNMENT) | |
Constructor. | |
Public Member Functions inherited from wxDataViewCustomRenderer | |
wxDataViewCustomRenderer (const wxString &varianttype="string", wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT) | |
Constructor. | |
virtual | ~wxDataViewCustomRenderer () |
Destructor. | |
virtual bool | ActivateCell (const wxRect &cell, wxDataViewModel *model, const wxDataViewItem &item, unsigned int col, const wxMouseEvent *mouseEvent) |
Override this to react to cell activation. | |
virtual wxWindow * | CreateEditorCtrl (wxWindow *parent, wxRect labelRect, const wxVariant &value) |
Override this to create the actual editor control once editing is about to start. | |
const wxDataViewItemAttr & | GetAttr () const |
Return the attribute to be used for rendering. | |
virtual wxSize | GetSize () const =0 |
Return size required to show content. | |
virtual bool | GetValueFromEditorCtrl (wxWindow *editor, wxVariant &value) |
Override this so that the renderer can get the value from the editor control (pointed to by editor): | |
virtual bool | HasEditorCtrl () const |
Override this and make it return true in order to indicate that this renderer supports in-place editing. | |
virtual bool | LeftClick (wxPoint cursor, wxRect cell, wxDataViewModel *model, const wxDataViewItem &item, unsigned int col) |
Override this to react to a left click. | |
virtual bool | Activate (wxRect cell, wxDataViewModel *model, const wxDataViewItem &item, unsigned int col) |
Override this to react to the activation of a cell. | |
virtual bool | Render (wxRect cell, wxDC *dc, int state)=0 |
Override this to render the cell. | |
void | RenderText (const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state) |
This method should be called from within Render() whenever you need to render simple text. | |
virtual bool | StartDrag (const wxPoint &cursor, const wxRect &cell, wxDataViewModel *model, const wxDataViewItem &item, unsigned int col) |
Override this to start a drag operation. | |
Public Member Functions inherited from wxDataViewRenderer | |
wxDataViewRenderer (const wxString &varianttype, wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT) | |
Constructor. | |
void | EnableEllipsize (wxEllipsizeMode mode=wxELLIPSIZE_MIDDLE) |
Enable or disable replacing parts of the item text with ellipsis to make it fit the column width. | |
void | DisableEllipsize () |
Disable replacing parts of the item text with ellipsis. | |
virtual int | GetAlignment () const |
Returns the alignment. | |
wxEllipsizeMode | GetEllipsizeMode () const |
Returns the ellipsize mode used by the renderer. | |
virtual wxDataViewCellMode | GetMode () const |
Returns the cell mode. | |
wxDataViewColumn * | GetOwner () const |
Returns pointer to the owning wxDataViewColumn. | |
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. | |
wxString | GetVariantType () const |
Returns a string with the type of the wxVariant supported by this renderer. | |
virtual void | SetAlignment (int align) |
Sets the alignment of the renderer's content. | |
void | SetOwner (wxDataViewColumn *owner) |
Sets the owning wxDataViewColumn. | |
virtual bool | SetValue (const wxVariant &value)=0 |
Set the value of the renderer (and thus its cell) to value. | |
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. | |
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 NULL the internal reference data. | |
wxObject (const wxObject &other) | |
Copy ctor. | |
virtual | ~wxObject () |
Destructor. | |
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). | |
wxObjectRefData * | GetRefData () const |
Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. | |
bool | IsKindOf (const wxClassInfo *info) const |
Determines whether this class is a subclass of (or the same class as) the given class. | |
bool | IsSameAs (const wxObject &obj) const |
Returns true if this object has the same data pointer as obj. | |
void | Ref (const wxObject &clone) |
Makes this object refer to the data in clone. | |
void | SetRefData (wxObjectRefData *data) |
Sets the wxObject::m_refData pointer. | |
void | UnRef () |
Decrements the reference count in the associated data, and if it is zero, deletes the data. | |
void | UnShare () |
This is the same of AllocExclusive() but this method is public. | |
void | operator delete (void *buf) |
The delete operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined. | |
void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0) |
The new operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined. | |
Additional Inherited Members | |
Protected Member Functions inherited from wxDataViewCustomRenderer | |
wxSize | GetTextExtent (const wxString &str) const |
Helper for GetSize() implementations, respects attributes. | |
Protected Attributes inherited from wxObject | |
wxObjectRefData * | m_refData |
Pointer to an object which is the object's reference-counted data. | |
wxDataViewSpinRenderer::wxDataViewSpinRenderer | ( | int | min, |
int | max, | ||
wxDataViewCellMode | mode = wxDATAVIEW_CELL_EDITABLE , |
||
int | align = wxDVR_DEFAULT_ALIGNMENT |
||
) |
Constructor.
min and max indicate the minimum and maximum values for the wxSpinCtrl.