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.
__init__ |
Default constructor. |
AppendColumn |
Appends a column to the control and additionally appends a column to the store with the type string. |
AppendIconTextColumn |
Appends an icon-and-text column to the control and the store. |
AppendItem |
Appends an item (=row) to the control and store. |
AppendProgressColumn |
Appends a progress column to the control and the store. |
AppendTextColumn |
Appends a text column to the control and the store. |
AppendToggleColumn |
Appends a toggle column to the control and the store. |
Create |
Creates the control and a wx.dataview.DataViewListStore as its internal model. |
DeleteAllItems |
Delete all items (= all rows). |
DeleteItem |
Delete the row at position row. |
GetItemCount |
Returns the number of items (=rows) in the control. |
GetItemData |
Returns the client data associated with the item. |
GetSelectedRow |
Returns index of the selected row or wx.NOT_FOUND . |
GetStore |
Returns the store. |
GetTextValue |
Returns the value from the store. |
GetToggleValue |
Returns the value from the store. |
GetValue |
Returns the value from the store. |
InsertColumn |
Inserts a column to the control and additionally inserts a column to the store with the type string. |
InsertItem |
Inserts an item (=row) to the control and store. |
IsRowSelected |
Returns True if row is selected. |
ItemToRow |
Returns the position of given item or wx.NOT_FOUND if it’s not a valid item. |
PrependColumn |
Prepends a column to the control and additionally prepends a column to the store with the type string. |
PrependItem |
Prepends an item (=row) to the control and store. |
RowToItem |
Returns the wx.dataview.DataViewItem at the given row. |
SelectRow |
Selects given row. |
SetItemData |
Associates a client data pointer with the given item. |
SetTextValue |
Sets the value in the store and update the control. |
SetToggleValue |
Sets the value in the store and update the control. |
SetValue |
Sets the value in the store and update the control. |
UnselectRow |
Unselects given row. |
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
.
Parameters: |
|
---|
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.
Parameters: | column (wx.dataview.DataViewColumn) – |
---|---|
Return type: | bool |
AppendColumn (self, column, varianttype)
Appends a column to the control and additionally appends a column to the list store with the type varianttype.
Parameters: |
|
---|
AppendIconTextColumn
(self, label, mode=DATAVIEW_CELL_INERT, width=-1, 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.
Parameters: |
|
---|---|
Return type: |
AppendItem
(self, values, data=None)¶Appends an item (=row) to the control and store.
Parameters: |
|
---|
AppendProgressColumn
(self, label, mode=DATAVIEW_CELL_INERT, width=-1, 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.
Parameters: |
|
---|---|
Return type: |
AppendTextColumn
(self, label, mode=DATAVIEW_CELL_INERT, width=-1, 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.
Parameters: |
|
---|---|
Return type: |
AppendToggleColumn
(self, label, mode=DATAVIEW_CELL_ACTIVATABLE, width=-1, 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.
Parameters: |
|
---|---|
Return type: |
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.
Parameters: |
|
---|---|
Return type: | bool |
DeleteAllItems
(self)¶Delete all items (= all rows).
DeleteItem
(self, row)¶Delete the row at position row.
Parameters: | row – |
---|
GetItemCount
(self)¶Returns the number of items (=rows) in the control.
Return type: | int |
---|
New in version 2.9.4.
GetItemData
(self, item)¶Returns the client data associated with the item.
Parameters: | item (wx.dataview.DataViewItem) – |
---|---|
Return type: | wx.UIntPtr |
New in version 2.9.4.
See also
GetSelectedRow
(self)¶Returns index of the selected row or wx.NOT_FOUND
.
Return type: | int |
---|
New in version 2.9.2.
GetStore
(self)¶Returns the store.
Return type: | wx.dataview.DataViewListStore |
---|
GetTextValue
(self, row, col)¶Returns the value from the store.
This method assumes that the string is stored in respective column.
Parameters: |
|
---|---|
Return type: |
|
GetToggleValue
(self, row, col)¶Returns the value from the store.
This method assumes that the boolean value is stored in respective column.
Parameters: |
|
---|---|
Return type: | bool |
GetValue
(self, row, col)¶Returns the value from the store.
Parameters: |
|
---|---|
Return type: | 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.
Parameters: |
|
---|---|
Return type: | 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.
Parameters: |
|
---|
InsertItem
(self, row, values, data=None)¶Inserts an item (=row) to the control and store.
Parameters: |
|
---|
IsRowSelected
(self, row)¶Returns True
if row is selected.
Parameters: | row – |
---|---|
Return type: | 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.
Parameters: | item (wx.dataview.DataViewItem) – |
---|---|
Return type: | 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.
Parameters: | column (wx.dataview.DataViewColumn) – |
---|---|
Return type: | bool |
PrependColumn (self, column, varianttype)
Prepends a column to the control and additionally prepends a column to the list store with the type varianttype.
Parameters: |
|
---|
PrependItem
(self, values, data=None)¶Prepends an item (=row) to the control and store.
Parameters: |
|
---|
RowToItem
(self, row)¶Returns the wx.dataview.DataViewItem at the given row.
Parameters: | row (int) – |
---|---|
Return type: | wx.dataview.DataViewItem |
New in version 2.9.2.
SelectRow
(self, row)¶Selects given row.
Parameters: | 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.
Parameters: |
|
---|
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.
Parameters: |
|
---|
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.
Parameters: |
|
---|
SetValue
(self, value, row, col)¶Sets the value in the store and update the control.
Parameters: |
|
---|
UnselectRow
(self, row)¶Unselects given row.
Parameters: | row – |
---|
New in version 2.9.2.
See also
ItemCount
¶See GetItemCount
SelectedRow
¶See GetSelectedRow