Fixed setting property label with wxPGproperty::SetLabel

If there is a corresponding cell containing a cached text for column 0 then this text also needs to be updated when the label is changed.

See #16982.
This commit is contained in:
Artur Wieczorek 2015-05-10 18:25:30 +02:00
parent dd036218bd
commit 91144a2247
2 changed files with 15 additions and 1 deletions

View File

@ -2128,7 +2128,7 @@ public:
m_helpString = helpString; m_helpString = helpString;
} }
void SetLabel( const wxString& label ) { m_label = label; } void SetLabel( const wxString& label );
void SetName( const wxString& newName ); void SetName( const wxString& newName );

View File

@ -705,6 +705,20 @@ bool wxPGProperty::IsSomeParent( wxPGProperty* candidate ) const
return false; return false;
} }
void wxPGProperty::SetLabel(const wxString& label)
{
m_label = label;
// Update cell text if possible
if ( HasCell(0) )
{
wxPGCell& cell = GetCell(0);
if ( cell.HasText() )
{
cell.SetText(label);
}
}
}
void wxPGProperty::SetName( const wxString& newName ) void wxPGProperty::SetName( const wxString& newName )
{ {
wxPropertyGrid* pg = GetGrid(); wxPropertyGrid* pg = GetGrid();