This class is a wx.dataview.DataViewCtrl which internally uses a wx.dataview.DataViewListStore 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 wx.dataview.DataViewModel.
listctrl = wx.dataview.DataViewListCtrl(parent, wx.ID_ANY)
listctrl.AppendToggleColumn("Toggle")
listctrl.AppendTextColumn("Text")
data = [True, "row 1"]
listctrl.AppendItem(data)
data = [False, "row 3"]
listctrl.AppendItem(data)
^^
This class supports the following styles:
See wx.dataview.DataViewCtrl for the list of supported styles. ^^
^^
Event macros for events emitted by this class:
See wx.dataview.DataViewCtrl for the list of events emitted by this class. ^^
New in version 2.9.0.
Default constructor. |
|
Appends a column to the control and additionally appends a column to the store with the type string. |
|
Appends an icon-and-text column to the control and the store. |
|
Appends an item (i.e. a row) to the control. |
|
Appends a progress column to the control and the store. |
|
Appends a text column to the control and the store. |
|
Appends a toggle column to the control and the store. |
|
Creates the control and a wx.dataview.DataViewListStore as its internal model. |
|
Delete all items (= all rows). |
|
Delete the row at position row. |
|
Returns the number of items (=rows) in the control. |
|
Returns the client data associated with the item. |
|
Returns index of the selected row or |
|
Returns the store. |
|
Returns the value from the store. |
|
Returns the value from the store. |
|
Returns the value from the store. |
|
Inserts a column to the control and additionally inserts a column to the store with the type string. |
|
Inserts an item (i.e. a row) to the control. |
|
Returns |
|
Returns the position of given item or |
|
Prepends a column to the control and additionally prepends a column to the store with the type string. |
|
Prepends an item (i.e. a row) to the control. |
|
Returns the wx.dataview.DataViewItem at the given row. |
|
Selects given row. |
|
Associates a client data pointer with the given item. |
|
Sets the value in the store and update the control. |
|
Sets the value in the store and update the control. |
|
Sets the value in the store and update the control. |
|
Unselects given row. |
See |
|
See |
|
See |
wx.dataview.
DataViewListCtrl
(DataViewCtrl)¶Possible constructors:
DataViewListCtrl()
DataViewListCtrl(parent, id=ID_ANY, pos=DefaultPosition,
size=DefaultSize, style=DV_ROW_LINES, validator=DefaultValidator)
This class is a DataViewCtrl which internally uses a DataViewListStore and forwards most of its API to that class.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_ROW_LINES, validator=DefaultValidator)
Constructor.
Calls Create
.
parent (wx.Window) –
id (wx.WindowID) –
pos (wx.Point) –
size (wx.Size) –
style (long) –
validator (wx.Validator) –
AppendColumn
(self, *args, **kw)¶AppendColumn (self, column)
Appends a column to the control and additionally appends a column to the store with the type string.
column (wx.dataview.DataViewColumn) –
bool
AppendColumn (self, column, varianttype)
Appends a column to the control and additionally appends a column to the list store with the type varianttype.
column (wx.dataview.DataViewColumn) –
varianttype (string) –
AppendIconTextColumn
(self, label, mode=DATAVIEW_CELL_INERT, width=COL_WIDTH_DEFAULT, align=ALIGN_LEFT, flags=DATAVIEW_COL_RESIZABLE)¶Appends an icon-and-text column to the control and the store.
See DataViewColumn.__init__
for more info about the parameters.
label (string) –
mode (DataViewCellMode) –
width (int) –
align (Alignment) –
flags (int) –
AppendItem
(self, values, data=None)¶Appends an item (i.e. a row) to the control.
Note that the size of values vector must be exactly equal to the number of columns in the control and that columns must not be modified after adding any items to the control (or, conversely, items must not be added before the columns are set up).
values (VariantVector
) –
data (wx.UIntPtr) –
AppendProgressColumn
(self, label, mode=DATAVIEW_CELL_INERT, width=COL_WIDTH_DEFAULT, align=ALIGN_LEFT, flags=DATAVIEW_COL_RESIZABLE)¶Appends a progress column to the control and the store.
See DataViewColumn.__init__
for more info about the parameters.
label (string) –
mode (DataViewCellMode) –
width (int) –
align (Alignment) –
flags (int) –
AppendTextColumn
(self, label, mode=DATAVIEW_CELL_INERT, width=COL_WIDTH_DEFAULT, align=ALIGN_LEFT, flags=DATAVIEW_COL_RESIZABLE)¶Appends a text column to the control and the store.
See DataViewColumn.__init__
for more info about the parameters.
label (string) –
mode (DataViewCellMode) –
width (int) –
align (Alignment) –
flags (int) –
AppendToggleColumn
(self, label, mode=DATAVIEW_CELL_ACTIVATABLE, width=COL_WIDTH_DEFAULT, align=ALIGN_LEFT, flags=DATAVIEW_COL_RESIZABLE)¶Appends a toggle column to the control and the store.
See DataViewColumn.__init__
for more info about the parameters.
label (string) –
mode (DataViewCellMode) –
width (int) –
align (Alignment) –
flags (int) –
Create
(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_ROW_LINES, validator=DefaultValidator)¶Creates the control and a wx.dataview.DataViewListStore as its internal model.
parent (wx.Window) –
id (wx.WindowID) –
pos (wx.Point) –
size (wx.Size) –
style (long) –
validator (wx.Validator) –
bool
DeleteAllItems
(self)¶Delete all items (= all rows).
DeleteItem
(self, row)¶Delete the row at position row.
row –
GetClassDefaultAttributes
(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
VisualAttributes
GetItemCount
(self)¶Returns the number of items (=rows) in the control.
int
New in version 2.9.4.
GetItemData
(self, item)¶Returns the client data associated with the item.
item (wx.dataview.DataViewItem) –
wx.UIntPtr
New in version 2.9.4.
See also
GetSelectedRow
(self)¶Returns index of the selected row or wx.NOT_FOUND
.
int
New in version 2.9.2.
GetStore
(self)¶Returns the store.
GetTextValue
(self, row, col)¶Returns the value from the store.
This method assumes that the string is stored in respective column.
row (int) –
col (int) –
string
GetToggleValue
(self, row, col)¶Returns the value from the store.
This method assumes that the boolean value is stored in respective column.
row (int) –
col (int) –
bool
GetValue
(self, row, col)¶Returns the value from the store.
row (int) –
col (int) –
value
InsertColumn
(self, *args, **kw)¶InsertColumn (self, pos, column)
Inserts a column to the control and additionally inserts a column to the store with the type string.
pos (int) –
column (wx.dataview.DataViewColumn) –
bool
InsertColumn (self, pos, column, varianttype)
Inserts a column to the control and additionally inserts a column to the list store with the type varianttype.
pos (int) –
column (wx.dataview.DataViewColumn) –
varianttype (string) –
InsertItem
(self, row, values, data=None)¶Inserts an item (i.e. a row) to the control.
See remarks for AppendItem
for preconditions of this method.
Additionally, row must be less than or equal to the current number of items in the control (see GetItemCount
).
row (int) –
values (VariantVector
) –
data (wx.UIntPtr) –
IsRowSelected
(self, row)¶Returns True
if row is selected.
row –
bool
New in version 2.9.2.
See also
ItemToRow
(self, item)¶Returns the position of given item or wx.NOT_FOUND
if it’s not a valid item.
item (wx.dataview.DataViewItem) –
int
New in version 2.9.2.
PrependColumn
(self, *args, **kw)¶PrependColumn (self, column)
Prepends a column to the control and additionally prepends a column to the store with the type string.
column (wx.dataview.DataViewColumn) –
bool
PrependColumn (self, column, varianttype)
Prepends a column to the control and additionally prepends a column to the list store with the type varianttype.
column (wx.dataview.DataViewColumn) –
varianttype (string) –
PrependItem
(self, values, data=None)¶Prepends an item (i.e. a row) to the control.
See remarks for AppendItem
for preconditions of this method.
values (VariantVector
) –
data (wx.UIntPtr) –
RowToItem
(self, row)¶Returns the wx.dataview.DataViewItem at the given row.
row (int) –
New in version 2.9.2.
SelectRow
(self, row)¶Selects given row.
row –
New in version 2.9.2.
See also
SetItemData
(self, item, data)¶Associates a client data pointer with the given item.
Notice that the control does not take ownership of the pointer for compatibility with wx.ListCtrl. I.e. it will not delete the pointer (if it is a pointer and not a number) itself, it is up to you to do it.
item (wx.dataview.DataViewItem) –
data (wx.UIntPtr) –
New in version 2.9.4.
See also
SetTextValue
(self, value, row, col)¶Sets the value in the store and update the control.
This method assumes that the string is stored in respective column.
value (string) –
row (int) –
col (int) –
SetToggleValue
(self, value, row, col)¶Sets the value in the store and update the control.
This method assumes that the boolean value is stored in respective column.
value (bool) –
row (int) –
col (int) –
SetValue
(self, value, row, col)¶Sets the value in the store and update the control.
value (DVCVariant) –
row (int) –
col (int) –
UnselectRow
(self, row)¶Unselects given row.
row –
New in version 2.9.2.
See also
ItemCount
¶See GetItemCount
SelectedRow
¶See GetSelectedRow