Property representing image file(name). More...
#include <advprops.h>
Public Member Functions | |
virtual void | OnCustomPaint (wxDC &dc, const wxRect &rect, wxPGPaintData &paintdata) |
Override to paint an image in front of the property value text or drop-down list item (but only if wxPGProperty::OnMeasureImage is overridden as well). | |
virtual wxSize | OnMeasureImage (int item) const |
Returns size of the custom painted image in front of property. | |
virtual void | OnSetValue () |
This virtual function is called after m_value has been set. | |
wxImageFileProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, const wxString &value=wxEmptyString) | |
Protected Attributes | |
wxBitmap * | m_pBitmap |
wxImage * | m_pImage |
Property representing image file(name).
virtual void wxImageFileProperty::OnCustomPaint | ( | wxDC & | dc, | |
const wxRect & | rect, | |||
wxPGPaintData & | paintdata | |||
) | [virtual] |
Override to paint an image in front of the property value text or drop-down list item (but only if wxPGProperty::OnMeasureImage is overridden as well).
If property's OnMeasureImage() returns size that has height != 0 but less than row height ( < 0 has special meanings), wxPropertyGrid 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 wxPG_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.
dc | wxDC to paint on. | |
rect | Box reserved for custom graphics. Includes surrounding rectangle, if any. If x is < 0, then this is a measure item call (see above). | |
paintdata | wxPGPaintData structure with much useful data. |
Reimplemented from wxPGProperty.
virtual wxSize wxImageFileProperty::OnMeasureImage | ( | int | item | ) | const [virtual] |
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 | Normally -1, but can be an index to the property's list of items. |
Reimplemented from wxPGProperty.
virtual void wxImageFileProperty::OnSetValue | ( | ) | [virtual] |
This virtual function is called after m_value has been set.
Reimplemented from wxFileProperty.