wxPropertyGrid Class Reference

#include <propgrid.h>

Inheritance diagram for wxPropertyGrid:

wxPropertyGridInterface

List of all members.


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_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.

Public Member Functions

void AddActionTrigger (int action, int keycode, int modifiers=0)
bool AdjustPosForClipperWindow (wxWindow *topCtrlWnd, int *x, int *y)
bool CanClose ()
void CenterSplitter (bool enable_auto_centering=false)
bool ChangePropertyValue (wxPGPropArg id, wxVariant newValue)
virtual void Clear ()
void ClearActionTriggers (int action)
void ClearInternalFlag (long flag)
void ClearModifiedStatus ()
void ClearModifiedStatus (wxPGPropArg id)
bool ClearSelection ()
void ClearTargetPage ()
virtual bool CommitChangesFromEditor (wxUint32 flags=0)
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=(0), const wxChar *name=wxPropertyGridNameStr)
void DecFrozen ()
virtual bool DoOnValidationFailure (wxPGProperty *property, wxVariant &invalidValue)
virtual void DoOnValidationFailureReset (wxPGProperty *property)
virtual bool DoPropertyChanged (wxPGProperty *p, unsigned int selFlags=0)
virtual void DoShowPropertyError (wxPGProperty *property, const wxString &msg)
void EditorsValueWasModified ()
void EditorsValueWasNotModified ()
bool EditorValidate ()
bool EnableCategories (bool enable)
bool EnsureVisible (wxPGPropArg id)
wxSize FitColumns ()
void FixPosForTextCtrl (wxWindow *ctrl, const wxPoint &offset=wxPoint(0, 0))
wxWindow * GenerateEditorButton (const wxPoint &pos, const wxSize &sz)
wxWindow * GenerateEditorTextCtrl (const wxPoint &pos, const wxSize &sz, const wxString &value, wxWindow *secondary, int extraStyle=0, int maxLen=0)
wxWindow * GenerateEditorTextCtrlAndButton (const wxPoint &pos, const wxSize &sz, wxWindow **psecondary, int limited_editing, wxPGProperty *property)
wxColour GetCaptionBackgroundColour () const
const wxFont & GetCaptionFont () const
wxFont & GetCaptionFont ()
wxColour GetCaptionForegroundColour () const
wxColour GetCellBackgroundColour () const
wxColour GetCellDisabledTextColour () const
wxColour GetCellTextColour () const
unsigned int GetChildrenCount (wxPGPropArg id) const
unsigned int GetChildrenCount ()
unsigned int GetColumnCount () const
const wxPGCommonValueGetCommonValue (unsigned int i) const
unsigned int GetCommonValueCount () const
wxString GetCommonValueLabel (unsigned int i) const
wxWindow * GetEditorControl () const
wxWindow * GetEditorControlSecondary () const
wxTextCtrl * GetEditorTextCtrl () const
wxColour GetEmptySpaceColour () const
wxPGPropertyGetFirstCategory () const
wxPGPropertyGetFirstProperty ()
wxPGPropertyGetFirstVisible ()
const wxPGPropertyGetFirstVisible () const
int GetFontHeight () const
wxPoint GetGoodEditorDialogPosition (wxPGProperty *p, const wxSize &sz)
wxPropertyGridGetGrid ()
wxRect GetImageRect (wxPGProperty *p, int item) const
wxSize GetImageSize (wxPGProperty *p=NULL, int item=-1) const
long GetInternalFlags () const
wxPGPropertyGetItemAtY (int y) const
wxPGPropertyGetLastChild (wxPGPropArg id)
const wxPGPropertyGetLastItem (int flags=wxPG_ITERATE_DEFAULT) const
wxPGPropertyGetLastItem (int flags=wxPG_ITERATE_DEFAULT)
wxPGPropertyGetLastProperty ()
wxPGPropertyGetLastVisible ()
wxColour GetLineColour () const
wxColour GetMarginColour () const
wxPGPropertyGetNextCategory (wxPGPropArg id) const
wxPGPropertyGetNextProperty (wxPGPropArg id)
wxPGPropertyGetNextVisible (wxPGPropArg id) const
wxPanel * GetPanel () const
wxPGPropertyGetPrevProperty (wxPGPropArg id)
wxPGPropertyGetPrevSiblingProperty (wxPGPropArg id)
wxPGPropertyGetPrevVisible (wxPGPropArg id)
wxWindow * GetPrimaryEditor () const
wxColour GetPropertyBackgroundColour (wxPGPropArg id) const
wxPGPropertyGetPropertyByLabel (const wxString &name) const
wxColour GetPropertyColour (wxPGPropArg id) const
wxRect GetPropertyRect (const wxPGProperty *p1, const wxPGProperty *p2) const
wxColour GetPropertyTextColour (wxPGPropArg id) const
wxPGPropertyGetRoot () const
int GetRowHeight () const
wxPGPropertyGetSelectedProperty () const
wxPGPropertyGetSelection () const
wxColour GetSelectionBackgroundColour () const
wxColour GetSelectionForegroundColour () const
int GetSpacingY () const
int GetSplitterPosition () const
int GetUnspecifiedCommonValue () const
wxPGValidationInfoGetValidationInfo ()
int GetVerticalSpacing () const
bool HasInternalFlag (long flag) const
bool HasSelection () const
bool HasVirtualWidth () const
wxPropertyGridHitTestResult HitTest (const wxPoint &pt) const
void IncFrozen ()
bool IsAnyModified () const
bool IsEditorsValueModified () const
bool IsFrozen () const
bool IsMainButtonEvent (const wxEvent &event)
bool IsPropertySelected (wxPGPropArg id) const
void OnComboItemPaint (wxPGCustomComboControl *pCb, int item, wxDC &dc, wxRect &rect, int flags)
void OnCustomEditorEvent (wxCommandEvent &event)
bool OnValidationFailure (wxPGProperty *property, wxVariant &invalidValue)
void OnValidationFailureReset (wxPGProperty *property)
virtual bool PerformValidation (wxPGProperty *p, wxVariant &pendingValue)
virtual void RefreshProperty (wxPGProperty *p)
void ResetColours ()
bool SelectProperty (wxPGPropArg id, bool focus=false)
void SendNavigationKeyEvent (int dir)
void SetButtonShortcut (int keycode, bool ctrlDown=false, bool altDown=false)
void SetCaptionBackgroundColour (const wxColour &col)
void SetCaptionForegroundColour (const wxColour &col)
void SetCaptionTextColour (wxPGPropArg id, const wxColour &col)
void SetCellBackgroundColour (const wxColour &col)
void SetCellDisabledTextColour (const wxColour &col)
void SetCellTextColour (const wxColour &col)
void SetColumnCount (int colCount)
void SetCurrentCategory (wxPGPropArg id)
void SetEmptySpaceColour (const wxColour &col)
void SetInternalFlag (long flag)
void SetLineColour (const wxColour &col)
void SetMarginColour (const wxColour &col)
void SetPropertyAttributeAll (const wxString &attrName, wxVariant value)
void SetPropertyBackgroundColour (wxPGPropArg id, const wxColour &col)
void SetPropertyColour (wxPGPropArg id, const wxColour &col)
void SetPropertyColourToDefault (wxPGPropArg id)
void SetPropertyName (wxPGPropArg id, const wxString &newname)
void SetPropertyTextColour (wxPGPropArg id, const wxColour &col)
void SetSelectionBackground (const wxColour &col)
void SetSelectionForeground (const wxColour &col)
void SetSplitterLeft (bool subProps=false)
void SetSplitterPosition (int newxpos, bool refresh=true)
void SetUnspecifiedCommonValue (int index)
void SetupTextCtrlValue (const wxString text)
void SetVerticalSpacing (int vspacing)
void SetVirtualWidth (int width)
virtual void SetWindowStyleFlag (long style)
void ShowPropertyError (wxPGPropArg id, const wxString &msg)
void Sort (wxPGPropArg id)
void Sort ()
void SwitchState (wxPropertyGridState *pNewState)
bool UnfocusEditor ()
void ValueChangeInEvent (wxVariant variant)
 wxPropertyGrid (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=(0), const wxChar *name=wxPropertyGridNameStr)
 wxPropertyGrid ()
virtual ~wxPropertyGrid ()

Static Public Member Functions

static void ArrayStringToString (wxString &dst, const wxArrayString &src, wxChar preDelim, wxChar postDelim, int flags)
static void AutoGetTranslation (bool enable)
static wxString & CreateEscapeSequences (wxString &dst_str, wxString &src_str)
static void DoubleToString (wxString &target, double value, int precision, bool removeZeroes, wxString *precTemplate)
static wxString & ExpandEscapeSequences (wxString &dst_str, wxString &src_str)
static wxPGEditorRegisterEditorClass (wxPGEditor *editor, const wxString &name, bool noDefCheck=false)

Protected Member Functions

virtual wxPropertyGridStateCreateState () const


Constructor & Destructor Documentation

wxPropertyGrid::wxPropertyGrid (  ) 

Two step constructor.

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

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

The default constructor.

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

See also:
Additional Window Styles

virtual wxPropertyGrid::~wxPropertyGrid (  )  [virtual]

Destructor.


Member Function Documentation

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

Adds given key combination to trigger given action.

Parameters:
action Which action to trigger. See List of list of wxPropertyGrid actions.

bool wxPropertyGrid::AdjustPosForClipperWindow ( wxWindow *  topCtrlWnd,
int *  x,
int *  y 
)

Adjusts given position if topCtrlWnd is child of clipper window.

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)".

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.

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.

void wxPropertyGrid::CenterSplitter ( bool  enable_auto_centering = false  ) 

Centers the splitter.

If argument is true, automatic splitter centering is enabled (only applicapple if style wxPG_SPLITTER_AUTO_CENTER was defined).

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:
Returns true if value was succesfully changed.

Reimplemented from wxPropertyGridInterface.

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.

void wxPropertyGrid::ClearActionTriggers ( int  action  ) 

Clears action triggers for given action.

Parameters:
action Which action to trigger. See List of list of wxPropertyGrid actions.

void wxPropertyGrid::ClearModifiedStatus (  ) 

Resets modified status of all properties.

void wxPropertyGrid::ClearModifiedStatus ( wxPGPropArg  id  ) 

Resets modified status of a property and all sub-properties.

bool wxPropertyGrid::ClearSelection (  ) 

Deselect current selection, if any.

Returns true if success (ie. validator did not intercept).

Reimplemented from wxPropertyGridInterface.

void wxPropertyGrid::ClearTargetPage (  ) 

Synonymous to Clear.

Deprecated:
Since version 1.3.

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:
Returns true if anything was changed.

bool wxPropertyGrid::Create ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = (0),
const wxChar *  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

virtual wxPropertyGridState* wxPropertyGrid::CreateState (  )  const [protected, virtual]

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.

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

Override to customize property validation failure behavior.

Parameters:
invalidValue Value which failed in validation.
Return values:
Return true if user is allowed to change to another property even if current has invalid value.

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.

virtual bool wxPropertyGrid::DoPropertyChanged ( wxPGProperty p,
unsigned int  selFlags = 0 
) [virtual]

Pending value is expected to be passed in PerformValidation().

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).

static void wxPropertyGrid::DoubleToString ( wxString &  target,
double  value,
int  precision,
bool  removeZeroes,
wxString *  precTemplate 
) [static]

Standardized double-to-string conversion.

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

void wxPropertyGrid::EditorsValueWasNotModified (  ) 

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.

bool wxPropertyGrid::EnableCategories ( bool  enable  ) 

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

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.

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:
Minimum size 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.

void wxPropertyGrid::FixPosForTextCtrl ( wxWindow *  ctrl,
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).

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.

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

Shortcut for creating text editor widget.

Parameters:
pos Same as pos given for CreateEditor.
sz Same as sz given for CreateEditor.
value Initial text for wxTextCtrl.
secondary If right-side control, such as button, also created, then create it first and pass it as this parameter.
extraStyle Extra style flags to pass for wxTextCtrl.
Remarks:
Note that this should generally be called only by new classes derived from wxPGProperty.

wxColour wxPropertyGrid::GetCaptionBackgroundColour (  )  const

Returns current category caption background colour.

wxColour wxPropertyGrid::GetCaptionForegroundColour (  )  const

Returns current category caption text colour.

wxColour wxPropertyGrid::GetCellBackgroundColour (  )  const

Returns current cell background colour.

wxColour wxPropertyGrid::GetCellDisabledTextColour (  )  const

Returns current cell text colour when disabled.

wxColour wxPropertyGrid::GetCellTextColour (  )  const

Returns current cell text colour.

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.

unsigned int wxPropertyGrid::GetChildrenCount (  ) 

Returns number of children of the root property.

unsigned int wxPropertyGrid::GetCommonValueCount (  )  const

Returns number of common values.

wxString wxPropertyGrid::GetCommonValueLabel ( unsigned int  i  )  const

Returns label of given common value.

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.

wxWindow* wxPropertyGrid::GetEditorControlSecondary (  )  const

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

wxTextCtrl* wxPropertyGrid::GetEditorTextCtrl (  )  const

Returns wxTextCtrl active in currently selected property, if any.

Takes into account wxOwnerDrawnComboBox.

wxColour wxPropertyGrid::GetEmptySpaceColour (  )  const

Returns colour of empty space below properties.

wxPGProperty* wxPropertyGrid::GetFirstCategory (  )  const

Returns id of first category (from target page).

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

wxPGProperty* wxPropertyGrid::GetFirstProperty (  ) 

Returns id of first property that is not a category.

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

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.

int wxPropertyGrid::GetFontHeight (  )  const

Returns height of highest characters of used font.

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

Generates position for a widget editor dialog box.

Parameters:
p Property for which dialog is positioned.
sz Known or over-approximated size of the dialog.
Return values:
Position for dialog.

wxPropertyGrid* wxPropertyGrid::GetGrid (  ) 

Returns pointer to itself.

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

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.

wxPGProperty* wxPropertyGrid::GetItemAtY ( int  y  )  const

Returns GetCustomPaintWidth for odcombo, GetImageSize(m_selected) otherwise.

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

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.

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

Returns last item which could be iterated using given flags.

Parameters:
flags List of iterator flags

wxPGProperty* wxPropertyGrid::GetLastProperty (  ) 

Returns id of last item.

Ignores categories and sub-properties.

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

wxPGProperty* wxPropertyGrid::GetLastVisible (  ) 

Returns id of last visible item.

Does not ignore categories sub-properties.

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

wxColour wxPropertyGrid::GetLineColour (  )  const

Returns colour of lines between cells.

wxColour wxPropertyGrid::GetMarginColour (  )  const

Returns background colour of margin.

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.

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.

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.

wxPanel* wxPropertyGrid::GetPanel (  )  const

Returns wxWindow that the properties are painted on, and which should be used as the parent for editor controls.

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.

wxPGProperty* wxPropertyGrid::GetPrevSiblingProperty ( wxPGPropArg  id  ) 

Returns id of previous item under the same parent.

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

wxPGProperty* wxPropertyGrid::GetPrevVisible ( wxPGPropArg  id  ) 

Returns id of previous visible property.

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

wxColour wxPropertyGrid::GetPropertyBackgroundColour ( wxPGPropArg  id  )  const

Returns cell background colour of a property.

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.

wxColour wxPropertyGrid::GetPropertyColour ( wxPGPropArg  id  )  const

Returns cell background colour of a property.

wxRect wxPropertyGrid::GetPropertyRect ( const wxPGProperty p1,
const wxPGProperty p2 
) const

Returns rectangle that fully contains properties between and including p1 and p2.

wxColour wxPropertyGrid::GetPropertyTextColour ( wxPGPropArg  id  )  const

Returns cell background colour of a property.

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.

int wxPropertyGrid::GetRowHeight (  )  const

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

wxPGProperty* wxPropertyGrid::GetSelection (  )  const

Returns currently selected property.

Reimplemented from wxPropertyGridInterface.

wxColour wxPropertyGrid::GetSelectionBackgroundColour (  )  const

Returns current selection background colour.

wxColour wxPropertyGrid::GetSelectionForegroundColour (  )  const

Returns current selection text colour.

int wxPropertyGrid::GetSplitterPosition (  )  const

Returns current splitter x position.

int wxPropertyGrid::GetUnspecifiedCommonValue (  )  const

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

int wxPropertyGrid::GetVerticalSpacing (  )  const

Returns current vertical spacing.

bool wxPropertyGrid::HasSelection (  )  const

Returns true if a property is selected.

wxPropertyGridHitTestResult wxPropertyGrid::HitTest ( const wxPoint &  pt  )  const

Returns information about arbitrary position in the grid.

bool wxPropertyGrid::IsAnyModified (  )  const

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

bool wxPropertyGrid::IsEditorsValueModified (  )  const

Returns true if editor's value was marked modified.

bool wxPropertyGrid::IsFrozen (  )  const

Returns true if updating is frozen (ie.

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

bool wxPropertyGrid::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).

bool wxPropertyGrid::IsPropertySelected ( wxPGPropArg  id  )  const

Returns true if given property is selected.

Deprecated:
Since version 1.3.

void wxPropertyGrid::OnCustomEditorEvent ( wxCommandEvent &  event  ) 

Pass this function to Connect calls in propertyclass::CreateEditor.

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

Called when validation for given property fails.

Parameters:
invalidValue Value which failed in validation.
Return values:
Return true 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().

void wxPropertyGrid::OnValidationFailureReset ( wxPGProperty property  ) 

Called to indicate property and editor has valid value now.

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

Runs all validation functionality (includes sending wxEVT_PG_CHANGING).

Returns true if all tests passed.

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

Registers a new editor class.

Return values:
Pointer to the editor class instance that should be used.

void wxPropertyGrid::ResetColours (  ) 

Resets all colours to the original system values.

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:
id Id to property to select.
Return values:
True if selection finished succesfully. Usually only fails if current value in editor is not valid.
See also:
wxPropertyGrid::Unselect

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.

void wxPropertyGrid::SetCaptionBackgroundColour ( const wxColour &  col  ) 

Sets category caption background colour.

void wxPropertyGrid::SetCaptionForegroundColour ( const wxColour &  col  ) 

Sets category caption text colour.

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

Sets text colour of a category caption (but not it's children).

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.

void wxPropertyGrid::SetCellDisabledTextColour ( const wxColour &  col  ) 

Sets cell text colour for disabled properties.

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.

void wxPropertyGrid::SetColumnCount ( int  colCount  ) 

Set number of columns (2+).

void wxPropertyGrid::SetCurrentCategory ( wxPGPropArg  id  ) 

Sets the current category - Append will add non-categories under this one.

void wxPropertyGrid::SetEmptySpaceColour ( const wxColour &  col  ) 

Sets colour of empty space below properties.

void wxPropertyGrid::SetLineColour ( const wxColour &  col  ) 

Sets colour of lines between cells.

void wxPropertyGrid::SetMarginColour ( const wxColour &  col  ) 

Sets background colour of margin.

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.

void wxPropertyGrid::SetPropertyBackgroundColour ( 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.

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.

void wxPropertyGrid::SetPropertyColourToDefault ( wxPGPropArg  id  ) 

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

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

Sets name of a property.

Parameters:
id Id of a property.
newname New name.

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

Sets text colour of property and all its children.

void wxPropertyGrid::SetSelectionBackground ( const wxColour &  col  ) 

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

void wxPropertyGrid::SetSelectionForeground ( const wxColour &  col  ) 

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

void wxPropertyGrid::SetSplitterLeft ( bool  subProps = false  ) 

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

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

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.

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.

void wxPropertyGrid::SetupTextCtrlValue ( const wxString  text  ) 

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

Parameters:
text Initial text value of created wxTextCtrl.

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.

void wxPropertyGrid::SetVirtualWidth ( int  width  ) 

Set virtual width for this particular page.

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

virtual void wxPropertyGrid::SetWindowStyleFlag ( long  style  )  [virtual]

Overridden function.

See also:
Additional Window Styles

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

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

void wxPropertyGrid::Sort ( wxPGPropArg  id  ) 

Sorts children of a category.

void wxPropertyGrid::Sort (  ) 

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

void wxPropertyGrid::SwitchState ( wxPropertyGridState pNewState  ) 

Mostly useful for page switching.

bool wxPropertyGrid::UnfocusEditor (  ) 

Unfocuses or closes editor if one was open, but does not deselect property.

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.


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

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