Pcbnew: fix a minor bug I created in rev 3912.
Still try to find a better fix for Bug #1100876, however I am thinking the bug is not in Kicad: looks like a buggy version of wxWidgets is used, which sends sometimes an unwanted wxCommandEvent event, when an event::Check() is called inside a function called by a wxUpdateUIEvent event.
This commit is contained in:
parent
7b8c89149b
commit
ac64da651d
|
@ -77,10 +77,6 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME
|
||||||
int m_RecordingMacros;
|
int m_RecordingMacros;
|
||||||
MACROS_RECORDED m_Macros[10];
|
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.
|
/// The auxiliary right vertical tool bar used to access the microwave tools.
|
||||||
wxAuiToolBar* m_microWaveToolBar;
|
wxAuiToolBar* m_microWaveToolBar;
|
||||||
|
|
||||||
|
|
|
@ -289,7 +289,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
|
||||||
m_hasAutoSave = true;
|
m_hasAutoSave = true;
|
||||||
m_RecordingMacros = -1;
|
m_RecordingMacros = -1;
|
||||||
m_microWaveToolBar = NULL;
|
m_microWaveToolBar = NULL;
|
||||||
m_autoPlaceModeId = 0;
|
|
||||||
#ifdef KICAD_SCRIPTING_WXPYTHON
|
#ifdef KICAD_SCRIPTING_WXPYTHON
|
||||||
m_pythonPanel = NULL;
|
m_pythonPanel = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
@ -837,19 +836,15 @@ void PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent )
|
||||||
switch( aEvent.GetId() )
|
switch( aEvent.GetId() )
|
||||||
{
|
{
|
||||||
case ID_TOOLBARH_PCB_MODE_MODULE:
|
case ID_TOOLBARH_PCB_MODE_MODULE:
|
||||||
if( aEvent.IsChecked() )
|
if( aEvent.IsChecked() &&
|
||||||
m_autoPlaceModeId = ID_TOOLBARH_PCB_MODE_MODULE;
|
m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
|
||||||
else if( m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_MODULE )
|
m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_TRACKS, false );
|
||||||
// clear m_autoPlaceModeId only if it was activated by this tool
|
|
||||||
m_autoPlaceModeId = 0;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_TOOLBARH_PCB_MODE_TRACKS:
|
case ID_TOOLBARH_PCB_MODE_TRACKS:
|
||||||
if( aEvent.IsChecked() )
|
if( aEvent.IsChecked() &&
|
||||||
m_autoPlaceModeId = ID_TOOLBARH_PCB_MODE_TRACKS;
|
m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
|
||||||
else if( m_autoPlaceModeId == ID_TOOLBARH_PCB_MODE_TRACKS )
|
m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_MODULE, false );
|
||||||
// clear m_autoPlaceModeId only if it was activated by this tool
|
|
||||||
m_autoPlaceModeId = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,20 +206,12 @@ void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
|
||||||
|
|
||||||
|
|
||||||
void PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent )
|
void PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent )
|
||||||
{return;
|
{
|
||||||
// Automatic placement of modules and tracks is a mutually exclusive operation
|
//Nothing to do.
|
||||||
// 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 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PCB_EDIT_FRAME::OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent )
|
void PCB_EDIT_FRAME::OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
// Automatic placement of modules and tracks is a mutually exclusive operation,
|
//Nothing to do.
|
||||||
// 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 );
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue