X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2728c3bfe7b7c4d4cac4dfb003e1da74727e8113..5b88a837ba75928cd3835a6b97ae2bf5ad983a6e:/interface/wx/propgrid/property.h diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 75efba3ce6..f553085577 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -46,13 +46,28 @@ */ #define wxPG_ATTR_INLINE_HELP wxS("InlineHelp") -/** wxBoolProperty specific, int, default 0. When 1 sets bool property to - use checkbox instead of choice. +/** Universal, wxArrayString. Set to enable auto-completion in any + wxTextCtrl-based property editor. +*/ +#define wxPG_ATTR_AUTOCOMPLETE wxS("AutoComplete") + +/** wxBoolProperty and wxFlagsProperty specific. Value type is bool. + Default value is False. + + When set to True, bool property will use check box instead of a + combo box as its editor control. If you set this attribute + for a wxFlagsProperty, it is automatically applied to child + bool properties. */ #define wxPG_BOOL_USE_CHECKBOX wxS("UseCheckbox") -/** wxBoolProperty specific, int, default 0. When 1 sets bool property value - to cycle on double click (instead of showing the popup listbox). +/** wxBoolProperty and wxFlagsProperty specific. Value type is bool. + Default value is False. + + Set to True for the bool property to cycle value on double click + (instead of showing the popup listbox). If you set this attribute + for a wxFlagsProperty, it is automatically applied to child + bool properties. */ #define wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING wxS("UseDClickCycling") @@ -193,6 +208,9 @@ Simple string property. wxPG_STRING_PASSWORD attribute may be used to echo value as asterisks and use wxTE_PASSWORD for wxTextCtrl. + wxPG_ATTR_AUTOCOMPLETE attribute may be used to enable auto-completion + (use a wxArrayString value), and is also supported by any property that + happens to use a wxTextCtrl-based editor. @remarks wxStringProperty has a special trait: if it has value of "", and also has child properties, then its displayed @@ -292,13 +310,16 @@ @subsection wxFlagsProperty - Represents a bit set that fits in a long integer. wxBoolProperty sub-properties - are created for editing individual bits. Textctrl is created to manually edit - the flags as a text; a continous sequence of spaces, commas and semicolons - is considered as a flag id separator. - Note: When changing "choices" (ie. flag labels) of wxFlagsProperty, you - will need to use wxPGProperty::SetChoices() - otherwise they will not get updated - properly. + Represents a bit set that fits in a long integer. wxBoolProperty sub- + properties are created for editing individual bits. Textctrl is created to + manually edit the flags as a text; a continous sequence of spaces, commas + and semicolons are considered as a flag id separator. + + Note: When changing "choices" (ie. flag labels) of wxFlagsProperty, + you will need to use wxPGProperty::SetChoices() - otherwise they will not + get updated properly. + + wxFlagsProperty supports the same attributes as wxBoolProperty. @subsection wxArrayStringProperty @@ -496,8 +517,11 @@ public: variant << value; SetValue(variant); - // If has private child properties then create them here. For example: - // AddChild( new wxStringProperty( "Subprop 1", wxPG_LABEL, value.GetSubProp1() ) ); + // If has private child properties then create them here. + // For example: + // AddPrivateChild( new wxStringProperty("Subprop 1", + // wxPG_LABEL, + // value.GetSubProp1())); } @endcode @@ -879,23 +903,22 @@ public: int AddChoice( const wxString& label, int value = wxPG_INVALID_VALUE ); /** - Adds a child property. If you use this instead of - wxPropertyGridInterface::Insert() or - wxPropertyGridInterface::AppendIn(), then you must set up - property's parental type before making the call. To do this, - call property's SetParentalType() function with either - wxPG_PROP_MISC_PARENT (normal, public children) or with - wxPG_PROP_AGGREGATE (private children for subclassed property). - For instance: + Adds a private child property. - @code - wxPGProperty* prop = new wxStringProperty(wxS("Property")); - prop->SetParentalType(wxPG_PROP_MISC_PARENT); - wxPGProperty* prop2 = new wxStringProperty(wxS("Property2")); - prop->AddChild(prop2); - @endcode + @deprecated Use AddPrivateChild() instead. + + @see AddPrivateChild() + */ + wxDEPRECATED( void AddChild( wxPGProperty* prop ) ); + + /** + Adds a private child property. If you use this instead of + wxPropertyGridInterface::Insert() or + wxPropertyGridInterface::AppendIn(), then property's parental + type will automatically be set up to wxPG_PROP_AGGREGATE. In other + words, all properties of this property will become private. */ - void AddChild( wxPGProperty* property ); + void AddPrivateChild( wxPGProperty* prop ); /** Adapts list variant into proper value using consecutive @@ -903,6 +926,19 @@ public: */ void AdaptListToValue( wxVariant& list, wxVariant* value ) const; + /** + Use this member function to add independent (ie. regular) children to + a property. + + @return Appended childProperty. + + @remarks wxPropertyGrid is not automatically refreshed by this + function. + + @see InsertChild(), AddPrivateChild() + */ + wxPGProperty* AppendChild( wxPGProperty* childProperty ); + /** Determines, recursively, if all children are not unspecified. @@ -1148,6 +1184,19 @@ public: */ int Index( const wxPGProperty* p ) const; + /** + Use this member function to add independent (ie. regular) children to + a property. + + @return Inserted childProperty. + + @remarks wxPropertyGrid is not automatically refreshed by this + function. + + @see AppendChild(), AddPrivateChild() + */ + wxPGProperty* InsertChild( int index, wxPGProperty* childProperty ); + /** Inserts a new choice to property's list of choices. @@ -1330,11 +1379,7 @@ public: wxPG_PROP_AGGREGATE (for derived property classes with private children). - @remarks You only need to call this if you use AddChild() to add - child properties. Adding properties with - wxPropertyGridInterface::Insert() or - wxPropertyGridInterface::AppendIn() will automatically set - property to use wxPG_PROP_MISC_PARENT style. + @remarks You generally do not need to call this function. */ void SetParentalType( int flag ); @@ -1371,10 +1416,11 @@ public: Pointer to list variant that contains child values. Used to indicate which children should be marked as modified. Usually you just use @NULL. @param flags - Use wxPG_SETVAL_REFRESH_EDITOR to update editor control, if it - was selected. + wxPG_SETVAL_REFRESH_EDITOR is set by default, to refresh editor + and redraw properties. */ - void SetValue( wxVariant value, wxVariant* pList = NULL, int flags = 0 ); + void SetValue( wxVariant value, wxVariant* pList = NULL, + int flags = wxPG_SETVAL_REFRESH_EDITOR ); /** Set wxBitmap in front of the value. This bitmap may be ignored @@ -1421,7 +1467,7 @@ public: Helper class for managing choices of wxPropertyGrid properties. Each entry can have label, value, bitmap, text colour, and background colour. - + wxPGChoices uses reference counting, similar to other wxWidgets classes. This means that assignment operator and copy constructor only copy the reference and not the actual data. Use Copy() member function to create a