Mac: Add wxDataViewCtrl::AdjustAutosizedColumns()

Refactor common code and also for upcoming accessibility from
wxCocoaOutlineView.

Part of #19003.

Co-Authored-By: Dimitri Schoolwerth <dimitri@schoolwerth.com>
This commit is contained in:
Andreas Falkenhahn 2020-12-22 01:58:46 +01:00 committed by Dimitri Schoolwerth
parent 1324b5122b
commit 9a78bfb553
2 changed files with 10 additions and 6 deletions

View File

@ -261,6 +261,8 @@ public:
m_Deleting = deleting;
}
void AdjustAutosizedColumns() const;
virtual wxDataViewColumn *GetCurrentColumn() const wxOVERRIDE;
virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE

View File

@ -506,9 +506,7 @@ int wxDataViewCtrl::GetColumnPosition(wxDataViewColumn const* columnPtr) const
void wxDataViewCtrl::Collapse(wxDataViewItem const& item)
{
GetDataViewPeer()->Collapse(item);
if ( m_ModelNotifier )
m_ModelNotifier->AdjustAutosizedColumns();
AdjustAutosizedColumns();
}
void wxDataViewCtrl::EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr)
@ -523,9 +521,7 @@ void wxDataViewCtrl::EnsureVisible(wxDataViewItem const& item, wxDataViewColumn
void wxDataViewCtrl::DoExpand(wxDataViewItem const& item, bool expandChildren)
{
GetDataViewPeer()->DoExpand(item, expandChildren);
if ( m_ModelNotifier )
m_ModelNotifier->AdjustAutosizedColumns();
AdjustAutosizedColumns();
}
bool wxDataViewCtrl::IsExpanded( const wxDataViewItem & item ) const
@ -701,6 +697,12 @@ void wxDataViewCtrl::FinishCustomItemEditing()
}
}
void wxDataViewCtrl::AdjustAutosizedColumns() const
{
if ( m_ModelNotifier )
m_ModelNotifier->AdjustAutosizedColumns();
}
/*static*/
wxVisualAttributes
wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))