phoenix_title wx.propgrid.PGChoices

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.


class_hierarchy Class Hierarchy

Inheritance diagram for class PGChoices:

method_summary Methods Summary

__init__

Default constructor.

Add

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

AddAsSorted

Adds a 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.

EnsureData

ExtractData

Changes ownership of data to you.

GetCount

Returns number of items.

GetData

Returns data, increases refcount.

GetDataPtr

Returns plain data ptr - no refcounting stuff is done.

GetId

Gets an number identifying this list.

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 a 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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

__getitem__

Returns a reference to a :class:PGChoiceEntry using Python list syntax.

__len__


property_summary Properties Summary

Count

See GetCount

Data

See GetData

DataPtr

See GetDataPtr

Id

See GetId

Labels

See GetLabels


api Class API

class 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.


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Default constructor.

Return type:

None



__init__ (self, a : PGChoices)

Copy constructor, uses reference counting.

To create a real copy, use Copy member function instead.

Parameters:

a (wx.propgrid.PGChoices) –

Return type:

None



__init__ (self, labels : List[str], values: List[int]=[])

Constructor.

Parameters:
  • 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.

Return type:

None



__init__ (self, data : PGChoicesData)

Simple interface constructor.

Parameters:

data (wx.propgrid.PGChoicesData) –

Return type:

None





Add(self, *args, **kw)

overload Overloaded Implementations:



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.

Parameters:
  • arr (list of strings) –

  • arrint (list of integers) –

Return type:

None



Add (self, label : str, value: int=PG_INVALID_VALUE)

Adds a single choice item.

Parameters:
  • label (string) – Label for added choice.

  • value (int) – Value for added choice. If unspecified, index is used.

Return type:

wx.propgrid.PGChoiceEntry



Add (self, label : str, bitmap : Bitmap, value: int=PG_INVALID_VALUE)

Adds a single item, with bitmap.

Parameters:
  • label (string) –

  • bitmap (wx.Bitmap) –

  • value (int) –

Return type:

wx.propgrid.PGChoiceEntry



Add (self, entry : PGChoiceEntry)

Adds a single item with full entry information.

Parameters:

entry (wx.propgrid.PGChoiceEntry) –

Return type:

wx.propgrid.PGChoiceEntry





AddAsSorted(self, label : str, value: int=PG_INVALID_VALUE)

Adds a single item, sorted.

Parameters:
  • label (string) –

  • value (int) –

Return type:

wx.propgrid.PGChoiceEntry



AllocExclusive(self)

Creates exclusive copy of current choices.

Return type:

None



Assign(self, a : PGChoices)

Assigns choices data, using reference counting.

To create a real copy, use Copy member function instead.

Parameters:

a (wx.propgrid.PGChoices) –

Return type:

None



AssignData(self, data : PGChoicesData)

Assigns data from another set of choices.

Parameters:

data (wx.propgrid.PGChoicesData) –

Return type:

None



Clear(self)

Deletes all items.

Return type:

None



Copy(self)

Returns a real copy of the choices.

Return type:

wx.propgrid.PGChoices



EnsureData(self)
Return type:

None



ExtractData(self)

Changes ownership of data to you.

Return type:

wx.propgrid.PGChoicesData



GetCount(self)

Returns number of items.

Return type:

int



GetData(self)

Returns data, increases refcount.

Return type:

wx.propgrid.PGChoicesData



GetDataPtr(self)

Returns plain data ptr - no refcounting stuff is done.

Return type:

wx.propgrid.PGChoicesData



GetId(self)

Gets an number identifying this list.

Return type:

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.

Parameters:
  • strings (list of strings) –

  • unmatched (list of strings) –

Return type:

List[int]



GetLabel(self, ind : int)

Returns label of item.

Parameters:

ind (int) –

Return type:

str



GetLabels(self)

Returns array of choice labels.

Return type:

List[str]



GetValue(self, ind : int)

Returns value of item.

Parameters:

ind (int) –

Return type:

int



GetValuesForStrings(self, strings : List[str])

Returns array of values matching the given strings.

Unmatching strings result in PG_INVALID_VALUE entry in array.

Parameters:

strings (list of strings) –

Return type:

List[int]



Index(self, *args, **kw)

overload Overloaded Implementations:



Index (self, label : str)

Returns index of item with given label.

Parameters:

label (string) –

Return type:

int



Index (self, val : int)

Returns index of item with given value.

Parameters:

val (int) –

Return type:

int





Insert(self, *args, **kw)

overload Overloaded Implementations:



Insert (self, label : str, index : int, value: int=PG_INVALID_VALUE)

Inserts a single item.

Parameters:
  • label (string) –

  • index (int) –

  • value (int) –

Return type:

wx.propgrid.PGChoiceEntry



Insert (self, entry : PGChoiceEntry, index : int)

Inserts a single item with full entry information.

Parameters:
Return type:

wx.propgrid.PGChoiceEntry





IsOk(self)

Returns False if this is a constant empty set of choices, which should not be modified.

Return type:

bool



Item(self, i : int)

Returns item at given index.

Parameters:

i (int) –

Return type:

wx.propgrid.PGChoiceEntry



RemoveAt(self, nIndex : int, count: int=1)

Removes count items starting at position nIndex.

Parameters:
  • nIndex (int) –

  • count (int) –

Return type:

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.

Parameters:
  • labels (list of strings) –

  • values (list of integers) –

Return type:

None



__getitem__(self, index)

Returns a reference to a :class:PGChoiceEntry using Python list syntax.



__len__(self)

Properties

Count

See GetCount



Data

See GetData



DataPtr

See GetDataPtr



Id

See GetId



Labels

See GetLabels