Helper class for managing choices of wx.propgrid.PropertyGrid properties.
Each entry can have label, value, bitmap, text colour, and background colour.
wx.propgrid.PGChoices uses reference counting, similar to other wxWidgets classes. This means that assignment operator and copy constructor only copy the reference and not the actual data. Use Copy
member function to create a real copy.
Note
If you do not specify value for entry, index is used.
__init__ |
Default constructor. |
Add |
Adds to current. |
AddAsSorted |
Adds single item, sorted. |
AllocExclusive |
Creates exclusive copy of current choices. |
Assign |
Assigns choices data, using reference counting. |
AssignData |
Assigns data from another set of choices. |
Clear |
Deletes all items. |
Copy |
Returns a real copy of the choices. |
GetCount |
Returns number of items. |
GetIndicesForStrings |
Returns array of indices matching given strings. |
GetLabel |
Returns label of item. |
GetLabels |
Returns array of choice labels. |
GetValue |
Returns value of item;. |
GetValuesForStrings |
Returns array of values matching the given strings. |
Index |
Returns index of item with given label. |
Insert |
Inserts single item. |
IsOk |
Returns False if this is a constant empty set of choices, which should not be modified. |
Item |
Returns item at given index. |
RemoveAt |
Removes count items starting at position nIndex. |
Set |
Sets contents from lists of strings and values. |
__getitem__ |
Returns a reference to a :class:PGChoiceEntry using Python list syntax. |
__len__ |
wx.propgrid.
PGChoices
(object)¶Possible constructors:
PGChoices()
PGChoices(a)
PGChoices(labels, values=[])
PGChoices(data)
Helper class for managing choices of PropertyGrid properties.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, a)
Copy constructor, uses reference counting.
To create a real copy, use Copy
member function instead.
Parameters: | a (wx.propgrid.PGChoices) – |
---|
__init__ (self, labels, values=[])
Constructor.
Parameters: |
|
---|
__init__ (self, data)
Constructor.
Parameters: | data (wx.propgrid.PGChoicesData) – |
---|
Add
(self, *args, **kw)¶Add (self, labels, values=None)
Adds to current.
If did not have own copies, creates them now. If was empty, identical to set except that creates copies.
Parameters: |
|
---|
Add (self, arr, arrint)
Version that works with list of strings and ArrayInt.
Parameters: |
|
---|
Add (self, label, value=PG_INVALID_VALUE)
Adds single item.
Parameters: |
|
---|---|
Return type: |
Add (self, label, bitmap, value=PG_INVALID_VALUE)
Adds a single item, with bitmap.
Parameters: |
|
---|---|
Return type: |
Add (self, entry)
Adds a single item with full entry information.
Parameters: | entry (wx.propgrid.PGChoiceEntry) – |
---|---|
Return type: | wx.propgrid.PGChoiceEntry |
AddAsSorted
(self, label, value=PG_INVALID_VALUE)¶Adds single item, sorted.
Parameters: |
|
---|---|
Return type: |
AllocExclusive
(self)¶Creates exclusive copy of current choices.
Assign
(self, a)¶Assigns choices data, using reference counting.
To create a real copy, use Copy
member function instead.
Parameters: | a (wx.propgrid.PGChoices) – |
---|
AssignData
(self, data)¶Assigns data from another set of choices.
Parameters: | data (wx.propgrid.PGChoicesData) – |
---|
Clear
(self)¶Deletes all items.
Copy
(self)¶Returns a real copy of the choices.
Return type: | wx.propgrid.PGChoices |
---|
GetCount
(self)¶Returns number of items.
Return type: | int |
---|
GetIndicesForStrings
(self, strings, unmatched=None)¶Returns array of indices matching given strings.
Unmatching strings are added to ‘unmatched’, if not None
.
Parameters: |
|
---|---|
Return type: | list of integers |
GetLabel
(self, ind)¶Returns label of item.
Parameters: | ind (int) – |
---|---|
Return type: | string |
GetLabels
(self)¶Returns array of choice labels.
Return type: | list of strings |
---|
GetValue
(self, ind)¶Returns value of item;.
Parameters: | ind (int) – |
---|---|
Return type: | int |
GetValuesForStrings
(self, strings)¶Returns array of values matching the given strings.
Unmatching strings result in wx.propgrid.PG_INVALID_VALUE
entry in array.
Parameters: | strings (list of strings) – |
---|---|
Return type: | list of integers |
Index
(self, *args, **kw)¶Index (self, label)
Returns index of item with given label.
Parameters: | label (string) – |
---|---|
Return type: | int |
Index (self, val)
Returns index of item with given value.
Parameters: | val (int) – |
---|---|
Return type: | int |
Insert
(self, *args, **kw)¶Insert (self, label, index, value=PG_INVALID_VALUE)
Inserts single item.
Parameters: |
|
---|---|
Return type: |
Insert (self, entry, index)
Inserts a single item with full entry information.
Parameters: |
|
---|---|
Return type: |
IsOk
(self)¶Returns False
if this is a constant empty set of choices, which should not be modified.
Return type: | bool |
---|
Item
(self, i)¶Returns item at given index.
Parameters: | i (int) – |
---|---|
Return type: | wx.propgrid.PGChoiceEntry |
RemoveAt
(self, nIndex, count=1)¶Removes count items starting at position nIndex.
Parameters: |
|
---|
Set
(self, *args, **kw)¶Sets contents from lists of strings and values.
Set (self, labels, values=None)
Parameters: |
|
---|
Set (self, labels, values=[])
Parameters: |
|
---|
__getitem__
(self, index)¶Returns a reference to a :class:PGChoiceEntry using Python list syntax.
__len__
(self)¶