+
+#if defined(__WXGTK20__)
+ // for testing
+ #define wxUSE_GENERICDATAVIEWCTRL 1
+#elif defined(__WXMAC__)
+ #define wxUSE_GENERICDATAVIEWCTRL 1
+#else
+ #define wxUSE_GENERICDATAVIEWCTRL 1
+#endif
+
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
virtual bool RowAppended() = 0;
virtual bool RowPrepended() = 0;
virtual bool RowInserted( size_t before ) = 0;
virtual bool RowDeleted( size_t row ) = 0;
virtual bool RowChanged( size_t row ) = 0;
virtual bool ValueChanged( size_t col, size_t row ) = 0;
virtual bool RowAppended() = 0;
virtual bool RowPrepended() = 0;
virtual bool RowInserted( size_t before ) = 0;
virtual bool RowDeleted( size_t row ) = 0;
virtual bool RowChanged( size_t row ) = 0;
virtual bool ValueChanged( size_t col, size_t row ) = 0;
void SetOwner( wxDataViewListModel *owner ) { m_owner = owner; }
wxDataViewListModel *GetOwner() { return m_owner; }
void SetOwner( wxDataViewListModel *owner ) { m_owner = owner; }
wxDataViewListModel *GetOwner() { return m_owner; }
// return type as reported by wxVariant
virtual wxString GetColType( size_t col ) = 0;
// get value into a wxVariant
// return type as reported by wxVariant
virtual wxString GetColType( size_t col ) = 0;
// get value into a wxVariant
// set value, call ValueChanged() afterwards!
virtual bool SetValue( wxVariant &variant, size_t col, size_t row ) = 0;
// set value, call ValueChanged() afterwards!
virtual bool SetValue( wxVariant &variant, size_t col, size_t row ) = 0;
virtual bool RowDeleted( size_t row );
virtual bool RowChanged( size_t row );
virtual bool ValueChanged( size_t col, size_t row );
virtual bool RowDeleted( size_t row );
virtual bool RowChanged( size_t row );
virtual bool ValueChanged( size_t col, size_t row );
virtual void AddViewingColumn( wxDataViewColumn *view_column, size_t model_column );
virtual void RemoveViewingColumn( wxDataViewColumn *column );
virtual void AddViewingColumn( wxDataViewColumn *view_column, size_t model_column );
virtual void RemoveViewingColumn( wxDataViewColumn *column );
virtual void AddNotifier( wxDataViewListModelNotifier *notifier );
virtual void RemoveNotifier( wxDataViewListModelNotifier *notifier );
virtual void AddNotifier( wxDataViewListModelNotifier *notifier );
virtual void RemoveNotifier( wxDataViewListModelNotifier *notifier );
typedef int (wxCALLBACK *wxDataViewListModelCompare)
(size_t row1, size_t row2, size_t col, wxDataViewListModel* model );
typedef int (wxCALLBACK *wxDataViewListModelCompare)
(size_t row1, size_t row2, size_t col, wxDataViewListModel* model );
// return type as reported by wxVariant
virtual wxString GetColType( size_t col );
// get value into a wxVariant
// return type as reported by wxVariant
virtual wxString GetColType( size_t col );
// get value into a wxVariant
// set value, call ValueChanged() afterwards!
virtual bool SetValue( wxVariant &variant, size_t col, size_t row );
// set value, call ValueChanged() afterwards!
virtual bool SetValue( wxVariant &variant, size_t col, size_t row );
virtual bool RowDeleted( size_t row );
virtual bool RowChanged( size_t row );
virtual bool ValueChanged( size_t col, size_t row );
virtual bool RowDeleted( size_t row );
virtual bool RowChanged( size_t row );
virtual bool ValueChanged( size_t col, size_t row );
- virtual bool SetValue( const wxVariant &value ) { return true; }
- virtual bool GetValue( wxVariant &value ) { return true; }
- virtual bool Validate( wxVariant &value ) { return true; }
-
- wxString GetVariantType() { return m_variantType; }
-
+ virtual bool SetValue( const wxVariant& WXUNUSED(value) ) { return true; }
+ virtual bool GetValue( wxVariant& WXUNUSED(value) ) { return true; }
+ virtual bool Validate( wxVariant& WXUNUSED(value) ) { return true; }
+
+ wxString GetVariantType() { return m_variantType; }
+ wxDataViewCellMode GetMode() { return m_mode; }
+
void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; }
wxDataViewColumn* GetOwner() { return m_owner; }
void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; }
wxDataViewColumn* GetOwner() { return m_owner; }
+enum wxDataViewColumnSizing
+{
+ wxDATAVIEW_COL_WIDTH_FIXED,
+ wxDATAVIEW_COL_WIDTH_AUTO,
+ wxDATAVIEW_COL_WIDTH_GROW
+};
+
- wxDataViewColumnBase( const wxString &title, wxDataViewCell *cell, size_t model_column, int flags = 0 );
+ wxDataViewColumnBase( const wxString &title, wxDataViewCell *cell, size_t model_column,
+ int fixed_width = 80, wxDataViewColumnSizing sizing = wxDATAVIEW_COL_WIDTH_FIXED, int flags = 0 );
void SetOwner( wxDataViewCtrl *owner ) { m_owner = owner; }
wxDataViewCtrl *GetOwner() { return m_owner; }
void SetOwner( wxDataViewCtrl *owner ) { m_owner = owner; }
wxDataViewCtrl *GetOwner() { return m_owner; }
-// ---------------------------------------------------------
+// ---------------------------------------------------------
+
+#define wxDV_SINGLE 0x0000 // for convenience
+#define wxDV_MULTIPLE 0x0020 // can select multiple items
virtual bool AppendTextColumn( const wxString &label, size_t model_column );
virtual bool AppendToggleColumn( const wxString &label, size_t model_column );
virtual bool AppendProgressColumn( const wxString &label, size_t model_column );
virtual bool AppendDateColumn( const wxString &label, size_t model_column );
virtual bool AppendTextColumn( const wxString &label, size_t model_column );
virtual bool AppendToggleColumn( const wxString &label, size_t model_column );
virtual bool AppendProgressColumn( const wxString &label, size_t model_column );
virtual bool AppendDateColumn( const wxString &label, size_t model_column );
virtual size_t GetNumberOfColumns();
virtual bool DeleteColumn( size_t pos );
virtual bool ClearColumns();
virtual wxDataViewColumn* GetColumn( size_t pos );
virtual size_t GetNumberOfColumns();
virtual bool DeleteColumn( size_t pos );
virtual bool ClearColumns();
virtual wxDataViewColumn* GetColumn( size_t pos );