Another variation on the wxDataViewCtrl issue....

This commit is contained in:
Jeff Young 2020-02-26 17:56:47 +00:00
parent a2234b348d
commit 82ae9db262
3 changed files with 11 additions and 6 deletions

View File

@ -46,7 +46,6 @@ DIALOG_CLEANUP_TRACKS_AND_VIAS::DIALOG_CLEANUP_TRACKS_AND_VIAS( PCB_EDIT_FRAME*
m_cleanShortCircuitOpt->SetValue( cfg->m_Cleanup.cleanup_short_circuits ); m_cleanShortCircuitOpt->SetValue( cfg->m_Cleanup.cleanup_short_circuits );
m_deleteTracksInPadsOpt->SetValue( cfg->m_Cleanup.cleanup_tracks_in_pad ); m_deleteTracksInPadsOpt->SetValue( cfg->m_Cleanup.cleanup_tracks_in_pad );
m_changesDataView->AppendTextColumn( wxEmptyString, 0, wxDATAVIEW_CELL_INERT, 4000 );
m_changesTreeModel = new DRC_TREE_MODEL( m_changesDataView ); m_changesTreeModel = new DRC_TREE_MODEL( m_changesDataView );
m_changesDataView->AssociateModel( m_changesTreeModel ); m_changesDataView->AssociateModel( m_changesTreeModel );

View File

@ -55,15 +55,12 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFra
m_BrowseButton->SetBitmap( KiBitmap( folder_xpm ) ); m_BrowseButton->SetBitmap( KiBitmap( folder_xpm ) );
m_markerDataView->AppendTextColumn( wxEmptyString, 0, wxDATAVIEW_CELL_INERT, 4000 );
m_markerTreeModel = new DRC_TREE_MODEL( m_markerDataView ); m_markerTreeModel = new DRC_TREE_MODEL( m_markerDataView );
m_markerDataView->AssociateModel( m_markerTreeModel ); m_markerDataView->AssociateModel( m_markerTreeModel );
m_unconnectedDataView->AppendTextColumn( wxEmptyString, 0, wxDATAVIEW_CELL_INERT, 4000 );
m_unconnectedTreeModel = new DRC_TREE_MODEL( m_unconnectedDataView ); m_unconnectedTreeModel = new DRC_TREE_MODEL( m_unconnectedDataView );
m_unconnectedDataView->AssociateModel( m_unconnectedTreeModel ); m_unconnectedDataView->AssociateModel( m_unconnectedTreeModel );
m_footprintsDataView->AppendTextColumn( wxEmptyString, 0, wxDATAVIEW_CELL_INERT, 4000 );
m_footprintsTreeModel = new DRC_TREE_MODEL( m_footprintsDataView ); m_footprintsTreeModel = new DRC_TREE_MODEL( m_footprintsDataView );
m_footprintsDataView->AssociateModel( m_footprintsTreeModel ); m_footprintsDataView->AssociateModel( m_footprintsTreeModel );

View File

@ -232,7 +232,7 @@ public:
// on a row that has been deleted. // on a row that has been deleted.
m_view->UnselectAll(); m_view->UnselectAll();
BeforeReset(); Cleared();
delete m_drcItemsProvider; delete m_drcItemsProvider;
m_drcItemsProvider = aProvider; m_drcItemsProvider = aProvider;
@ -251,7 +251,16 @@ public:
node.m_Children.emplace_back( &node, drcItem, DRC_TREE_NODE::AUX_ITEM ); node.m_Children.emplace_back( &node, drcItem, DRC_TREE_NODE::AUX_ITEM );
} }
AfterReset(); #if defined( __LINUX__ )
// The fastest method to update wxDataViewCtrl is to rebuild from
// scratch by calling Cleared(). Linux requires to reassociate model to
// display data, but Windows will create multiple associations.
// On MacOS, this crashes kicad. See https://gitlab.com/kicad/code/kicad/issues/3666
// and https://gitlab.com/kicad/code/kicad/issues/3653
m_view->AssociateModel( this );
#endif
m_view->ClearColumns();
m_view->AppendTextColumn( wxEmptyString, 0, wxDATAVIEW_CELL_INERT, 4000 );
ExpandAll(); ExpandAll();
} }