const wxDataViewListStore *GetStore() const
{ return (const wxDataViewListStore*) GetModel(); }
- void AppendCol( wxDataViewColumn *column, const wxString &varianttype );
- void PrependCol( wxDataViewColumn *column, const wxString &varianttype );
- void InsertCol( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype );
+ bool AppendColumn( wxDataViewColumn *column, const wxString &varianttype );
+ bool PrependColumn( wxDataViewColumn *column, const wxString &varianttype );
+ bool InsertColumn( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype );
- wxDataViewColumn *AppendTextCol( const wxString &label,
+ // overridden from base class
+ virtual bool PrependColumn( wxDataViewColumn *col );
+ virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
+ virtual bool AppendColumn( wxDataViewColumn *col );
+
+ wxDataViewColumn *AppendTextColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
- wxDataViewColumn *AppendToggleCol( const wxString &label,
+ wxDataViewColumn *AppendToggleColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
- wxDataViewColumn *AppendProgressCol( const wxString &label,
+ wxDataViewColumn *AppendProgressColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
- wxDataViewColumn *AppendIconTextCol( const wxString &label,
+ wxDataViewColumn *AppendIconTextColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
@code
wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( parent, -1 );
- listctrl->AppendToggleCol( "Toggle" );
- listctrl->AppendTextCol( "Text" );
+ listctrl->AppendToggleColumn( "Toggle" );
+ listctrl->AppendTextColumn( "Text" );
wxVector<wxVariant> data;
data.push_back( true );
Appends a column to the control and additonally appends a
column to the store with the type @a varianttype.
*/
- void AppendCol( wxDataViewColumn *column, const wxString &varianttype );
+ void AppendColumn( wxDataViewColumn *column, const wxString &varianttype );
/**
Prepends a column to the control and additonally prepends a
column to the store with the type @a varianttype.
*/
- void PrependCol( wxDataViewColumn *column, const wxString &varianttype );
+ void PrependColumn( wxDataViewColumn *column, const wxString &varianttype );
/**
Inserts a column to the control and additonally inserts a
column to the store with the type @a varianttype.
*/
- void InsertCol( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype );
+ void InsertColumn( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype );
+
+ /**
+ Overridden from wxDataViewCtrl
+
+ Appends a column to the control and additonally appends a
+ column to the store with the type string.
+ */
+ virtual void AppendColumn( wxDataViewColumn *column );
+
+ /**
+ Overridden from wxDataViewCtrl
+
+ Prepends a column to the control and additonally prepends a
+ column to the store with the type string.
+ */
+ virtual void PrependColumn( wxDataViewColumn *column );
+
+ /**
+ Overridden from wxDataViewCtrl
+
+ Inserts a column to the control and additonally inserts a
+ column to the store with the type string.
+ */
+ virtual void InsertColumn( unsigned int pos, wxDataViewColumn *column );
/**
Inserts a text column to the control and the store.
*/
- wxDataViewColumn *AppendTextCol( const wxString &label,
+ wxDataViewColumn *AppendTextColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
/**
Inserts a toggle column to the control and the store.
*/
- wxDataViewColumn *AppendToggleCol( const wxString &label,
+ wxDataViewColumn *AppendToggleColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
/**
Inserts a progress column to the control and the store.
*/
- wxDataViewColumn *AppendProgressCol( const wxString &label,
+ wxDataViewColumn *AppendProgressColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
/**
Inserts a icon and text column to the control and the store.
*/
- wxDataViewColumn *AppendIconTextCol( const wxString &label,
+ wxDataViewColumn *AppendIconTextColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( panel, -1,
wxDefaultPosition, wxSize(100,200) );
- listctrl->AppendToggleCol( wxT("Toggle") );
- listctrl->AppendTextCol( wxT("Text") );
+ listctrl->AppendToggleColumn( wxT("Toggle") );
+ listctrl->AppendTextColumn( wxT("Text") );
wxVector<wxVariant> data;
data.push_back( true );
wxDataViewCtrlBase::AppendToggleColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
-
wxDataViewColumn *ret = new wxDataViewColumn( label,
new wxDataViewToggleRenderer( wxT("bool"), mode ),
model_column, width, align, flags );
return wxDataViewCtrl::Create( parent, id, pos, size, style, validator );
}
-void wxDataViewListCtrl::AppendCol( wxDataViewColumn *column, const wxString &varianttype )
+bool wxDataViewListCtrl::AppendColumn( wxDataViewColumn *column, const wxString &varianttype )
{
GetStore()->AppendColumn( varianttype );
- AppendColumn( column );
+ return wxDataViewCtrl::AppendColumn( column );
}
-void wxDataViewListCtrl::PrependCol( wxDataViewColumn *column, const wxString &varianttype )
+bool wxDataViewListCtrl::PrependColumn( wxDataViewColumn *column, const wxString &varianttype )
{
GetStore()->PrependColumn( varianttype );
- PrependColumn( column );
+ return wxDataViewCtrl::PrependColumn( column );
}
-void wxDataViewListCtrl::InsertCol( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype )
+bool wxDataViewListCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype )
{
GetStore()->InsertColumn( pos, varianttype );
- InsertColumn( pos, column );
+ return wxDataViewCtrl::InsertColumn( pos, column );
+}
+
+bool wxDataViewListCtrl::PrependColumn( wxDataViewColumn *col )
+{
+ return PrependColumn( col, "string" );
+}
+
+bool wxDataViewListCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *col )
+{
+ return InsertColumn( pos, col, "string" );
+}
+
+bool wxDataViewListCtrl::AppendColumn( wxDataViewColumn *col )
+{
+ return AppendColumn( col, "string" );
}
-wxDataViewColumn *wxDataViewListCtrl::AppendTextCol( const wxString &label,
+wxDataViewColumn *wxDataViewListCtrl::AppendTextColumn( const wxString &label,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
GetStore()->AppendColumn( wxT("string") );
- return AppendTextColumn( label, GetStore()->GetColumnCount()-1, mode, width, align, flags );
+
+ wxDataViewColumn *ret = new wxDataViewColumn( label,
+ new wxDataViewTextRenderer( wxT("string"), mode ),
+ GetStore()->GetColumnCount()-1, width, align, flags );
+
+ wxDataViewCtrl::AppendColumn( ret );
+
+ return ret;
}
-wxDataViewColumn *wxDataViewListCtrl::AppendToggleCol( const wxString &label,
+wxDataViewColumn *wxDataViewListCtrl::AppendToggleColumn( const wxString &label,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
GetStore()->AppendColumn( wxT("bool") );
- return AppendToggleColumn( label, GetStore()->GetColumnCount()-1, mode, width, align, flags );
+
+ wxDataViewColumn *ret = new wxDataViewColumn( label,
+ new wxDataViewToggleRenderer( wxT("bool"), mode ),
+ GetStore()->GetColumnCount()-1, width, align, flags );
+
+ wxDataViewCtrl::AppendColumn( ret );
+
+ return ret;
}
-wxDataViewColumn *wxDataViewListCtrl::AppendProgressCol( const wxString &label,
+wxDataViewColumn *wxDataViewListCtrl::AppendProgressColumn( const wxString &label,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
GetStore()->AppendColumn( wxT("long") );
- return AppendProgressColumn( label, GetStore()->GetColumnCount()-1, mode, width, align, flags );
+
+ wxDataViewColumn *ret = new wxDataViewColumn( label,
+ new wxDataViewProgressRenderer( wxEmptyString, wxT("long"), mode ),
+ GetStore()->GetColumnCount()-1, width, align, flags );
+
+ wxDataViewCtrl::AppendColumn( ret );
+
+ return ret;
}
-wxDataViewColumn *wxDataViewListCtrl::AppendIconTextCol( const wxString &label,
+wxDataViewColumn *wxDataViewListCtrl::AppendIconTextColumn( const wxString &label,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
GetStore()->AppendColumn( wxT("wxDataViewIconText") );
- return AppendIconTextColumn( label, GetStore()->GetColumnCount()-1, mode, width, align, flags );
+
+ wxDataViewColumn *ret = new wxDataViewColumn( label,
+ new wxDataViewIconTextRenderer( wxT("wxDataViewIconText"), mode ),
+ GetStore()->GetColumnCount()-1, width, align, flags );
+
+ wxDataViewCtrl::AppendColumn( ret );
+
+ return ret;
}
void wxDataViewListCtrl::OnSize( wxSizeEvent &event )