wxPGProperty::AddChild() can now be used to add normal child properties (previously it was only used to add private children of derived property classes such as wxFontProperty and wxFlagsProperty). However, to allow backwards compatibility, SetParentalStyle(wxPG_PROP_MISC_PARENT) needs to be called before doing so. Also done: merged property initialization code from PrepareToAddItem() and PrepareSubProperties() to InitAfterAdded().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2008-10-14 17:15:59 +00:00
parent c8c86bd0ba
commit 2fd4a52415
11 changed files with 261 additions and 201 deletions

View File

@@ -868,8 +868,21 @@ public:
int AddChoice( const wxString& label, int value = wxPG_INVALID_VALUE );
/**
Properties which have private child properties should add them
with this function, called in their constructor.
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:
@code
wxPGProperty* prop = new wxStringProperty(wxS("Property"));
prop->SetParentalType(wxPG_PROP_MISC_PARENT);
wxPGProperty* prop2 = new wxStringProperty(wxS("Property2"));
prop->AddChild(prop2);
@endcode
*/
void AddChild( wxPGProperty* property );
@@ -1299,6 +1312,23 @@ public:
*/
void SetName( const wxString& newName );
/**
Changes what sort of parent this property is for its children.
@param flag
Use one of the following values: wxPG_PROP_MISC_PARENT (for generic
parents), wxPG_PROP_CATEGORY (for categories), or
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.
*/
void SetParentalType( int flag );
/** Sets wxValidator for a property */
void SetValidator( const wxValidator& validator );