wx.propgrid.CursorProperty¶Property representing wx.Cursor.
Class Hierarchy¶
Inheritance diagram for class CursorProperty:
Methods Summary¶Override to paint an image in front of the property value text or drop-down list item (but only if |
|
Returns size of the custom painted image in front of property. |
|
Converts property value into a text representation. |
Class API¶Possible constructors:
CursorProperty(label=PG_LABEL, name=PG_LABEL, value=0) -> None
Property representing Cursor.
label (string)
name (string)
value (int)
None
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+rect.width) 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.
rect (wx.Rect) – Box reserved for custom graphics. Includes surrounding rectangle, if any. If x+width is < 0, then this is a measure item call (see above).
paintdata (wx.propgrid.PGPaintData) – wx.propgrid.PGPaintData structure with much useful data about painted item.
None
Note
You can actually exceed rect width, but if you do so then paintdata.m_drawnWidth must be set to the full width drawn in pixels.
Due to technical reasons, rect’s height will be default even if custom height was reported during measure call.
Brush is guaranteed to be default background colour. It has been already used to clear the background of area being painted. It can be modified.
Pen is guaranteed to be 1-wide ‘black’ (or whatever is the proper colour) pen for drawing framing rectangle. It can be changed as well.
See also
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.
item (int) – Normally -1, but can be an index to the property’s list of items.
Size
Note
Default behaviour is to return wx.Size, which means no image.
Default image width or height is indicated with dimension -1.
You can also return PG_DEFAULT_IMAGE_SIZE which equals DefaultSize.
Converts property value into a text representation.
value (PGVariant) – Value to be converted.
flags (PGPropValFormatFlags) – If wx.propgrid.PGPropValFormatFlags.Null (default value), then displayed string is returned. If wx.propgrid.PGPropValFormatFlags.FullValue is set, returns complete, storable string value instead of displayable. If wx.propgrid.PGPropValFormatFlags.EditableValue is set, returns string value that must be editable in textctrl. If wx.propgrid.PGPropValFormatFlags.CompositeFragment is set, returns text that is appropriate to display as a part of string property’s composite text representation.
str
Note
Default implementation calls GenerateComposedValue .