Pcbnew: suppress incorrect wx alert when opening the plot dialog from File/Plot menu

This commit is contained in:
jean-pierre charras 2019-04-11 17:36:51 +02:00
parent 232b1c799f
commit 0fae86b1ba
2 changed files with 5 additions and 3 deletions

View File

@ -252,7 +252,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnBrowseLibrary( wxCommandEvent& event
for( int ii = 1; ii <= entry->GetUnitCount(); ii++ ) for( int ii = 1; ii <= entry->GetUnitCount(); ii++ )
m_unitChoice->Append( LIB_PART::SubReference( ii, false ) ); m_unitChoice->Append( LIB_PART::SubReference( ii, false ) );
if( unit < 0 || unit >= m_unitChoice->GetCount() ) if( unit < 0 || unit >= (int)m_unitChoice->GetCount() )
unit = 0; unit = 0;
m_unitChoice->SetSelection( unit ); m_unitChoice->SetSelection( unit );

View File

@ -1109,7 +1109,7 @@ void PCB_EDIT_FRAME::OnSwitchCanvas( wxCommandEvent& aEvent )
void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event ) void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event )
{ {
PCB_PLOT_PARAMS plotSettings = GetPlotSettings(); PCB_PLOT_PARAMS plotSettings = GetPlotSettings();
wxMessageBox(wxString::Format("ToPlotter id %d (%d)",event.GetId(),ID_GEN_PLOT_GERBER ) );
switch( event.GetId() ) switch( event.GetId() )
{ {
case ID_GEN_PLOT_GERBER: plotSettings.SetFormat( PLOT_FORMAT_GERBER ); break; case ID_GEN_PLOT_GERBER: plotSettings.SetFormat( PLOT_FORMAT_GERBER ); break;
@ -1118,7 +1118,9 @@ void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event )
case ID_GEN_PLOT_PDF: plotSettings.SetFormat( PLOT_FORMAT_PDF ); break; case ID_GEN_PLOT_PDF: plotSettings.SetFormat( PLOT_FORMAT_PDF ); break;
case ID_GEN_PLOT_PS: plotSettings.SetFormat( PLOT_FORMAT_POST ); break; case ID_GEN_PLOT_PS: plotSettings.SetFormat( PLOT_FORMAT_POST ); break;
case ID_GEN_PLOT_SVG: wxFAIL_MSG( "Must be handled by ExportSVG()" ); break; case ID_GEN_PLOT_SVG: wxFAIL_MSG( "Must be handled by ExportSVG()" ); break;
default: wxFAIL_MSG( "Unknown plot type" ); break; case ID_GEN_PLOT:
default: // called with no specified plot type: keep the previous setup
break;
} }
SetPlotSettings( plotSettings ); SetPlotSettings( plotSettings );