Most of the shared property manipulation interface shared by wx.propgrid.PropertyGrid, wx.propgrid.PropertyGridPage, and wx.propgrid.PropertyGridManager is defined in this class.
Note
In separate wx.propgrid.PropertyGrid component this class was known as PropertyContainerMethods.
wx.propgrid.PropertyGridInterface’s property operation member functions all accept a special PGPropArg id argument, using which you can refer to properties either by their pointer (for performance) or by their name (for conveniency).
wx.propgrid.PropertyGrid, wx.propgrid.PropertyGridManager, wx.propgrid.PropertyGridPage
Appends property to the list. |
|
Same as |
|
“Clears properties and re-fills to match members and values of |
|
In order to add new items into a property with private children (for instance, wx.propgrid.FlagsProperty), you need to call this method. |
|
Changes value of a property, as if by user. |
|
Deletes all properties. |
|
Resets modified status of all properties. |
|
Clears current selection, if any. |
|
Collapses given category or property with children. |
|
Collapses all items that can be collapsed. |
|
Removes and deletes a property and any children. |
|
Disables a property. |
|
Add built-in properties to the map. |
|
Map pg value type ids to getter methods. |
|
Returns |
|
Enables or disables property. |
|
Called after population of property with fixed children has finished. |
|
Expands given category or property with children. |
|
Expands all items that can be expanded. |
|
Returns auto-resize proportion of the given column. |
|
Returns editor pointer of editor with given name. |
|
Returns id of first item that matches given criteria. |
|
Returns id of first child of given property. |
|
Returns iterator class instance. |
|
Adds to targetArr pointers to properties that have given flags set. |
|
Returns pointer to a property with given name (case-sensitive). |
|
Returns value of given attribute. |
|
Returns map-like storage of property’s attributes. |
|
Returns background colour of first cell of a property. |
|
Returns first property which label matches given string. |
|
Returns pointer to a property with given name (case-sensitive). |
|
|
|
Returns pointer of property’s nearest parent category. |
|
Returns property’s editor. |
|
Returns help string associated with a property. |
|
Returns property’s custom value image ( |
|
Returns label of a property. |
|
Returns property’s name, by which it is globally accessible. |
|
Returns parent item of a property. |
|
Returns text colour of first cell of a property. |
|
Returns validator of a property as a reference, which you can pass to any number of SetPropertyValidator. |
|
Returns property’s value as Variant . |
|
Return’s property’s value as ArrayInt. |
|
Returns property’s value as list of strings . |
|
Returns property’s value as bool. |
|
Return’s property’s value as wx.DateTime. |
|
Returns property’s value as double-precision floating point number. |
|
Returns property’s value as integer. |
|
Returns property’s value as integer. |
|
Returns property’s value as native signed 64-bit integer. |
|
Returns property’s value as String . |
|
Returns property’s value as integer. |
|
Returns property’s value as native 64-bit integer. |
|
Returns all property values in the grid. |
|
Returns a pythonic property iterator for a single PropertyGrid |
|
Similar to GetVIterator but returns a pythonic iterator. |
|
Returns list of currently selected properties. |
|
Returns currently selected property. |
|
Similar to |
|
Hides or reveals a property. |
|
Initializes all property types. |
|
Inserts property to the property container. |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Disables (limit = |
|
Registers Python type/class to property mapping. |
|
If state is shown in its grid, refresh it now. |
|
Initializes additional property editors (SpinCtrl etc.). |
|
Register a new editor, either an instance or a class. |
|
Removes a property. |
|
Replaces property with id with newly created one. |
|
Restores user-editable state. |
|
Used to acquire user-editable state (selected property, expanded properties, scrolled position, splitter positions). |
|
Sets strings listed in the choice dropdown of a wx.propgrid.BoolProperty. |
|
Set proportion of an auto-stretchable column. |
|
Sets value (Variant &) of a property. |
|
Sets an attribute for this property. |
|
Sets property attribute for all applicable properties. |
|
Sets background colour of given property. |
|
Sets text, bitmap, and colours for given column’s cell. |
|
Resets text and background colours of given property. |
|
Sets editor for a property. |
|
Associates the help string with property. |
|
Set wx.Bitmap taken from wx.BitmapBundle in front of the value. |
|
Sets label of a property. |
|
Sets maximum length of text in property text editor. |
|
Sets name of a property. |
|
Sets property (and, recursively, its children) to have read-only value. |
|
Sets text colour of given property. |
|
Sets validator of a property. |
|
Sets value (floating point) of a property. |
|
Sets value (String ) of a property. |
|
Sets property’s value to unspecified. |
|
Sets property values from a dictionary. |
|
Adjusts how wx.propgrid.PropertyGrid behaves when invalid value is entered in a property. |
|
Sorts all properties recursively. |
|
Sorts children of a property. |
|
This attribute is a pythonic iterator over all items in this |
|
This attribute is a pythonic iterator over all properties in |
See |
|
See |
wx.propgrid.
PropertyGridInterface
(object)¶Most of the shared property manipulation interface shared by PropertyGrid, PropertyGridPage, and PropertyGridManager is defined in this class.
Append
(self, property)¶Appends property to the list.
wx.propgrid.PropertyGrid assumes ownership of the object. Becomes child of most recently added category.
property (wx.propgrid.PGProperty) –
Note
wx.propgrid.PropertyGrid takes the ownership of the property pointer.
If appending a category with name identical to a category already in the wx.propgrid.PropertyGrid, then newly created category is deleted, and most recently added category (under which properties are appended) is set to the one with same name. This allows easier adding of items to same categories in multiple passes.
Does not automatically redraw the control, so you may need to call Refresh() when calling this function after control has been shown for the first time.
This functions deselects selected property, if any. Validation failure option wx.propgrid.PG_VFB_STAY_IN_PROPERTY
is not respected, i.e. selection is cleared even if editor had invalid value.
AppendIn
(self, id, newProperty)¶Same as Append
, but appends under given parent property.
id (wx.propgrid.PGPropArgCls) – Name or pointer to parent property.
newProperty (wx.propgrid.PGProperty) – Property to be added.
AutoFill
(self, obj, parent=None)¶“Clears properties and re-fills to match members and values of the given object or dictionary obj.
BeginAddChildren
(self, id)¶In order to add new items into a property with private children (for instance, wx.propgrid.FlagsProperty), you need to call this method.
After populating has been finished, you need to call EndAddChildren
.
id (wx.propgrid.PGPropArgCls) –
See also
ChangePropertyValue
(self, id, newValue)¶Changes value of a property, as if by user.
Use this instead of SetPropertyValue
if you need the value to run through validation process, and also send wxEVT_PG_CHANGED
.
id (wx.propgrid.PGPropArgCls) –
newValue (PGVariant) –
bool
Returns True
if value was successfully changed.
Note
Since this function sends wxEVT_PG_CHANGED
, it should not be called from EVT_PG_CHANGED
handler.
Clear
(self)¶Deletes all properties.
Note
This functions deselects selected property, if any. Validation failure option wx.propgrid.PG_VFB_STAY_IN_PROPERTY
is not respected, i.e. selection is cleared even if editor had invalid value.
ClearModifiedStatus
(self)¶Resets modified status of all properties.
ClearSelection
(self, validation=False)¶Clears current selection, if any.
validation (bool) – If set to False
, deselecting the property will always work, even if its editor had invalid value in it.
bool
Returns True
if successful or if there was no selection. May fail if validation was enabled and active editor had invalid value.
Note
In wxWidgets 2.9 and later, this function no longer sends PG_EVT_SELECTED
.
Collapse
(self, id)¶Collapses given category or property with children.
id (wx.propgrid.PGPropArgCls) –
bool
Returns True
if actually collapsed.
Note
This function may deselect selected property, if any. Validation failure option wx.propgrid.PG_VFB_STAY_IN_PROPERTY
is not respected, i.e. selection is cleared even if editor had invalid value.
CollapseAll
(self)¶Collapses all items that can be collapsed.
bool
Return False
if failed (may fail if editor value cannot be validated).
Note
This functions clears selection. Validation failure option wx.propgrid.PG_VFB_STAY_IN_PROPERTY
is not respected, i.e. selection is cleared even if editor had invalid value.
DeleteProperty
(self, id)¶Removes and deletes a property and any children.
id (wx.propgrid.PGPropArgCls) – Pointer or name of a property.
This functions deselects selected property, if any. Validation failure option wx.propgrid.PG_VFB_STAY_IN_PROPERTY
is not respected, i.e. selection is cleared even if editor had invalid value.
Note
If you delete a property in a wx.propgrid.PropertyGrid event handler, the actual deletion is postponed until the next idle event.
DisableProperty
(self, id)¶Disables a property.
id (wx.propgrid.PGPropArgCls) –
bool
Note
Property is refreshed with new settings.
See also
DoDefaultTypeMappings
(self)¶Add built-in properties to the map.
DoDefaultValueTypeMappings
(self)¶Map pg value type ids to getter methods.
EditorValidate
(self)¶Returns True
if all property grid data changes have been committed.
Usually only returns False
if value in active editor has been invalidated by a wx.Validator.
bool
EnableProperty
(self, id, enable=True)¶Enables or disables property.
Disabled property usually appears as having grey text.
id (wx.propgrid.PGPropArgCls) – Name or pointer to a property.
enable (bool) – If False
, property is disabled instead.
bool
EndAddChildren
(self, id)¶Called after population of property with fixed children has finished.
id (wx.propgrid.PGPropArgCls) –
See also
Expand
(self, id)¶Expands given category or property with children.
id (wx.propgrid.PGPropArgCls) –
bool
Returns True
if actually expanded.
Note
This function may deselect selected property, if any. Validation failure option wx.propgrid.PG_VFB_STAY_IN_PROPERTY
is not respected, i.e. selection is cleared even if editor had invalid value.
ExpandAll
(self, expand=True)¶Expands all items that can be expanded.
expand (bool) –
bool
Note
This functions clears selection. Validation failure option wx.propgrid.PG_VFB_STAY_IN_PROPERTY
is not respected, i.e. selection is cleared even if editor had invalid value.
GetColumnProportion
(self, column)¶Returns auto-resize proportion of the given column.
column (int) –
int
See also
GetEditorByName
(editorName)¶Returns editor pointer of editor with given name.
editorName (string) –
GetFirst
(self, flags=PG_ITERATE_ALL)¶Returns id of first item that matches given criteria.
flags (int) – See wx.propgrid.PG_ITERATOR_FLAGS.
GetFirstChild
(self, id)¶Returns id of first child of given property.
id (wx.propgrid.PGPropArgCls) –
Note
Does not return private children!
GetIterator
(self, *args, **kw)¶GetIterator (self, flags=PG_ITERATE_DEFAULT, firstProp=None)
Returns iterator class instance.
flags (int) – See wx.propgrid.PG_ITERATOR_FLAGS. Value wx.propgrid.PG_ITERATE_DEFAULT
causes iteration over everything except private child properties.
firstProp (wx.propgrid.PGProperty) – Property to start iteration from. If None
, then first child of root is used.
GetIterator (self, flags, startPos)
Returns iterator class instance.
flags (int) – See wx.propgrid.PG_ITERATOR_FLAGS. Value wx.propgrid.PG_ITERATE_DEFAULT
causes iteration over everything except private child properties.
startPos (int) – Either wx.TOP
or wx.BOTTOM
. wx.TOP
will indicate that iterations start from the first property from the top, and wx.BOTTOM
means that the iteration will instead begin from bottommost valid item.
GetPropertiesWithFlag
(self, targetArr, flags, inverse=False, iterFlags=PG_ITERATE_PROPERTIES|PG_ITERATE_HIDDEN|PG_ITERATE_CATEGORIES)¶Adds to targetArr pointers to properties that have given flags set.
However, if inverse is set to True
, then only properties without given flags are stored.
targetArr (ArrayPGProperty) – Array of pointers to properties in which found properties are stored.
flags (PGProperty.FlagType) – Property flags to use.
inverse (bool) – If False
, properties that have given flags are stored, otherwise there are stored only properties without given flags.
iterFlags (int) – Iterator flags to use. Default is everything expect private children. See wx.propgrid.PG_ITERATOR_FLAGS.
GetProperty
(self, name)¶Returns pointer to a property with given name (case-sensitive).
If there is no property with such name, None
pointer is returned.
name (string) –
Note
Properties which have non-category, non-root parent cannot be accessed globally by their name. Instead, use “<property>.<subproperty>” instead of “<subproperty>”.
GetPropertyAttribute
(self, id, attrName)¶Returns value of given attribute.
If none found, returns NullVariant.
id (wx.propgrid.PGPropArgCls) –
attrName (string) –
PGVariant
GetPropertyAttributes
(self, id)¶Returns map-like storage of property’s attributes.
id (wx.propgrid.PGPropArgCls) –
Note
Note that if extra style PG_EX_WRITEONLY_BUILTIN_ATTRIBUTES
is set, then builtin-attributes are not included in the storage.
GetPropertyBackgroundColour
(self, id)¶Returns background colour of first cell of a property.
id (wx.propgrid.PGPropArgCls) –
Colour
GetPropertyByLabel
(self, label)¶Returns first property which label matches given string.
None
if none found. Note that this operation is very slow when compared to GetPropertyByName
.
label (string) –
GetPropertyByName
(self, *args, **kw)¶GetPropertyByName (self, name)
Returns pointer to a property with given name (case-sensitive).
If there is no property with such name, None
pointer is returned.
name (string) –
Note
Properties which have non-category, non-root parent cannot be accessed globally by their name. Instead, use “<property>.<subproperty>” instead of “<subproperty>”.
GetPropertyByName (self, name, subname)
Returns child property subname of property name.
Same as calling GetPropertyByName(“name.subname”), albeit slightly faster.
name (string) –
subname (string) –
GetPropertyByNameA
(self, name)¶GetPropertyByName
with assertion error message.
name (string) –
GetPropertyCategory
(self, id)¶Returns pointer of property’s nearest parent category.
If no category found, returns None
.
id (wx.propgrid.PGPropArgCls) –
GetPropertyClientData
(self, p)¶GetPropertyEditor
(self, id)¶Returns property’s editor.
id (wx.propgrid.PGPropArgCls) –
GetPropertyHelpString
(self, id)¶Returns help string associated with a property.
id (wx.propgrid.PGPropArgCls) –
string
GetPropertyImage
(self, id)¶Returns property’s custom value image (None
of none).
id (wx.propgrid.PGPropArgCls) –
Bitmap
GetPropertyLabel
(self, id)¶Returns label of a property.
id (wx.propgrid.PGPropArgCls) –
string
GetPropertyName
(self, property)¶Returns property’s name, by which it is globally accessible.
property (wx.propgrid.PGProperty) –
string
GetPropertyParent
(self, id)¶Returns parent item of a property.
id (wx.propgrid.PGPropArgCls) –
GetPropertyTextColour
(self, id)¶Returns text colour of first cell of a property.
id (wx.propgrid.PGPropArgCls) –
Colour
GetPropertyValidator
(self, id)¶Returns validator of a property as a reference, which you can pass to any number of SetPropertyValidator.
id (wx.propgrid.PGPropArgCls) –
Validator
GetPropertyValue
(self, id)¶Returns property’s value as Variant .
If property value is unspecified, NullVariant is returned.
id (wx.propgrid.PGPropArgCls) –
PGVariant
GetPropertyValueAsArrayInt
(self, id)¶Return’s property’s value as ArrayInt.
id (wx.propgrid.PGPropArgCls) –
list of integers
GetPropertyValueAsArrayString
(self, id)¶Returns property’s value as list of strings .
id (wx.propgrid.PGPropArgCls) –
list of strings
GetPropertyValueAsBool
(self, id)¶Returns property’s value as bool.
id (wx.propgrid.PGPropArgCls) –
bool
GetPropertyValueAsDateTime
(self, id)¶Return’s property’s value as wx.DateTime.
id (wx.propgrid.PGPropArgCls) –
DateTime
GetPropertyValueAsDouble
(self, id)¶Returns property’s value as double-precision floating point number.
id (wx.propgrid.PGPropArgCls) –
float
GetPropertyValueAsInt
(self, id)¶Returns property’s value as integer.
id (wx.propgrid.PGPropArgCls) –
int
GetPropertyValueAsLong
(self, id)¶Returns property’s value as integer.
id (wx.propgrid.PGPropArgCls) –
long
GetPropertyValueAsLongLong
(self, id)¶Returns property’s value as native signed 64-bit integer.
id (wx.propgrid.PGPropArgCls) –
LongLong_t
GetPropertyValueAsString
(self, id)¶Returns property’s value as String .
If property does not use string value type, then its value is converted using wx.propgrid.PGProperty.GetValueAsString
.
id (wx.propgrid.PGPropArgCls) –
string
GetPropertyValueAsULong
(self, id)¶Returns property’s value as integer.
id (wx.propgrid.PGPropArgCls) –
int
GetPropertyValueAsULongLong
(self, id)¶Returns property’s value as native 64-bit integer.
id (wx.propgrid.PGPropArgCls) –
ULongLong_t
GetPropertyValues
(self, dict_=None, as_strings=False, inc_attributes=False, flags=PG_ITERATE_PROPERTIES)¶Returns all property values in the grid.
dict_ – A diftionary to fill with the property values. If not given, then a new one is created. The dict_ can be an object as well, in which case it’s __dict__ is used.
as_strings – if True, then string representations of values are fetched instead of native types. Useful for config and such.
inc_attributes – if True, then property attributes are added
in the form of "@<propname>@<attr>"
.
flags – Flags to pass to the iterator. See wx.propgrid.PG_ITERATOR_FLAGS.
A dictionary with values. It is always a dictionary, so if dict_ was an object with __dict__ attribute, then that attribute is returned.
GetPyIterator
(self, flags=PG_ITERATE_DEFAULT, firstProperty=None)¶Returns a pythonic property iterator for a single PropertyGrid
or page in PropertyGridManager . Arguments are same as for
GetIterator
.
The following example demonstrates iterating absolutely all items in a single grid:
iterator = propGrid.GetPyIterator(wx.propgrid.PG_ITERATE_ALL)
for prop in iterator:
print(prop)
GetPyVIterator
(self, flags=PG_ITERATE_DEFAULT)¶Similar to GetVIterator
but returns a pythonic iterator.
GetSelectedProperties
(self)¶Returns list of currently selected properties.
ArrayPGProperty
Note
ArrayPGProperty should be compatible with std.vector API.
GetSelection
(self)¶Returns currently selected property.
None
if none.
Note
When wx.propgrid.PG_EX_MULTIPLE_SELECTION
extra style is used, this member function returns the focused property, that is the one which can have active editor.
GetVIterator
(self, flags)¶Similar to GetIterator
, but instead returns wx.propgrid.PGVIterator instance, which can be useful for forward-iterating through arbitrary property containers.
flags (int) – See wx.propgrid.PG_ITERATOR_FLAGS.
HideProperty
(self, id, hide=True, flags=PG_RECURSE)¶Hides or reveals a property.
id (wx.propgrid.PGPropArgCls) – Name or pointer to a property.
hide (bool) – If True
, hides property, otherwise reveals it.
flags (int) – By default changes are applied recursively. Set this parameter wx.propgrid.PG_DONT_RECURSE
to prevent this.
bool
InitAllTypeHandlers
()¶Initializes all property types.
Causes references to most object files in the library, so calling this may cause significant increase in executable size when linking with static library.
Insert
(self, *args, **kw)¶Insert (self, priorThis, newProperty)
Inserts property to the property container.
priorThis (wx.propgrid.PGPropArgCls) – New property is inserted just prior to this. Available only in the first variant. There are two versions of this function to allow this parameter to be either an id or name to a property.
newProperty (wx.propgrid.PGProperty) – Pointer to the inserted property. wx.propgrid.PropertyGrid will take ownership of this object.
wx.propgrid.PropertyGrid takes the ownership of the property pointer.
While Append may be faster way to add items, make note that when both types of data storage (categoric and non-categoric) are active, Insert becomes even more slow. This is especially True
if current mode is non-categoric.
This functions deselects selected property, if any. Validation failure option wx.propgrid.PG_VFB_STAY_IN_PROPERTY
is not respected, i.e. selection is cleared even if editor had invalid value.
Example of use:
# append category
my_cat_id = thePropGrid.Append(wx.propgrid.PropertyCategory("My Category"))
...
# insert into category - using second variant
my_item_id1 = thePropGrid.Insert(my_cat_id, 0, wx.propgrid.StringProperty("My String 1"))
# insert before to first item - using first variant
my_item_id2 = thePropGrid.Insert(my_item_id, wx.propgrid.StringProperty("My String 2"))
Returns newProperty.
Insert (self, parent, index, newProperty)
Inserts property to the property container.
See the other overload for more details.
parent (wx.propgrid.PGPropArgCls) – New property is inserted under this category. Available only in the second variant. There are two versions of this function to allow this parameter to be either an id or name to a property.
index (int) – Index under category. Available only in the second variant. If index is < 0, property is appended in category.
newProperty (wx.propgrid.PGProperty) – Pointer to the inserted property. wx.propgrid.PropertyGrid will take ownership of this object.
Returns newProperty.
IsPropertyCategory
(self, id)¶Returns True
if property is a category.
id (wx.propgrid.PGPropArgCls) –
bool
IsPropertyEnabled
(self, id)¶Returns True
if property is enabled.
id (wx.propgrid.PGPropArgCls) –
bool
IsPropertyExpanded
(self, id)¶Returns True
if given property is expanded.
Naturally, always returns False
for properties that cannot be expanded.
id (wx.propgrid.PGPropArgCls) –
bool
IsPropertyModified
(self, id)¶Returns True
if property has been modified after value set or modify flag clear by software.
id (wx.propgrid.PGPropArgCls) –
bool
IsPropertySelected
(self, id)¶Returns True
if property is selected.
id (wx.propgrid.PGPropArgCls) –
bool
IsPropertyShown
(self, id)¶Returns True
if property is shown (i.e.
HideProperty
with True
not called for it).
id (wx.propgrid.PGPropArgCls) –
bool
IsPropertyValueUnspecified
(self, id)¶Returns True
if property value is set to unspecified.
id (wx.propgrid.PGPropArgCls) –
bool
LimitPropertyEditing
(self, id, limit=True)¶Disables (limit = True
) or enables (limit = False
) wx.TextCtrl editor of a property, if it is not the sole mean to edit the value.
id (wx.propgrid.PGPropArgCls) –
limit (bool) –
Note
Property is refreshed with new settings.
MapType
(self, class_, factory)¶Registers Python type/class to property mapping.
factory – Property builder function/class.
RefreshGrid
(self, state=None)¶If state is shown in its grid, refresh it now.
state (wx.propgrid.PropertyGridPageState) –
RefreshProperty
(self, p)¶p (wx.propgrid.PGProperty) –
Note
This function reselects the property and may cause excess flicker, so to just call Refresh() on a rect of single property, call DrawItem() instead.
RegisterAdditionalEditors
()¶Initializes additional property editors (SpinCtrl etc.).
Causes references to most object files in the library, so calling this may cause significant increase in executable size when linking with static library.
RegisterEditor
(self, editor, editorName=None)¶Register a new editor, either an instance or a class.
RemoveProperty
(self, id)¶Removes a property.
Does not delete the property object, but instead returns it.
id (wx.propgrid.PGPropArgCls) – Pointer or name of a property.
Note
Removed property cannot have any children.
ReplaceProperty
(self, id, property)¶Replaces property with id with newly created one.
For example, this code replaces existing property named “Flags” with one that will have different set of items:
pg.ReplaceProperty("Flags",
wx.propgrid.FlagsProperty("Flags", wx.propgrid.PG_LABEL, newItems))
id (wx.propgrid.PGPropArgCls) –
property (wx.propgrid.PGProperty) –
See also
RestoreEditableState
(self, src, restoreStates=AllStates)¶Restores user-editable state.
See also wx.propgrid.PropertyGridInterface.SaveEditableState
.
src (string) – String generated by SaveEditableState.
restoreStates (int) – Which parts to restore from source string. See list of editable state flags.
bool
Returns False
if there was problem reading the string.
Note
If some parts of state (such as scrolled or splitter position) fail to restore correctly, please make sure that you call this function after wx.propgrid.PropertyGrid size has been set (this may sometimes be tricky when sizers are used).
SaveEditableState
(self, includedStates=AllStates)¶Used to acquire user-editable state (selected property, expanded properties, scrolled position, splitter positions).
includedStates (int) – Which parts of state to include. See list of editable state flags.
string
SetBoolChoices
(trueChoice, falseChoice)¶Sets strings listed in the choice dropdown of a wx.propgrid.BoolProperty.
Defaults are “True” and “False”, so changing them to, say, “Yes” and “No” may be useful in some less technical applications.
trueChoice (string) –
falseChoice (string) –
SetColumnProportion
(self, column, proportion)¶Set proportion of an auto-stretchable column.
wx.propgrid.PG_SPLITTER_AUTO_CENTER
window style needs to be used to indicate that columns are auto- resizable.
column (int) –
proportion (int) –
bool
Returns False
on failure.
Note
You should call this for individual pages of wx.propgrid.PropertyGridManager (if used).
See also
SetPropVal
(self, id, value)¶Sets value (Variant &) of a property.
Same as SetPropertyValue, but accepts reference.
id (wx.propgrid.PGPropArgCls) –
value (PGVariant) –
SetPropertyAttribute
(self, id, attrName, value, argFlags=0)¶Sets an attribute for this property.
id (wx.propgrid.PGPropArgCls) – Name or pointer to a property.
attrName (string) – Text identifier of attribute. See PropertyGrid Property Attribute Identifiers.
value (PGVariant) – Value of attribute.
argFlags (long) – Optional. Use wx.propgrid.PG_RECURSE
to set the attribute to child properties recursively.
Note
Setting attribute’s value to NullVariant will simply remove it from property’s set of attributes.
Property is refreshed with new settings.
SetPropertyAttributeAll
(self, attrName, value)¶Sets property attribute for all applicable properties.
Be sure to use this method only after all properties have been added to the grid.
attrName (string) –
value (PGVariant) –
Note
Properties are refreshed with new settings.
SetPropertyBackgroundColour
(self, id, colour, flags=PG_RECURSE)¶Sets background colour of given property.
id (wx.propgrid.PGPropArgCls) – Property name or pointer.
colour (wx.Colour) – New background colour.
flags (int) – Default is wx.propgrid.PG_RECURSE
which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children.
Note
If category is tried to set recursively, only its children are affected.
Property is redrawn with new colour.
SetPropertyCell
(self, id, column, text="", bitmap=BitmapBundle(), fgCol=NullColour, bgCol=NullColour)¶Sets text, bitmap, and colours for given column’s cell.
id (wx.propgrid.PGPropArgCls) –
column (int) –
text (string) –
bitmap (wx.BitmapBundle) –
fgCol (wx.Colour) –
bgCol (wx.Colour) –
Note
You can set label cell by using column 0.
You can use wx.propgrid.PG_LABEL
as text to use default text for column.
SetPropertyClientData
(self, p, data)¶SetPropertyColoursToDefault
(self, id, flags=PG_DONT_RECURSE)¶Resets text and background colours of given property.
id (wx.propgrid.PGPropArgCls) – Property name or pointer.
flags (int) – Default is wx.propgrid.PG_DONT_RECURSE
which causes colour to be reset only for the property in question (for backward compatibility).
Note
If category is tried to set recursively, only its children are affected.
Property is redrawn with new colours.
SetPropertyEditor
(self, *args, **kw)¶SetPropertyEditor (self, id, editor)
Sets editor for a property.
id (wx.propgrid.PGPropArgCls) – Property name or pointer to a property.
editor (wx.propgrid.PGEditor) – For builtin editors, use PGEditor_X, where X is builtin editor’s name (TextCtrl, Choice, etc. see wx.propgrid.PGEditor documentation for full list).
wx.propgrid.PropertyGrid.RegisterEditorClass
.
SetPropertyEditor (self, id, editorName)
Sets editor control of a property.
As editor argument, use editor name string, such as “TextCtrl” or “Choice”.
id (wx.propgrid.PGPropArgCls) –
editorName (string) –
SetPropertyHelpString
(self, id, helpString)¶Associates the help string with property.
id (wx.propgrid.PGPropArgCls) –
helpString (string) –
Note
By default, text is shown either in the manager’s “description” text box or in the status bar. If extra window style wx.propgrid.PG_EX_HELP_AS_TOOLTIPS
is used, then the text will appear as a tooltip.
SetPropertyImage
(self, id, bmp)¶Set wx.Bitmap taken from wx.BitmapBundle in front of the value.
id (wx.propgrid.PGPropArgCls) –
bmp (wx.BitmapBundle) –
Note
Bitmap will be scaled to a size returned by wx.propgrid.PropertyGrid.GetImageSize
;
SetPropertyLabel
(self, id, newproplabel)¶Sets label of a property.
id (wx.propgrid.PGPropArgCls) –
newproplabel (string) –
Note
Properties under same parent may have same labels. However, property names must still remain unique.
SetPropertyMaxLength
(self, id, maxLen)¶Sets maximum length of text in property text editor.
id (wx.propgrid.PGPropArgCls) – Property name or pointer.
maxLen (int) – Maximum number of characters of the text the user can enter in the text editor. If it is 0, the length is not limited and the text can be as long as it is supported by the underlying native text control widget.
bool
Returns True
if maximum length was set.
See also
SetPropertyName
(self, id, newName)¶Sets name of a property.
id (wx.propgrid.PGPropArgCls) – Name or pointer of property which name to change.
newName (string) – New name for property.
SetPropertyReadOnly
(self, id, set=True, flags=PG_RECURSE)¶Sets property (and, recursively, its children) to have read-only value.
In other words, user cannot change the value in the editor, but they can still copy it.
id (wx.propgrid.PGPropArgCls) – Property name or pointer.
set (bool) – Use True
to enable read-only, False
to disable it.
flags (int) – By default changes are applied recursively. Set this parameter to wx.propgrid.PG_DONT_RECURSE
to prevent this.
Note
This is mainly for use with textctrl editor. Only some other editors fully support it.
Property is refreshed with new settings.
SetPropertyTextColour
(self, id, colour, flags=PG_RECURSE)¶Sets text colour of given property.
id (wx.propgrid.PGPropArgCls) – Property name or pointer.
colour (wx.Colour) – New text colour.
flags (int) – Default is wx.propgrid.PG_RECURSE
which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children.
Note
If category is tried to set recursively, only its children are affected.
Property is redrawn with new colour.
SetPropertyValidator
(self, id, validator)¶Sets validator of a property.
id (wx.propgrid.PGPropArgCls) –
validator (wx.Validator) –
SetPropertyValue
(self, *args, **kw)¶SetPropertyValue (self, id, value)
Sets value (floating point) of a property.
id (wx.propgrid.PGPropArgCls) –
value (float) –
SetPropertyValue (self, id, value)
Sets value (bool) of a property.
id (wx.propgrid.PGPropArgCls) –
value (bool) –
SetPropertyValue (self, id, value)
Sets value (string) of a property.
id (wx.propgrid.PGPropArgCls) –
value (string) –
SetPropertyValue (self, id, value)
Sets value (list of strings ) of a property.
id (wx.propgrid.PGPropArgCls) –
value (list of strings) –
SetPropertyValue (self, id, value)
Sets value ( wx.DateTime) of a property.
id (wx.propgrid.PGPropArgCls) –
value (wx.DateTime) –
SetPropertyValue (self, id, value)
Sets value (:ref:`wx.Object`&) of a property.
id (wx.propgrid.PGPropArgCls) –
value (wx.Object) –
SetPropertyValue (self, id, value)
Sets value (wxArrayInt&) of a property.
id (wx.propgrid.PGPropArgCls) –
value (list of integers) –
SetPropertyValue (self, id, value)
Sets value (Variant ) of a property.
id (wx.propgrid.PGPropArgCls) –
value (PGVariant) –
Note
Use ChangePropertyValue
instead if you need to run through validation process and send property change event.
SetPropertyValue (self, id, value)
Sets value (long integer) of a property.
id (wx.propgrid.PGPropArgCls) –
value (long) –
SetPropertyValueString
(self, id, value)¶Sets value (String ) of a property.
id (wx.propgrid.PGPropArgCls) –
value (string) –
Note
This method uses wx.propgrid.PGProperty.SetValueFromString
, which all properties should implement. This means that there should not be a type error, and instead the string is converted to property’s actual value type.
SetPropertyValueUnspecified
(self, id)¶Sets property’s value to unspecified.
If it has children (it may be category), then the same thing is done to them.
id (wx.propgrid.PGPropArgCls) –
SetPropertyValues
(self, dict_, autofill=False)¶Sets property values from a dictionary.
dict_ – the source of the property values to set, which can be either a dictionary or an object with a __dict__ attribute.
autofill – If True
, keys with not relevant properties are
auto-created. For more info, see :method:`AutoFill`.
Note
Keys starting with underscore are ignored. Attributes can be set with entries named like “@<propname>@<attr>”.
SetValidationFailureBehavior
(self, vfbFlags)¶Adjusts how wx.propgrid.PropertyGrid behaves when invalid value is entered in a property.
vfbFlags (int) – See PropertyGrid Validation Failure behaviour Flags for possible values.
Sort
(self, flags=0)¶Sorts all properties recursively.
flags (int) – This can contain any of the following options: wx.propgrid.PG_SORT_TOP_LEVEL_ONLY
: Only sort categories and their immediate children. Sorting done by wx.propgrid.PG_AUTO_SORT
option uses this.
See also
SortChildren
, wx.propgrid.PropertyGrid.SetSortFunction
SortChildren
(self, id, flags=0)¶Sorts children of a property.
id (wx.propgrid.PGPropArgCls) – Name or pointer to a property.
flags (int) – This can contain any of the following options: wx.propgrid.PG_RECURSE
: Sorts recursively.
See also
Sort
, wx.propgrid.PropertyGrid.SetSortFunction
_AutoFillMany
(self, cat, dict_)¶_AutoFillOne
(self, cat, k, v)¶_Items
(self)¶This attribute is a pythonic iterator over all items in this PropertyGrid property container, excluding only private child properties. Usage is simple:
for prop in propGrid.Items:
print(prop)
_Properties
(self)¶This attribute is a pythonic iterator over all properties in this PropertyGrid property container. It will only skip categories and private child properties. Usage is simple:
for prop in propGrid.Properties:
print(prop)
Properties
¶See _Properties