diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 67055bda12..e7d3f6cb32 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -77,10 +77,6 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME int m_RecordingMacros; MACROS_RECORDED m_Macros[10]; - /// The command ID of the current auto place mode which will be set for either - /// automatic placement of tracks or modules. - int m_autoPlaceModeId; - /// The auxiliary right vertical tool bar used to access the microwave tools. wxAuiToolBar* m_microWaveToolBar; diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 8e9eed8fe1..f43df817a9 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -289,7 +289,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title, m_hasAutoSave = true; m_RecordingMacros = -1; m_microWaveToolBar = NULL; - m_autoPlaceModeId = 0; #ifdef KICAD_SCRIPTING_WXPYTHON m_pythonPanel = NULL; #endif @@ -837,19 +836,15 @@ void PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent ) switch( aEvent.GetId() ) { case ID_TOOLBARH_PCB_MODE_MODULE: - if( aEvent.IsChecked() ) - m_autoPlaceModeId = ID_TOOLBARH_PCB_MODE_MODULE; - else if( m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_MODULE ) - // clear m_autoPlaceModeId only if it was activated by this tool - m_autoPlaceModeId = 0; + if( aEvent.IsChecked() && + m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) ) + m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_TRACKS, false ); break; case ID_TOOLBARH_PCB_MODE_TRACKS: - if( aEvent.IsChecked() ) - m_autoPlaceModeId = ID_TOOLBARH_PCB_MODE_TRACKS; - else if( m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_TRACKS ) - // clear m_autoPlaceModeId only if it was activated by this tool - m_autoPlaceModeId = 0; + if( aEvent.IsChecked() && + m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) ) + m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_MODULE, false ); break; } } diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index 720fecaa25..6c82eeefcd 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -206,20 +206,12 @@ void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent ) void PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent ) -{return; - // 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. - bool state = m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_TRACKS; - m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_TRACKS, state ); +{ + //Nothing to do. } void PCB_EDIT_FRAME::OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent ) { - // 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. - bool state = m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_MODULE; - m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_MODULE, state ); + //Nothing to do. }