wxPGProperty Class Reference

wxPGProperty is base class for all wxPropertyGrid properties. More...

#include <propgrid.h>

Inheritance diagram for wxPGProperty:
Inheritance graph
[legend]

List of all members.

Public Types

typedef void * ClientDataType
typedef wxUint32 FlagType

Public Member Functions

wxPGCellAcquireCell (unsigned int column)
bool ActualIntToValue (wxVariant &variant, int number, int argFlags=0) const
bool ActualStringToValue (wxVariant &variant, const wxString &text, int argFlags=0) const
bool ActualValidateValue (wxVariant &value, wxPGValidationInfo &validationInfo) const
void AdaptListToValue (wxVariant &list, wxVariant *value) const
void AddPrivateChild (wxPGProperty *prop)
wxPGPropertyAppendChild (wxPGProperty *prop)
int AppendChoice (const wxString &label, int value=wxPG_INVALID_VALUE)
bool AreAllChildrenSpecified (wxVariant *pendingList=NULL) const
bool AreChildrenComponents () const
bool CanHaveExtraChildren () const
void ChangeFlag (FlagType flag, bool set)
virtual void ChildChanged (wxVariant &thisValue, int childIndex, wxVariant &childValue) const
void ClearFlag (FlagType flag)
void DeleteChildren ()
void DeleteChoice (int index)
virtual wxVariant DoGetAttribute (const wxString &name) const
virtual const wxPGEditorDoGetEditorClass () const
virtual wxValidator * DoGetValidator () const
virtual wxVariant DoGetValue () const
virtual bool DoSetAttribute (const wxString &name, wxVariant &value)
void Empty ()
void EnableCommonValue (bool enable=true)
void FixIndexesOfChildren (unsigned int starthere=0)
void GenerateComposedValue (wxString &text, int argFlags=0) const
unsigned int GetArrIndex () const
wxString GetAttribute (const wxString &name, const wxString &defVal) const
wxVariant GetAttribute (const wxString &name) const
double GetAttributeAsDouble (const wxString &name, double defVal) const
long GetAttributeAsLong (const wxString &name, long defVal) const
const wxPGAttributeStorageGetAttributes () const
wxVariant GetAttributesAsList () const
const wxString & GetBaseName () const
wxPGCellGetCell (unsigned int column) const
virtual wxPGCellRendererGetCellRenderer (int column) const
unsigned int GetChildCount () const
int GetChildrenHeight (int lh, int iMax=-1) const
unsigned int GetChoiceCount () const
virtual int GetChoiceInfo (wxPGChoiceInfo *choiceinfo)
const wxPGChoicesGetChoices () const
wxPGChoicesGetChoices ()
wxString GetChoiceString (unsigned int index)
const wxChar * GetClassName () const
ClientDataType GetClientData () const
const wxPGEditorGetColumnEditor (int column) const
int GetCommonValue () const
unsigned int GetCount () const
const wxPGChoiceEntryGetCurrentChoice () const
wxVariant GetDefaultValue () const
unsigned int GetDepth () const
int GetDisplayedCommonValueCount () const
wxString GetDisplayedString () const
const wxPGEditorGetEditorClass () const
virtual wxPGEditorDialogAdapterGetEditorDialog () const
FlagType GetFlags () const
wxString GetFlagsAsString (FlagType flagsMask) const
wxPropertyGridGetGrid () const
wxPropertyGridGetGridIfDisplayed () const
const wxString & GetHelpString () const
int GetImageOffset (int imageWidth) const
unsigned int GetIndexInParent () const
wxPGPropertyGetItemAtY (unsigned int y, unsigned int lh, unsigned int *nextItemY) const
const wxString & GetLabel () const
const wxPGPropertyGetLastVisibleSubItem () const
wxPGPropertyGetMainParent () const
int GetMaxLength () const
wxString GetName () const
wxPGCellGetOrCreateCell (unsigned int column)
wxPGPropertyGetParent () const
wxPropertyGridStateGetParentState () const
wxPGPropertyGetPropertyByName (const wxString &name) const
wxString GetType () const
wxVariant GetValue () const
virtual wxString GetValueAsString (int argFlags=0) const
wxBitmap * GetValueImage () const
const wxVariant & GetValueRef () const
wxVariant & GetValueRef ()
wxString GetValueString (int argFlags=0) const
wxString GetValueType () const
int GetY () const
FlagType HasFlag (FlagType flag) const
bool HasVisibleChildren () const
bool Hide (bool hide, int flags=wxPG_RECURSE)
int Index (const wxPGProperty *p) const
wxPGPropertyInsertChild (int index, wxPGProperty *childProperty)
int InsertChoice (const wxString &label, int index, int value=wxPG_INVALID_VALUE)
bool IsCategory () const
bool IsEnabled () const
bool IsExpanded () const
bool IsFlagSet (FlagType flag) const
bool IsRoot () const
bool IsSomeParent (wxPGProperty *candidate_parent) const
bool IsSubProperty () const
bool IsTextEditable () const
bool IsValueUnspecified () const
bool IsVisible () const
wxPGPropertyItem (unsigned int i) const
wxPGPropertyLast () const
virtual void OnCustomPaint (wxDC &dc, const wxRect &rect, wxPGPaintData &paintdata)
virtual bool OnEvent (wxPropertyGrid *propgrid, wxWindow *wnd_primary, wxEvent &event)
virtual wxSize OnMeasureImage (int item=-1) const
virtual void OnSetValue ()
virtual void OnValidationFailure (wxVariant &pendingValue)
bool PrepareValueForDialogEditing (wxPropertyGrid *propgrid)
bool RecreateEditor ()
virtual void RefreshChildren ()
void RefreshEditor ()
void SetAttribute (const wxString &name, wxVariant value)
void SetAttributes (const wxPGAttributeStorage &attributes)
void SetCell (int column, wxPGCell *cellObj)
bool SetChoices (const wxArrayString &labels, const wxArrayInt &values=wxPG_EMPTY_ARRAYINT)
bool SetChoices (wxPGChoices &choices)
void SetChoiceSelection (int newValue, const wxPGChoiceInfo &choiceInfo)
void SetChoicesExclusive ()
void SetClientData (ClientDataType clientData)
void SetCommonValue (int commonValue)
void SetDefaultValue (wxVariant &value)
void SetEditor (const wxString &editorName)
void SetEditor (const wxPGEditor *editor)
void SetExpanded (bool expanded)
void SetFlag (FlagType flag)
void SetFlagRecursively (FlagType flag, bool set)
void SetFlagsFromString (const wxString &str)
void SetHelpString (const wxString &helpString)
void SetLabel (const wxString &label)
bool SetMaxLength (int maxLen)
void SetName (const wxString &newName)
void SetValue (wxVariant value, wxVariant *pList=NULL, int flags=wxPG_SETVAL_REFRESH_EDITOR)
bool SetValueFromInt (long value, int flags=0)
bool SetValueFromString (const wxString &text, int flags=wxPG_PROGRAMMATIC_VALUE)
void SetValueImage (wxBitmap &bmp)
void SetValueInEvent (wxVariant value) const
void SetValueToUnspecified ()
void SetWasModified (bool set=true)
wxPGPropertyUpdateParentValues ()
FlagType UsesAutoUnspecified () const
 wxPGProperty (const wxString &label, const wxString &name)
 wxPGProperty ()
virtual ~wxPGProperty ()

Protected Member Functions

void AddChild (wxPGProperty *prop)
void AddChild2 (wxPGProperty *prop, int index=-1, bool correct_mode=true)
void DoEmpty ()
void DoSetName (const wxString &str)
wxString GetColumnText (unsigned int col) const
wxPGPropertyGetPropertyByNameWH (const wxString &name, unsigned int hintIndex) const
int GetY2 (int lh) const
void PrepareSubProperties ()
void SetParentalType (int flag)
void SetParentState (wxPropertyGridState *pstate)
void SubPropsChanged (int oldSelInd=-1)

Protected Attributes

unsigned int m_arrIndex
wxPGAttributeStorage m_attributes
unsigned char m_bgColIndex
wxArrayPtrVoid m_cells
wxArrayPtrVoid m_children
ClientDataType m_clientData
int m_commonValue
const wxPGEditorm_customEditor
unsigned char m_depth
unsigned char m_depthBgCol
unsigned char m_fgColIndex
FlagType m_flags
wxString m_helpString
wxString m_label
short m_maxLen
wxString m_name
wxPGPropertym_parent
wxPropertyGridStatem_parentState
wxVariant m_value
wxBitmap * m_valueBitmap

Private Member Functions

void Init (const wxString &label, const wxString &name)
void Init ()
virtual bool IntToValue (wxVariant &value, int number, int argFlags=0) const
virtual bool StringToValue (wxVariant &variant, const wxString &text, int argFlags=0) const
virtual bool ValidateValue (wxVariant &value, wxPGValidationInfo &validationInfo) const

Friends

class wxPropertyGrid
class wxPropertyGridInterface
class wxPropertyGridPopulator
class wxPropertyGridState
class wxStringProperty

Detailed Description

wxPGProperty is base class for all wxPropertyGrid properties.

Definition at line 1943 of file propgrid.h.


Member Typedef Documentation

Definition at line 1956 of file propgrid.h.

typedef wxUint32 wxPGProperty::FlagType

Definition at line 1954 of file propgrid.h.


Constructor & Destructor Documentation

wxPGProperty::wxPGProperty (  ) 

Basic constructor. Should not be necessary to override.

wxPGProperty::wxPGProperty ( const wxString &  label,
const wxString &  name 
)

Constructor. Real used property classes should have constructor of this style:

        // If T is a class, then it should be a constant reference
        // (e.g. const T& ) instead.
        MyProperty( const wxString& label, const wxString& name, T value )
            : wxPGProperty(label, name)
        {
            // Generally recommended way to set the initial value
            // (as it should work in pretty much 100% of cases).
            wxVariant variant;
            variant << value;
            SetValue(variant);

            // If has child properties then create them here. For example:
            //     AddPrivateChild( new wxStringProperty(wxT("Subprop 1"),
            //                                           wxPG_LABEL,
            //                                           value.GetSubProp1()));
        }

Of course, in this example, wxPGProperty could actually any other property class.

virtual wxPGProperty::~wxPGProperty (  )  [virtual]

Virtual destructor. It is customary for derived properties to implement this.


Member Function Documentation

wxPGCell* wxPGProperty::AcquireCell ( unsigned int  column  )  [inline]

Returns wxPGCell of given column, NULL if none. If valid object is returned, caller will gain its ownership.

Definition at line 2396 of file propgrid.h.

bool wxPGProperty::ActualIntToValue ( wxVariant &  variant,
int  number,
int  argFlags = 0 
) const [inline]

Definition at line 2228 of file propgrid.h.

bool wxPGProperty::ActualStringToValue ( wxVariant &  variant,
const wxString &  text,
int  argFlags = 0 
) const [inline]

Definition at line 2213 of file propgrid.h.

bool wxPGProperty::ActualValidateValue ( wxVariant &  value,
wxPGValidationInfo validationInfo 
) const [inline]

Definition at line 2198 of file propgrid.h.

void wxPGProperty::AdaptListToValue ( wxVariant &  list,
wxVariant *  value 
) const

Adapts list variant into proper value using consequtive ChildChanged-calls.

void wxPGProperty::AddChild ( wxPGProperty prop  )  [protected]

Call this to add sub-properties which will become private, fixed children. To handle value changes to and from these properties, you must implement RefreshChildren() and ChildChanged() in derived property class.

Remarks:
If you wish to add independent child properties, use InsertChild() instead. If you wish to add private child properties outside derived property class, use AddPrivateChild().
Deprecated:
Since wxPropertyGrid 1.4.5. Use AddPrivateChild() instead.
See also:
AddPrivateChild(), AppendChild(), InsertChild()
void wxPGProperty::AddChild2 ( wxPGProperty prop,
int  index = -1,
bool  correct_mode = true 
) [protected]

This is used by Insert etc.

void wxPGProperty::AddPrivateChild ( wxPGProperty prop  )  [inline]

Call this to add sub-properties which will become private, fixed children. To handle value changes to and from these properties, you must implement RefreshChildren() and ChildChanged() in derived property class.

Remarks:
If you wish to add independent child properties, use AppendChild() or InsertChild() instead.
See also:
AppendChild(), InsertChild()

Definition at line 2428 of file propgrid.h.

wxPGProperty* wxPGProperty::AppendChild ( wxPGProperty prop  )  [inline]

Appends a new child property.

See also:
InsertChild(), AddPrivateChild()

Definition at line 2438 of file propgrid.h.

int wxPGProperty::AppendChoice ( const wxString &  label,
int  value = wxPG_INVALID_VALUE 
) [inline]

Adds entry to property's wxPGChoices and editor control (if it is active). Returns index of item added.

Definition at line 2388 of file propgrid.h.

bool wxPGProperty::AreAllChildrenSpecified ( wxVariant *  pendingList = NULL  )  const

Determines, recursively, if all children are not unspecified. Takes values in given list into account.

bool wxPGProperty::AreChildrenComponents (  )  const [inline]

Returns true if children of this property are component values (for instance, points size, face name, and is_underlined are component values of a font).

Definition at line 2409 of file propgrid.h.

bool wxPGProperty::CanHaveExtraChildren (  )  const [inline]

Returns true if extra children can be added for this property (i.e. it is wxPropertyCategory or wxCustomProperty)

Definition at line 2629 of file propgrid.h.

void wxPGProperty::ChangeFlag ( FlagType  flag,
bool  set 
) [inline]

Sets or clears given property flag(s).

Definition at line 2927 of file propgrid.h.

virtual void wxPGProperty::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 in wxPGRootProperty, wxPropertyCategory, wxFlagsProperty, and wxCustomProperty.

void wxPGProperty::ClearFlag ( FlagType  flag  )  [inline]

Definition at line 3065 of file propgrid.h.

void wxPGProperty::DeleteChildren (  ) 

Deletes children of the property.

void wxPGProperty::DeleteChoice ( int  index  ) 

Removes entry from property's wxPGChoices and editor control (if it is active).

If selected item is deleted, then the value is set to unspecified.

void wxPGProperty::DoEmpty (  )  [protected]

Deletes all sub-properties.

virtual wxVariant wxPGProperty::DoGetAttribute ( const wxString &  name  )  const [virtual]

Returns value of an attribute.

Override if custom handling of attributes is needed.

Default implementation simply return NULL variant.

virtual const wxPGEditor* wxPGProperty::DoGetEditorClass (  )  const [virtual]

Returns pointer to an instance of editor class.

virtual wxValidator* wxPGProperty::DoGetValidator (  )  const [virtual]

Returns pointer to the wxValidator that should be used with the editor of this property (NULL for no validator). Setting validator explicitly via SetPropertyValidator will override this.

In most situations, code like this should work well (macros are used to maintain one actual validator instance, so on the second call the function exits within the first macro):

        wxValidator* wxMyPropertyClass::DoGetValidator () const
        {
            WX_PG_DOGETVALIDATOR_ENTRY()

            wxMyValidator* validator = new wxMyValidator(...);

            ... prepare validator...

            WX_PG_DOGETVALIDATOR_EXIT(validator)
        }
Remarks:
You can get common filename validator by returning wxFileProperty::GetClassValidator(). wxDirProperty, for example, uses it.

Reimplemented in wxIntProperty, wxFloatProperty, and wxFileProperty.

virtual wxVariant wxPGProperty::DoGetValue (  )  const [inline, virtual]

Override this to return something else than m_value as the value.

Definition at line 2014 of file propgrid.h.

virtual bool wxPGProperty::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.

void wxPGProperty::DoSetName ( const wxString &  str  )  [inline, protected]

Definition at line 3170 of file propgrid.h.

void wxPGProperty::Empty (  )  [inline]

Deletes children of the property.

Definition at line 2470 of file propgrid.h.

void wxPGProperty::EnableCommonValue ( bool  enable = true  )  [inline]

Call to enable or disable usage of common value (integer value that can be selected for properties instead of their normal values) for this property.

Common values are disabled by the default for all properties.

Definition at line 2480 of file propgrid.h.

void wxPGProperty::FixIndexesOfChildren ( unsigned int  starthere = 0  ) 
void wxPGProperty::GenerateComposedValue ( wxString &  text,
int  argFlags = 0 
) const

Composes text from values of child properties.

unsigned int wxPGProperty::GetArrIndex (  )  const [inline]

Definition at line 2771 of file propgrid.h.

wxString wxPGProperty::GetAttribute ( const wxString &  name,
const wxString &  defVal 
) const

Returns named attribute, as string, if found. Otherwise defVal is returned.

wxVariant wxPGProperty::GetAttribute ( const wxString &  name  )  const
double wxPGProperty::GetAttributeAsDouble ( const wxString &  name,
double  defVal 
) const

Returns named attribute, as double, if found. Otherwise defVal is returned.

long wxPGProperty::GetAttributeAsLong ( const wxString &  name,
long  defVal 
) const

Returns named attribute, as long, if found. Otherwise defVal is returned.

const wxPGAttributeStorage& wxPGProperty::GetAttributes (  )  const [inline]

Returns comma-delimited string of property attributes.

Definition at line 2636 of file propgrid.h.

wxVariant wxPGProperty::GetAttributesAsList (  )  const

Returns m_attributes as list wxVariant.

const wxString& wxPGProperty::GetBaseName (  )  const [inline]

Returns property's base name (ie. parent's name is not added in any case)

Definition at line 2496 of file propgrid.h.

wxPGCell* wxPGProperty::GetCell ( unsigned int  column  )  const [inline]

Returns wxPGCell of given column, NULL if none. wxPGProperty will retain ownership of the cell object.

Remarks:
If cell object does not exist for given column, it will not be created. Use GetOrCreateCell() instead if you want that behavior.

Definition at line 2547 of file propgrid.h.

virtual wxPGCellRenderer* wxPGProperty::GetCellRenderer ( int  column  )  const [virtual]

Returns used wxPGCellRenderer instance for given property column (label=0, value=1).

Default implementation returns editor's renderer for all columns.

unsigned int wxPGProperty::GetChildCount (  )  const [inline]

Returns number of child properties

Definition at line 3087 of file propgrid.h.

int wxPGProperty::GetChildrenHeight ( int  lh,
int  iMax = -1 
) const

Returns height of children, recursively, and by taking expanded/collapsed status into account.

iMax is used when finding property y-positions.

unsigned int wxPGProperty::GetChoiceCount (  )  const
virtual int wxPGProperty::GetChoiceInfo ( wxPGChoiceInfo choiceinfo  )  [virtual]

Returns current value's index to the choice control. May also return, through pointer arguments, strings that should be inserted to that control. Irrelevant to classes which do not employ wxPG_EDITOR(Choice) or similar.

Remarks:
  • If returns NULL in choices, then this class must be derived from wxBaseEnumProperty.
  • Must not crash even if property's set of choices is uninitialized (i.e. it points to wxPGGlobalVars->m_emptyConstants).

Reimplemented in wxEnumProperty, wxFlagsProperty, and wxCustomProperty.

const wxPGChoices& wxPGProperty::GetChoices (  )  const

Reimplemented in wxEnumProperty.

wxPGChoices& wxPGProperty::GetChoices (  ) 
wxString wxPGProperty::GetChoiceString ( unsigned int  index  ) 
const wxChar* wxPGProperty::GetClassName (  )  const [inline]

Definition at line 2561 of file propgrid.h.

ClientDataType wxPGProperty::GetClientData (  )  const [inline]

Definition at line 3001 of file propgrid.h.

const wxPGEditor* wxPGProperty::GetColumnEditor ( int  column  )  const [inline]

Returns editor used for given column. NULL for no editor.

Definition at line 2654 of file propgrid.h.

wxString wxPGProperty::GetColumnText ( unsigned int  col  )  const [protected]

Returns text for given column.

int wxPGProperty::GetCommonValue (  )  const [inline]

Returns common value selected for this property. -1 for none.

Definition at line 2664 of file propgrid.h.

unsigned int wxPGProperty::GetCount (  )  const [inline]

Returns number of child properties

Definition at line 3093 of file propgrid.h.

const wxPGChoiceEntry* wxPGProperty::GetCurrentChoice (  )  const
wxVariant wxPGProperty::GetDefaultValue (  )  const
unsigned int wxPGProperty::GetDepth (  )  const [inline]

Definition at line 2773 of file propgrid.h.

int wxPGProperty::GetDisplayedCommonValueCount (  )  const [inline]

Return number of displayed common values for this property.

Definition at line 8038 of file propgrid.h.

wxString wxPGProperty::GetDisplayedString (  )  const [inline]

Definition at line 2574 of file propgrid.h.

const wxPGEditor* wxPGProperty::GetEditorClass (  )  const
virtual wxPGEditorDialogAdapter* wxPGProperty::GetEditorDialog (  )  const [virtual]

Returns instance of a new wxPGEditorDialogAdapter instance, which is used when user presses the (optional) button next to the editor control;

Default implementation returns NULL (ie. no action is generated when button is pressed).

Reimplemented in wxFileProperty.

FlagType wxPGProperty::GetFlags (  )  const [inline]

Definition at line 2645 of file propgrid.h.

wxString wxPGProperty::GetFlagsAsString ( FlagType  flagsMask  )  const

Gets flags as a'|' delimited string. Note that flag names are not prepended with 'wxPG_PROP_'.

Parameters:
flagsMask String will only be made to include flags combined by this parameter.
wxPropertyGrid* wxPGProperty::GetGrid (  )  const

Returns property grid where property lies.

wxPropertyGrid* wxPGProperty::GetGridIfDisplayed (  )  const

Returns owner wxPropertyGrid, but only if one is currently on a page displaying this property.

const wxString& wxPGProperty::GetHelpString (  )  const [inline]

Definition at line 3060 of file propgrid.h.

int wxPGProperty::GetImageOffset ( int  imageWidth  )  const

Converts image width into full image offset, with margins.

unsigned int wxPGProperty::GetIndexInParent (  )  const [inline]

Returns position in parent's array.

Definition at line 2783 of file propgrid.h.

wxPGProperty* wxPGProperty::GetItemAtY ( unsigned int  y,
unsigned int  lh,
unsigned int *  nextItemY 
) const
const wxString& wxPGProperty::GetLabel (  )  const [inline]

Returns property's label.

Definition at line 2490 of file propgrid.h.

const wxPGProperty* wxPGProperty::GetLastVisibleSubItem (  )  const

Returns last visible sub-property, recursively.

wxPGProperty* wxPGProperty::GetMainParent (  )  const

Returns highest level non-category, non-root parent. Useful when you have nested wxCustomProperties/wxParentProperties.

Remarks:
Thus, if immediate parent is root or category, this will return the property itself.
int wxPGProperty::GetMaxLength (  )  const [inline]

Definition at line 2709 of file propgrid.h.

wxString wxPGProperty::GetName (  )  const

Returns property's name with all (non-category, non-root) parents.

wxPGCell* wxPGProperty::GetOrCreateCell ( unsigned int  column  ) 

Returns wxPGCell of given column, creating one if necesasry. wxPGProperty will retain ownership of the cell object.

wxPGProperty* wxPGProperty::GetParent (  )  const [inline]

Return parent of property

Definition at line 2600 of file propgrid.h.

wxPropertyGridState* wxPGProperty::GetParentState (  )  const [inline]

Definition at line 3116 of file propgrid.h.

wxPGProperty* wxPGProperty::GetPropertyByName ( const wxString &  name  )  const

Returns (direct) child property with given name (or NULL if not found).

wxPGProperty* wxPGProperty::GetPropertyByNameWH ( const wxString &  name,
unsigned int  hintIndex 
) const [protected]

Returns (direct) child property with given name (or NULL if not found), with hint index.

Parameters:
hintIndex Start looking for the child at this index.
Remarks:
Does not support scope (ie. Parent.Child notation).
wxString wxPGProperty::GetType (  )  const [inline]

Returns type name of property that is compatible with CreatePropertyByType. and wxVariant::GetType.

Definition at line 2672 of file propgrid.h.

wxVariant wxPGProperty::GetValue (  )  const [inline]

Definition at line 2509 of file propgrid.h.

virtual wxString wxPGProperty::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().

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.
  • Implementations are never called with m_value being null variant (ie. unspecified value), so you don't need to check for that. Naturally this means that unspecified value is always displayed as an empty string.
See also:
GetValueString()

Reimplemented in wxFontProperty, wxPropertyCategory, wxBaseEnumProperty, wxFlagsProperty, wxFileProperty, wxLongStringProperty, and wxCustomProperty.

wxBitmap* wxPGProperty::GetValueImage (  )  const [inline]

Definition at line 2752 of file propgrid.h.

const wxVariant& wxPGProperty::GetValueRef (  )  const [inline]

Definition at line 2530 of file propgrid.h.

wxVariant& wxPGProperty::GetValueRef (  )  [inline]

Returns reference to the internal stored value. GetValue is preferred way to get the actual value, since GetValueRef ignores DoGetValue, which may override stored value.

Definition at line 2525 of file propgrid.h.

wxString wxPGProperty::GetValueString ( int  argFlags = 0  )  const

Same as GetValueAsString, except takes common value into account.

wxString wxPGProperty::GetValueType (  )  const [inline]

Definition at line 2243 of file propgrid.h.

int wxPGProperty::GetY (  )  const

Returns coordinate to the top y of the property. Note that the position of scrollbars is not taken into account.

int wxPGProperty::GetY2 ( int  lh  )  const [protected]
FlagType wxPGProperty::HasFlag ( FlagType  flag  )  const [inline]

Definition at line 2621 of file propgrid.h.

bool wxPGProperty::HasVisibleChildren (  )  const

Returns true if property has even one visible child.

bool wxPGProperty::Hide ( bool  hide,
int  flags = wxPG_RECURSE 
) [inline]

Hides or reveals the property.

Parameters:
hide true for hide, false for reveal.
flags By default changes are applied recursively. Set this paramter wxPG_DONT_RECURSE to prevent this.

Definition at line 8054 of file propgrid.h.

int wxPGProperty::Index ( const wxPGProperty p  )  const [inline]

Returns index of given sub-property.

Definition at line 3109 of file propgrid.h.

void wxPGProperty::Init ( const wxString &  label,
const wxString &  name 
) [private]
void wxPGProperty::Init (  )  [private]
wxPGProperty* wxPGProperty::InsertChild ( int  index,
wxPGProperty childProperty 
)

Use this member function to add independent (ie. regular) children to a property.

Returns:
Inserted childProperty.
Remarks:
wxPropertyGrid is not automatically refreshed by this function.
See also:
AppendChild(), AddPrivateChild()
int wxPGProperty::InsertChoice ( const wxString &  label,
int  index,
int  value = wxPG_INVALID_VALUE 
)

Adds entry to property's wxPGChoices and editor control (if it is active). Returns index of item added.

virtual bool wxPGProperty::IntToValue ( wxVariant &  value,
int  number,
int  argFlags = 0 
) const [private, 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.

Parameters:
argFlags If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable
Remarks:
  • Default implementation may work correctly if used value type is int.
  • If property is not supposed to use choice or spinctrl or other editor with int-based value, it is not necessary to implement this method.
  • 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.
  • You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behavior).

Reimplemented in wxSystemColourProperty, wxIntProperty, wxUIntProperty, wxBaseEnumProperty, and wxCustomProperty.

bool wxPGProperty::IsCategory (  )  const [inline]

Returns true if this property is actually a wxPropertyCategory.

Definition at line 2688 of file propgrid.h.

bool wxPGProperty::IsEnabled (  )  const [inline]

Definition at line 2802 of file propgrid.h.

bool wxPGProperty::IsExpanded (  )  const [inline]

Definition at line 2796 of file propgrid.h.

bool wxPGProperty::IsFlagSet ( FlagType  flag  )  const [inline]

Definition at line 2602 of file propgrid.h.

bool wxPGProperty::IsRoot (  )  const [inline]

Returns true if this property is actually a wxRootProperty.

Definition at line 2692 of file propgrid.h.

bool wxPGProperty::IsSomeParent ( wxPGProperty candidate_parent  )  const
bool wxPGProperty::IsSubProperty (  )  const [inline]

Returns true if this is a sub-property.

Definition at line 2695 of file propgrid.h.

bool wxPGProperty::IsTextEditable (  )  const

Returns true if property has editable wxTextCtrl when selected.

Remarks:
Altough disabled properties do not displayed editor, they still return True here as being disabled is considered a temporary condition (unlike being read-only or having limited editing enabled).
bool wxPGProperty::IsValueUnspecified (  )  const [inline]

Definition at line 2616 of file propgrid.h.

bool wxPGProperty::IsVisible (  )  const

Returns true if all parents expanded.

wxPGProperty* wxPGProperty::Item ( unsigned int  i  )  const [inline]

Returns sub-property at index i.

Definition at line 3099 of file propgrid.h.

wxPGProperty* wxPGProperty::Last (  )  const [inline]

Returns last sub-property.

Definition at line 3106 of file propgrid.h.

virtual void wxPGProperty::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.

Parameters:
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.
Remarks:
  • 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:
GetValueAsString
virtual bool wxPGProperty::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.
virtual wxSize wxPGProperty::OnMeasureImage ( int  item = -1  )  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.

Parameters:
item Normally -1, but can be an index to the property's list of items.
Remarks:
  • Default behavior is to return wxSize(0,0), which means no image.
  • Default image width or height is indicated with dimension -1.
  • You can also return wxPG_DEFAULT_IMAGE_SIZE which equals wxSize(-1, -1).
virtual void wxPGProperty::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 in wxFontProperty, wxSystemColourProperty, wxStringProperty, wxBaseEnumProperty, wxFlagsProperty, wxFileProperty, and wxArrayStringProperty.

virtual void wxPGProperty::OnValidationFailure ( wxVariant &  pendingValue  )  [virtual]

Called whenever validation has failed with given pending value.

Remarks:
If you implement this in your custom property class, please remember to call the baser implementation as well as they may use it to revert property into pre-change state.

Reimplemented in wxBaseEnumProperty.

void wxPGProperty::PrepareSubProperties (  )  [protected]
bool wxPGProperty::PrepareValueForDialogEditing ( wxPropertyGrid propgrid  ) 

Updates property value in case there were last minute changes. If value was unspecified, it will be set to default. Use only for properties that have TextCtrl-based editor.

Remarks:
If you have code similar to
            // Update the value in case of last minute changes
            if ( primary && propgrid->IsEditorsValueModified() )
                 GetEditorClass()->CopyValueFromControl( this, primary );
in wxPGProperty::OnEvent wxEVT_COMMAND_BUTTON_CLICKED handler, then replace it with call to this method.
Return values:
True if value changed.
bool wxPGProperty::RecreateEditor (  ) 

If property's editor is created this forces its recreation. Useful in SetAttribute etc. Returns true if actually did anything.

virtual void wxPGProperty::RefreshChildren (  )  [virtual]

Refresh values of child properties. Automatically called after value is set.

Reimplemented in wxFlagsProperty.

void wxPGProperty::RefreshEditor (  ) 

If property's editor is active, then update it's value.

void wxPGProperty::SetAttribute ( const wxString &  name,
wxVariant  value 
)

Sets an attribute for this property. There are both common attributes and property class specific ones. For list of common attributes, see wxPropertyGridInterface::SetPropertyAttribute().

Remarks:
Settings attribute's value to Null variant will simply remove it from property's set of attributes.
void wxPGProperty::SetAttributes ( const wxPGAttributeStorage attributes  ) 

Sets attributes from a comma-delimited string.

void wxPGProperty::SetCell ( int  column,
wxPGCell cellObj 
)

Sets cell information for given column.

Note that the property takes ownership of given wxPGCell instance.

bool wxPGProperty::SetChoices ( const wxArrayString &  labels,
const wxArrayInt &  values = wxPG_EMPTY_ARRAYINT 
) [inline]

Sets new set of choices for property.

Definition at line 4627 of file propgrid.h.

bool wxPGProperty::SetChoices ( wxPGChoices choices  ) 

Set choices of a property to specified set of labels and values.

Remarks:
This operation clears the property value. Also, if you try to use this on a property which cannot hold choices, a run-time error will be shown.
void wxPGProperty::SetChoiceSelection ( int  newValue,
const wxPGChoiceInfo choiceInfo 
)

Changes value of a property with choices, but only works if the value type is long or string.

void wxPGProperty::SetChoicesExclusive (  ) 

If property has choices and they are not yet exclusive, new such copy of them will be created.

void wxPGProperty::SetClientData ( ClientDataType  clientData  )  [inline]

Sets client data (void*) of a property.

Remarks:
This untyped client data has to be deleted manually.

Definition at line 3016 of file propgrid.h.

void wxPGProperty::SetCommonValue ( int  commonValue  )  [inline]

Sets common value selected for this property. -1 for none.

Definition at line 2863 of file propgrid.h.

void wxPGProperty::SetDefaultValue ( wxVariant &  value  )  [inline]

Set default value of a property. Synonymous to

            SetAttribute(wxT("DefaultValue"), value);

Definition at line 2835 of file propgrid.h.

void wxPGProperty::SetEditor ( const wxString &  editorName  )  [inline]

Sets editor for a property.

Definition at line 8049 of file propgrid.h.

void wxPGProperty::SetEditor ( const wxPGEditor editor  )  [inline]

Sets editor for a property.

Definition at line 2842 of file propgrid.h.

void wxPGProperty::SetExpanded ( bool  expanded  )  [inline]

Definition at line 2913 of file propgrid.h.

void wxPGProperty::SetFlag ( FlagType  flag  )  [inline]

Sets given property flag(s).

Definition at line 2922 of file propgrid.h.

void wxPGProperty::SetFlagRecursively ( FlagType  flag,
bool  set 
)
void wxPGProperty::SetFlagsFromString ( const wxString &  str  ) 

Sets flags from a '|' delimited string. Note that flag names are not prepended with 'wxPG_PROP_'.

void wxPGProperty::SetHelpString ( const wxString &  helpString  )  [inline]

Definition at line 2937 of file propgrid.h.

void wxPGProperty::SetLabel ( const wxString &  label  )  [inline]

Sets property's label.

Remarks:
  • Properties under same parent may have same labels. However, property names must still remain unique.

Definition at line 2948 of file propgrid.h.

bool wxPGProperty::SetMaxLength ( int  maxLen  )  [inline]

Set max length of text editor.

Definition at line 8059 of file propgrid.h.

void wxPGProperty::SetName ( const wxString &  newName  ) 
void wxPGProperty::SetParentalType ( int  flag  )  [inline, protected]

Definition at line 3178 of file propgrid.h.

void wxPGProperty::SetParentState ( wxPropertyGridState pstate  )  [inline, protected]

Definition at line 3183 of file propgrid.h.

void wxPGProperty::SetValue ( wxVariant  value,
wxVariant *  pList = NULL,
int  flags = wxPG_SETVAL_REFRESH_EDITOR 
)

Call this to set value of the property. Unlike methods in wxPropertyGrid, this does not automatically update the display.

Remarks:
Use wxPropertyGrid::ChangePropertyValue() instead if you need to run through validation process and send property change event.

If you need to change property value in event, based on user input, use SetValueInEvent() instead.

(only if wxPG_PROP_AGGREGATE flag is set).

Parameters:
pList Pointer to list variant that contains child values. Used to indicate which children should be marked as modified.
flags Various flags (for instance, wxPG_SETVAL_REFRESH_EDITOR), which is on by default.
bool wxPGProperty::SetValueFromInt ( long  value,
int  flags = 0 
)

Converts integer to a value, and if succesfull, calls SetValue() on it. Default behavior is to do nothing.

Parameters:
value Int to get the value from.
flags If has wxPG_FULL_VALUE, then the value given is a actual value and not an index.
Return values:
true if value was changed.
bool wxPGProperty::SetValueFromString ( const wxString &  text,
int  flags = wxPG_PROGRAMMATIC_VALUE 
)

Converts string to a value, and if succesfull, calls SetValue() on it. Default behavior is to do nothing.

Parameters:
text String to get the value from.
Return values:
true if value was changed.
void wxPGProperty::SetValueImage ( wxBitmap &  bmp  ) 

Set wxBitmap in front of the value. This bitmap may be ignored by custom cell renderers.

void wxPGProperty::SetValueInEvent ( wxVariant  value  )  const

Call in OnEvent(), OnButtonClick() etc. to change the property value based on user input.

Remarks:
This method is const since it doesn't actually modify value, but posts given variant as pending value, stored in wxPropertyGrid.
void wxPGProperty::SetValueToUnspecified (  )  [inline]

Definition at line 2952 of file propgrid.h.

void wxPGProperty::SetWasModified ( bool  set = true  )  [inline]

Call with 'false' in OnSetValue to cancel value changes after all (ie. cancel 'true' returned by StringToValue() or IntToValue()).

Definition at line 3054 of file propgrid.h.

virtual bool wxPGProperty::StringToValue ( wxVariant &  variant,
const wxString &  text,
int  argFlags = 0 
) const [private, virtual]

Converts 'text' into proper value 'variant'. Returns true if new (different than m_value) value could be interpreted from the text.

Parameters:
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).
Remarks:
  • Default implementation converts semicolon delimited tokens into child values. Only works for properties with children.
  • You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behavior).

Reimplemented in wxPGRootProperty, wxBaseEnumProperty, wxFlagsProperty, wxFileProperty, wxLongStringProperty, and wxCustomProperty.

void wxPGProperty::SubPropsChanged ( int  oldSelInd = -1  )  [protected]
wxPGProperty* wxPGProperty::UpdateParentValues (  ) 

Updates composed values of parent non-category properties, recursively. Returns topmost property updated.

Remarks:
  • Must not call SetValue() (as can be called in it).
FlagType wxPGProperty::UsesAutoUnspecified (  )  const [inline]

Returns true if containing grid uses wxPG_EX_AUTO_UNSPECIFIED_VALUES.

Definition at line 2747 of file propgrid.h.

virtual bool wxPGProperty::ValidateValue ( wxVariant &  value,
wxPGValidationInfo validationInfo 
) const [private, virtual]

Implement this function in derived class to check the value. Return true if it is ok. Returning false prevents property change events from occurring.

Remarks:
  • Default implementation always returns true.

Reimplemented in wxIntProperty, wxUIntProperty, wxFloatProperty, and wxBaseEnumProperty.


Friends And Related Function Documentation

friend class wxPropertyGrid [friend]

Definition at line 1946 of file propgrid.h.

friend class wxPropertyGridInterface [friend]

Definition at line 1947 of file propgrid.h.

friend class wxPropertyGridPopulator [friend]

Definition at line 1949 of file propgrid.h.

friend class wxPropertyGridState [friend]

Definition at line 1948 of file propgrid.h.

friend class wxStringProperty [friend]

Definition at line 1950 of file propgrid.h.


Member Data Documentation

unsigned int wxPGProperty::m_arrIndex [protected]

Definition at line 3210 of file propgrid.h.

Definition at line 3205 of file propgrid.h.

unsigned char wxPGProperty::m_bgColIndex [protected]

Definition at line 3227 of file propgrid.h.

wxArrayPtrVoid wxPGProperty::m_cells [protected]

Definition at line 3207 of file propgrid.h.

wxArrayPtrVoid wxPGProperty::m_children [protected]

Definition at line 3206 of file propgrid.h.

Definition at line 3196 of file propgrid.h.

int wxPGProperty::m_commonValue [protected]

Definition at line 3211 of file propgrid.h.

Definition at line 3197 of file propgrid.h.

unsigned char wxPGProperty::m_depth [protected]

Definition at line 3221 of file propgrid.h.

unsigned char wxPGProperty::m_depthBgCol [protected]

Definition at line 3225 of file propgrid.h.

unsigned char wxPGProperty::m_fgColIndex [protected]

Definition at line 3228 of file propgrid.h.

Definition at line 3213 of file propgrid.h.

wxString wxPGProperty::m_helpString [protected]

Definition at line 3208 of file propgrid.h.

wxString wxPGProperty::m_label [protected]

Definition at line 3192 of file propgrid.h.

short wxPGProperty::m_maxLen [protected]

Definition at line 3215 of file propgrid.h.

wxString wxPGProperty::m_name [protected]

Definition at line 3193 of file propgrid.h.

Definition at line 3194 of file propgrid.h.

Definition at line 3195 of file propgrid.h.

wxVariant wxPGProperty::m_value [protected]

Definition at line 3204 of file propgrid.h.

wxBitmap* wxPGProperty::m_valueBitmap [protected]

Definition at line 3202 of file propgrid.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


wxpropgrid
Author(s): Jaakko Salli
autogenerated on Fri Jan 11 09:34:07 2013