wxFontProperty Class Reference

#include <advprops.h>

Inheritance diagram for wxFontProperty:

wxPGProperty

List of all members.


Detailed Description

Property representing wxFont.

Public Member Functions

virtual void ChildChanged (wxVariant &thisValue, int childIndex, wxVariant &childValue) const
virtual wxString GetValueAsString (int argFlags=0) const
virtual bool OnEvent (wxPropertyGrid *propgrid, wxWindow *primary, wxEvent &event)
virtual void OnSetValue ()
virtual void RefreshChildren ()
 wxFontProperty (const wxString &label=wxPG_LABEL, const wxString &name=wxPG_LABEL, const wxFont &value=wxFont())

Member Function Documentation

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;
                ...
            }
        }

Parameters:
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.

Parameters:
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.
Remarks:
Default implementation returns string composed from text representations of child properties.

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.

Parameters:
event Associated wxEvent.
Return values:
Should return true if any changes in value should be reported.
Remarks:
  • If property uses choice control, and displays a dialog on some choice items, then it is preferred to display that dialog in IntToValue instead of OnEvent.

Reimplemented from wxPGProperty.

virtual void wxFontProperty::OnSetValue (  )  [virtual]

This virtual function is called after m_value has been set.

Remarks:
  • If m_value was set to Null variant (ie. unspecified value), OnSetValue() will not be called.
  • m_value may be of any variant type. Typically properties internally support only one variant type, and as such OnSetValue() provides a good opportunity to convert supported values into internal type.
  • Default implementation does nothing.

Reimplemented from wxPGProperty.

virtual void wxFontProperty::RefreshChildren (  )  [virtual]

Refresh values of child properties.

Automatically called after value is set.

Reimplemented from wxPGProperty.


The documentation for this class was generated from the following file:

Generated on Sun Nov 2 12:30:01 2008 for wxPropertyGrid by  doxygen 1.5.5