Property representing wxFont. More...
#include <advprops.h>
Public Member Functions | |
virtual void | ChildChanged (wxVariant &thisValue, int childIndex, wxVariant &childValue) const |
Called after value of a child property has been altered. | |
virtual wxString | GetValueAsString (int argFlags=0) const |
Returns text representation of property's value. | |
virtual bool | OnEvent (wxPropertyGrid *propgrid, wxWindow *primary, wxEvent &event) |
Events received by editor widgets are processed here. | |
virtual void | OnSetValue () |
This virtual function is called after m_value has been set. | |
virtual void | RefreshChildren () |
Refresh values of child properties. | |
wxFontProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, const wxFont &value=wxFont()) |
Property representing wxFont.
virtual void wxFontProperty::ChildChanged | ( | wxVariant & | thisValue, | |
int | childIndex, | |||
wxVariant & | childValue | |||
) | const [virtual] |
Called after value of a child property has been altered.
Note that this function is usually called at the time that value of this property, or given child property, is still pending for change.
Sample pseudo-code implementation:
void MyProperty::ChildChanged( wxVariant& thisValue, int childIndex, wxVariant& childValue ) const { // Acquire reference to actual type of data stored in variant // (TFromVariant only exists if wxPropertyGrid's wxVariant-macros were used to create // the variant class). T& data = TFromVariant(thisValue); // Copy childValue into data. switch ( childIndex ) { case 0: data.SetSubProp1( childvalue.GetLong() ); break; case 1: data.SetSubProp2( childvalue.GetString() ); break; ... } }
thisValue | Value of this property, that should be altered. | |
childIndex | Index of child changed (you can use Item(childIndex) to get). | |
childValue | Value of the child property. |
Reimplemented from wxPGProperty.
virtual wxString wxFontProperty::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 wxPGProperty.
virtual bool wxFontProperty::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 void wxFontProperty::OnSetValue | ( | ) | [virtual] |
This virtual function is called after m_value has been set.
Reimplemented from wxPGProperty.
virtual void wxFontProperty::RefreshChildren | ( | ) | [virtual] |
Refresh values of child properties.
Automatically called after value is set.
Reimplemented from wxPGProperty.