Has dropdown list of wxWidgets system colours. More...
#include <advprops.h>
Public Member Functions | |
virtual wxString | ColourToString (const wxColour &col, int index) const |
Override in derived class to customize how colours are printed as strings. | |
virtual bool | DoSetAttribute (const wxString &name, wxVariant &value) |
Special handling for attributes of this property. | |
virtual wxColour | GetColour (int index) const |
Default is to use wxSystemSettings::GetColour(index). | |
virtual int | GetCustomColourIndex () const |
Returns index of entry that triggers colour picker dialog (default is last). | |
wxColourPropertyValue | GetVal (const wxVariant *pVariant=NULL) const |
virtual wxString | GetValueAsString (int argFlags=0) const |
Returns text representation of property's value. | |
virtual bool | IntToValue (wxVariant &variant, int number, int argFlags=0) const |
Converts 'number' (including choice selection) into proper value 'variant'. | |
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 bool | OnEvent (wxPropertyGrid *propgrid, wxWindow *primary, wxEvent &event) |
Events received by editor widgets are processed here. | |
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. | |
bool | QueryColourFromUser (wxVariant &variant) const |
virtual bool | StringToValue (wxVariant &variant, const wxString &text, int argFlags=0) const |
Converts 'text' into proper value 'variant'. | |
wxSystemColourProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, const wxColourPropertyValue &value=wxColourPropertyValue()) | |
Protected Member Functions | |
int | ColToInd (const wxColour &colour) const |
virtual wxVariant | DoTranslateVal (wxColourPropertyValue &v) const |
void | Init (int type, const wxColour &colour) |
wxVariant | TranslateVal (int type, const wxColour &colour) const |
wxVariant | TranslateVal (wxColourPropertyValue &v) const |
wxSystemColourProperty (const wxString &label, const wxString &name, const wxChar **labels, const long *values, wxPGChoices *choicesCache, const wxColour &value) | |
wxSystemColourProperty (const wxString &label, const wxString &name, const wxChar **labels, const long *values, wxPGChoices *choicesCache, const wxColourPropertyValue &value) |
Has dropdown list of wxWidgets system colours.
Value used is of wxColourPropertyValue type.
virtual bool wxSystemColourProperty::DoSetAttribute | ( | const wxString & | name, | |
wxVariant & | value | |||
) | [virtual] |
Special handling for attributes of this property.
If returns false, then the attribute will be automatically stored in m_attributes.
Default implementation simply returns false.
Reimplemented from wxPGProperty.
virtual wxColour wxSystemColourProperty::GetColour | ( | int | index | ) | const [virtual] |
Default is to use wxSystemSettings::GetColour(index).
Override to use custom colour tables etc.
virtual wxString wxSystemColourProperty::GetValueAsString | ( | int | argFlags = 0 |
) | const [virtual] |
Returns text representation of property's value.
Generally this function should not be called from the application code. Instead, call GetValueString().
argFlags | If wxPG_FULL_VALUE is set, returns complete, storable string value instead of displayable. If wxPG_EDITABLE_VALUE is set, returns string value that must be editable in textctrl. If wxPG_COMPOSITE_FRAGMENT is set, returns text that is appropriate to display as a part of composite property string value. |
Reimplemented from wxBaseEnumProperty.
virtual bool wxSystemColourProperty::IntToValue | ( | wxVariant & | value, | |
int | number, | |||
int | argFlags = 0 | |||
) | const [virtual] |
Converts 'number' (including choice selection) into proper value 'variant'.
Returns true if new (different than m_value) value could be interpreted from the integer.
argFlags | If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable |
Reimplemented from wxBaseEnumProperty.
virtual void wxSystemColourProperty::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 bool wxSystemColourProperty::OnEvent | ( | wxPropertyGrid * | propgrid, | |
wxWindow * | wnd_primary, | |||
wxEvent & | event | |||
) | [virtual] |
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, should be handled here. Also, if custom handling for regular events is desired, then that can also be done (for example, wxSystemColourProperty custom handles wxEVT_COMMAND_CHOICE_SELECTED).
If the event causes value to be changed, wxPropertyGrid::ValueChangeInEvent(value) should be used.
event | Associated wxEvent. |
Should | return true if any changes in value should be reported. |
Reimplemented from wxPGProperty.
virtual wxSize wxSystemColourProperty::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 wxSystemColourProperty::OnSetValue | ( | ) | [virtual] |
This virtual function is called after m_value has been set.
Reimplemented from wxBaseEnumProperty.
virtual bool wxSystemColourProperty::StringToValue | ( | wxVariant & | variant, | |
const wxString & | text, | |||
int | argFlags = 0 | |||
) | const [virtual] |
Converts 'text' into proper value 'variant'.
Returns true if new (different than m_value) value could be interpreted from the text.
argFlags | If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable one (they may be different). If wxPG_COMPOSITE_FRAGMENT is set, text is interpreted as a part of composite property string value (as generated by GetValueAsString() called with this same flag). |
Reimplemented from wxBaseEnumProperty.