wxPropertyGridInterface Class Reference

In order to have most same base methods, both wxPropertyGrid and wxPropertyGridManager must derive from this. More...

#include <propgrid.h>

Inheritance diagram for wxPropertyGridInterface:
wxPropertyGrid wxPropertyGridManager wxPropertyGridPage

List of all members.

Public Types

enum  EditableStateFlags {
  SelectionState = 0x01, ExpandedState = 0x02, ScrollPosState = 0x04, PageState = 0x08,
  SplitterPosState = 0x10, DescBoxState = 0x20, AllStates
}

Public Member Functions

void AddPropertyChoice (wxPGPropArg id, const wxString &label, int value=INT_MAX)
 Adds choice to a property that can accept one.
wxPGPropertyAppend (wxPGProperty *property)
 Appends property to the list.
wxPGPropertyAppendCategory (const wxString &label, const wxString &name=(*((wxString *) NULL)))
wxPGPropertyAppendIn (wxPGPropArg id, wxPGProperty *newproperty)
void BeginAddChildren (wxPGPropArg id)
 Inorder to add new items into a property with fixed children (for instance, wxFlagsProperty), you need to call this method.
bool ChangePropertyValue (wxPGPropArg id, wxVariant newValue)
 Changes value of a property, as if from an editor.
virtual void Clear ()=0
 Deletes all properties.
bool ClearPropertyValue (wxPGPropArg id)
 Resets value of a property to its default.
bool ClearSelection (bool validation=true)
 Clears current selection, if any.
bool Collapse (wxPGPropArg id)
 Collapses given category or property with children.
bool CollapseAll ()
 Collapses all items that can be collapsed.
void Delete (wxPGPropArg id)
 Deletes a property by id.
void DeleteProperty (wxPGPropArg id)
 Removes and deletes a property.
void DeletePropertyChoice (wxPGPropArg id, int index)
 Deletes choice from a property.
bool Disable (wxPGPropArg id)
 Disables property.
bool DisableProperty (wxPGPropArg id)
 Disables property.
bool EnableProperty (wxPGPropArg id, bool enable=true)
 Enables or disables property, depending on whether enable is true or false.
void EndAddChildren (wxPGPropArg id)
 Called after population of property with fixed children has finished.
bool Expand (wxPGPropArg id)
 Expands given category or property with children.
bool ExpandAll (bool expand=true)
 Expands all items that can be expanded.
int GetColumnProportion (unsigned int column) const
 Returns auto-resize proportion of the given column.
wxArrayPGProperty GetExpandedProperties () const
 Returns list of expanded properties.
const wxPGPropertyGetFirst (int flags=wxPG_ITERATE_ALL) const
wxPGPropertyGetFirst (int flags=wxPG_ITERATE_ALL)
 Returns id of first item, whether it is a category or property.
wxPGPropertyGetFirstChild (wxPGPropArg id)
 Returns id of first child of given property.
wxPropertyGridConstIterator GetIterator (int flags, int startPos) const
wxPropertyGridIterator GetIterator (int flags, int startPos)
 Returns iterator class instance.
wxPropertyGridConstIterator GetIterator (int flags=wxPG_ITERATE_DEFAULT, wxPGProperty *firstProp=NULL) const
wxPropertyGridIterator GetIterator (int flags=wxPG_ITERATE_DEFAULT, wxPGProperty *firstProp=NULL)
 Returns iterator class instance.
wxPGPropertyGetNextSiblingProperty (wxPGPropArg id)
 Returns next item under the same parent.
void GetPropertiesWithFlag (wxArrayPGProperty *targetArr, wxPGProperty::FlagType flags, bool inverse=false, int iterFlags=(wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_HIDDEN|wxPG_ITERATE_CATEGORIES)) const
 Adds to 'targetArr' pointers to properties that have given flags 'flags' set.
wxPGPropertyGetProperty (const wxString &name) const
 Returns pointer to the property with given name (case-sensitive).
wxVariant GetPropertyAttribute (wxPGPropArg id, const wxString &attrName) const
 Returns value of given attribute.
const wxPGAttributeStorageGetPropertyAttributes (wxPGPropArg id) const
 Returns map-like storage of property's attributes.
wxPGPropertyGetPropertyByName (const wxString &name, const wxString &subname) const
 Returns id of a sub-property 'subname' of property 'name'.
wxPGPropertyGetPropertyByName (const wxString &name) const
 Returns pointer to the property with given name (case-sensitive).
wxPGPropertyGetPropertyByNameA (const wxString &name) const
wxPropertyCategoryGetPropertyCategory (wxPGPropArg id) const
 Returns pointer of property's nearest parent category.
wxPGChoicesGetPropertyChoices (wxPGPropArg id)
 Returns writable reference to property's list of choices (and relevant values).
const wxChar * GetPropertyClassName (wxPGPropArg id) const
 Gets name of property's constructor function.
wxPGProperty::ClientDataType GetPropertyClientData (wxPGPropArg id) const
 Returns client data (void*) of a property.
const wxPGEditorGetPropertyEditor (wxPGPropArg id) const
 Returns property's editor.
wxString GetPropertyHelpString (wxPGPropArg id) const
 Returns help string associated with a property.
wxBitmap * GetPropertyImage (wxPGPropArg id) const
 Returns property's custom value image (NULL of none).
unsigned int GetPropertyIndex (wxPGPropArg id)
 Returns property's position under its parent.
const wxString & GetPropertyLabel (wxPGPropArg id)
 Returns label of a property.
wxString GetPropertyName (wxPGPropArg id)
 Returns name of a property, by which it is globally accessible.
wxPGPropertyGetPropertyParent (wxPGPropArg id)
 Returns parent item of a property.
wxPGPropertyGetPropertyPtr (wxPGPropArg id) const
 Returns pointer to a property.
wxString GetPropertyShortClassName (wxPGPropArg id)
 Returns short name for property's class.
wxValidator * GetPropertyValidator (wxPGPropArg id)
 Returns validator of a property as a reference, which you can pass to any number of SetPropertyValidator.
wxVariant GetPropertyValue (wxPGPropArg id)
 Returns value as wxVariant.
wxArrayInt GetPropertyValueAsArrayInt (wxPGPropArg id) const
wxArrayString GetPropertyValueAsArrayString (wxPGPropArg id) const
bool GetPropertyValueAsBool (wxPGPropArg id) const
double GetPropertyValueAsDouble (wxPGPropArg id) const
int GetPropertyValueAsInt (wxPGPropArg id) const
long GetPropertyValueAsLong (wxPGPropArg id) const
wxLongLong_t GetPropertyValueAsLongLong (wxPGPropArg id) const
wxPoint GetPropertyValueAsPoint (wxPGPropArg id) const
wxSize GetPropertyValueAsSize (wxPGPropArg id) const
wxString GetPropertyValueAsString (wxPGPropArg id) const
unsigned long GetPropertyValueAsULong (wxPGPropArg id) const
wxULongLong_t GetPropertyValueAsULongLong (wxPGPropArg id) const
void * GetPropertyValueAsVoidPtr (wxPGPropArg id) const
wxObject * GetPropertyValueAsWxObjectPtr (wxPGPropArg id) const
wxVariant GetPropertyValues (const wxString &listname=wxEmptyString, wxPGProperty *baseparent=NULL, long flags=0) const
 Returns a wxVariant list containing wxVariant versions of all property values.
wxString GetPropertyValueType (wxPGPropArg id)
const wxArrayPGProperty & GetSelectedProperties () const
 Returns list of currently selected properties.
wxPGPropertyGetSelection () const
 Returns currently selected property.
wxPropertyGridStateGetState () const
virtual wxPGVIterator GetVIterator (int flags) const
 Similar to GetIterator, but instead returns wxPGVIterator instance, which can be useful for forward-iterating through arbitrary property containers.
bool HideProperty (wxPGPropArg id, bool hide=true, int flags=wxPG_RECURSE)
 Hides or reveals a property.
wxPGPropertyInsert (wxPGPropArg parent, int index, wxPGProperty *newproperty)
 Also see documentation for Insert .
wxPGPropertyInsert (wxPGPropArg priorThis, wxPGProperty *newproperty)
 Inserts property to the property container.
wxPGPropertyInsertCategory (wxPGPropArg id, int index, const wxString &label, const wxString &name=(*((wxString *) NULL)))
void InsertPropertyChoice (wxPGPropArg id, const wxString &label, int index, int value=INT_MAX)
 Inserts choice to a property that can accept one.
bool IsModified (wxPGPropArg id) const
 Returns true if property has been modified after value set or modify flag clear by software.
bool IsPropertyCategory (wxPGPropArg id) const
 Returns true if property is a category.
bool IsPropertyEnabled (wxPGPropArg id) const
 Returns true if property is enabled.
bool IsPropertyExpanded (wxPGPropArg id) const
 Returns true if given property is expanded.
bool IsPropertyKindOf (wxPGPropArg id, wxClassInfo *info) const
 Returns true if property is of certain type.
bool IsPropertyModified (wxPGPropArg id) const
 Returns true if property has been modified after value set or modify flag clear by software.
virtual bool IsPropertySelected (wxPGPropArg id) const
 Returns true if property is selected.
bool IsPropertyShown (wxPGPropArg id) const
 Returns true if property is shown (ie.
bool IsPropertyUnspecified (wxPGPropArg id) const
 Returns true if property value is set to unspecified.
bool IsPropertyValueType (wxPGPropArg id, const wxChar *typestr) const
 Returns true if property's value type has name typestr.
void LimitPropertyEditing (wxPGPropArg id, bool limit=true)
 Disables (limit = true) or enables (limit = false) wxTextCtrl editor of a property, if it is not the sole mean to edit the value.
void NamesToProperties (wxArrayPGProperty *properties, const wxArrayString &names) const
 Converts array of names to array of property pointers.
void PropertiesToNames (wxArrayString *names, const wxArrayPGProperty &properties) const
 Converts array of properties to array of names.
virtual void RefreshGrid (wxPropertyGridState *state=NULL)
 If state is shown in it's grid, refresh it now.
virtual void RefreshProperty (wxPGProperty *p)=0
wxPGPropertyRemoveProperty (wxPGPropArg id)
 Removes a property.
wxPGPropertyReplaceProperty (wxPGPropArg id, wxPGProperty *property)
 Replaces property with id with newly created property.
bool RestoreEditableState (const wxString &src, int restoreStates=AllStates)
 Restores user-editable state.
wxString SaveEditableState (int includedStates=AllStates) const
 Used to acquire user-editable state (selected property, expanded properties, scrolled position, splitter positions).
bool SetColumnProportion (unsigned int column, int proportion)
 Set proportion of a auto-stretchable column.
void SetExpandedProperties (const wxArrayPGProperty &array, bool expand=true)
 Sets all properties in given array as expanded.
void SetPropertiesFlag (const wxArrayPGProperty &srcArr, wxPGProperty::FlagType flags, bool inverse=false)
 Sets or clears flag(s) of all properties in given array.
void SetPropertyAttribute (wxPGPropArg id, const wxString &attrName, wxVariant value, long argFlags=0)
 Sets an attribute of a property.
void SetPropertyAttributes (wxPGPropArg id, const wxPGAttributeStorage &attributes)
 Sets attributes from a wxPGAttributeStorage.
void SetPropertyCell (wxPGPropArg id, int column, const wxString &text=wxEmptyString, const wxBitmap &bitmap=wxNullBitmap, const wxColour &fgCol=wxNullColour, const wxColour &bgCol=wxNullColour)
 Sets text, bitmap, and colours for given column's cell.
void SetPropertyChoices (wxPGPropArg id, wxPGChoices &choices)
 Set choices of a property to specified set of labels and values.
void SetPropertyChoicesExclusive (wxPGPropArg id)
 If property's set of choices is shared, then calling this method converts it to private.
void SetPropertyClientData (wxPGPropArg id, wxPGProperty::ClientDataType clientData)
 Sets client data (void*) of a property.
void SetPropertyEditor (wxPGPropArg id, const wxString &editorName)
 Sets editor control of a property.
void SetPropertyEditor (wxPGPropArg id, const wxPGEditor *editor)
 Sets editor control of a property.
void SetPropertyHelpString (wxPGPropArg id, const wxString &helpString)
 Associates the help string with property.
void SetPropertyImage (wxPGPropArg id, wxBitmap &bmp)
 Set wxBitmap in front of the value.
void SetPropertyLabel (wxPGPropArg id, const wxString &newproplabel)
 Sets label of a property.
bool SetPropertyMaxLength (wxPGPropArg id, int maxLen)
 Sets max length of property's text.
void SetPropertyReadOnly (wxPGPropArg id, bool set=true, int flags=wxPG_RECURSE)
 Sets property (and, recursively, its children) to have read-only value.
void SetPropertyValidator (wxPGPropArg id, const wxValidator &validator)
 Sets validator of a property.
void SetPropertyValue (wxPGPropArg id, const wxArrayInt &value)
 Sets value (wxArrayInt&) of a property.
void SetPropertyValue (wxPGPropArg id, wxULongLong_t value)
 Sets value (wxULongLong&) of a property.
void SetPropertyValue (wxPGPropArg id, wxLongLong_t value)
 Sets value (wxLongLong&) of a property.
void SetPropertyValue (wxPGPropArg id, const wxSize &value)
 Sets value (wxSize&) of a property.
void SetPropertyValue (wxPGPropArg id, const wxPoint &value)
 Sets value (wxPoint&) of a property.
void SetPropertyValue (wxPGPropArg id, wxVariant value)
 Sets value (wxVariant&) of a property.
void SetPropertyValue (wxPGPropArg id, wxObject &value)
void SetPropertyValue (wxPGPropArg id, void *value)
 Sets value (void*) of a property.
void SetPropertyValue (wxPGPropArg id, wxObject *value)
 Sets value (wxObject*) of a property.
void SetPropertyValue (wxPGPropArg id, const wxString &value)
 Sets value (wxString) of a property.
void SetPropertyValue (wxPGPropArg id, const wxArrayString &value)
 Sets value (wxArrayString) of a property.
void SetPropertyValue (wxPGPropArg id, const wxChar *value)
void SetPropertyValue (wxPGPropArg id, bool value)
 Sets value (bool) of a property.
void SetPropertyValue (wxPGPropArg id, double value)
 Sets value (floating point) of a property.
void SetPropertyValue (wxPGPropArg id, int value)
 Sets value (integer) of a property.
void SetPropertyValue (wxPGPropArg id, long value)
 Sets value (long integer) of a property.
void SetPropertyValues (const wxVariant &list, wxPGPropArg defaultCategory=((wxPGProperty *) NULL))
 Sets property values from a list of wxVariants.
void SetPropertyValues (const wxVariantList &list, wxPGPropArg defaultCategory=((wxPGProperty *) NULL))
 Sets property values from a list of wxVariants.
void SetPropertyValueUnspecified (wxPGPropArg id)
 Sets property's value to unspecified.
void SetPropVal (wxPGPropArg id, wxVariant &value)
 Sets value (wxDateTime&) of a property.
void SetValidationFailureBehavior (int vfbFlags)
 Adjusts how wxPropertyGrid behaves when invalid value is entered in a property.
virtual ~wxPropertyGridInterface ()
 Destructor.

Static Public Member Functions

static wxPGPropertyCreatePropertyByClass (const wxString &classname, const wxString &label, const wxString &name)
 Constructs a property.
static wxPGPropertyCreatePropertyByType (const wxString &valuetype, const wxString &label, const wxString &name)
 Constructs a property.
static wxPGEditorGetEditorByName (const wxString &editorName)
static void InitAllTypeHandlers ()
 Initializes *all* property types.
static void RegisterAdditionalEditors ()
 Initializes additional property editors (SpinCtrl etc.
static void SetBoolChoices (const wxString &true_choice, const wxString &false_choice)
 Lets user to set the strings listed in the choice dropdown of a wxBoolProperty.

Protected Member Functions

bool DoClearSelection (bool validation, int selFlags=0)
virtual wxPGPropertyDoGetPropertyByName (const wxString &name) const
virtual bool DoSelectPage (int WXUNUSED(index))
void DoSetPropertyAttribute (wxPGPropArg id, const wxString &name, wxVariant &value, long argFlags)
virtual wxVariant GetEditableStateItem (const wxString &name) const
 In derived class, implement to return editable state component with given name.
virtual wxPropertyGridStateGetPageState (int pageIndex) const
virtual bool SetEditableStateItem (const wxString &name, wxVariant value)
 In derived class, implement to set editable state component with given name to given value.

Protected Attributes

wxString m_emptyString
wxPropertyGridStatem_pState

Detailed Description

In order to have most same base methods, both wxPropertyGrid and wxPropertyGridManager must derive from this.


Member Enumeration Documentation

Flags for wxPropertyGridInterface::SaveEditableState() and wxPropertyGridInterface::RestoreEditableState().

Enumerator:
SelectionState 

Include selected property.

ExpandedState 

Include expanded/collapsed property information.

ScrollPosState 

Include scrolled position.

PageState 

Include selected page information.

Only applies to wxPropertyGridManager.

SplitterPosState 

Include splitter position.

Stored for each page.

DescBoxState 

Include description box size.

Only applies to wxPropertyGridManager.

AllStates 

Include all supported user editable state information.

This is usually the default value.


Member Function Documentation

void wxPropertyGridInterface::AddPropertyChoice ( wxPGPropArg  id,
const wxString &  label,
int  value = INT_MAX 
)

Adds choice to a property that can accept one.

Remarks:
  • If you need to make sure that you modify only the set of choices of a single property (and not also choices of other properties with initially identical set), call wxPropertyGrid::SetPropertyChoicesPrivate.
  • This usually only works for wxEnumProperty and derivatives (wxFlagsProperty can get accept new items but its items may not get updated).
wxPGProperty* wxPropertyGridInterface::Append ( wxPGProperty property  ) 

Appends property to the list.

wxPropertyGrid assumes ownership of the object. Becomes child of most recently added category.

Remarks:
  • wxPropertyGrid takes the ownership of the property pointer.
  • If appending a category with name identical to a category already in the wxPropertyGrid, then newly created category is deleted, and most recently added category (under which properties are appended) is set to the one with same name. This allows easier adding of items to same categories in multiple passes.
  • Does not automatically redraw the control, so you may need to call Refresh when calling this function after control has been shown for the first time.
void wxPropertyGridInterface::BeginAddChildren ( wxPGPropArg  id  ) 

Inorder to add new items into a property with fixed children (for instance, wxFlagsProperty), you need to call this method.

After populating has been finished, you need to call EndAddChildren.

bool wxPropertyGridInterface::ChangePropertyValue ( wxPGPropArg  id,
wxVariant  newValue 
)

Changes value of a property, as if from an editor.

Use this instead of SetPropertyValue() if you need the value to run through validation process, and also send the property change event.

Return values:
Returns true if value was succesfully changed.

Reimplemented in wxPropertyGrid.

bool wxPropertyGridInterface::ClearPropertyValue ( wxPGPropArg  id  ) 

Resets value of a property to its default.

bool wxPropertyGridInterface::ClearSelection ( bool  validation = true  ) 

Clears current selection, if any.

Returns true if success (ie. validator did not intercept). You can set validation = false to let selection be cleared even if property had invalid value in its editor.

bool wxPropertyGridInterface::Collapse ( wxPGPropArg  id  ) 

Collapses given category or property with children.

Returns true if actually collapses.

bool wxPropertyGridInterface::CollapseAll (  ) 

Collapses all items that can be collapsed.

Return values:
Return false if failed (may fail if editor value cannot be validated).
static wxPGProperty* wxPropertyGridInterface::CreatePropertyByClass ( const wxString &  classname,
const wxString &  label,
const wxString &  name 
) [static]

Constructs a property.

Class used is given as the first string argument. It may be either normal property class name, such as "wxIntProperty" or a short one such as "Int".

static wxPGProperty* wxPropertyGridInterface::CreatePropertyByType ( const wxString &  valuetype,
const wxString &  label,
const wxString &  name 
) [static]

Constructs a property.

Value type name used is given as the first string argument. It may be "string", "long", etc. Any value returned by wxVariant::GetType fits there.

Otherwise, this is similar as CreatePropertyByClass.

Remarks:
Cannot generate property category.
void wxPropertyGridInterface::Delete ( wxPGPropArg  id  ) 

Deletes a property by id.

If category is deleted, all children are automatically deleted as well.

Deprecated:
Since version 1.3. Use DeleteProperty() instead.
void wxPropertyGridInterface::DeleteProperty ( wxPGPropArg  id  ) 

Removes and deletes a property.

Parameters:
id Pointer or name of a property.
Remarks:
If you delete a property in a wxPropertyGrid event handler, the actual deletion is postponed until the next idle event.
void wxPropertyGridInterface::DeletePropertyChoice ( wxPGPropArg  id,
int  index 
)

Deletes choice from a property.

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

See AddPropertyChoice for more details.

bool wxPropertyGridInterface::Disable ( wxPGPropArg  id  ) 

Disables property.

Deprecated:
Since version 1.3. Use wxPropertyGrid::Enable(property, false) instead.
bool wxPropertyGridInterface::DisableProperty ( wxPGPropArg  id  ) 

Disables property.

bool wxPropertyGridInterface::EnableProperty ( wxPGPropArg  id,
bool  enable = true 
)

Enables or disables property, depending on whether enable is true or false.

bool wxPropertyGridInterface::Expand ( wxPGPropArg  id  ) 

Expands given category or property with children.

Returns true if actually expands.

int wxPropertyGridInterface::GetColumnProportion ( unsigned int  column  )  const

Returns auto-resize proportion of the given column.

See also:
SetColumnProportion()
wxArrayPGProperty wxPropertyGridInterface::GetExpandedProperties (  )  const

Returns list of expanded properties.

Remarks:
If wxPG_USE_STL is 1, then wxArrayPGProperty is typedef of std::vector<wxPGProperty*>.
wxPGProperty* wxPropertyGridInterface::GetFirst ( int  flags = wxPG_ITERATE_ALL  ) 

Returns id of first item, whether it is a category or property.

Parameters:
flags List of iterator flags
wxPGProperty* wxPropertyGridInterface::GetFirstChild ( wxPGPropArg  id  ) 

Returns id of first child of given property.

Remarks:
Does not return sub-properties!
wxPropertyGridIterator wxPropertyGridInterface::GetIterator ( int  flags,
int  startPos 
)

Returns iterator class instance.

Parameters:
flags wxPropertyGridIterator flags. If default wxPG_ITERATE_DEFAULT supplied, everything except private child properties are iterated. List of iterator flags
startPos Either wxTOP or wxBOTTOM. wxTOP will indicate that iterations start from the first property from the top, and wxBOTTOM means that the iteration will instead begin from bottommost valid item.

Reimplemented in wxPropertyGridManager.

wxPropertyGridIterator wxPropertyGridInterface::GetIterator ( int  flags = wxPG_ITERATE_DEFAULT,
wxPGProperty firstProp = NULL 
)

Returns iterator class instance.

Parameters:
flags wxPropertyGridIterator flags. If default wxPG_ITERATE_DEFAULT supplied, everything except private child properties are iterated. List of iterator flags
firstProp Property to start iteration from. If NULL, then first child of root is used.

Reimplemented in wxPropertyGridManager.

wxPGProperty* wxPropertyGridInterface::GetNextSiblingProperty ( wxPGPropArg  id  ) 

Returns next item under the same parent.

void wxPropertyGridInterface::GetPropertiesWithFlag ( wxArrayPGProperty *  targetArr,
wxPGProperty::FlagType  flags,
bool  inverse = false,
int  iterFlags = (wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_HIDDEN|wxPG_ITERATE_CATEGORIES) 
) const

Adds to 'targetArr' pointers to properties that have given flags 'flags' set.

However, if 'inverse' is set to true, then only properties without given flags are stored.

Parameters:
flags Property flags to use.
iterFlags Iterator flags to use. Default is everything expect private children.
Remarks:
If wxPG_USE_STL is 1, then wxArrayPGProperty is typedef of std::vector<wxPGProperty*>.
wxPGProperty* wxPropertyGridInterface::GetProperty ( const wxString &  name  )  const

Returns pointer to the property with given name (case-sensitive).

If there is no property with such name, pointer is returned.

Remarks:
Properties which have non-category, non-root parent can not be accessed globally by their name. Instead, use "<property>.<subproperty>" instead of "<subproperty>".
wxVariant wxPropertyGridInterface::GetPropertyAttribute ( wxPGPropArg  id,
const wxString &  attrName 
) const

Returns value of given attribute.

If none found, returns NULL-variant.

const wxPGAttributeStorage& wxPropertyGridInterface::GetPropertyAttributes ( wxPGPropArg  id  )  const

Returns map-like storage of property's attributes.

Remarks:
Note that if extra style wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES is set, then builtin-attributes are not included in the storage.
wxPGProperty* wxPropertyGridInterface::GetPropertyByName ( const wxString &  name,
const wxString &  subname 
) const

Returns id of a sub-property 'subname' of property 'name'.

Same as calling GetPropertyByNameI(wxT("name.subname")), albeit slightly faster.

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

Returns pointer to the property with given name (case-sensitive).

If there is no property with such name, pointer is returned.

Remarks:
Properties which have non-category, non-root parent can not be accessed globally by their name. Instead, use "<property>.<subproperty>" instead of "<subproperty>".
wxPropertyCategory* wxPropertyGridInterface::GetPropertyCategory ( wxPGPropArg  id  )  const

Returns pointer of property's nearest parent category.

If no category found, returns NULL.

wxPGChoices& wxPropertyGridInterface::GetPropertyChoices ( wxPGPropArg  id  ) 

Returns writable reference to property's list of choices (and relevant values).

If property does not have any choices, will return reference to an invalid set of choices that will return false on IsOk call.

const wxChar* wxPropertyGridInterface::GetPropertyClassName ( wxPGPropArg  id  )  const

Gets name of property's constructor function.

wxPGProperty::ClientDataType wxPropertyGridInterface::GetPropertyClientData ( wxPGPropArg  id  )  const

Returns client data (void*) of a property.

const wxPGEditor* wxPropertyGridInterface::GetPropertyEditor ( wxPGPropArg  id  )  const

Returns property's editor.

wxString wxPropertyGridInterface::GetPropertyHelpString ( wxPGPropArg  id  )  const

Returns help string associated with a property.

wxBitmap* wxPropertyGridInterface::GetPropertyImage ( wxPGPropArg  id  )  const

Returns property's custom value image (NULL of none).

unsigned int wxPropertyGridInterface::GetPropertyIndex ( wxPGPropArg  id  ) 

Returns property's position under its parent.

const wxString& wxPropertyGridInterface::GetPropertyLabel ( wxPGPropArg  id  ) 

Returns label of a property.

wxString wxPropertyGridInterface::GetPropertyName ( wxPGPropArg  id  ) 

Returns name of a property, by which it is globally accessible.

wxPGProperty* wxPropertyGridInterface::GetPropertyParent ( wxPGPropArg  id  ) 

Returns parent item of a property.

wxString wxPropertyGridInterface::GetPropertyShortClassName ( wxPGPropArg  id  ) 

Returns short name for property's class.

For example, "wxPropertyCategory" translates to "Category" and "wxIntProperty" to "Int".

wxVariant wxPropertyGridInterface::GetPropertyValue ( wxPGPropArg  id  ) 

Returns value as wxVariant.

To get wxObject pointer from it, you will have to use WX_PG_VARIANT_TO_WXOBJECT(VARIANT,CLASSNAME) macro.

If property value is unspecified, Null variant is returned.

wxVariant wxPropertyGridInterface::GetPropertyValues ( const wxString &  listname = wxEmptyString,
wxPGProperty baseparent = NULL,
long  flags = 0 
) const

Returns a wxVariant list containing wxVariant versions of all property values.

Order is not guaranteed.

Parameters:
flags Use wxPG_KEEP_STRUCTURE to retain category structure; each sub category will be its own wxVariantList of wxVariant. Use wxPG_INC_ATTRIBUTES to include property attributes as well. Each attribute will be stored as list variant named "@@<propname>@@attr."
Remarks:
const wxArrayPGProperty& wxPropertyGridInterface::GetSelectedProperties (  )  const

Returns list of currently selected properties.

Remarks:
wxArrayPGProperty should be compatible with std::vector API.
wxPGProperty* wxPropertyGridInterface::GetSelection (  )  const

Returns currently selected property.

NULL if none.

Remarks:
When wxPG_EX_MULTIPLE_SELECTION extra style is used, this member function returns the focused property, that is the one that can have active editor.

Reimplemented in wxPropertyGridManager.

bool wxPropertyGridInterface::HideProperty ( wxPGPropArg  id,
bool  hide = true,
int  flags = wxPG_RECURSE 
)

Hides or reveals a property.

Parameters:
hide If true, hides property, otherwise reveals it.
flags By default changes are applied recursively. Set this paramter wxPG_DONT_RECURSE to prevent this.
static void wxPropertyGridInterface::InitAllTypeHandlers (  )  [static]

Initializes *all* property types.

Causes references to most object files in the library, so calling this may cause significant increase in executable size when linking with static library.

wxPGProperty* wxPropertyGridInterface::Insert ( wxPGPropArg  parent,
int  index,
wxPGProperty newproperty 
)

Also see documentation for Insert .

Parameters:
parent New property is inserted under this category. Available only in the second variant. There are two versions of this function to allow this parameter to be either an id or name to a property.
index Index under category. Available only in the second variant. If index is < 0, property is appended in category.
wxPGProperty* wxPropertyGridInterface::Insert ( wxPGPropArg  priorThis,
wxPGProperty newproperty 
)

Inserts property to the property container.

Parameters:
priorThis New property is inserted just prior to this. Available only in the first variant. There are two versions of this function to allow this parameter to be either an id or name to a property.
newproperty Pointer to the inserted property. wxPropertyGrid will take ownership of this object.
Returns:
Returns id for the property,
Remarks:

While Append may be faster way to add items, make note that when both data storages (categoric and non-categoric) are active, Insert becomes even more slow. This is especially true if current mode is non-categoric.

Example of use:

            // append category
            wxPGProperty* my_cat_id = propertygrid->Append( new wxPropertyCategory (wxT("My Category")) );

            ...

            // insert into category - using second variant
            wxPGProperty* my_item_id_1 = propertygrid->Insert( my_cat_id, 0, new wxStringProperty(wxT("My String 1")) );

            // insert before to first item - using first variant
            wxPGProperty* my_item_id_2 = propertygrid->Insert( my_item_id, new wxStringProperty(wxT("My String 2")) );
void wxPropertyGridInterface::InsertPropertyChoice ( wxPGPropArg  id,
const wxString &  label,
int  index,
int  value = INT_MAX 
)

Inserts choice to a property that can accept one.

See AddPropertyChoice for more details.

bool wxPropertyGridInterface::IsModified ( wxPGPropArg  id  )  const

Returns true if property has been modified after value set or modify flag clear by software.

Deprecated:
Since version 1.3. Use IsPropertyModified instead.
bool wxPropertyGridInterface::IsPropertyCategory ( wxPGPropArg  id  )  const

Returns true if property is a category.

bool wxPropertyGridInterface::IsPropertyEnabled ( wxPGPropArg  id  )  const

Returns true if property is enabled.

bool wxPropertyGridInterface::IsPropertyExpanded ( wxPGPropArg  id  )  const

Returns true if given property is expanded.

Naturally, always returns false for properties that cannot be expanded.

bool wxPropertyGridInterface::IsPropertyKindOf ( wxPGPropArg  id,
wxClassInfo *  info 
) const

Returns true if property is of certain type.

Parameters:
info Preferably use WX_PG_CLASSINFO(PROPERTYNAME). Alternative is PROPERTYNAMEClassInfo.
bool wxPropertyGridInterface::IsPropertyShown ( wxPGPropArg  id  )  const

Returns true if property is shown (ie.

hideproperty with true not called for it).

bool wxPropertyGridInterface::IsPropertyValueType ( wxPGPropArg  id,
const wxChar *  typestr 
) const

Returns true if property's value type has name typestr.

Deprecated:
Since version 1.3. Use GetPropertyValueType() and wxString comparison instead.
void wxPropertyGridInterface::NamesToProperties ( wxArrayPGProperty *  properties,
const wxArrayString &  names 
) const

Converts array of names to array of property pointers.

Remarks:
If wxPG_USE_STL is 1, then wxArrayPGProperty is typedef of std::vector<wxPGProperty*>.
void wxPropertyGridInterface::PropertiesToNames ( wxArrayString *  names,
const wxArrayPGProperty &  properties 
) const

Converts array of properties to array of names.

Remarks:
If wxPG_USE_STL is 1, then wxArrayPGProperty is typedef of std::vector<wxPGProperty*>.
static void wxPropertyGridInterface::RegisterAdditionalEditors (  )  [static]

Initializes additional property editors (SpinCtrl etc.

). Causes references to most object files in the library, so calling this may cause significant increase in executable size when linking with static library.

wxPGProperty* wxPropertyGridInterface::RemoveProperty ( wxPGPropArg  id  ) 

Removes a property.

Does not delete the property object, but instead returns it.

Parameters:
id Pointer or name of a property.
Remarks:
Removed property cannot have any children.

Also, if you remove property in a wxPropertyGrid event handler, the actual removal is postponed until the next idle event.

wxPGProperty* wxPropertyGridInterface::ReplaceProperty ( wxPGPropArg  id,
wxPGProperty property 
)

Replaces property with id with newly created property.

For example, this code replaces existing property named "Flags" with one that will have different set of items:

            pg->ReplaceProperty(wxT("Flags"),
                wxFlagsProperty(wxT("Flags"),wxPG_LABEL,newItems))

For more info, see wxPropertyGrid::Insert.

bool wxPropertyGridInterface::RestoreEditableState ( const wxString &  src,
int  restoreStates = AllStates 
)

Restores user-editable state.

See also wxPropertyGridInterface::SaveEditableState().

Parameters:
src String generated by SaveEditableState.
restoreStates Which parts to restore from source string. See list of editable state flags".
Returns:
False if there was problem reading the string.
Remarks:
If some parts of state (such as scrolled or splitter position) fail to restore correctly, please make sure that you call this function after wxPropertyGrid size has been set (this may sometimes be tricky when sizers are used).
wxString wxPropertyGridInterface::SaveEditableState ( int  includedStates = AllStates  )  const

Used to acquire user-editable state (selected property, expanded properties, scrolled position, splitter positions).

Parameters:
includedStates Which parts of state to include. See list of editable state flags.
static void wxPropertyGridInterface::SetBoolChoices ( const wxString &  true_choice,
const wxString &  false_choice 
) [static]

Lets user to set the strings listed in the choice dropdown of a wxBoolProperty.

Defaults are "True" and "False", so changing them to, say, "Yes" and "No" may be useful in some less technical applications.

bool wxPropertyGridInterface::SetColumnProportion ( unsigned int  column,
int  proportion 
)

Set proportion of a auto-stretchable column.

Returns:
Returns on failure.
Remarks:
This member function will fail unless window style wxPG_SPLITTER_AUTO_CENTER is used.

Also, you should call this for individual pages of wxPropertyGridManager (if used).

See also:
GetColumnProportion()
void wxPropertyGridInterface::SetExpandedProperties ( const wxArrayPGProperty &  array,
bool  expand = true 
)

Sets all properties in given array as expanded.

Parameters:
expand False if you want to collapse properties instead.
Remarks:
If wxPG_USE_STL is 1, then wxArrayPGProperty is typedef of std::vector<wxPGProperty*>.
void wxPropertyGridInterface::SetPropertiesFlag ( const wxArrayPGProperty &  srcArr,
wxPGProperty::FlagType  flags,
bool  inverse = false 
)

Sets or clears flag(s) of all properties in given array.

Parameters:
flags Property flags to set or clear.
inverse Set to true if you want to clear flag instead of setting them.
Remarks:
If wxPG_USE_STL is 1, then wxArrayPGProperty is typedef of std::vector<wxPGProperty*>.
void wxPropertyGridInterface::SetPropertyAttribute ( wxPGPropArg  id,
const wxString &  attrName,
wxVariant  value,
long  argFlags = 0 
)

Sets an attribute of a property.

Ids and relevants values are totally specific to property classes and may affect either the given instance or all instances of that class. See wxPropertyGrid Property Attribute Identifiers for list of built-in attributes.

Parameters:
argFlags Optional. Use wxPG_RECURSE to set the attribute to child properties as well.
Remarks:
  • Settings attribute's value to Null variant will simply remove it from property's set of attributes.
  • wxVariant doesn't have int constructor (as of 2.5.4), so you will need to cast int values (including most numeral constants) to long.
void wxPropertyGridInterface::SetPropertyCell ( wxPGPropArg  id,
int  column,
const wxString &  text = wxEmptyString,
const wxBitmap &  bitmap = wxNullBitmap,
const wxColour &  fgCol = wxNullColour,
const wxColour &  bgCol = wxNullColour 
)

Sets text, bitmap, and colours for given column's cell.

Remarks:
  • You can set label cell by setting column to 0.
  • You can use wxPG_LABEL as text to use default text for column.
void wxPropertyGridInterface::SetPropertyChoices ( wxPGPropArg  id,
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.

This function will deselect the property, if necessary.

void wxPropertyGridInterface::SetPropertyClientData ( wxPGPropArg  id,
wxPGProperty::ClientDataType  clientData 
)

Sets client data (void*) of a property.

Remarks:
This untyped client data has to be deleted manually.
void wxPropertyGridInterface::SetPropertyEditor ( wxPGPropArg  id,
const wxString &  editorName 
)

Sets editor control of a property.

As editor argument, use editor name string, such as wxT("TextCtrl") or wxT("Choice").

void wxPropertyGridInterface::SetPropertyEditor ( wxPGPropArg  id,
const wxPGEditor editor 
)

Sets editor control of a property.

As editor argument, use wxPG_EDITOR(EditorName), where basic built-in editor names are TextCtrl, Choice, ComboBox, CheckBox, TextCtrlAndButton, and ChoiceAndButton. Additional editors include SpinCtrl and DatePickerCtrl, which also require wxPropertyGrid::RegisterAdditionalEditors() call prior using.

void wxPropertyGridInterface::SetPropertyHelpString ( wxPGPropArg  id,
const wxString &  helpString 
)

Associates the help string with property.

Remarks:
By default, text is shown either in the manager's "description" text box or in the status bar. If extra window style wxPG_EX_HELP_AS_TOOLTIPS is used, then the text will appear as a tooltip.
void wxPropertyGridInterface::SetPropertyImage ( wxPGPropArg  id,
wxBitmap &  bmp 
)

Set wxBitmap in front of the value.

Remarks:
void wxPropertyGridInterface::SetPropertyLabel ( wxPGPropArg  id,
const wxString &  newproplabel 
)

Sets label of a property.

Remarks:
  • Properties under same parent may have same labels. However, property names must still remain unique.
void wxPropertyGridInterface::SetPropertyReadOnly ( wxPGPropArg  id,
bool  set = true,
int  flags = wxPG_RECURSE 
)

Sets property (and, recursively, its children) to have read-only value.

In other words, user cannot change the value in the editor, but they can still copy it.

Parameters:
flags By default changes are applied recursively. Set this paramter wxPG_DONT_RECURSE to prevent this.
Remarks:
This is mainly for use with textctrl editor. Not all other editors fully support it.

Also note that read-only state does not immediately become active for currently open property editor.

void wxPropertyGridInterface::SetPropertyValue ( wxPGPropArg  id,
wxVariant  value 
)

Sets value (wxVariant&) of a property.

Remarks:
Use wxPropertyGrid::ChangePropertyValue() instead if you need to run through validation process and send property change event.
void wxPropertyGridInterface::SetPropertyValue ( wxPGPropArg  id,
void *  value 
)

Sets value (void*) of a property.

void wxPropertyGridInterface::SetPropertyValue ( wxPGPropArg  id,
const wxString &  value 
)

Sets value (wxString) of a property.

Remarks:
This method uses wxPGProperty::SetValueFromString, which all properties should implement. This means that there should not be a type error, and instead the string is converted to property's actual value type.
void wxPropertyGridInterface::SetPropertyValueUnspecified ( wxPGPropArg  id  ) 

Sets property's value to unspecified.

If it has children (it may be category), then the same thing is done to them.

void wxPropertyGridInterface::SetPropVal ( wxPGPropArg  id,
wxVariant &  value 
)

Sets value (wxDateTime&) of a property.

Sets value (wxVariant&) of a property. Same as SetPropertyValue, but accepts reference.

void wxPropertyGridInterface::SetValidationFailureBehavior ( int  vfbFlags  ) 

Adjusts how wxPropertyGrid behaves when invalid value is entered in a property.

Parameters:
vfbFlags See list of valid flags values

The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations Enumerator
Generated on Sun Aug 22 12:42:15 2010 for wxPropertyGrid by  doxygen 1.6.3