#pragma hdrstop
#endif
+#include "wx/defs.h"
+
+#if wxUSE_DATAVIEWCTRL
+
#include "wx/object.h"
#include "wx/dataview.h"
#include "wx/log.h"
return false;
}
-bool wxDataViewListModel::ValueChanged( size_t row, size_t col )
+bool wxDataViewListModel::ValueChanged( size_t col, size_t row )
{
if (m_notifier)
- return m_notifier->RowAppended();
+ return m_notifier->ValueChanged( col, row );
return false;
}
return m_notifier;
}
+// ---------------------------------------------------------
+// wxDataViewCellBase
+// ---------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewCellBase, wxObject)
+
+wxDataViewCellBase::wxDataViewCellBase( const wxString &varianttype, wxDataViewCellMode mode )
+{
+ m_variantType = varianttype;
+ m_mode = mode;
+}
+
+// ---------------------------------------------------------
+// wxDataViewColumnBase
+// ---------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumnBase, wxObject)
+
+wxDataViewColumnBase::wxDataViewColumnBase( const wxString &title, wxDataViewCell *cell, size_t model_column, int flags)
+{
+ m_cell = cell;
+ m_model_column = model_column;
+ m_flags = flags;
+ m_title = title;
+ m_owner = NULL;
+ m_cell->SetOwner( (wxDataViewColumn*) this );
+}
+
+wxDataViewColumnBase::~wxDataViewColumnBase()
+{
+ if (m_cell)
+ delete m_cell;
+}
+
+void wxDataViewColumnBase::SetTitle( const wxString &title )
+{
+ m_title = title;
+}
+
+wxString wxDataViewColumnBase::GetTitle()
+{
+ return m_title;
+}
+
// ---------------------------------------------------------
// wxDataViewCtrlBase
// ---------------------------------------------------------
wxDataViewCtrlBase::wxDataViewCtrlBase()
{
m_model = NULL;
+ m_cols.DeleteContents( true );
}
wxDataViewCtrlBase::~wxDataViewCtrlBase()
return m_model;
}
+bool wxDataViewCtrlBase::AppendTextColumn( const wxString &label, size_t model_column )
+{
+ return AppendColumn( new wxDataViewColumn( label, new wxDataViewTextCell(), model_column ) );
+}
+
+bool wxDataViewCtrlBase::AppendToggleColumn( const wxString &label, size_t model_column )
+{
+ return AppendColumn( new wxDataViewColumn( label, new wxDataViewToggleCell(), model_column ) );
+}
+
+bool wxDataViewCtrlBase::AppendProgressColumn( const wxString &label, size_t model_column )
+{
+ return AppendColumn( new wxDataViewColumn( label, new wxDataViewProgressCell(), model_column ) );
+}
+
+bool wxDataViewCtrlBase::AppendDateColumn( const wxString &label, size_t model_column )
+{
+ return AppendColumn( new wxDataViewColumn( label, new wxDataViewDateCell(), model_column ) );
+}
+
+bool wxDataViewCtrlBase::AppendColumn( wxDataViewColumn *col )
+{
+ m_cols.Append( (wxObject*) col );
+ col->SetOwner( (wxDataViewCtrl*) this );
+ return true;
+}
+
+size_t wxDataViewCtrlBase::GetNumberOfColumns()
+{
+ return m_cols.GetCount();
+}
+
+bool wxDataViewCtrlBase::DeleteColumn( size_t pos )
+{
+ return false;
+}
+
+bool wxDataViewCtrlBase::ClearColumns()
+{
+ return false;
+}
+
+wxDataViewColumn* wxDataViewCtrlBase::GetColumn( size_t pos )
+{
+ return (wxDataViewColumn*) m_cols[ pos ];
+}
+
+#endif