Bug fix for DRC tree view on MSW.

This commit is contained in:
Jeff Young 2020-03-07 17:04:09 +00:00
parent 535033c5c9
commit 1e4ae5d526
1 changed files with 7 additions and 2 deletions

View File

@ -86,8 +86,6 @@ void DRC_TREE_MODEL::rebuildModel( DRC_ITEMS_PROVIDER* aProvider, int aSeveritie
if( m_view ) if( m_view )
m_view->UnselectAll(); m_view->UnselectAll();
Cleared();
if( aProvider != m_drcItemsProvider ) if( aProvider != m_drcItemsProvider )
{ {
delete m_drcItemsProvider; delete m_drcItemsProvider;
@ -128,6 +126,10 @@ void DRC_TREE_MODEL::rebuildModel( DRC_ITEMS_PROVIDER* aProvider, int aSeveritie
int width = m_view->GetMainWindow()->GetRect().GetWidth() - WX_DATAVIEW_WINDOW_PADDING; int width = m_view->GetMainWindow()->GetRect().GetWidth() - WX_DATAVIEW_WINDOW_PADDING;
m_view->AppendTextColumn( wxEmptyString, 0, wxDATAVIEW_CELL_INERT, width ); m_view->AppendTextColumn( wxEmptyString, 0, wxDATAVIEW_CELL_INERT, width );
// Must be called after a significant change to force the wxDataViewModel
// to reread all of them, repopulating itself entirely.
Cleared();
ExpandAll(); ExpandAll();
} }
@ -326,4 +328,7 @@ void DRC_TREE_MODEL::onSizeView( wxSizeEvent& aEvent )
if( m_view->GetColumnCount() > 0 ) if( m_view->GetColumnCount() > 0 )
m_view->GetColumn( 0 )->SetWidth( width ); m_view->GetColumn( 0 )->SetWidth( width );
// Pass size event to other widgets
aEvent.Skip();
} }