-// wxDataViewRenderer
-// ---------------------------------------------------------
-
-class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewRendererBase
-{
-public:
- wxDataViewRenderer( const wxString &varianttype,
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
- int align = wxDVR_DEFAULT_ALIGNMENT );
- virtual ~wxDataViewRenderer();
-
- virtual bool Render( wxRect cell, wxDC *dc, int state ) = 0;
- virtual wxSize GetSize() const = 0;
-
- virtual void SetAlignment( int align )
- { m_align=align; }
- virtual int GetAlignment() const
- { return m_align; }
-
- virtual void SetMode( wxDataViewCellMode mode )
- { m_mode=mode; }
- virtual wxDataViewCellMode GetMode() const
- { return m_mode; }
-
- virtual bool Activate( wxRect WXUNUSED(cell),
- wxDataViewModel *WXUNUSED(model),
- const wxDataViewItem & WXUNUSED(item),
- unsigned int WXUNUSED(col) )
- { return false; }
-
- virtual bool LeftClick( wxPoint WXUNUSED(cursor),
- wxRect WXUNUSED(cell),
- wxDataViewModel *WXUNUSED(model),
- const wxDataViewItem & WXUNUSED(item),
- unsigned int WXUNUSED(col) )
- { return false; }
- virtual bool RightClick( wxPoint WXUNUSED(cursor),
- wxRect WXUNUSED(cell),
- wxDataViewModel *WXUNUSED(model),
- const wxDataViewItem & WXUNUSED(item),
- unsigned int WXUNUSED(col) )
- { return false; }
- virtual bool StartDrag( wxPoint WXUNUSED(cursor),
- wxRect WXUNUSED(cell),
- wxDataViewModel *WXUNUSED(model),
- const wxDataViewItem & WXUNUSED(item),
- unsigned int WXUNUSED(col) )
- { return false; }
-
- // Create DC on request
- virtual wxDC *GetDC();
-
-private:
- wxDC *m_dc;
- int m_align;
- wxDataViewCellMode m_mode;
-
-protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer)
-};
-
-// ---------------------------------------------------------
-// wxDataViewCustomRenderer
-// ---------------------------------------------------------
-
-class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewRenderer
-{
-public:
- wxDataViewCustomRenderer( const wxString &varianttype = wxT("string"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
- int align = wxDVR_DEFAULT_ALIGNMENT );
-
-protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
-};
-
-
-// ---------------------------------------------------------
-// wxDataViewTextRenderer
-// ---------------------------------------------------------
-
-class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewCustomRenderer
-{
-public:
- wxDataViewTextRenderer( const wxString &varianttype = wxT("string"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
- int align = wxDVR_DEFAULT_ALIGNMENT );
-
- bool SetValue( const wxVariant &value );
- bool GetValue( wxVariant &value ) const;
-
- bool Render( wxRect cell, wxDC *dc, int state );
- wxSize GetSize() const;
-
- // in-place editing
- virtual bool HasEditorCtrl();
- virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value );
- virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
-
-private:
- wxString m_text;
-
-protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer)
-};
-
-// ---------------------------------------------------------
-// wxDataViewBitmapRenderer
-// ---------------------------------------------------------
-
-class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewCustomRenderer
-{
-public:
- wxDataViewBitmapRenderer( const wxString &varianttype = wxT("wxBitmap"),
- wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
- int align = wxDVR_DEFAULT_ALIGNMENT );
-
- bool SetValue( const wxVariant &value );
- bool GetValue( wxVariant &value ) const;
-
- bool Render( wxRect cell, wxDC *dc, int state );
- wxSize GetSize() const;
-
-private:
- wxIcon m_icon;
- wxBitmap m_bitmap;
-
-protected:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer)
-};
-
-// ---------------------------------------------------------
-// wxDataViewToggleRenderer