Fixed wxPGProperty ctor documentation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
338c3ec73a
commit
a6ca568ce0
@ -1038,35 +1038,16 @@ class WXDLLIMPEXP_PROPGRID wxPGProperty : public wxObject
|
||||
public:
|
||||
typedef wxUint32 FlagType;
|
||||
|
||||
/** Basic constructor.
|
||||
/**
|
||||
Default constructor.
|
||||
*/
|
||||
wxPGProperty();
|
||||
|
||||
/** Constructor.
|
||||
Non-abstract property classes should have constructor of this style:
|
||||
/**
|
||||
Constructor.
|
||||
|
||||
@code
|
||||
|
||||
// If T is a class, then it should be a constant reference
|
||||
// (e.g. const T& ) instead.
|
||||
MyProperty( const wxString& label, const wxString& name, T value )
|
||||
: wxPGProperty()
|
||||
{
|
||||
// Generally recommended way to set the initial value
|
||||
// (as it should work in pretty much 100% of cases).
|
||||
wxVariant variant;
|
||||
variant << value;
|
||||
SetValue(variant);
|
||||
|
||||
// If has private child properties then create them here. Also
|
||||
// set flag that indicates presence of private children. E.g.:
|
||||
//
|
||||
// AddPrivateChild( new wxStringProperty("Subprop 1",
|
||||
// wxPG_LABEL,
|
||||
// value.GetSubProp1() ) );
|
||||
}
|
||||
|
||||
@endcode
|
||||
All non-abstract property classes should have a constructor with
|
||||
the same first two arguments as this one.
|
||||
*/
|
||||
wxPGProperty( const wxString& label, const wxString& name );
|
||||
|
||||
|
@ -428,11 +428,15 @@
|
||||
class MyProperty : public wxPGProperty
|
||||
{
|
||||
public:
|
||||
// All arguments of ctor must have a default value -
|
||||
// Default constructor
|
||||
MyProperty() { }
|
||||
|
||||
// All arguments of this ctor must have a default value -
|
||||
// use wxPG_LABEL for label and name
|
||||
MyProperty( const wxString& label = wxPG_LABEL,
|
||||
const wxString& name = wxPG_LABEL,
|
||||
const wxString& value = wxEmptyString )
|
||||
: wxPGProperty(label, name)
|
||||
{
|
||||
// m_value is wxVariant
|
||||
m_value = value;
|
||||
@ -509,7 +513,7 @@ public:
|
||||
@code
|
||||
|
||||
MyProperty( const wxString& label, const wxString& name, const T& value )
|
||||
: wxPGProperty()
|
||||
: wxPGProperty(label, name)
|
||||
{
|
||||
// Generally recommended way to set the initial value
|
||||
// (as it should work in pretty much 100% of cases).
|
||||
|
Loading…
Reference in New Issue
Block a user