diff --git a/include/id.h b/include/id.h index 29fbd45029..16f2fe27b0 100644 --- a/include/id.h +++ b/include/id.h @@ -24,30 +24,12 @@ */ /** - * @file id.h - * * @brief Common command IDs shared by more than one of the KiCad applications. * * Only place command IDs used in base window class event tables or shared * across multiple applications such as the zoom, grid, and language IDs. - * Application specific IDs should be defined in the appropriate header - * file to prevent the entire project from being rebuilt. * - * However, we must avoid duplicate IDs in menus and toolbar items, when wxUpdateUIEvent - * are associated to menuitems and/or toolbar items - * The reason is the fact wxWidgets try to send a wxUpdateUIEvent event to a given window and, - * if a wxUpdateUIEvent event function is not defined for a menuitem, wxWidgets - * propagates this event ID to parents of the given window. - * Therefore duplicate IDs could create strange behavior in menus and subtle bugs, depending - * on the code inside the wxUpdateUIEvent event functions called in parent frames. - * I did not seen this propagation to child frames, only to parent frames - * - * Issues exist only if 2 menus have the same ID, and only one menu is associated to - * a wxUpdateUIEvent event, and this one is defined in a parent Window. - * The probability it happens is low, but not null. - * - * Therefore we reserve room in ID list for each sub application. - * Please, change these values if needed + * Most things should use the new ACTION framwork instead. */ @@ -81,13 +63,6 @@ enum main_id ID_PREFERENCES_RESET_PANEL, - ID_GEN_PLOT, - ID_GEN_PLOT_PS, - ID_GEN_PLOT_GERBER, - ID_GEN_PLOT_SVG, - ID_GEN_PLOT_DXF, - ID_GEN_PLOT_PDF, - ID_LANGUAGE_CHOICE, ID_LANGUAGE_DANISH, ID_LANGUAGE_DEFAULT, diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index f6152367ed..4f91e39bdb 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -1999,42 +1998,6 @@ void PCB_EDIT_FRAME::FindNext( bool reverse ) } -void PCB_EDIT_FRAME::ToPlotter( int aID ) -{ - PCB_PLOT_PARAMS plotSettings = GetPlotSettings(); - - switch( aID ) - { - case ID_GEN_PLOT_GERBER: - plotSettings.SetFormat( PLOT_FORMAT::GERBER ); - break; - case ID_GEN_PLOT_DXF: - plotSettings.SetFormat( PLOT_FORMAT::DXF ); - 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_SVG: - plotSettings.SetFormat( PLOT_FORMAT::SVG ); - break; - case ID_GEN_PLOT: - /* keep the previous setup */ - break; - default: - wxFAIL_MSG( wxT( "ToPlotter(): unexpected plot type" ) ); break; - break; - } - - SetPlotSettings( plotSettings ); - - DIALOG_PLOT dlg( this ); - dlg.ShowQuasiModal( ); -} - - int PCB_EDIT_FRAME::TestStandalone() { if( Kiface().IsSingle() ) diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index 217ff143b8..1d9d9cd8ff 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -156,11 +156,6 @@ public: */ void FindNext( bool reverse = false ); - /** - * Open a dialog frame to create plot and drill files relative to the current board. - */ - void ToPlotter( int aID ); - bool LayerManagerShown(); bool PropertiesShown(); bool NetInspectorShown(); diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index 5ef35d54df..b9bbefaceb 100644 --- a/pcbnew/tools/board_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -368,7 +369,8 @@ int BOARD_EDITOR_CONTROL::PageSettings( const TOOL_EVENT& aEvent ) int BOARD_EDITOR_CONTROL::Plot( const TOOL_EVENT& aEvent ) { - m_frame->ToPlotter( ID_GEN_PLOT ); + DIALOG_PLOT dlg( m_frame ); + dlg.ShowQuasiModal(); return 0; } @@ -530,13 +532,26 @@ int BOARD_EDITOR_CONTROL::ExportNetlist( const TOOL_EVENT& aEvent ) } +int BOARD_EDITOR_CONTROL::GenerateGerbers( const TOOL_EVENT& aEvent ) +{ + PCB_PLOT_PARAMS plotSettings = m_frame->GetPlotSettings(); + + plotSettings.SetFormat( PLOT_FORMAT::GERBER ); + + m_frame->SetPlotSettings( plotSettings ); + + DIALOG_PLOT dlg( m_frame ); + dlg.ShowQuasiModal( ); + + return 0; +} + + int BOARD_EDITOR_CONTROL::GenerateFabFiles( const TOOL_EVENT& aEvent ) { wxCommandEvent dummy; - if( aEvent.IsAction( &PCB_ACTIONS::generateGerbers ) ) - m_frame->ToPlotter( ID_GEN_PLOT_GERBER ); - else if( aEvent.IsAction( &PCB_ACTIONS::generateReportFile ) ) + if( aEvent.IsAction( &PCB_ACTIONS::generateReportFile ) ) m_frame->GenFootprintsReport( dummy ); else if( aEvent.IsAction( &PCB_ACTIONS::generateD356File ) ) m_frame->GenD356File( dummy ); @@ -1846,7 +1861,7 @@ void BOARD_EDITOR_CONTROL::setTransitions() } Go( &BOARD_EDITOR_CONTROL::GenerateDrillFiles, PCB_ACTIONS::generateDrillFiles.MakeEvent() ); - Go( &BOARD_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateGerbers.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::GenerateGerbers, PCB_ACTIONS::generateGerbers.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::GeneratePosFile, PCB_ACTIONS::generatePosFile.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateReportFile.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateD356File.MakeEvent() ); diff --git a/pcbnew/tools/board_editor_control.h b/pcbnew/tools/board_editor_control.h index 0dd155a0d6..b09f541425 100644 --- a/pcbnew/tools/board_editor_control.h +++ b/pcbnew/tools/board_editor_control.h @@ -75,6 +75,7 @@ public: int ExportNetlist( const TOOL_EVENT& aEvent ); int GenerateDrillFiles( const TOOL_EVENT& aEvent ); int GeneratePosFile( const TOOL_EVENT& aEvent ); + int GenerateGerbers( const TOOL_EVENT& aEvent ); int GenerateFabFiles( const TOOL_EVENT& aEvent ); int RepairBoard( const TOOL_EVENT& aEvent );