// wxDataViewCtrl globals
// ----------------------------------------------------------------------------
+class WXDLLIMPEXP_CORE wxDataViewCtrl;
+class WXDLLIMPEXP_CORE wxDataViewColumn;
+class WXDLLIMPEXP_CORE wxDataViewCell;
+
extern WXDLLEXPORT_DATA(const wxChar) wxDataViewCtrlNameStr[];
// ---------------------------------------------------------
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewListModel)
};
+// ---------------------------------------------------------
+// wxDataViewCellBase
+// ---------------------------------------------------------
+
+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
+};
+
+class wxDataViewCellBase: public wxObject
+{
+public:
+ wxDataViewCellBase( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+
+ virtual bool SetValue( const wxVariant &value ) { return true; }
+ virtual bool GetValue( wxVariant &value ) { return true; }
+ virtual bool BeginEdit() { return true; }
+ virtual bool EndEdit() { return true; }
+
+ virtual bool Render( wxRect cell, wxRect exposed, wxDC *dc, int state ) { return true; }
+
+ void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; }
+ wxDataViewColumn* GetOwner() { return m_owner; }
+
+ wxString GetVariantType() { return m_variantType; }
+
+private:
+ wxDataViewCellMode m_mode;
+ wxString m_variantType;
+ wxDataViewColumn *m_owner;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCellBase)
+};
+
+// ---------------------------------------------------------
+// wxDataViewColumnBase
+// ---------------------------------------------------------
+
+enum wxDataViewColumnFlags
+{
+ wxDATAVIEW_COL_RESIZABLE = 1,
+ wxDATAVIEW_COL_SORTABLE = 2,
+ wxDATAVIEW_COL_HIDDEN = 4
+};
+
+class wxDataViewColumnBase: public wxObject
+{
+public:
+ wxDataViewColumnBase( const wxString &title, wxDataViewCell *cell, size_t model_column, int flags = 0 );
+ ~wxDataViewColumnBase();
+
+ virtual void SetTitle( const wxString &title );
+ virtual wxString GetTitle();
+
+ wxDataViewCell* GetCell() { return m_cell; }
+
+ size_t GetModelColumn() { return m_model_column; }
+
+ void SetOwner( wxDataViewCtrl *owner ) { m_owner = owner; }
+ wxDataViewCtrl *GetOwner() { return m_owner; }
+
+private:
+ wxDataViewCtrl *m_ctrl;
+ wxDataViewCell *m_cell;
+ int m_model_column;
+ int m_flags;
+ wxString m_title;
+ wxDataViewCtrl *m_owner;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumnBase)
+};
+
// ---------------------------------------------------------
// wxDataViewCtrlBase
// ---------------------------------------------------------
public:
wxDataViewCtrlBase();
~wxDataViewCtrlBase();
-
- virtual bool AppendStringColumn( const wxString &label ) = 0;
virtual bool AssociateModel( wxDataViewListModel *model );
wxDataViewListModel* GetModel();
+ virtual bool AppendStringColumn( const wxString &label, size_t model_column );
+ virtual bool AppendColumn( wxDataViewColumn *col );
+ virtual size_t GetNumberOfColumns();
+ virtual bool DeleteColumn( size_t pos );
+ virtual bool ClearColumns();
+ virtual wxDataViewColumn* GetColumn( size_t pos );
+
private:
wxDataViewListModel *m_model;
+ wxList m_cols;
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase)
};
-
-
#if defined(__WXGTK20__)
#include "wx/gtk/dataview.h"
#elif defined(__WXMAC__)