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.
Default constructor. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
|
Adds a single item, sorted. |
|
Creates exclusive copy of current choices. |
|
Assigns choices data, using reference counting. |
|
Assigns data from another set of choices. |
|
Deletes all items. |
|
Returns a real copy of the choices. |
|
Changes ownership of data to you. |
|
Returns number of items. |
|
Returns data, increases refcount. |
|
Returns plain data ptr - no refcounting stuff is done. |
|
Gets an number identifying this list. |
|
Returns array of indices matching given strings. |
|
Returns label of item. |
|
Returns array of choice labels. |
|
Returns value of item. |
|
Returns array of values matching the given strings. |
|
Returns index of item with given label. |
|
Inserts a single item. |
|
Returns |
|
Returns item at given index. |
|
Removes count items starting at position nIndex. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
|
Returns a reference to a :class:PGChoiceEntry using Python list syntax. |
|
See |
|
See |
|
See |
|
See |
|
See |
wx.propgrid.
PGChoices
(object)¶Possible constructors:
PGChoices() -> None
PGChoices(a : PGChoices) -> None
PGChoices(labels : List[str], values: List[int]=[]) -> None
PGChoices(data : PGChoicesData) -> None
Helper class for managing choices of PropertyGrid properties.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
None
__init__ (self, a : PGChoices)
Copy constructor, uses reference counting.
To create a real copy, use Copy
member function instead.
a (wx.propgrid.PGChoices) –
None
__init__ (self, labels : List[str], values: List[int]=[])
Constructor.
labels (list of strings) – Labels for choices.
values (list of integers) – Values for choices. If empty, indexes are used. Otherwise must have at least the same size as labels.
None
__init__ (self, data : PGChoicesData)
Simple interface constructor.
data (wx.propgrid.PGChoicesData) –
None
Add
(self, *args, **kw)¶Add (self, arr : List[str], arrint : List[int])
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
arr (list of strings) –
arrint (list of integers) –
None
Add (self, label : str, value: int=PG_INVALID_VALUE)
Adds a single choice item.
label (string) – Label for added choice.
value (int) – Value for added choice. If unspecified, index is used.
Add (self, label : str, bitmap : Bitmap, value: int=PG_INVALID_VALUE)
Adds a single item, with bitmap.
label (string) –
bitmap (wx.Bitmap) –
value (int) –
Add (self, entry : PGChoiceEntry)
Adds a single item with full entry information.
entry (wx.propgrid.PGChoiceEntry) –
AddAsSorted
(self, label : str, value: int=PG_INVALID_VALUE)¶Adds a single item, sorted.
label (string) –
value (int) –
AllocExclusive
(self)¶Creates exclusive copy of current choices.
None
Assign
(self, a : PGChoices)¶Assigns choices data, using reference counting.
To create a real copy, use Copy
member function instead.
a (wx.propgrid.PGChoices) –
None
AssignData
(self, data : PGChoicesData)¶Assigns data from another set of choices.
data (wx.propgrid.PGChoicesData) –
None
Clear
(self)¶Deletes all items.
None
Copy
(self)¶Returns a real copy of the choices.
EnsureData
(self)¶None
ExtractData
(self)¶Changes ownership of data to you.
GetCount
(self)¶Returns number of items.
int
GetData
(self)¶Returns data, increases refcount.
GetDataPtr
(self)¶Returns plain data ptr - no refcounting stuff is done.
GetId
(self)¶Gets an number identifying this list.
wx.IntPtr
GetIndicesForStrings
(self, strings : List[str], unmatched: Optional[List[str]]=None)¶Returns array of indices matching given strings.
Unmatching strings are added to ‘unmatched’, if not None
.
strings (list of strings) –
unmatched (list of strings) –
List[int]
GetLabel
(self, ind : int)¶Returns label of item.
ind (int) –
str
GetLabels
(self)¶Returns array of choice labels.
List[str]
GetValue
(self, ind : int)¶Returns value of item.
ind (int) –
int
GetValuesForStrings
(self, strings : List[str])¶Returns array of values matching the given strings.
Unmatching strings result in PG_INVALID_VALUE
entry in array.
strings (list of strings) –
List[int]
Index
(self, *args, **kw)¶Index (self, label : str)
Returns index of item with given label.
label (string) –
int
Index (self, val : int)
Returns index of item with given value.
val (int) –
int
Insert
(self, *args, **kw)¶Insert (self, label : str, index : int, value: int=PG_INVALID_VALUE)
Inserts a single item.
label (string) –
index (int) –
value (int) –
Insert (self, entry : PGChoiceEntry, index : int)
Inserts a single item with full entry information.
entry (wx.propgrid.PGChoiceEntry) –
index (int) –
IsOk
(self)¶Returns False
if this is a constant empty set of choices, which should not be modified.
bool
Item
(self, i : int)¶Returns item at given index.
i (int) –
RemoveAt
(self, nIndex : int, count: int=1)¶Removes count items starting at position nIndex.
nIndex (int) –
count (int) –
None
Set
(self, labels : List[str], values: List[int]=[])¶This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
labels (list of strings) –
values (list of integers) –
None
__getitem__
(self, index)¶Returns a reference to a :class:PGChoiceEntry using Python list syntax.
__len__
(self)¶DataPtr
¶See GetDataPtr