Try to fix Bug #1100876< Modes (track/footprint) not available.>

It could be a race condition when setting the tools state on and off in PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent ) on some Linux/wxWidgets versions
(does not happen on my computer)
This commit is contained in:
jean-pierre charras
2013-01-18 15:12:57 +01:00
parent 5aaa55c898
commit 129f93b8d3
3 changed files with 58 additions and 17 deletions
+16 -6
View File
@@ -206,15 +206,25 @@ void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent )
{
// Automatic placement of modules and tracks is a mutually exclusive operation so
// clear the other tool if one of the two is selected.
aEvent.Check( m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_TRACKS );
// Automatic placement of modules and tracks is a mutually exclusive operation
// So this tool is activated only if
// m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_TRACKS.
// To avoid creating erroneous events (seems happen on some Linux/wxWidgets versions)
// the tool state is changed only when it is incorrect
bool state = m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_TRACKS;
if( aEvent.IsChecked() != state )
aEvent.Check( state );
}
void PCB_EDIT_FRAME::OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent )
{
// Automatic placement of modules and tracks is a mutually exclusive operation so
// clear the other tool if one of the two is selected.
aEvent.Check( m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_MODULE );
// Automatic placement of modules and tracks is a mutually exclusive operation,
// So this tool is activated only if
// m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_MODULE.
// To avoid creating erroneous events (seems happen on some Linux/wxWidgets versions)
// the tool state is changed only when it is incorrect
bool state = m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_MODULE;
if( aEvent.IsChecked() != state )
aEvent.Check( state );
}