Make wxCOL_WIDTH_AUTOSIZE work dynamically in generic wxDataViewCtrl
Caching the best column widths broke autosizing behaviour if the column title was updated after setting the width to wxCOL_WIDTH_AUTOSIZE. Fix this by invaliding the column cached width if its text changes.
This commit is contained in:
@@ -186,6 +186,15 @@ void wxDataViewColumn::UpdateDisplay()
|
||||
}
|
||||
}
|
||||
|
||||
void wxDataViewColumn::UpdateWidth()
|
||||
{
|
||||
if (m_owner)
|
||||
{
|
||||
int idx = m_owner->GetColumnIndex( this );
|
||||
m_owner->OnColumnWidthChange( idx );
|
||||
}
|
||||
}
|
||||
|
||||
void wxDataViewColumn::UnsetAsSortKey()
|
||||
{
|
||||
m_sort = false;
|
||||
@@ -4846,6 +4855,13 @@ bool wxDataViewCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *col )
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::OnColumnWidthChange(unsigned int idx)
|
||||
{
|
||||
InvalidateColBestWidth(idx);
|
||||
|
||||
OnColumnChange(idx);
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::OnColumnChange(unsigned int idx)
|
||||
{
|
||||
if ( m_headerArea )
|
||||
|
Reference in New Issue
Block a user