wxDataViewListCtrl Class Reference
[ControlswxDataViewCtrl Related Classes]

#include <wx/dataview.h>

Inheritance diagram for wxDataViewListCtrl:
Inheritance graph
[legend]

Detailed Description

This class is a wxDataViewCtrl which internally uses a wxDataViewListStore and forwards most of its API to that class.

The purpose of this class is to offer a simple way to display and edit a small table of data without having to write your own wxDataViewModel.

       wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( parent, wxID_ANY );

       listctrl->AppendToggleColumn( "Toggle" );
       listctrl->AppendTextColumn( "Text" );

       wxVector<wxVariant> data;
       data.push_back( wxVariant(true) );
       data.push_back( wxVariant("row 1") );
       listctrl->AppendItem( data );

       data.clear();
       data.push_back( wxVariant(false) );
       data.push_back( wxVariant("row 3") );
       listctrl->AppendItem( data );

Styles

This class supports the following styles:

See wxDataViewCtrl for the list of supported styles.

Events emitted by this class

Event macros for events emitted by this class:

See wxDataViewCtrl for the list of events emitted by this class.

Library:  wxAdvanced
Category:  Controls, wxDataViewCtrl Related Classes

Public Member Functions

 wxDataViewListCtrl ()
 Default ctor.
 wxDataViewListCtrl (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDV_ROW_LINES, const wxValidator &validator=wxDefaultValidator)
 Constructor.
 ~wxDataViewListCtrl ()
 Destructor.
bool Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDV_ROW_LINES, const wxValidator &validator=wxDefaultValidator)
 Creates the control and a wxDataViewListStore as its internal model.



wxDataViewListStoreGetStore ()
 Returns the store.
const wxDataViewListStoreGetStore () const
 Returns the store.
Column management functions



virtual void AppendColumn (wxDataViewColumn *column)
 Appends a column to the control and additionally appends a column to the store with the type string.
void AppendColumn (wxDataViewColumn *column, const wxString &varianttype)
 Appends a column to the control and additionally appends a column to the list store with the type varianttype.
wxDataViewColumnAppendTextColumn (const wxString &label, wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int width=-1, wxAlignment align=wxALIGN_LEFT, int flags=wxDATAVIEW_COL_RESIZABLE)
 Appends a text column to the control and the store.
wxDataViewColumnAppendToggleColumn (const wxString &label, wxDataViewCellMode mode=wxDATAVIEW_CELL_ACTIVATABLE, int width=-1, wxAlignment align=wxALIGN_LEFT, int flags=wxDATAVIEW_COL_RESIZABLE)
 Appends a toggle column to the control and the store.
wxDataViewColumnAppendProgressColumn (const wxString &label, wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int width=-1, wxAlignment align=wxALIGN_LEFT, int flags=wxDATAVIEW_COL_RESIZABLE)
 Appends a progress column to the control and the store.
wxDataViewColumnAppendIconTextColumn (const wxString &label, wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int width=-1, wxAlignment align=wxALIGN_LEFT, int flags=wxDATAVIEW_COL_RESIZABLE)
 Appends an icon-and-text column to the control and the store.
virtual void InsertColumn (unsigned int pos, wxDataViewColumn *column)
 Inserts a column to the control and additionally inserts a column to the store with the type string.
void InsertColumn (unsigned int pos, wxDataViewColumn *column, const wxString &varianttype)
 Inserts a column to the control and additionally inserts a column to the list store with the type varianttype.
virtual void PrependColumn (wxDataViewColumn *column)
 Prepends a column to the control and additionally prepends a column to the store with the type string.
void PrependColumn (wxDataViewColumn *column, const wxString &varianttype)
 Prepends a column to the control and additionally prepends a column to the list store with the type varianttype.
Item management functions



void AppendItem (const wxVector< wxVariant > &values, wxClientData *data=NULL)
 Appends an item (=row) to the control and store.
void PrependItem (const wxVector< wxVariant > &values, wxClientData *data=NULL)
 Prepends an item (=row) to the control and store.
void InsertItem (unsigned int row, const wxVector< wxVariant > &values, wxClientData *data=NULL)
 Inserts an item (=row) to the control and store.
void DeleteItem (unsigned row)
 Delete the row at position row.
void DeleteAllItems ()
 Delete all items (= all rows).
void SetValue (const wxVariant &value, unsigned int row, unsigned int col)
 Sets the value in the store and update the control.
void GetValue (wxVariant &value, unsigned int row, unsigned int col)
 Returns the value from the store.
void SetTextValue (const wxString &value, unsigned int row, unsigned int col)
 Sets the value in the store and update the control.
wxString GetTextValue (unsigned int row, unsigned int col) const
 Returns the value from the store.
void SetToggleValue (bool value, unsigned int row, unsigned int col)
 Sets the value in the store and update the control.
bool GetToggleValue (unsigned int row, unsigned int col) const
 Returns the value from the store.

List of all members.


Constructor & Destructor Documentation

wxDataViewListCtrl::wxDataViewListCtrl (  ) 

Default ctor.

wxDataViewListCtrl::wxDataViewListCtrl ( wxWindow parent,
wxWindowID  id,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxDV_ROW_LINES,
const wxValidator validator = wxDefaultValidator 
)

Constructor.

Calls Create().

wxDataViewListCtrl::~wxDataViewListCtrl (  ) 

Destructor.

Deletes the image list if any.


Member Function Documentation

void wxDataViewListCtrl::AppendColumn ( wxDataViewColumn column,
const wxString varianttype 
)

Appends a column to the control and additionally appends a column to the list store with the type varianttype.

virtual void wxDataViewListCtrl::AppendColumn ( wxDataViewColumn column  )  [virtual]

Appends a column to the control and additionally appends a column to the store with the type string.

Reimplemented from wxDataViewCtrl.

wxDataViewColumn* wxDataViewListCtrl::AppendIconTextColumn ( const wxString label,
wxDataViewCellMode  mode = wxDATAVIEW_CELL_INERT,
int  width = -1,
wxAlignment  align = wxALIGN_LEFT,
int  flags = wxDATAVIEW_COL_RESIZABLE 
)

Appends an icon-and-text column to the control and the store.

See wxDataViewColumn::wxDataViewColumn for more info about the parameters.

void wxDataViewListCtrl::AppendItem ( const wxVector< wxVariant > &  values,
wxClientData data = NULL 
)

Appends an item (=row) to the control and store.

wxDataViewColumn* wxDataViewListCtrl::AppendProgressColumn ( const wxString label,
wxDataViewCellMode  mode = wxDATAVIEW_CELL_INERT,
int  width = -1,
wxAlignment  align = wxALIGN_LEFT,
int  flags = wxDATAVIEW_COL_RESIZABLE 
)

Appends a progress column to the control and the store.

See wxDataViewColumn::wxDataViewColumn for more info about the parameters.

wxDataViewColumn* wxDataViewListCtrl::AppendTextColumn ( const wxString label,
wxDataViewCellMode  mode = wxDATAVIEW_CELL_INERT,
int  width = -1,
wxAlignment  align = wxALIGN_LEFT,
int  flags = wxDATAVIEW_COL_RESIZABLE 
)

Appends a text column to the control and the store.

See wxDataViewColumn::wxDataViewColumn for more info about the parameters.

wxDataViewColumn* wxDataViewListCtrl::AppendToggleColumn ( const wxString label,
wxDataViewCellMode  mode = wxDATAVIEW_CELL_ACTIVATABLE,
int  width = -1,
wxAlignment  align = wxALIGN_LEFT,
int  flags = wxDATAVIEW_COL_RESIZABLE 
)

Appends a toggle column to the control and the store.

See wxDataViewColumn::wxDataViewColumn for more info about the parameters.

bool wxDataViewListCtrl::Create ( wxWindow parent,
wxWindowID  id,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxDV_ROW_LINES,
const wxValidator validator = wxDefaultValidator 
)

Creates the control and a wxDataViewListStore as its internal model.

Reimplemented from wxDataViewCtrl.

void wxDataViewListCtrl::DeleteAllItems (  ) 

Delete all items (= all rows).

void wxDataViewListCtrl::DeleteItem ( unsigned  row  ) 

Delete the row at position row.

const wxDataViewListStore* wxDataViewListCtrl::GetStore (  )  const

Returns the store.

wxDataViewListStore* wxDataViewListCtrl::GetStore (  ) 

Returns the store.

wxString wxDataViewListCtrl::GetTextValue ( unsigned int  row,
unsigned int  col 
) const

Returns the value from the store.

This method assumes that the a string is stored in respective column.

bool wxDataViewListCtrl::GetToggleValue ( unsigned int  row,
unsigned int  col 
) const

Returns the value from the store.

This method assumes that the a boolean value is stored in respective column.

void wxDataViewListCtrl::GetValue ( wxVariant value,
unsigned int  row,
unsigned int  col 
)

Returns the value from the store.

void wxDataViewListCtrl::InsertColumn ( unsigned int  pos,
wxDataViewColumn column,
const wxString varianttype 
)

Inserts a column to the control and additionally inserts a column to the list store with the type varianttype.

virtual void wxDataViewListCtrl::InsertColumn ( unsigned int  pos,
wxDataViewColumn column 
) [virtual]

Inserts a column to the control and additionally inserts a column to the store with the type string.

Reimplemented from wxDataViewCtrl.

void wxDataViewListCtrl::InsertItem ( unsigned int  row,
const wxVector< wxVariant > &  values,
wxClientData data = NULL 
)

Inserts an item (=row) to the control and store.

void wxDataViewListCtrl::PrependColumn ( wxDataViewColumn column,
const wxString varianttype 
)

Prepends a column to the control and additionally prepends a column to the list store with the type varianttype.

virtual void wxDataViewListCtrl::PrependColumn ( wxDataViewColumn column  )  [virtual]

Prepends a column to the control and additionally prepends a column to the store with the type string.

Reimplemented from wxDataViewCtrl.

void wxDataViewListCtrl::PrependItem ( const wxVector< wxVariant > &  values,
wxClientData data = NULL 
)

Prepends an item (=row) to the control and store.

void wxDataViewListCtrl::SetTextValue ( const wxString value,
unsigned int  row,
unsigned int  col 
)

Sets the value in the store and update the control.

This method assumes that the a string is stored in respective column.

void wxDataViewListCtrl::SetToggleValue ( bool  value,
unsigned int  row,
unsigned int  col 
)

Sets the value in the store and update the control.

This method assumes that the a boolean value is stored in respective column.

void wxDataViewListCtrl::SetValue ( const wxVariant value,
unsigned int  row,
unsigned int  col 
)

Sets the value in the store and update the control.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



wxWidgets logo

[ top ]