wxPropertyGrid
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
wxPropertyGrid Class Reference

wxPropertyGrid is a specialized two-column grid for editing properties such as strings, numbers, flagsets, fonts, and colours. More...

#include <propgrid.h>

Inheritance diagram for wxPropertyGrid:
wxPropertyGridInterface

Public Member Functions

void AddActionTrigger (int action, int keycode, int modifiers=0)
 Adds given key combination to trigger given action. More...
 
bool AddToSelection (wxPGPropArg id)
 Adds given property into selection. More...
 
bool AdjustPosForClipperWindow (wxWindow *topCtrlWnd, int *x, int *y)
 Adjusts given position if topCtrlWnd is child of clipper window.
 
void BeginLabelEdit (unsigned int column=0)
 Creates label editor wxTextCtrl for given column, for property that is currently selected. More...
 
bool CanClose ()
 Returns true if all property grid data changes have been committed. More...
 
void CenterSplitter (bool enableAutoResizing=false)
 Centers the splitter. More...
 
bool ChangePropertyValue (wxPGPropArg id, wxVariant newValue)
 Changes value of a property, as if from an editor. More...
 
virtual void Clear ()
 Deletes all properties. More...
 
void ClearActionTriggers (int action)
 Clears action triggers for given action. More...
 
void ClearInternalFlag (long flag)
 
void ClearModifiedStatus (wxPGPropArg id)
 Resets modified status of a property and all sub-properties.
 
void ClearModifiedStatus ()
 Resets modified status of all properties.
 
void ClearTargetPage ()
 Synonymous to Clear. More...
 
virtual bool CommitChangesFromEditor (wxUint32 flags=0)
 Forces updating the value of property from the editor control. More...
 
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=(0), const wxString &name=wxPropertyGridNameStr)
 Two step creation. More...
 
void DecFrozen ()
 
virtual void DoHidePropertyError (wxPGProperty *property)
 Override in derived class to hide an error displayed by DoShowPropertyError(). More...
 
virtual bool DoOnValidationFailure (wxPGProperty *property, wxVariant &invalidValue)
 Override to customize property validation failure behavior. More...
 
virtual void DoOnValidationFailureReset (wxPGProperty *property)
 Override to customize resetting of property validation failure status. More...
 
virtual bool DoPropertyChanged (wxPGProperty *p, unsigned int selFlags=0)
 Pending value is expected to be passed in PerformValidation().
 
virtual void DoShowPropertyError (wxPGProperty *property, const wxString &msg)
 Override in derived class to display error messages in custom manner (these message usually only result from validation failure). More...
 
void DrawItem (wxPGProperty *p)
 
virtual void DrawItemAndChildren (wxPGProperty *p)
 
void DrawItemAndValueRelated (wxPGProperty *p)
 Draws item, children, and consequtive parents as long as category is not met. More...
 
void EditorsValueWasModified ()
 Call when editor widget's contents is modified. More...
 
void EditorsValueWasNotModified ()
 Reverse of EditorsValueWasModified(). More...
 
bool EditorValidate ()
 Returns true if all property grid data changes have been committed. More...
 
bool EnableCategories (bool enable)
 Enables or disables (shows/hides) categories according to parameter enable. More...
 
void EndLabelEdit (bool commit=true)
 Destroys label editor wxTextCtrl, if any. More...
 
bool EnsureVisible (wxPGPropArg id)
 Scrolls and/or expands items to ensure that the given item is visible. More...
 
wxSize FitColumns ()
 Reduces column sizes to minimum possible that contents are still visibly (naturally some margin space will be applied as well). More...
 
void FixPosForTextCtrl (wxWindow *ctrl, unsigned int forColumn=1, const wxPoint &offset=wxPoint(0, 0))
 Fixes position of wxTextCtrl-like control (wxSpinCtrl usually fits as one). More...
 
wxWindow * GenerateEditorButton (const wxPoint &pos, const wxSize &sz)
 Shortcut for creating dialog-caller button. More...
 
wxWindow * GenerateEditorTextCtrl (const wxPoint &pos, const wxSize &sz, const wxString &value, wxWindow *secondary, int extraStyle=0, int maxLen=0, unsigned int forColumn=1)
 Shortcut for creating text editor widget. More...
 
wxWindow * GenerateEditorTextCtrlAndButton (const wxPoint &pos, const wxSize &sz, wxWindow **psecondary, int limited_editing, wxPGProperty *property)
 
wxColour GetCaptionBackgroundColour () const
 Returns current category caption background colour. More...
 
wxFont & GetCaptionFont ()
 
const wxFont & GetCaptionFont () const
 
wxColour GetCaptionForegroundColour () const
 Returns current category caption text colour. More...
 
wxColour GetCellBackgroundColour () const
 Returns current cell background colour. More...
 
wxColour GetCellDisabledTextColour () const
 Returns current cell text colour when disabled. More...
 
wxColour GetCellTextColour () const
 Returns current cell text colour. More...
 
unsigned int GetChildrenCount ()
 Returns number of children of the root property.
 
unsigned int GetChildrenCount (wxPGPropArg id) const
 Returns number of children for the property. More...
 
unsigned int GetColumnCount () const
 
const wxPGCommonValueGetCommonValue (unsigned int i) const
 
unsigned int GetCommonValueCount () const
 Returns number of common values.
 
wxString GetCommonValueLabel (unsigned int i) const
 Returns label of given common value.
 
wxWindow * GetEditorControl () const
 Returns pointer to current active primary editor control (NULL if none). More...
 
wxWindow * GetEditorControlSecondary () const
 Returns pointer to current active secondary editor control (NULL if none).
 
wxTextCtrl * GetEditorTextCtrl () const
 Returns wxTextCtrl active in currently selected property, if any. More...
 
wxColour GetEmptySpaceColour () const
 Returns colour of empty space below properties. More...
 
wxPGPropertyGetFirstCategory () const
 Returns id of first category (from target page). More...
 
wxPGPropertyGetFirstProperty ()
 Returns id of first property that is not a category. More...
 
const wxPGPropertyGetFirstVisible () const
 Returns id of first visible item, whether it is a category or property. More...
 
wxPGPropertyGetFirstVisible ()
 
int GetFontHeight () const
 Returns height of highest characters of used font. More...
 
wxPoint GetGoodEditorDialogPosition (wxPGProperty *p, const wxSize &sz)
 Generates position for a widget editor dialog box. More...
 
wxPropertyGridGetGrid ()
 Returns pointer to itself. More...
 
wxRect GetImageRect (wxPGProperty *p, int item) const
 
wxSize GetImageSize (wxPGProperty *p=NULL, int item=-1) const
 Returns size of the custom paint image in front of property. More...
 
long GetInternalFlags () const
 
wxPGPropertyGetItemAtY (int y) const
 Returns GetCustomPaintWidth for odcombo, GetImageSize(GetSelection()) otherwise. More...
 
wxTextCtrl * GetLabelEditor () const
 Returns currently active label editor, NULL if none.
 
wxPGPropertyGetLastChild (wxPGPropArg id)
 Returns id of last child of given property. More...
 
wxPGPropertyGetLastItem (int flags=wxPG_ITERATE_DEFAULT)
 Returns last item which could be iterated using given flags. More...
 
const wxPGPropertyGetLastItem (int flags=wxPG_ITERATE_DEFAULT) const
 
wxPGPropertyGetLastProperty ()
 Returns id of last item. More...
 
wxPGPropertyGetLastVisible ()
 Returns id of last visible item. More...
 
wxColour GetLineColour () const
 Returns colour of lines between cells. More...
 
wxColour GetMarginColour () const
 Returns background colour of margin. More...
 
wxPGPropertyGetNextCategory (wxPGPropArg id) const
 Returns id of next category after a given property (which does not have to be category). More...
 
wxPGPropertyGetNextProperty (wxPGPropArg id)
 Returns id of next property. More...
 
wxPGPropertyGetNextVisible (wxPGPropArg id) const
 Returns id of next visible item. More...
 
wxPanel * GetPanel () const
 Returns wxWindow that the properties are painted on, and which should be used as the parent for editor controls.
 
wxPGPropertyGetPrevProperty (wxPGPropArg id)
 Returns id of previous property. More...
 
wxPGPropertyGetPrevSiblingProperty (wxPGPropArg id)
 Returns id of previous item under the same parent. More...
 
wxPGPropertyGetPrevVisible (wxPGPropArg id)
 Returns id of previous visible property. More...
 
wxWindow * GetPrimaryEditor () const
 
wxColour GetPropertyBackgroundColour (wxPGPropArg id) const
 Returns cell background colour of a property. More...
 
wxPGPropertyGetPropertyByLabel (const wxString &name) const
 Returns id of property with given label (case-sensitive). More...
 
wxColour GetPropertyColour (wxPGPropArg id) const
 Returns cell background colour of a property. More...
 
wxRect GetPropertyRect (const wxPGProperty *p1, const wxPGProperty *p2) const
 Returns rectangle that fully contains properties between and including p1 and p2.
 
wxColour GetPropertyTextColour (wxPGPropArg id) const
 Returns cell background colour of a property. More...
 
wxPGPropertyGetRoot () const
 Returns "root property". More...
 
int GetRowHeight () const
 Returns height of a single grid row (in pixels). More...
 
wxPGPropertyGetSelectedProperty () const
 
wxColour GetSelectionBackgroundColour () const
 Returns current selection background colour. More...
 
wxColour GetSelectionForegroundColour () const
 Returns current selection text colour. More...
 
wxPGSortCallback GetSortFunction () const
 Returns the property sort function (NULL is default).
 
int GetSpacingY () const
 
int GetSplitterPosition () const
 Returns current splitter x position. More...
 
int GetUnspecifiedCommonValue () const
 Returns index of common value that will truly change value to unspecified.
 
const wxPGCellGetUnspecifiedValueAppearance () const
 Returns current appearance of unspecified value cells. More...
 
wxString GetUnspecifiedValueText (int argFlags=0) const
 Returns (visual) text representation of the unspecified property value.
 
wxPGValidationInfoGetValidationInfo ()
 
int GetVerticalSpacing () const
 Returns current vertical spacing. More...
 
bool HandleCustomEditorEvent (wxCommandEvent &event)
 
bool HasInternalFlag (long flag) const
 
bool HasSelection () const
 Returns true if a property is selected. More...
 
bool HasVirtualWidth () const
 
wxPropertyGridHitTestResult HitTest (const wxPoint &pt) const
 Returns information about arbitrary position in the grid.
 
void IncFrozen ()
 
bool IsAnyModified () const
 Returns true if any property has been modified by the user. More...
 
bool IsEditorFocused () const
 Returns if editor control has focus.
 
bool IsEditorsValueModified () const
 Returns true if editor's value was marked modified. More...
 
bool IsFrozen () const
 Returns true if updating is frozen (ie. More...
 
bool IsMainButtonEvent (const wxEvent &event)
 Returns true if given event is from first of an array of buttons (as can be in case when wxPGMultiButton is used).
 
void MakeColumnEditable (unsigned int column, bool editable=true)
 Makes given column editable by user. More...
 
void OnComboItemPaint (wxPGCustomComboControl *pCb, int item, wxDC &dc, wxRect &rect, int flags)
 
void OnCustomEditorEvent (wxCommandEvent &event)
 Pass this function to Connect calls in propertyclass::CreateEditor.
 
void OnTLPChanging (wxWindow *newTLP)
 It is recommended that you call this function any time your code causes wxPropertyGrid's top-level parent to change. More...
 
bool OnValidationFailure (wxPGProperty *property, wxVariant &invalidValue)
 Called when validation for given property fails. More...
 
void OnValidationFailureReset (wxPGProperty *property)
 Called to indicate property and editor has valid value now.
 
virtual bool PerformValidation (wxPGProperty *p, wxVariant &pendingValue)
 Runs all validation functionality (includes sending wxEVT_PG_CHANGING). More...
 
void RefreshEditor ()
 If selected property's editor is active, then update it's value.
 
virtual void RefreshProperty (wxPGProperty *p)
 
bool RemoveFromSelection (wxPGPropArg id)
 Removes given property from selection. More...
 
void ResetColours ()
 Resets all colours to the original system values.
 
void ResetColumnSizes (bool enableAutoResizing=false)
 Resets column sizes and splitter positions, based on proportions. More...
 
bool SelectProperty (wxPGPropArg id, bool focus=false)
 Selects a property. More...
 
void SendNavigationKeyEvent (int dir)
 
void SetButtonShortcut (int keycode, bool ctrlDown=false, bool altDown=false)
 Changes keyboard shortcut to push the editor button. More...
 
void SetCaptionBackgroundColour (const wxColour &col)
 Sets category caption background colour. More...
 
void SetCaptionForegroundColour (const wxColour &col)
 Sets category caption text colour. More...
 
void SetCaptionTextColour (wxPGPropArg id, const wxColour &col)
 Sets text colour of a category caption (but not it's children).
 
void SetCellBackgroundColour (const wxColour &col)
 Sets default cell background colour - applies to property cells. More...
 
void SetCellDisabledTextColour (const wxColour &col)
 Sets cell text colour for disabled properties.
 
void SetCellTextColour (const wxColour &col)
 Sets default cell text colour - applies to property name and value text. More...
 
void SetColumnCount (int colCount)
 Set number of columns (2+).
 
void SetCurrentCategory (wxPGPropArg id)
 Sets the current category - Append will add non-categories under this one.
 
void SetEmptySpaceColour (const wxColour &col)
 Sets colour of empty space below properties. More...
 
void SetInternalFlag (long flag)
 
void SetLineColour (const wxColour &col)
 Sets colour of lines between cells. More...
 
void SetMarginColour (const wxColour &col)
 Sets background colour of margin. More...
 
void SetPropertyAttributeAll (const wxString &attrName, wxVariant value)
 Sets property attribute for all applicapple properties. More...
 
void SetPropertyBackgroundColour (wxPGPropArg id, const wxColour &col, int flags=wxPG_RECURSE)
 Sets background colour of property and all its children. More...
 
void SetPropertyColour (wxPGPropArg id, const wxColour &col)
 Sets background colour of property and all its children. More...
 
void SetPropertyColourToDefault (wxPGPropArg id)
 Sets background and text colour of property and all its children to the default. More...
 
void SetPropertyName (wxPGPropArg id, const wxString &newname)
 Sets name of a property. More...
 
void SetPropertyTextColour (wxPGPropArg id, const wxColour &col, int flags=wxPG_RECURSE)
 Sets text colour of property and all its children. More...
 
void SetSelection (const wxArrayPGProperty &newSelection)
 Set entire new selection from given list of properties.
 
void SetSelectionBackground (const wxColour &col)
 Sets selection background colour - applies to selected property name background. More...
 
void SetSelectionForeground (const wxColour &col)
 Sets selection foreground colour - applies to selected property name text. More...
 
void SetSortFunction (wxPGSortCallback sortFunction)
 Sets the property sorting function. More...
 
void SetSplitterLeft (bool subProps=false)
 Moves splitter as left as possible, while still allowing all labels to be shown in full. More...
 
void SetSplitterPosition (int newxpos, bool refresh=true)
 Sets x coordinate of the splitter. More...
 
void SetUnspecifiedCommonValue (int index)
 Set index of common value that will truly change value to unspecified. More...
 
void SetUnspecifiedValueAppearance (const wxPGCell &cell)
 Sets appearance of value cells representing an unspecified property value. More...
 
void SetupTextCtrlValue (const wxString text)
 Must be called in wxPGEditor::CreateControls() if primary editor window is wxTextCtrl, just before textctrl is created. More...
 
void SetVerticalSpacing (int vspacing)
 Sets vertical spacing. More...
 
void SetVirtualWidth (int width)
 Set virtual width for this particular page. More...
 
virtual void SetWindowStyleFlag (long style)
 Overridden function. More...
 
void ShowPropertyError (wxPGPropArg id, const wxString &msg)
 Shows an brief error message that is related to a property. More...
 
void Sort ()
 Sorts all items at all levels (except sub-properties). More...
 
void Sort (wxPGPropArg id)
 Sorts children of a category.
 
void SwitchState (wxPropertyGridState *pNewState)
 Mostly useful for page switching.
 
bool UnfocusEditor ()
 Unfocuses or closes editor if one was open, but does not deselect property.
 
void ValueChangeInEvent (wxVariant variant)
 Call this from wxPGProperty::OnEvent() to cause property value to be changed after the function returns (with true as return value). More...
 
bool WasValueChangedInEvent () const
 You can use this member function, for instance, to detect in wxPGProperty::OnEvent() if wxPGProperty::SetValueInEvent() was already called in wxPGEditor::OnEvent(). More...
 
 wxPropertyGrid ()
 Two step constructor. More...
 
 wxPropertyGrid (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=(0), const wxString &name=wxPropertyGridNameStr)
 The default constructor. More...
 
virtual ~wxPropertyGrid ()
 Destructor.
 
- Public Member Functions inherited from wxPropertyGridInterface
void AddPropertyChoice (wxPGPropArg id, const wxString &label, int value=INT_MAX)
 Adds choice to a property that can accept one. More...
 
wxPGPropertyAppend (wxPGProperty *property)
 Appends property to the list. More...
 
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. More...
 
bool ChangePropertyValue (wxPGPropArg id, wxVariant newValue)
 Changes value of a property, as if from an editor. More...
 
bool ClearPropertyValue (wxPGPropArg id)
 Resets value of a property to its default. More...
 
bool ClearSelection (bool validation=true)
 Clears current selection, if any. More...
 
bool Collapse (wxPGPropArg id)
 Collapses given category or property with children. More...
 
bool CollapseAll ()
 Collapses all items that can be collapsed. More...
 
void Delete (wxPGPropArg id)
 Deletes a property by id. More...
 
void DeleteProperty (wxPGPropArg id)
 Removes and deletes a property. More...
 
void DeletePropertyChoice (wxPGPropArg id, int index)
 Deletes choice from a property. More...
 
bool Disable (wxPGPropArg id)
 Disables property. More...
 
bool DisableProperty (wxPGPropArg id)
 Disables property. More...
 
bool EnableProperty (wxPGPropArg id, bool enable=true)
 Enables or disables property, depending on whether enable is true or false. More...
 
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. More...
 
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. More...
 
wxArrayPGProperty GetExpandedProperties () const
 Returns list of expanded properties. More...
 
wxPGPropertyGetFirst (int flags=wxPG_ITERATE_ALL)
 Returns id of first item, whether it is a category or property. More...
 
const wxPGPropertyGetFirst (int flags=wxPG_ITERATE_ALL) const
 
wxPGPropertyGetFirstChild (wxPGPropArg id)
 Returns id of first child of given property. More...
 
wxPropertyGridIterator GetIterator (int flags=wxPG_ITERATE_DEFAULT, wxPGProperty *firstProp=NULL)
 Returns iterator class instance. More...
 
wxPropertyGridConstIterator GetIterator (int flags=wxPG_ITERATE_DEFAULT, wxPGProperty *firstProp=NULL) const
 
wxPropertyGridIterator GetIterator (int flags, int startPos)
 Returns iterator class instance. More...
 
wxPropertyGridConstIterator GetIterator (int flags, int startPos) const
 
wxPGPropertyGetNextSiblingProperty (wxPGPropArg id)
 Returns next item under the same parent. More...
 
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. More...
 
wxPGPropertyGetProperty (const wxString &name) const
 Returns pointer to the property with given name (case-sensitive). More...
 
wxVariant GetPropertyAttribute (wxPGPropArg id, const wxString &attrName) const
 Returns value of given attribute. More...
 
const wxPGAttributeStorageGetPropertyAttributes (wxPGPropArg id) const
 Returns map-like storage of property's attributes. More...
 
wxPGPropertyGetPropertyByName (const wxString &name) const
 Returns pointer to the property with given name (case-sensitive). More...
 
wxPGPropertyGetPropertyByName (const wxString &name, const wxString &subname) const
 Returns id of a sub-property 'subname' of property 'name'. More...
 
wxPGPropertyGetPropertyByNameA (const wxString &name) const
 
wxPropertyCategoryGetPropertyCategory (wxPGPropArg id) const
 Returns pointer of property's nearest parent category. More...
 
wxPGChoicesGetPropertyChoices (wxPGPropArg id)
 Returns writable reference to property's list of choices (and relevant values). More...
 
const wxChar * GetPropertyClassName (wxPGPropArg id) const
 Gets name of property's constructor function. More...
 
wxPGProperty::ClientDataType GetPropertyClientData (wxPGPropArg id) const
 Returns client data (void*) of a property. More...
 
const wxPGEditorGetPropertyEditor (wxPGPropArg id) const
 Returns property's editor. More...
 
wxString GetPropertyHelpString (wxPGPropArg id) const
 Returns help string associated with a property. More...
 
wxBitmap * GetPropertyImage (wxPGPropArg id) const
 Returns property's custom value image (NULL of none). More...
 
unsigned int GetPropertyIndex (wxPGPropArg id)
 Returns property's position under its parent. More...
 
const wxString & GetPropertyLabel (wxPGPropArg id)
 Returns label of a property. More...
 
wxString GetPropertyName (wxPGPropArg id)
 Returns name of a property, by which it is globally accessible. More...
 
wxPGPropertyGetPropertyParent (wxPGPropArg id)
 Returns parent item of a property. More...
 
wxPGPropertyGetPropertyPtr (wxPGPropArg id) const
 Returns pointer to a property.
 
wxString GetPropertyShortClassName (wxPGPropArg id)
 Returns short name for property's class. More...
 
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. More...
 
wxArrayInt GetPropertyValueAsArrayInt (wxPGPropArg id) const
 
wxArrayString GetPropertyValueAsArrayString (wxPGPropArg id) const
 
bool GetPropertyValueAsBool (wxPGPropArg id) const
 
wxDateTime GetPropertyValueAsDateTime (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. More...
 
wxString GetPropertyValueType (wxPGPropArg id)
 
const wxArrayPGProperty & GetSelectedProperties () const
 Returns list of currently selected properties. More...
 
wxPGPropertyGetSelection () const
 Returns currently selected property. More...
 
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. More...
 
wxPGPropertyInsert (wxPGPropArg priorThis, wxPGProperty *newproperty)
 Inserts property to the property container. More...
 
wxPGPropertyInsert (wxPGPropArg parent, int index, wxPGProperty *newproperty)
 Also see documentation for Insert . More...
 
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. More...
 
bool IsModified (wxPGPropArg id) const
 Returns true if property has been modified after value set or modify flag clear by software. More...
 
bool IsPropertyCategory (wxPGPropArg id) const
 Returns true if property is a category. More...
 
bool IsPropertyEnabled (wxPGPropArg id) const
 Returns true if property is enabled. More...
 
bool IsPropertyExpanded (wxPGPropArg id) const
 Returns true if given property is expanded. More...
 
bool IsPropertyKindOf (wxPGPropArg id, wxClassInfo *info) const
 Returns true if property is of certain type. More...
 
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. More...
 
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. More...
 
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. More...
 
void PropertiesToNames (wxArrayString *names, const wxArrayPGProperty &properties) const
 Converts array of properties to array of names. More...
 
virtual void RefreshGrid (wxPropertyGridState *state=NULL)
 If state is shown in it's grid, refresh it now.
 
wxPGPropertyRemoveProperty (wxPGPropArg id)
 Removes a property. More...
 
wxPGPropertyReplaceProperty (wxPGPropArg id, wxPGProperty *property)
 Replaces property with id with newly created property. More...
 
bool RestoreEditableState (const wxString &src, int restoreStates=AllStates)
 Restores user-editable state. More...
 
wxString SaveEditableState (int includedStates=AllStates) const
 Used to acquire user-editable state (selected property, expanded properties, scrolled position, splitter positions). More...
 
bool SetColumnProportion (unsigned int column, int proportion)
 Set proportion of a auto-stretchable column. More...
 
void SetExpandedProperties (const wxArrayPGProperty &array, bool expand=true)
 Sets all properties in given array as expanded. More...
 
void SetPropertiesFlag (const wxArrayPGProperty &srcArr, wxPGProperty::FlagType flags, bool inverse=false)
 Sets or clears flag(s) of all properties in given array. More...
 
void SetPropertyAttribute (wxPGPropArg id, const wxString &attrName, wxVariant value, long argFlags=0)
 Sets an attribute of a property. More...
 
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. More...
 
void SetPropertyChoices (wxPGPropArg id, wxPGChoices &choices)
 Set choices of a property to specified set of labels and values. More...
 
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. More...
 
void SetPropertyEditor (wxPGPropArg id, const wxPGEditor *editor)
 Sets editor control of a property. More...
 
void SetPropertyEditor (wxPGPropArg id, const wxString &editorName)
 Sets editor control of a property. More...
 
void SetPropertyHelpString (wxPGPropArg id, const wxString &helpString)
 Associates the help string with property. More...
 
void SetPropertyImage (wxPGPropArg id, wxBitmap &bmp)
 Set wxBitmap in front of the value. More...
 
void SetPropertyLabel (wxPGPropArg id, const wxString &newproplabel)
 Sets label of a property. More...
 
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. More...
 
void SetPropertyValidator (wxPGPropArg id, const wxValidator &validator)
 Sets validator of a property.
 
void SetPropertyValue (wxPGPropArg id, long value)
 Sets value (long integer) of a property.
 
void SetPropertyValue (wxPGPropArg id, int value)
 Sets value (integer) of a property.
 
void SetPropertyValue (wxPGPropArg id, double value)
 Sets value (floating point) of a property.
 
void SetPropertyValue (wxPGPropArg id, bool value)
 Sets value (bool) of a property.
 
void SetPropertyValue (wxPGPropArg id, const wxChar *value)
 
void SetPropertyValue (wxPGPropArg id, const wxArrayString &value)
 Sets value (wxArrayString) of a property.
 
void SetPropertyValue (wxPGPropArg id, const wxDateTime &value)
 
void SetPropertyValue (wxPGPropArg id, const wxString &value)
 Sets value (wxString) of a property. More...
 
void SetPropertyValue (wxPGPropArg id, wxObject *value)
 Sets value (wxObject*) of a property.
 
void SetPropertyValue (wxPGPropArg id, void *value)
 Sets value (void*) of a property. More...
 
void SetPropertyValue (wxPGPropArg id, wxObject &value)
 
void SetPropertyValue (wxPGPropArg id, wxVariant value)
 Sets value (wxVariant&) of a property. More...
 
void SetPropertyValue (wxPGPropArg id, const wxPoint &value)
 Sets value (wxPoint&) of a property.
 
void SetPropertyValue (wxPGPropArg id, const wxSize &value)
 Sets value (wxSize&) of a property.
 
void SetPropertyValue (wxPGPropArg id, wxLongLong_t value)
 Sets value (wxLongLong&) of a property.
 
void SetPropertyValue (wxPGPropArg id, wxULongLong_t value)
 Sets value (wxULongLong&) of a property.
 
void SetPropertyValue (wxPGPropArg id, const wxArrayInt &value)
 Sets value (wxArrayInt&) of a property.
 
void SetPropertyValues (const wxVariantList &list, wxPGPropArg defaultCategory=((wxPGProperty *) NULL))
 Sets property values from a list of wxVariants.
 
void SetPropertyValues (const wxVariant &list, wxPGPropArg defaultCategory=((wxPGProperty *) NULL))
 Sets property values from a list of wxVariants.
 
void SetPropertyValueUnspecified (wxPGPropArg id)
 Sets property's value to unspecified. More...
 
void SetPropVal (wxPGPropArg id, wxVariant &value)
 Sets value (wxDateTime&) of a property. More...
 
void SetValidationFailureBehavior (int vfbFlags)
 Adjusts how wxPropertyGrid behaves when invalid value is entered in a property. More...
 
virtual ~wxPropertyGridInterface ()
 Destructor.
 

Static Public Member Functions

static void ArrayStringToString (wxString &dst, const wxArrayString &src, wxChar preDelim, wxChar postDelim, int flags)
 Generates contents for string dst based on the convetents of wxArrayString src. More...
 
static void AutoGetTranslation (bool enable)
 This static function enables or disables automatic use of wxGetTranslation for following strings: wxEnumProperty list labels, wxFlagsProperty sub-property labels. More...
 
static wxString & CreateEscapeSequences (wxString &dst_str, wxString &src_str)
 
static void DoubleToString (wxString &target, double value, int precision, bool removeZeroes, wxString *precTemplate)
 Standardized double-to-string conversion.
 
static wxString & ExpandEscapeSequences (wxString &dst_str, wxString &src_str)
 
static wxPGEditorRegisterEditorClass (wxPGEditor *editor, const wxString &name, bool noDefCheck=false)
 Registers a new editor class. More...
 
- Static Public Member Functions inherited from wxPropertyGridInterface
static wxPGPropertyCreatePropertyByClass (const wxString &classname, const wxString &label, const wxString &name)
 Constructs a property. More...
 
static wxPGPropertyCreatePropertyByType (const wxString &valuetype, const wxString &label, const wxString &name)
 Constructs a property. More...
 
static wxPGEditorGetEditorByName (const wxString &editorName)
 
static void InitAllTypeHandlers ()
 Initializes all property types. More...
 
static void RegisterAdditionalEditors ()
 Initializes additional property editors (SpinCtrl etc.). More...
 
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. More...
 

Protected Member Functions

virtual wxPropertyGridStateCreateState () const
 wxPropertyGridState used by the grid is created here. More...
 
- Protected Member Functions inherited from wxPropertyGridInterface
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.
 

Additional Inherited Members

- Public Types inherited from wxPropertyGridInterface
enum  EditableStateFlags {
  SelectionState = 0x01, ExpandedState = 0x02, ScrollPosState = 0x04, PageState = 0x08,
  SplitterPosState = 0x10, DescBoxState = 0x20, AllStates
}
 
- Protected Attributes inherited from wxPropertyGridInterface
wxString m_emptyString
 
wxPropertyGridStatem_pState
 

Detailed Description

wxPropertyGrid is a specialized two-column grid for editing properties such as strings, numbers, flagsets, fonts, and colours.

wxPropertySheet used to do the very same thing, but it hasn't been updated for a while and it is currently deprecated.

Please note that most member functions are inherited and as such not documented on this page. This means you will probably also want to read wxPropertyGridInterface class reference.

Derived from

wxPropertyGridInterface
wxScrolledWindow
wxPanel
wxWindow
wxEvtHandler
wxObject

Include files

<wx/propertygrid/propertygrid.h>

Window styles

Additional Window Styles

Event handling

To process input from a propertygrid control, use these event handler macros to direct input to member functions that take a wxPropertyGridEvent argument.

EVT_PG_SELECTED (id, func)Property is selected.
EVT_PG_CHANGED (id, func)Property value is modified.
EVT_PG_CHANGING (id, func)Property value is about to be changed. Use wxPropertyGridEvent::GetValue() to take a peek at the pending value, and wxPropertyGridEvent::Veto() to prevent change from taking place, if necessary.
EVT_PG_HIGHLIGHTED (id, func)Mouse moves over property. Event's property is NULL if hovered on area that is not a property.
EVT_PG_RIGHT_CLICK (id, func)Mouse right-clicked on a property.
EVT_PG_DOUBLE_CLICK (id, func)Mouse double-clicked on a property.
EVT_PG_ITEM_COLLAPSED (id, func)User collapses a property or category.
EVT_PG_ITEM_EXPANDED (id, func)User expands a property or category.
EVT_PG_LABEL_EDIT_BEGIN (id, func)User is about to begin editing a property label. You can veto this event to prevent the action.
EVT_PG_LABEL_EDIT_ENDING (id, func)

User is about to end editing of a property label. You can veto this event to prevent the action.

EVT_BUTTON (id, func)Button in a property editor was clicked. Only occurs if the property doesn't handle button clicks itself.
EVT_TEXT (id, func)wxTextCtrl based editor was updated (but property value was not yet modified)
See also
wxPropertyGridEvent
Remarks

For code examples, see the main page.

Constructor & Destructor Documentation

◆ wxPropertyGrid() [1/2]

wxPropertyGrid::wxPropertyGrid ( )

Two step constructor.

Call Create when this constructor is called to build up the wxPropertyGrid

◆ wxPropertyGrid() [2/2]

wxPropertyGrid::wxPropertyGrid ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = (0),
const wxString &  name = wxPropertyGridNameStr 
)

The default constructor.

The styles to be used are styles valid for the wxWindow and wxScrolledWindow.

See also
Additional Window Styles

Member Function Documentation

◆ AddActionTrigger()

void wxPropertyGrid::AddActionTrigger ( int  action,
int  keycode,
int  modifiers = 0 
)

Adds given key combination to trigger given action.

Parameters
actionWhich action to trigger. See List of list of wxPropertyGrid actions.

◆ AddToSelection()

bool wxPropertyGrid::AddToSelection ( wxPGPropArg  id)

Adds given property into selection.

If wxPG_EX_MULTIPLE_SELECTION extra style is not used, then this has same effect as calling SelectProperty().

Remarks
Multiple selection is not supported for categories. This means that if you have properties selected, you cannot add category to selection, and also if you have category selected, you cannot add other properties to selection. This member function will fail silently in these cases, even returning true.

◆ ArrayStringToString()

static void wxPropertyGrid::ArrayStringToString ( wxString &  dst,
const wxArrayString &  src,
wxChar  preDelim,
wxChar  postDelim,
int  flags 
)
static

Generates contents for string dst based on the convetents of wxArrayString src.

Format will be "(preDelim)str1(postDelim) (preDelim)str2(postDelim) and so on. Set flags to 1 inorder to convert backslashes to double-back- slashes and "(preDelims)"'s to "(preDelims)".

◆ AutoGetTranslation()

static void wxPropertyGrid::AutoGetTranslation ( bool  enable)
static

This static function enables or disables automatic use of wxGetTranslation for following strings: wxEnumProperty list labels, wxFlagsProperty sub-property labels.

Default is false.

◆ BeginLabelEdit()

void wxPropertyGrid::BeginLabelEdit ( unsigned int  column = 0)

Creates label editor wxTextCtrl for given column, for property that is currently selected.

When multiple selection is enabled, this applies to whatever property GetSelection() returns.

Parameters
colIndexWhich column's label to edit. Note that you should not use value 1, which is reserved for property value column.

◆ CanClose()

bool wxPropertyGrid::CanClose ( )

Returns true if all property grid data changes have been committed.

Usually only returns false if value in active editor has been invalidated by a wxValidator.

◆ CenterSplitter()

void wxPropertyGrid::CenterSplitter ( bool  enableAutoResizing = false)

Centers the splitter.

Parameters
enableAutoResizingIf , automatic column resizing is enabled (only applicapple if window style wxPG_SPLITTER_AUTO_CENTER is used).

◆ ChangePropertyValue()

bool wxPropertyGrid::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
Returnstrue if value was succesfully changed.

◆ Clear()

virtual void wxPropertyGrid::Clear ( )
virtual

Deletes all properties.

Does not free memory allocated for arrays etc. This should not be called in wxPropertyGridManager.

Implements wxPropertyGridInterface.

◆ ClearActionTriggers()

void wxPropertyGrid::ClearActionTriggers ( int  action)

Clears action triggers for given action.

Parameters
actionWhich action to trigger. See List of list of wxPropertyGrid actions.

◆ ClearTargetPage()

void wxPropertyGrid::ClearTargetPage ( )

Synonymous to Clear.

Deprecated:
Since version 1.3.

◆ CommitChangesFromEditor()

virtual bool wxPropertyGrid::CommitChangesFromEditor ( wxUint32  flags = 0)
virtual

Forces updating the value of property from the editor control.

Note that wxEVT_PG_CHANGING and wxEVT_PG_CHANGED are dispatched using ProcessEvent, meaning your event handlers will be called immediately.

Return values
Returnstrue if anything was changed.

◆ Create()

bool wxPropertyGrid::Create ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = (0),
const wxString &  name = wxPropertyGridNameStr 
)

Two step creation.

Whenever the control is created without any parameters, use Create to actually create it. Don't access the control's public methods before this is called

See also
Additional Window Styles

◆ CreateState()

virtual wxPropertyGridState* wxPropertyGrid::CreateState ( ) const
protectedvirtual

wxPropertyGridState used by the grid is created here.

If grid is used in wxPropertyGridManager, there is no point overriding this - instead, set custom wxPropertyGridPage classes.

◆ DoHidePropertyError()

virtual void wxPropertyGrid::DoHidePropertyError ( wxPGProperty property)
virtual

Override in derived class to hide an error displayed by DoShowPropertyError().

See also
DoShowPropertyError()

◆ DoOnValidationFailure()

virtual bool wxPropertyGrid::DoOnValidationFailure ( wxPGProperty property,
wxVariant &  invalidValue 
)
virtual

Override to customize property validation failure behavior.

Parameters
invalidValueValue which failed in validation.
Return values
Returntrue if user is allowed to change to another property even if current has invalid value.

◆ DoOnValidationFailureReset()

virtual void wxPropertyGrid::DoOnValidationFailureReset ( wxPGProperty property)
virtual

Override to customize resetting of property validation failure status.

Remarks
Property is guaranteed to have flag wxPG_PROP_INVALID_VALUE set.

◆ DoShowPropertyError()

virtual void wxPropertyGrid::DoShowPropertyError ( wxPGProperty property,
const wxString &  msg 
)
virtual

Override in derived class to display error messages in custom manner (these message usually only result from validation failure).

Remarks
If you implement this, then you also need to implement DoHidePropertyError() - possibly to do nothing, if error does not need hiding (e.g. it was logged or shown in a message box).
See also
DoHidePropertyError()

◆ DrawItemAndValueRelated()

void wxPropertyGrid::DrawItemAndValueRelated ( wxPGProperty p)

Draws item, children, and consequtive parents as long as category is not met.

◆ EditorsValueWasModified()

void wxPropertyGrid::EditorsValueWasModified ( )

Call when editor widget's contents is modified.

For example, this is called when changes text in wxTextCtrl (used in wxStringProperty and wxIntProperty).

Remarks
This should only be called by properties.
See also
wxPGProperty::OnEvent

◆ EditorsValueWasNotModified()

void wxPropertyGrid::EditorsValueWasNotModified ( )

◆ EditorValidate()

bool wxPropertyGrid::EditorValidate ( )

Returns true if all property grid data changes have been committed.

Usually only returns false if value in active editor has been invalidated by a wxValidator.

◆ EnableCategories()

bool wxPropertyGrid::EnableCategories ( bool  enable)

Enables or disables (shows/hides) categories according to parameter enable.

◆ EndLabelEdit()

void wxPropertyGrid::EndLabelEdit ( bool  commit = true)

Destroys label editor wxTextCtrl, if any.

Parameters
commitUse (default) to store edited label text in property cell data.

◆ EnsureVisible()

bool wxPropertyGrid::EnsureVisible ( wxPGPropArg  id)

Scrolls and/or expands items to ensure that the given item is visible.

Returns true if something was actually done.

◆ FitColumns()

wxSize wxPropertyGrid::FitColumns ( )

Reduces column sizes to minimum possible that contents are still visibly (naturally some margin space will be applied as well).

Return values
Minimumsize for the grid to still display everything.
Remarks
Does not work well with wxPG_SPLITTER_AUTO_CENTER window style.

This function only works properly if grid size prior to call was already fairly large.

Note that you can also get calculated column widths by calling GetState->GetColumnWidth() immediately after this function returns.

◆ FixPosForTextCtrl()

void wxPropertyGrid::FixPosForTextCtrl ( wxWindow *  ctrl,
unsigned int  forColumn = 1,
const wxPoint &  offset = wxPoint(0, 0) 
)

Fixes position of wxTextCtrl-like control (wxSpinCtrl usually fits as one).

Call after control has been created (but before shown).

◆ GenerateEditorButton()

wxWindow* wxPropertyGrid::GenerateEditorButton ( const wxPoint &  pos,
const wxSize &  sz 
)

Shortcut for creating dialog-caller button.

Used, for example, by wxFontProperty.

Remarks
This should only be called by properties.

◆ GenerateEditorTextCtrl()

wxWindow* wxPropertyGrid::GenerateEditorTextCtrl ( const wxPoint &  pos,
const wxSize &  sz,
const wxString &  value,
wxWindow *  secondary,
int  extraStyle = 0,
int  maxLen = 0,
unsigned int  forColumn = 1 
)

Shortcut for creating text editor widget.

Parameters
posSame as pos given for CreateEditor.
szSame as sz given for CreateEditor.
valueInitial text for wxTextCtrl.
secondaryIf right-side control, such as button, also created, then create it first and pass it as this parameter.
extraStyleExtra style flags to pass for wxTextCtrl.
Remarks
Note that this should generally be called only by new classes derived from wxPGProperty.

◆ GetCaptionBackgroundColour()

wxColour wxPropertyGrid::GetCaptionBackgroundColour ( ) const

Returns current category caption background colour.

◆ GetCaptionForegroundColour()

wxColour wxPropertyGrid::GetCaptionForegroundColour ( ) const

Returns current category caption text colour.

◆ GetCellBackgroundColour()

wxColour wxPropertyGrid::GetCellBackgroundColour ( ) const

Returns current cell background colour.

◆ GetCellDisabledTextColour()

wxColour wxPropertyGrid::GetCellDisabledTextColour ( ) const

Returns current cell text colour when disabled.

◆ GetCellTextColour()

wxColour wxPropertyGrid::GetCellTextColour ( ) const

Returns current cell text colour.

◆ GetChildrenCount()

unsigned int wxPropertyGrid::GetChildrenCount ( wxPGPropArg  id) const

Returns number of children for the property.

NB: Cannot be in container methods class due to name hiding.

◆ GetEditorControl()

wxWindow* wxPropertyGrid::GetEditorControl ( ) const

Returns pointer to current active primary editor control (NULL if none).

If editor uses clipper window, pointer is returned to the actual editor, not the clipper.

◆ GetEditorTextCtrl()

wxTextCtrl* wxPropertyGrid::GetEditorTextCtrl ( ) const

Returns wxTextCtrl active in currently selected property, if any.

Takes into account wxOwnerDrawnComboBox.

◆ GetEmptySpaceColour()

wxColour wxPropertyGrid::GetEmptySpaceColour ( ) const

Returns colour of empty space below properties.

◆ GetFirstCategory()

wxPGProperty* wxPropertyGrid::GetFirstCategory ( ) const

Returns id of first category (from target page).

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

References wxPropertyGridInterface::GetFirst(), and wxPG_ITERATE_CATEGORIES.

◆ GetFirstProperty()

wxPGProperty* wxPropertyGrid::GetFirstProperty ( )

Returns id of first property that is not a category.

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetFirstVisible()

const wxPGProperty* wxPropertyGrid::GetFirstVisible ( ) const

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

Note that visible item means category, property, or sub-property which user can see when control is scrolled properly. It does not only mean items that are actually painted on the screen.

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetFontHeight()

int wxPropertyGrid::GetFontHeight ( ) const

Returns height of highest characters of used font.

References wxPropertyGridInterface::GetFirst(), and wxPG_ITERATE_VISIBLE.

◆ GetGoodEditorDialogPosition()

wxPoint wxPropertyGrid::GetGoodEditorDialogPosition ( wxPGProperty p,
const wxSize &  sz 
)

Generates position for a widget editor dialog box.

Parameters
pProperty for which dialog is positioned.
szKnown or over-approximated size of the dialog.
Return values
Positionfor dialog.

◆ GetGrid()

wxPropertyGrid* wxPropertyGrid::GetGrid ( )

Returns pointer to itself.

Dummy function that enables same kind of code to use wxPropertyGrid and wxPropertyGridManager.

◆ GetImageSize()

wxSize wxPropertyGrid::GetImageSize ( wxPGProperty p = NULL,
int  item = -1 
) const

Returns size of the custom paint image in front of property.

If no argument is given, returns preferred size.

◆ GetItemAtY()

wxPGProperty* wxPropertyGrid::GetItemAtY ( int  y) const

Returns GetCustomPaintWidth for odcombo, GetImageSize(GetSelection()) otherwise.

Returns property (or category) at given y coordinate (relative to control's top left).

◆ GetLastChild()

wxPGProperty* wxPropertyGrid::GetLastChild ( wxPGPropArg  id)

Returns id of last child of given property.

Remarks
Returns even sub-properties.
Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetLastItem()

wxPGProperty* wxPropertyGrid::GetLastItem ( int  flags = wxPG_ITERATE_DEFAULT)

Returns last item which could be iterated using given flags.

Parameters
flagsList of iterator flags

◆ GetLastProperty()

wxPGProperty* wxPropertyGrid::GetLastProperty ( )

Returns id of last item.

Ignores categories and sub-properties.

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

References wxPGProperty::IsCategory(), and wxPG_ITERATE_DEFAULT.

◆ GetLastVisible()

wxPGProperty* wxPropertyGrid::GetLastVisible ( )

Returns id of last visible item.

Does not ignore categories sub-properties.

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetLineColour()

wxColour wxPropertyGrid::GetLineColour ( ) const

Returns colour of lines between cells.

References wxPG_ITERATE_VISIBLE.

◆ GetMarginColour()

wxColour wxPropertyGrid::GetMarginColour ( ) const

Returns background colour of margin.

◆ GetNextCategory()

wxPGProperty* wxPropertyGrid::GetNextCategory ( wxPGPropArg  id) const

Returns id of next category after a given property (which does not have to be category).

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetNextProperty()

wxPGProperty* wxPropertyGrid::GetNextProperty ( wxPGPropArg  id)

Returns id of next property.

This does not iterate to sub-properties or categories, unlike GetNextVisible.

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetNextVisible()

wxPGProperty* wxPropertyGrid::GetNextVisible ( wxPGPropArg  id) const

Returns id of next visible item.

Note that visible item means category, property, or sub-property which user can see when control is scrolled properly. It does not only mean items that are actually painted on the screen.

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetPrevProperty()

wxPGProperty* wxPropertyGrid::GetPrevProperty ( wxPGPropArg  id)

Returns id of previous property.

Unlike GetPrevVisible, this skips categories and sub-properties.

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetPrevSiblingProperty()

wxPGProperty* wxPropertyGrid::GetPrevSiblingProperty ( wxPGPropArg  id)

Returns id of previous item under the same parent.

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetPrevVisible()

wxPGProperty* wxPropertyGrid::GetPrevVisible ( wxPGPropArg  id)

Returns id of previous visible property.

Deprecated:
Since version 1.3. Use wxPropertyGridInterface::GetIterator() instead.

◆ GetPropertyBackgroundColour()

wxColour wxPropertyGrid::GetPropertyBackgroundColour ( wxPGPropArg  id) const

Returns cell background colour of a property.

◆ GetPropertyByLabel()

wxPGProperty* wxPropertyGrid::GetPropertyByLabel ( const wxString &  name) const

Returns id of property with given label (case-sensitive).

If there is no property with such label, returned property id is invalid ( i.e. it will return false with IsOk method). If there are multiple properties with identical name, most recent added is returned.

◆ GetPropertyColour()

wxColour wxPropertyGrid::GetPropertyColour ( wxPGPropArg  id) const

Returns cell background colour of a property.

◆ GetPropertyTextColour()

wxColour wxPropertyGrid::GetPropertyTextColour ( wxPGPropArg  id) const

Returns cell background colour of a property.

◆ GetRoot()

wxPGProperty* wxPropertyGrid::GetRoot ( ) const

Returns "root property".

It does not have name, etc. and it is not visible. It is only useful for accessing its children.

◆ GetRowHeight()

int wxPropertyGrid::GetRowHeight ( ) const

Returns height of a single grid row (in pixels).

◆ GetSelectionBackgroundColour()

wxColour wxPropertyGrid::GetSelectionBackgroundColour ( ) const

Returns current selection background colour.

◆ GetSelectionForegroundColour()

wxColour wxPropertyGrid::GetSelectionForegroundColour ( ) const

Returns current selection text colour.

References wxPropertyGridInterface::GetSelection().

◆ GetSplitterPosition()

int wxPropertyGrid::GetSplitterPosition ( ) const

Returns current splitter x position.

◆ GetUnspecifiedValueAppearance()

const wxPGCell& wxPropertyGrid::GetUnspecifiedValueAppearance ( ) const

Returns current appearance of unspecified value cells.

Remarks
If you set the unspecified value to have any textual representation, then that will override "InlineHelp" attribute.
See also
SetUnspecifiedValueAppearance()

◆ GetVerticalSpacing()

int wxPropertyGrid::GetVerticalSpacing ( ) const

Returns current vertical spacing.

◆ HasSelection()

bool wxPropertyGrid::HasSelection ( ) const

Returns true if a property is selected.

◆ IsAnyModified()

bool wxPropertyGrid::IsAnyModified ( ) const

Returns true if any property has been modified by the user.

◆ IsEditorsValueModified()

bool wxPropertyGrid::IsEditorsValueModified ( ) const

Returns true if editor's value was marked modified.

◆ IsFrozen()

bool wxPropertyGrid::IsFrozen ( ) const

Returns true if updating is frozen (ie.

Freeze() called but not yet Thaw() ).

◆ MakeColumnEditable()

void wxPropertyGrid::MakeColumnEditable ( unsigned int  column,
bool  editable = true 
)

Makes given column editable by user.

Parameters
editableUsing here will disable column from being editable.

◆ OnTLPChanging()

void wxPropertyGrid::OnTLPChanging ( wxWindow *  newTLP)

It is recommended that you call this function any time your code causes wxPropertyGrid's top-level parent to change.

wxPropertyGrid's OnIdle() handler should be able to detect most changes, but it is not perfect.

Parameters
newTLPNew top-level parent that is about to be set. Old one should still exist as the current one.
Remarks
This function is automatically called from wxPropertyGrid:: Reparent() and wxPropertyGridManager::Reparent().

◆ OnValidationFailure()

bool wxPropertyGrid::OnValidationFailure ( wxPGProperty property,
wxVariant &  invalidValue 
)

Called when validation for given property fails.

Parameters
invalidValueValue which failed in validation.
Return values
Returntrue if user is allowed to change to another property even if current has invalid value.
Remarks
To add your own validation failure behavior, override wxPropertyGrid::DoOnValidationFailure().

◆ PerformValidation()

virtual bool wxPropertyGrid::PerformValidation ( wxPGProperty p,
wxVariant &  pendingValue 
)
virtual

Runs all validation functionality (includes sending wxEVT_PG_CHANGING).

Returns true if all tests passed.

◆ RegisterEditorClass()

static wxPGEditor* wxPropertyGrid::RegisterEditorClass ( wxPGEditor editor,
const wxString &  name,
bool  noDefCheck = false 
)
static

Registers a new editor class.

Return values
Pointerto the editor class instance that should be used.

◆ RemoveFromSelection()

bool wxPropertyGrid::RemoveFromSelection ( wxPGPropArg  id)

Removes given property from selection.

If property is not selected, an assertion failure will occur.

◆ ResetColumnSizes()

void wxPropertyGrid::ResetColumnSizes ( bool  enableAutoResizing = false)

Resets column sizes and splitter positions, based on proportions.

Parameters
enableAutoResizingIf , automatic column resizing is enabled (only applicapple if window style wxPG_SPLITTER_AUTO_CENTER is used).
See also
wxPropertyGridInterface::SetColumnProportion()

◆ SelectProperty()

bool wxPropertyGrid::SelectProperty ( wxPGPropArg  id,
bool  focus = false 
)

Selects a property.

Editor widget is automatically created, but not focused unless focus is true. This will generate wxEVT_PG_SELECT event.

Parameters
idId to property to select.
Return values
Trueif selection finished succesfully. Usually only fails if current value in editor is not valid.
Remarks
This clears any previous selection.
See also
wxPropertyGridInterface::ClearSelection()

◆ SetButtonShortcut()

void wxPropertyGrid::SetButtonShortcut ( int  keycode,
bool  ctrlDown = false,
bool  altDown = false 
)

Changes keyboard shortcut to push the editor button.

Remarks
You can set default with keycode 0. Good value for the platform is guessed, but don't expect it to be very accurate.

◆ SetCaptionBackgroundColour()

void wxPropertyGrid::SetCaptionBackgroundColour ( const wxColour &  col)

Sets category caption background colour.

◆ SetCaptionForegroundColour()

void wxPropertyGrid::SetCaptionForegroundColour ( const wxColour &  col)

Sets category caption text colour.

◆ SetCellBackgroundColour()

void wxPropertyGrid::SetCellBackgroundColour ( const wxColour &  col)

Sets default cell background colour - applies to property cells.

Note that appearance of editor widgets may not be affected.

◆ SetCellTextColour()

void wxPropertyGrid::SetCellTextColour ( const wxColour &  col)

Sets default cell text colour - applies to property name and value text.

Note that appearance of editor widgets may not be affected.

◆ SetEmptySpaceColour()

void wxPropertyGrid::SetEmptySpaceColour ( const wxColour &  col)

Sets colour of empty space below properties.

◆ SetLineColour()

void wxPropertyGrid::SetLineColour ( const wxColour &  col)

Sets colour of lines between cells.

◆ SetMarginColour()

void wxPropertyGrid::SetMarginColour ( const wxColour &  col)

Sets background colour of margin.

◆ SetPropertyAttributeAll()

void wxPropertyGrid::SetPropertyAttributeAll ( const wxString &  attrName,
wxVariant  value 
)

Sets property attribute for all applicapple properties.

Be sure to use this method after all properties have been added to the grid.

◆ SetPropertyBackgroundColour()

void wxPropertyGrid::SetPropertyBackgroundColour ( wxPGPropArg  id,
const wxColour &  col,
int  flags = wxPG_RECURSE 
)

Sets background colour of property and all its children.

Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last.

Parameters
flagsDefault is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children.

◆ SetPropertyColour()

void wxPropertyGrid::SetPropertyColour ( wxPGPropArg  id,
const wxColour &  col 
)

Sets background colour of property and all its children.

Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last.

Deprecated:
Since version 1.3. Use SetPropertyBackgroundColour instead.

◆ SetPropertyColourToDefault()

void wxPropertyGrid::SetPropertyColourToDefault ( wxPGPropArg  id)

Sets background and text colour of property and all its children to the default.

◆ SetPropertyName()

void wxPropertyGrid::SetPropertyName ( wxPGPropArg  id,
const wxString &  newname 
)

Sets name of a property.

Parameters
idId of a property.
newnameNew name.

◆ SetPropertyTextColour()

void wxPropertyGrid::SetPropertyTextColour ( wxPGPropArg  id,
const wxColour &  col,
int  flags = wxPG_RECURSE 
)

Sets text colour of property and all its children.

Parameters
flagsDefault is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children.

◆ SetSelectionBackground()

void wxPropertyGrid::SetSelectionBackground ( const wxColour &  col)

Sets selection background colour - applies to selected property name background.

◆ SetSelectionForeground()

void wxPropertyGrid::SetSelectionForeground ( const wxColour &  col)

Sets selection foreground colour - applies to selected property name text.

◆ SetSortFunction()

void wxPropertyGrid::SetSortFunction ( wxPGSortCallback  sortFunction)

Sets the property sorting function.

Parameters
sortFunctionThe sorting function to be used. It should return a value greater than 0 if position of p1 is after p2. So, for instance, when comparing property names, you can use following implementation:
int MyPropertySortFunction(wxPropertyGrid* propGrid,
{
return p1->GetBaseName().compare( p2->GetBaseName() );
}
Remarks
Default property sort function sorts properties by their labels.

◆ SetSplitterLeft()

void wxPropertyGrid::SetSplitterLeft ( bool  subProps = false)

Moves splitter as left as possible, while still allowing all labels to be shown in full.

Parameters
subPropsIf false, will still allow sub-properties (ie. properties which parent is not root or category) to be cropped.

◆ SetSplitterPosition()

void wxPropertyGrid::SetSplitterPosition ( int  newxpos,
bool  refresh = true 
)

Sets x coordinate of the splitter.

Remarks
Splitter position cannot exceed grid size, and therefore setting it during form creation may fail as initial grid size is often smaller than desired splitter position, especially when sizers are being used.

◆ SetUnspecifiedCommonValue()

void wxPropertyGrid::SetUnspecifiedCommonValue ( int  index)

Set index of common value that will truly change value to unspecified.

Using -1 will set none to have such effect. Default is 0.

◆ SetUnspecifiedValueAppearance()

void wxPropertyGrid::SetUnspecifiedValueAppearance ( const wxPGCell cell)

Sets appearance of value cells representing an unspecified property value.

Default appearance is blank.

See also
wxPGProperty::SetValueToUnspecified(), wxPGProperty::IsValueUnspecified(),

◆ SetupTextCtrlValue()

void wxPropertyGrid::SetupTextCtrlValue ( const wxString  text)

Must be called in wxPGEditor::CreateControls() if primary editor window is wxTextCtrl, just before textctrl is created.

Parameters
textInitial text value of created wxTextCtrl.

◆ SetVerticalSpacing()

void wxPropertyGrid::SetVerticalSpacing ( int  vspacing)

Sets vertical spacing.

Can be 1, 2, or 3 - a value relative to font height. Value of 2 should be default on most platforms.

Remarks
On wxMSW, wxComboBox, when used as property editor widget, will spill out with anything less than 3.

◆ SetVirtualWidth()

void wxPropertyGrid::SetVirtualWidth ( int  width)

Set virtual width for this particular page.

Width -1 indicates that the virtual width should be disabled.

◆ SetWindowStyleFlag()

virtual void wxPropertyGrid::SetWindowStyleFlag ( long  style)
virtual

Overridden function.

See also
Additional Window Styles

◆ ShowPropertyError()

void wxPropertyGrid::ShowPropertyError ( wxPGPropArg  id,
const wxString &  msg 
)

Shows an brief error message that is related to a property.

◆ Sort()

void wxPropertyGrid::Sort ( )

Sorts all items at all levels (except sub-properties).

◆ ValueChangeInEvent()

void wxPropertyGrid::ValueChangeInEvent ( wxVariant  variant)

Call this from wxPGProperty::OnEvent() to cause property value to be changed after the function returns (with true as return value).

ValueChangeInEvent() must be used if you wish the application to be able to use wxEVT_PG_CHANGING to potentially veto the given value.

◆ WasValueChangedInEvent()

bool wxPropertyGrid::WasValueChangedInEvent ( ) const

You can use this member function, for instance, to detect in wxPGProperty::OnEvent() if wxPGProperty::SetValueInEvent() was already called in wxPGEditor::OnEvent().

It really only detects if was value was changed using wxPGProperty::SetValueInEvent(), which is usually used when a 'picker' dialog is displayed. If value was written by "normal means" in wxPGProperty::StringToValue() or IntToValue(), then this function will return false (on the other hand, wxPGProperty::OnEvent() is not even called in those cases).


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