Has dropdown list of wxWidgets system colours.
Value used is of wx.propgrid.ColourPropertyValue type.
__init__ |
|
ColourToString |
Override in derived class to customize how colours are printed as strings. |
DoSetAttribute |
Reimplement this member function to add special handling for attributes of this property. |
GetColour |
Default is to use SystemSettings.GetColour(index). |
GetCustomColourIndex |
Returns index of entry that triggers colour picker dialog (default is last). |
GetVal |
|
IntToValue |
Converts integer (possibly a choice selection) into Variant value appropriate for this property. |
OnCustomPaint |
Override to paint an image in front of the property value text or drop-down list item (but only if wx.propgrid.PGProperty.OnMeasureImage is overridden as well). |
OnEvent |
Events received by editor widgets are processed here. |
OnMeasureImage |
Returns size of the custom painted image in front of property. |
OnSetValue |
This virtual function is called after m_value has been set. |
QueryColourFromUser |
|
StringToValue |
Converts text into Variant value appropriate for this property. |
ValueToString |
Converts property value into a text representation. |
wx.propgrid.
SystemColourProperty
(EnumProperty)¶Possible constructors:
SystemColourProperty(label=PG_LABEL, name=PG_LABEL,
value=ColourPropertyValue())
Has dropdown list of wxWidgets system colours.
__init__
(self, label=PG_LABEL, name=PG_LABEL, value=ColourPropertyValue())¶Parameters: |
|
---|
ColourToString
(self, col, index, argFlags=0)¶Override in derived class to customize how colours are printed as strings.
Parameters: |
|
---|---|
Return type: |
|
DoSetAttribute
(self, name, value)¶Reimplement this member function to add special handling for attributes of this property.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | Return |
Note
To actually set property attribute values from the application, use wx.propgrid.PGProperty.SetAttribute
instead.
GetColour
(self, index)¶Default is to use SystemSettings.GetColour(index).
Override to use custom colour tables etc.
Parameters: | index (int) – |
---|---|
Return type: | Colour |
GetCustomColourIndex
(self)¶Returns index of entry that triggers colour picker dialog (default is last).
Return type: | int |
---|
GetVal
(self, pVariant=None)¶Parameters: | pVariant (PGVariant) – |
---|---|
Return type: | wx.propgrid.ColourPropertyValue |
IntToValue
(self, variant, number, argFlags=0)¶Converts integer (possibly a choice selection) into Variant value appropriate for this property.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | Returns |
Note
OnCustomPaint
(self, dc, rect, paintdata)¶Override to paint an image in front of the property value text or drop-down list item (but only if wx.propgrid.PGProperty.OnMeasureImage
is overridden as well).
If property’s OnMeasureImage
returns size that has height != 0 but less than row height ( < 0 has special meanings), wx.propgrid.PropertyGrid calls this method to draw a custom image in a limited area in front of the editor control or value text/graphics, and if control has drop-down list, then the image is drawn there as well (even in the case OnMeasureImage
returned higher height than row height).
NOTE
: Following applies when OnMeasureImage
returns a “flexible” height ( using PG_FLEXIBLE_SIZE(W,H) macro), which implies variable height items: If rect.x is < 0, then this is a measure item call, which means that dc is invalid and only thing that should be done is to set paintdata.m_drawnHeight to the height of the image of item at index paintdata.m_choiceItem. This call may be done even as often as once every drop-down popup show.
Parameters: |
|
---|
Note
See also
OnEvent
(self, propgrid, wnd_primary, event)¶Events received by editor widgets are processed here.
Note that editor class usually processes most events. Some, such as button press events of TextCtrlAndButton class, can be handled here. Also, if custom handling for regular events is desired, then that can also be done (for example, wx.propgrid.SystemColourProperty custom handles wxEVT_CHOICE
to display colour picker dialog when ‘custom’ selection is made).
If the event causes value to be changed, SetValueInEvent
should be called to set the new value.
The parameter event is the associated wx.Event.
Parameters: |
|
---|
return True
if any changes in value should be reported.
Return type: | bool |
---|
Note
OnMeasureImage
(self, item)¶Returns size of the custom painted image in front of property.
This method must be overridden to return non-default value if OnCustomPaint is to be called.
Parameters: | item (int) – Normally -1, but can be an index to the property’s list of items. |
---|---|
Return type: | Size |
OnSetValue
(self)¶This virtual function is called after m_value has been set.
Note
OnSetValue
will not be called.OnSetValue
provides a good opportunity to convert supported values into internal type.QueryColourFromUser
(self, variant)¶Parameters: | variant (PGVariant) – |
---|---|
Return type: | bool |
StringToValue
(self, variant, text, argFlags=0)¶Converts text into Variant value appropriate for this property.
Parameters: |
|
---|---|
Return type: | bool |
You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behaviour).
Returns: | Returns True if resulting Variant value was different. |
---|
Note
Default implementation converts semicolon delimited tokens into child values. Only works for properties with children.
ValueToString
(self, value, argFlags=0)¶Converts property value into a text representation.
Parameters: |
|
---|---|
Return type: |
|
Note
Default implementation calls GenerateComposedValue
.
CustomColourIndex
¶