Added wxPGChoices::Copy(), tweaked related documentation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -738,6 +738,11 @@ private:
|
|||||||
Each entry can have label, value, bitmap, text colour, and background
|
Each entry can have label, value, bitmap, text colour, and background
|
||||||
colour.
|
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
|
||||||
|
real copy.
|
||||||
|
|
||||||
@remarks If you do not specify value for entry, index is used.
|
@remarks If you do not specify value for entry, index is used.
|
||||||
|
|
||||||
@library{wxpropgrid}
|
@library{wxpropgrid}
|
||||||
@@ -754,7 +759,10 @@ public:
|
|||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Copy constructor. */
|
/**
|
||||||
|
Copy constructor, uses reference counting. To create a real copy,
|
||||||
|
use Copy() member function instead.
|
||||||
|
*/
|
||||||
wxPGChoices( const wxPGChoices& a )
|
wxPGChoices( const wxPGChoices& a )
|
||||||
{
|
{
|
||||||
if ( a.m_data != wxPGChoicesEmptyData )
|
if ( a.m_data != wxPGChoicesEmptyData )
|
||||||
@@ -853,6 +861,10 @@ public:
|
|||||||
wxPGChoiceEntry& AddAsSorted( const wxString& label,
|
wxPGChoiceEntry& AddAsSorted( const wxString& label,
|
||||||
int value = wxPG_INVALID_VALUE );
|
int value = wxPG_INVALID_VALUE );
|
||||||
|
|
||||||
|
/**
|
||||||
|
Assigns choices data, using reference counting. To create a real copy,
|
||||||
|
use Copy() member function instead.
|
||||||
|
*/
|
||||||
void Assign( const wxPGChoices& a )
|
void Assign( const wxPGChoices& a )
|
||||||
{
|
{
|
||||||
AssignData(a.m_data);
|
AssignData(a.m_data);
|
||||||
@@ -867,6 +879,17 @@ public:
|
|||||||
m_data->Clear();
|
m_data->Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns a real copy of the choices.
|
||||||
|
*/
|
||||||
|
wxPGChoices Copy() const
|
||||||
|
{
|
||||||
|
wxPGChoices dst;
|
||||||
|
dst.EnsureData();
|
||||||
|
dst.m_data->CopyDataFrom(m_data);
|
||||||
|
return dst;
|
||||||
|
}
|
||||||
|
|
||||||
void EnsureData()
|
void EnsureData()
|
||||||
{
|
{
|
||||||
if ( m_data == wxPGChoicesEmptyData )
|
if ( m_data == wxPGChoicesEmptyData )
|
||||||
|
@@ -1425,7 +1425,15 @@ public:
|
|||||||
@class wxPGChoices
|
@class wxPGChoices
|
||||||
|
|
||||||
Helper class for managing choices of wxPropertyGrid properties.
|
Helper class for managing choices of wxPropertyGrid properties.
|
||||||
Each entry can have label, value, bitmap, text colour, and background colour.
|
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
|
||||||
|
real copy.
|
||||||
|
|
||||||
|
@remarks If you do not specify value for entry, index is used.
|
||||||
|
|
||||||
@library{wxpropgrid}
|
@library{wxpropgrid}
|
||||||
@category{propgrid}
|
@category{propgrid}
|
||||||
@@ -1440,7 +1448,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
wxPGChoices();
|
wxPGChoices();
|
||||||
|
|
||||||
/** Copy constructor. */
|
/**
|
||||||
|
Copy constructor, uses reference counting. To create a real copy,
|
||||||
|
use Copy() member function instead.
|
||||||
|
*/
|
||||||
wxPGChoices( const wxPGChoices& a );
|
wxPGChoices( const wxPGChoices& a );
|
||||||
|
|
||||||
/** Constructor. */
|
/** Constructor. */
|
||||||
@@ -1481,7 +1492,8 @@ public:
|
|||||||
wxPGChoiceEntry& AddAsSorted( const wxString& label, int value = wxPG_INVALID_VALUE );
|
wxPGChoiceEntry& AddAsSorted( const wxString& label, int value = wxPG_INVALID_VALUE );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Assigns data from another set of choices.
|
Assigns choices data, using reference counting. To create a real copy,
|
||||||
|
use Copy() member function instead.
|
||||||
*/
|
*/
|
||||||
void Assign( const wxPGChoices& a );
|
void Assign( const wxPGChoices& a );
|
||||||
|
|
||||||
@@ -1495,6 +1507,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns a real copy of the choices.
|
||||||
|
*/
|
||||||
|
wxPGChoices Copy() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns labe of item.
|
Returns labe of item.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user