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
committed by Vadim Zeitlin
parent 6b236d5d7e
commit 6575ed47a1
2 changed files with 15 additions and 1 deletions

View File

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

View File

@@ -703,6 +703,20 @@ bool wxPGProperty::IsSomeParent( wxPGProperty* candidate ) const
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 )
{
wxPropertyGrid* pg = GetGrid();