diff --git a/common/colors_design_settings.cpp b/common/colors_design_settings.cpp index dae50497c6..36c1711ab2 100644 --- a/common/colors_design_settings.cpp +++ b/common/colors_design_settings.cpp @@ -192,18 +192,18 @@ void COLORS_DESIGN_SETTINGS::setupConfigParams() switch( m_frameType ) { case FRAME_GERBER: - case FRAME_PCB: /* no prefix */ break; + case FRAME_PCB_EDITOR: /* no prefix */ break; case FRAME_CVPCB_DISPLAY: - case FRAME_PCB_MODULE_VIEWER: - case FRAME_PCB_MODULE_VIEWER_MODAL: - case FRAME_PCB_FOOTPRINT_WIZARD: - case FRAME_PCB_FOOTPRINT_PREVIEW: - case FRAME_PCB_MODULE_EDITOR: SetConfigPrefix( "ModEdit" ); break; + case FRAME_FOOTPRINT_VIEWER: + case FRAME_FOOTPRINT_VIEWER_MODAL: + case FRAME_FOOTPRINT_WIZARD: + case FRAME_FOOTPRINT_PREVIEW: + case FRAME_FOOTPRINT_EDITOR: SetConfigPrefix( "ModEdit" ); break; - case FRAME_PCB_DISPLAY3D: SetConfigPrefix( "fp3d_" ); break; + case FRAME_PCB_DISPLAY3D: SetConfigPrefix( "fp3d_" ); break; - default: break; + default: break; } wxString fmt( "Color4DPCBLayer_%s" ); @@ -230,7 +230,7 @@ void COLORS_DESIGN_SETTINGS::setupConfigParams() // Add prms only relevant in board editor - if( m_frameType == FRAME_PCB ) + if( m_frameType == FRAME_PCB_EDITOR ) { Add( "Color4DViaThruEx", ITEM_COLOR( LAYER_VIA_THROUGH ), LIGHTGRAY ); Add( "Color4DViaBBlindEx", ITEM_COLOR( LAYER_VIA_BBLIND ), BROWN ); diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index fcb9c5a6f0..87b957fd58 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -651,7 +651,7 @@ bool EDA_DRAW_FRAME::saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvas FRAME_T allowed_frames[] = { FRAME_SCH, - FRAME_PCB, FRAME_PCB_MODULE_EDITOR, + FRAME_PCB_EDITOR, FRAME_FOOTPRINT_EDITOR, FRAME_GERBER }; diff --git a/common/kiway.cpp b/common/kiway.cpp index 3da7d82f75..b2ff4a9a07 100644 --- a/common/kiway.cpp +++ b/common/kiway.cpp @@ -279,11 +279,11 @@ KIWAY::FACE_T KIWAY::KifaceType( FRAME_T aFrameType ) case FRAME_SIMULATOR: return FACE_SCH; - case FRAME_PCB: - case FRAME_PCB_MODULE_EDITOR: - case FRAME_PCB_MODULE_VIEWER: - case FRAME_PCB_MODULE_VIEWER_MODAL: - case FRAME_PCB_FOOTPRINT_WIZARD: + case FRAME_PCB_EDITOR: + case FRAME_FOOTPRINT_EDITOR: + case FRAME_FOOTPRINT_VIEWER: + case FRAME_FOOTPRINT_VIEWER_MODAL: + case FRAME_FOOTPRINT_WIZARD: case FRAME_PCB_DISPLAY3D: return FACE_PCB; diff --git a/common/single_top.cpp b/common/single_top.cpp index b50ecf18a8..c4dc755c7a 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -317,9 +317,9 @@ bool PGM_SINGLE_TOP::OnPgmInit() wxString name; FRAME_T type; } frameTypes[] = { - { wxT( "pcb" ), FRAME_PCB }, - { wxT( "fpedit" ), FRAME_PCB_MODULE_EDITOR }, - { wxT( "" ), FRAME_T_COUNT } + { wxT( "pcb" ), FRAME_PCB_EDITOR }, + { wxT( "fpedit" ), FRAME_FOOTPRINT_EDITOR }, + { wxT( "" ), FRAME_T_COUNT } }; if( argc > 2 ) diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp index f3d3c1136d..5c2d685389 100644 --- a/common/tool/actions.cpp +++ b/common/tool/actions.cpp @@ -514,12 +514,12 @@ TOOL_ACTION ACTIONS::showSymbolEditor( "common.Control.showSymbolEditor", TOOL_ACTION ACTIONS::showFootprintBrowser( "common.Control.showFootprintBrowser", AS_GLOBAL, 0, "", _( "Footprint Library Browser" ), _( "Browse footprint libraries" ), - modview_icon_xpm, AF_NONE, (void*) FRAME_PCB_MODULE_VIEWER ); + modview_icon_xpm, AF_NONE, (void*) FRAME_FOOTPRINT_VIEWER ); TOOL_ACTION ACTIONS::showFootprintEditor( "common.Control.showFootprintEditor", AS_GLOBAL, 0, "", _( "Footprint Editor" ), _( "Create, delete and edit footprints" ), - module_editor_xpm, AF_NONE, (void*) FRAME_PCB_MODULE_EDITOR ); + module_editor_xpm, AF_NONE, (void*) FRAME_FOOTPRINT_EDITOR ); TOOL_ACTION ACTIONS::updatePcbFromSchematic( "common.Control.updatePcbFromSchematic", AS_GLOBAL, diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index 9b2b1ecaca..08bb0752c0 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -255,15 +255,15 @@ int COMMON_TOOLS::ZoomFitScreen( const TOOL_EVENT& aEvent ) double margin_scale_factor = 1.1; // Leave a bigger margin for library editors & viewers - if( frame->IsType( FRAME_SCH_LIB_EDITOR ) || frame->IsType( FRAME_PCB_MODULE_EDITOR ) ) - { - margin_scale_factor = 2; - } - else if( frame->IsType( FRAME_PCB_MODULE_VIEWER ) || frame->IsType( FRAME_PCB_MODULE_VIEWER_MODAL ) - || frame->IsType( FRAME_SCH_VIEWER ) || frame->IsType( FRAME_SCH_VIEWER_MODAL ) ) + if( frame->IsType( FRAME_FOOTPRINT_VIEWER ) || frame->IsType( FRAME_FOOTPRINT_VIEWER_MODAL ) + || frame->IsType( FRAME_SCH_VIEWER ) || frame->IsType( FRAME_SCH_VIEWER_MODAL ) ) { margin_scale_factor = 1.4; } + else if( frame->IsType( FRAME_SCH_LIB_EDITOR ) || frame->IsType( FRAME_FOOTPRINT_EDITOR ) ) + { + margin_scale_factor = 2; + } view->SetScale( scale / margin_scale_factor ); view->SetCenter( bBox.Centre() ); diff --git a/common/widgets/footprint_preview_widget.cpp b/common/widgets/footprint_preview_widget.cpp index 6a7d62cee2..91f1dbc7f1 100644 --- a/common/widgets/footprint_preview_widget.cpp +++ b/common/widgets/footprint_preview_widget.cpp @@ -116,7 +116,7 @@ FOOTPRINT_PREVIEW_PANEL_BASE* FOOTPRINT_PREVIEW_PANEL_BASE::Create( try { KIFACE* kiface = aKiway.KiFACE( KIWAY::FACE_PCB ); - auto window = kiface->CreateWindow( aParent, FRAME_PCB_FOOTPRINT_PREVIEW, &aKiway ); + auto window = kiface->CreateWindow( aParent, FRAME_FOOTPRINT_PREVIEW, &aKiway ); panel = dynamic_cast( window ); diff --git a/common/widgets/footprint_select_widget.cpp b/common/widgets/footprint_select_widget.cpp index 6cc27ae730..5425f54790 100644 --- a/common/widgets/footprint_select_widget.cpp +++ b/common/widgets/footprint_select_widget.cpp @@ -41,16 +41,15 @@ enum wxDEFINE_EVENT( EVT_FOOTPRINT_SELECTED, wxCommandEvent ); -FOOTPRINT_SELECT_WIDGET::FOOTPRINT_SELECT_WIDGET( wxWindow* aParent, - FOOTPRINT_LIST* aFpList, bool aUpdate, - int aMaxItems ) - : wxPanel( aParent ), - m_kiway( nullptr ), - m_update( aUpdate ), - m_finished_loading( false ), - m_max_items( aMaxItems ), - m_last_item( 0 ), - m_fp_list( aFpList ) +FOOTPRINT_SELECT_WIDGET::FOOTPRINT_SELECT_WIDGET( wxWindow* aParent, FOOTPRINT_LIST* aFpList, + bool aUpdate, int aMaxItems ) : + wxPanel( aParent ), + m_kiway( nullptr ), + m_update( aUpdate ), + m_finished_loading( false ), + m_max_items( aMaxItems ), + m_last_item( 0 ), + m_fp_list( aFpList ) { m_zero_filter = true; m_sizer = new wxBoxSizer( wxVERTICAL ); @@ -167,7 +166,7 @@ wxString FOOTPRINT_SELECT_WIDGET::ShowPicker() // event loop goes all silly. wxASSERT( !dsparent || dsparent->IsQuasiModal() ); - auto frame = m_kiway->Player( FRAME_PCB_MODULE_VIEWER_MODAL, true ); + auto frame = m_kiway->Player( FRAME_FOOTPRINT_VIEWER_MODAL, true ); if( !frame->ShowModal( &fpname, parent ) ) { @@ -195,14 +194,10 @@ void FOOTPRINT_SELECT_WIDGET::FilterByPinCount( int aPinCount ) } -void FOOTPRINT_SELECT_WIDGET::FilterByFootprintFilters( - wxArrayString const& aFilters, bool aZeroFilters ) +void FOOTPRINT_SELECT_WIDGET::FilterByFootprintFilters( wxArrayString const& aFilters, + bool aZeroFilters ) { - if( aZeroFilters && aFilters.size() == 0 ) - m_zero_filter = true; - else - m_zero_filter = false; - + m_zero_filter = ( aZeroFilters && aFilters.size() == 0 ); m_fp_filter.FilterByFootprintFilters( aFilters ); } diff --git a/common/widgets/grid_text_button_helpers.cpp b/common/widgets/grid_text_button_helpers.cpp index 2b6845bbb1..b779a098e6 100644 --- a/common/widgets/grid_text_button_helpers.cpp +++ b/common/widgets/grid_text_button_helpers.cpp @@ -234,7 +234,7 @@ protected: if( fpid.IsEmpty() ) fpid = m_preselect; - KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true, m_dlg ); + KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true, m_dlg ); if( frame->ShowModal( &fpid, m_dlg ) ) SetValue( fpid ); diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 2465217195..2d1ea2e4be 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -323,7 +323,7 @@ void SCH_EDIT_FRAME::SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_COMPONENT // Typically ExpressMail is going to be s-expression packets, but since // we have existing interpreter of the cross probe packet on the other // side in place, we use that here. - Kiway().ExpressMail( FRAME_PCB, MAIL_CROSS_PROBE, packet, this ); + Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_CROSS_PROBE, packet, this ); } } } @@ -344,7 +344,7 @@ void SCH_EDIT_FRAME::SendCrossProbeNetName( const wxString& aNetName ) // Typically ExpressMail is going to be s-expression packets, but since // we have existing interpreter of the cross probe packet on the other // side in place, we use that here. - Kiway().ExpressMail( FRAME_PCB, MAIL_CROSS_PROBE, packet, this ); + Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_CROSS_PROBE, packet, this ); } } } @@ -361,7 +361,7 @@ void SCH_EDIT_FRAME::SendCrossProbeClearHighlight() // Typically ExpressMail is going to be s-expression packets, but since // we have existing interpreter of the cross probe packet on the other // side in place, we use that here. - Kiway().ExpressMail( FRAME_PCB, MAIL_CROSS_PROBE, packet, this ); + Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_CROSS_PROBE, packet, this ); } } diff --git a/eeschema/dialogs/dialog_edit_one_field.cpp b/eeschema/dialogs/dialog_edit_one_field.cpp index 0053ada2aa..7961a33357 100644 --- a/eeschema/dialogs/dialog_edit_one_field.cpp +++ b/eeschema/dialogs/dialog_edit_one_field.cpp @@ -103,7 +103,7 @@ void DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick( wxCommandEvent& aEvent // pick a footprint using the footprint picker. wxString fpid = m_TextValue->GetValue(); - KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true ); + KIWAY_PLAYER* frame = Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true ); if( frame->ShowModal( &fpid, this ) ) { diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index 37463a9895..9a59e44786 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -86,8 +86,7 @@ protected: { // pick a footprint using the footprint picker. wxString fpid = m_grid->GetCellValue( m_grid->GetGridCursorRow(), FOOTPRINT ); - KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true, - m_dlg ); + KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true, m_dlg ); if( frame->ShowModal( &fpid, m_dlg ) ) m_grid->SetCellValue( m_grid->GetGridCursorRow(), FOOTPRINT, fpid ); diff --git a/eeschema/fields_grid_table.cpp b/eeschema/fields_grid_table.cpp index 3fc572ecb1..109e213210 100644 --- a/eeschema/fields_grid_table.cpp +++ b/eeschema/fields_grid_table.cpp @@ -525,7 +525,7 @@ void FIELDS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event ) { // pick a footprint using the footprint picker. wxString fpid = m_grid->GetCellValue( FOOTPRINT, FDC_VALUE ); - KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true, m_dlg ); + KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true, m_dlg ); if( frame->ShowModal( &fpid, m_dlg ) ) m_grid->SetCellValue( FOOTPRINT, FDC_VALUE, fpid ); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index ec3607118a..35fa87c35f 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -643,7 +643,7 @@ void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event ) return; } - KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB, true ); + KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_EDITOR, true ); // a pcb frame can be already existing, but not yet used. // this is the case when running the footprint editor, or the footprint viewer first @@ -661,7 +661,7 @@ void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event ) frame->Raise(); std::string payload; - Kiway().ExpressMail( FRAME_PCB, MAIL_PCB_UPDATE, payload, this ); + Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_PCB_UPDATE, payload, this ); } @@ -805,7 +805,7 @@ void SCH_EDIT_FRAME::OnOpenPcbnew( wxCommandEvent& event ) } else { - KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB, true ); + KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_EDITOR, true ); // a pcb frame can be already existing, but not yet used. // this is the case when running the footprint editor, or the footprint viewer first diff --git a/include/frame_type.h b/include/frame_type.h index 9bddd4178d..d122b0f769 100644 --- a/include/frame_type.h +++ b/include/frame_type.h @@ -39,13 +39,13 @@ enum FRAME_T FRAME_SCH_VIEWER_MODAL, FRAME_SIMULATOR, - FRAME_PCB, - FRAME_PCB_MODULE_EDITOR, - FRAME_PCB_MODULE_VIEWER, - FRAME_PCB_MODULE_VIEWER_MODAL, - FRAME_PCB_FOOTPRINT_WIZARD, + FRAME_PCB_EDITOR, + FRAME_FOOTPRINT_EDITOR, + FRAME_FOOTPRINT_VIEWER, + FRAME_FOOTPRINT_VIEWER_MODAL, + FRAME_FOOTPRINT_WIZARD, FRAME_PCB_DISPLAY3D, - FRAME_PCB_FOOTPRINT_PREVIEW, + FRAME_FOOTPRINT_PREVIEW, FRAME_CVPCB, FRAME_CVPCB_DISPLAY, diff --git a/kicad/import_project.cpp b/kicad/import_project.cpp index 8b90d5c129..0ceef1b188 100644 --- a/kicad/import_project.cpp +++ b/kicad/import_project.cpp @@ -160,13 +160,13 @@ void KICAD_MANAGER_FRAME::OnImportEagleFiles( wxCommandEvent& event ) if( pcb.FileExists() ) { - KIWAY_PLAYER* pcbframe = Kiway().Player( FRAME_PCB, false ); + KIWAY_PLAYER* pcbframe = Kiway().Player( FRAME_PCB_EDITOR, false ); if( !pcbframe ) { try // PCB frame was not available, try to start it { - pcbframe = Kiway().Player( FRAME_PCB, true ); + pcbframe = Kiway().Player( FRAME_PCB_EDITOR, true ); } catch( const IO_ERROR& err ) { @@ -186,7 +186,7 @@ void KICAD_MANAGER_FRAME::OnImportEagleFiles( wxCommandEvent& event ) std::string packet = StrPrintf( "%d\n%s", IO_MGR::EAGLE, TO_UTF8( pcb.GetFullPath() ) ); - pcbframe->Kiway().ExpressMail( FRAME_PCB, MAIL_IMPORT_FILE, packet, this ); + pcbframe->Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_IMPORT_FILE, packet, this ); // On Windows, Raise() does not bring the window on screen, when iconized if( pcbframe->IsIconized() ) diff --git a/kicad/tools/kicad_manager_actions.cpp b/kicad/tools/kicad_manager_actions.cpp index 0473856b1e..5e70074d45 100644 --- a/kicad/tools/kicad_manager_actions.cpp +++ b/kicad/tools/kicad_manager_actions.cpp @@ -69,13 +69,13 @@ TOOL_ACTION KICAD_MANAGER_ACTIONS::editPCB( "kicad.Control.editPCB", AS_GLOBAL, MD_CTRL + 'P', LEGACY_HK_NAME( "Run Pcbnew" ), _( "Edit PCB" ), _( "Edit PCB" ), - pcbnew_xpm, AF_NONE, (void*) FRAME_PCB ); + pcbnew_xpm, AF_NONE, (void*) FRAME_PCB_EDITOR ); TOOL_ACTION KICAD_MANAGER_ACTIONS::editFootprints( "kicad.Control.editFootprints", AS_GLOBAL, MD_CTRL + 'F', LEGACY_HK_NAME( "Run FpEditor" ), _( "Edit PCB Footprints" ), _( "Edit PCB Footprints" ), - module_editor_xpm, AF_NONE, (void*) FRAME_PCB_MODULE_EDITOR ); + module_editor_xpm, AF_NONE, (void*) FRAME_FOOTPRINT_EDITOR ); TOOL_ACTION KICAD_MANAGER_ACTIONS::viewGerbers( "kicad.Control.viewGerbers", AS_GLOBAL, diff --git a/kicad/tools/kicad_manager_control.cpp b/kicad/tools/kicad_manager_control.cpp index afb8c9025c..ba6c0ebcf1 100644 --- a/kicad/tools/kicad_manager_control.cpp +++ b/kicad/tools/kicad_manager_control.cpp @@ -360,7 +360,7 @@ int KICAD_MANAGER_CONTROL::ShowPlayer( const TOOL_EVENT& aEvent ) { filepath = m_frame->SchFileName(); } - else if( playerType == FRAME_PCB ) + else if( playerType == FRAME_PCB_EDITOR ) { wxFileName kicad_board( m_frame->PcbFileName() ); wxFileName legacy_board( m_frame->PcbLegacyFileName() ); diff --git a/kicad/treeproject_item.cpp b/kicad/treeproject_item.cpp index 3f6aeb8e05..f24ee04962 100644 --- a/kicad/treeproject_item.cpp +++ b/kicad/treeproject_item.cpp @@ -237,7 +237,7 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* aTreePrjFrame ) case TREE_FOOTPRINT_FILE: toolMgr->RunAction( KICAD_MANAGER_ACTIONS::editFootprints, true ); packet = fullFileName.ToStdString(); - kiway.ExpressMail( FRAME_PCB_MODULE_EDITOR, MAIL_FP_EDIT, packet ); + kiway.ExpressMail( FRAME_FOOTPRINT_EDITOR, MAIL_FP_EDIT, packet ); break; case TREE_SCHEMATIC_LIBFILE: diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 3c07808f47..d0db9fbac1 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -576,7 +576,7 @@ add_executable( pcbnew WIN32 MACOSX_BUNDLE ${PCBNEW_RESOURCES} ) set_source_files_properties( ../common/single_top.cpp pcbnew.cpp PROPERTIES - COMPILE_DEFINITIONS "TOP_FRAME=FRAME_PCB;PGM_DATA_FILE_EXT=\"kicad_pcb\";BUILD_KIWAY_DLL" + COMPILE_DEFINITIONS "TOP_FRAME=FRAME_PCB_EDITOR;PGM_DATA_FILE_EXT=\"kicad_pcb\";BUILD_KIWAY_DLL" ) target_link_libraries( pcbnew #singletop # replaces common, giving us restrictive control and link warnings. diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 8d142796ce..82ba02ae06 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -48,7 +48,7 @@ BOARD_COMMIT::BOARD_COMMIT( PCB_TOOL_BASE* aTool ) BOARD_COMMIT::BOARD_COMMIT( EDA_DRAW_FRAME* aFrame ) { m_toolMgr = aFrame->GetToolManager(); - m_editModules = aFrame->IsType( FRAME_PCB_MODULE_EDITOR ); + m_editModules = aFrame->IsType( FRAME_FOOTPRINT_EDITOR ); } diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 04dc0a6c1d..29e9cec600 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -96,7 +96,7 @@ wxPoint BOARD_ITEM::ZeroOffset( 0, 0 ); // These settings will be overriden later, depending on the draw frame that displays the board. // However, when a board is created by a python script, outside a frame, the colors must be set // so dummyColorsSettings provide this default initialization -static PCB_GENERAL_SETTINGS dummyGeneralSettings( FRAME_PCB ); +static PCB_GENERAL_SETTINGS dummyGeneralSettings( FRAME_PCB_EDITOR ); BOARD::BOARD() : BOARD_ITEM_CONTAINER( (BOARD_ITEM*) NULL, PCB_T ), diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index 73a02d9dae..fe90c65906 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -478,7 +478,7 @@ void DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint( wxCommandEvent& event ) { wxString newname = m_newID->GetValue(); - KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true ); + KIWAY_PLAYER* frame = Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true ); if( frame->ShowModal( &newname, this ) ) { diff --git a/pcbnew/dialogs/dialog_move_exact.cpp b/pcbnew/dialogs/dialog_move_exact.cpp index 36305b5866..7b5aa2becb 100644 --- a/pcbnew/dialogs/dialog_move_exact.cpp +++ b/pcbnew/dialogs/dialog_move_exact.cpp @@ -58,7 +58,7 @@ DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT( PCB_BASE_FRAME *aParent, wxPoint& aTransla m_menuIDs.push_back( aAnchor ); m_menuIDs.push_back( ROTATE_AROUND_USER_ORIGIN ); - if( aParent->IsType( FRAME_PCB ) ) + if( aParent->IsType( FRAME_PCB_EDITOR ) ) m_menuIDs.push_back( ROTATE_AROUND_AUX_ORIGIN ); buildRotationAnchorMenu(); diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index dd6398349e..b8a3208221 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -564,7 +564,7 @@ void DIALOG_PAD_PROPERTIES::initValues() // Disable pad net name wxTextCtrl if the caller is the footprint editor // because nets are living only in the board managed by the board editor - m_canEditNetName = m_parent->IsType( FRAME_PCB ); + m_canEditNetName = m_parent->IsType( FRAME_PCB_EDITOR ); // Setup layers names from board // Should be made first, before calling m_rbCopperLayersSel->SetSelection() diff --git a/pcbnew/dialogs/dialog_push_pad_properties.cpp b/pcbnew/dialogs/dialog_push_pad_properties.cpp index 65ebcb0cc1..83171ded03 100644 --- a/pcbnew/dialogs/dialog_push_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_push_pad_properties.cpp @@ -47,7 +47,7 @@ DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES( PCB_BASE_FRAME* aParent // that requires us to correct the button labels here. m_sdbSizer1OK->SetLabel( _( "Change Pads on Current Footprint" ) ); - if( aParent->IsType( FRAME_PCB_MODULE_EDITOR ) ) + if( aParent->IsType( FRAME_FOOTPRINT_EDITOR ) ) m_sdbSizer1Apply->Show( false ); else m_sdbSizer1Apply->SetLabel( _( "Change Pads on Identical Footprints" ) ); diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index 7220d514d8..c062e6d15e 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/pcbnew/dialogs/panel_fp_lib_table.cpp @@ -853,12 +853,12 @@ void InvokePcbLibTableEditor( KIWAY* aKiway, wxWindow* aCaller ) } } - auto editor = (FOOTPRINT_EDIT_FRAME*) aKiway->Player( FRAME_PCB_MODULE_EDITOR, false ); + auto editor = (FOOTPRINT_EDIT_FRAME*) aKiway->Player( FRAME_FOOTPRINT_EDITOR, false ); if( editor ) editor->SyncLibraryTree( true ); - auto viewer = (FOOTPRINT_VIEWER_FRAME*) aKiway->Player( FRAME_PCB_MODULE_VIEWER, false ); + auto viewer = (FOOTPRINT_VIEWER_FRAME*) aKiway->Player( FRAME_FOOTPRINT_VIEWER, false ); if( viewer ) viewer->ReCreateLibraryList(); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 2fb2f72033..c761a12406 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -101,7 +101,7 @@ static const wxChar defaultLibWidthEntry[] = wxT( "ModeditLibWidth" ); FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, EDA_DRAW_PANEL_GAL::GAL_TYPE aBackend ) : - PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_PCB_MODULE_EDITOR, wxEmptyString, + PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_FOOTPRINT_EDITOR, wxEmptyString, wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, GetFootprintEditorFrameName() ) { @@ -377,7 +377,7 @@ void FOOTPRINT_EDIT_FRAME::SetDesignSettings( const BOARD_DESIGN_SETTINGS& aSett const PCB_PLOT_PARAMS& FOOTPRINT_EDIT_FRAME::GetPlotSettings() const { // get the settings from the parent editor, not our BOARD. - PCB_BASE_FRAME* parentFrame = (PCB_BASE_FRAME*) Kiway().Player( FRAME_PCB, true ); + PCB_BASE_FRAME* parentFrame = (PCB_BASE_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, true ); wxASSERT( parentFrame ); return parentFrame->GetPlotSettings(); @@ -387,7 +387,7 @@ const PCB_PLOT_PARAMS& FOOTPRINT_EDIT_FRAME::GetPlotSettings() const void FOOTPRINT_EDIT_FRAME::SetPlotSettings( const PCB_PLOT_PARAMS& aSettings ) { // set the settings into parent editor, not our BOARD. - PCB_BASE_FRAME* parentFrame = (PCB_BASE_FRAME*) Kiway().Player( FRAME_PCB, true ); + PCB_BASE_FRAME* parentFrame = (PCB_BASE_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, true ); wxASSERT( parentFrame ); parentFrame->SetPlotSettings( aSettings ); @@ -488,7 +488,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected( wxUpdateUIEvent& aEvent ) void FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard( wxUpdateUIEvent& aEvent ) { - PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB, false ); + PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false ); aEvent.Enable( frame && frame->GetBoard()->GetFirstModule() != NULL ); } @@ -496,7 +496,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard( wxUpdateUIEvent& aEvent void FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard( wxUpdateUIEvent& aEvent ) { - PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB, false ); + PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false ); MODULE* module_in_edit = GetBoard()->GetFirstModule(); bool canInsert = frame && module_in_edit && !module_in_edit->GetLink(); diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index 6c27e914b7..35f1909b54 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -198,16 +198,16 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) { if( !HandleUnsavedChanges( this, _( "The current footprint has been modified. " "Save changes?" ), - [&]() -> bool { - return SaveFootprint( GetBoard()->GetFirstModule() ); - } ) ) + [&]() -> bool { + return SaveFootprint( GetBoard()->GetFirstModule() ); + } ) ) { break; } } - FOOTPRINT_WIZARD_FRAME* wizard = (FOOTPRINT_WIZARD_FRAME*) Kiway().Player( - FRAME_PCB_FOOTPRINT_WIZARD, true, this ); + auto wizard = (FOOTPRINT_WIZARD_FRAME*) Kiway().Player( FRAME_FOOTPRINT_WIZARD, true, + this ); if( wizard->ShowModal( NULL, this ) ) { diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index a3a988de15..a8f315034d 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -568,7 +568,7 @@ bool PCB_BASE_EDIT_FRAME::AddLibrary( const wxString& aFilename ) return false; } - auto editor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_PCB_MODULE_EDITOR, false ); + auto editor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_FOOTPRINT_EDITOR, false ); if( editor ) { @@ -577,7 +577,7 @@ bool PCB_BASE_EDIT_FRAME::AddLibrary( const wxString& aFilename ) editor->FocusOnLibID( libID ); } - auto viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, false ); + auto viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_FOOTPRINT_VIEWER, false ); if( viewer ) viewer->ReCreateLibraryList(); @@ -791,7 +791,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew ) { // update module in the current board, // not just add it to the board with total disregard for the netlist... - PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB, false ); + PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false ); if( pcbframe == NULL ) // happens when the board editor is not active (or closed) { diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp index 9d90da91bb..19b4e51646 100644 --- a/pcbnew/footprint_preview_panel.cpp +++ b/pcbnew/footprint_preview_panel.cpp @@ -261,7 +261,7 @@ FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL( KIWAY* aKiway, wxWindow* aPare EnableScrolling( false, false ); // otherwise Zoom Auto disables GAL canvas m_dummyBoard = std::make_unique(); - m_colorsSettings = std::make_unique( FRAME_PCB_FOOTPRINT_PREVIEW ); + m_colorsSettings = std::make_unique( FRAME_FOOTPRINT_PREVIEW ); m_colorsSettings->Load( Kiface().KifaceSettings() ); UseColorScheme( m_colorsSettings.get() ); @@ -368,7 +368,7 @@ wxWindow* FOOTPRINT_PREVIEW_PANEL::GetWindow() FOOTPRINT_PREVIEW_PANEL* FOOTPRINT_PREVIEW_PANEL::New( KIWAY* aKiway, wxWindow* aParent ) { - PCB_EDIT_FRAME* pcbnew = static_cast( aKiway->Player( FRAME_PCB, false ) ); + PCB_EDIT_FRAME* pcbnew = static_cast( aKiway->Player( FRAME_PCB_EDITOR, false ) ); wxConfigBase* cfg = Kiface().KifaceSettings(); wxConfigBase* commonCfg = Pgm().CommonSettings(); bool btemp; diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 64602cd77a..975696a03e 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -112,15 +112,14 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent FRAME_T aFrameType ) : PCB_BASE_FRAME( aKiway, aParent, aFrameType, _( "Footprint Library Browser" ), wxDefaultPosition, wxDefaultSize, - aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ? ( aParent ? PARENT_STYLE : MODAL_STYLE ) - : NONMODAL_STYLE, - aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ? FOOTPRINT_VIEWER_FRAME_NAME_MODAL - : FOOTPRINT_VIEWER_FRAME_NAME ) + aFrameType == FRAME_FOOTPRINT_VIEWER_MODAL ? ( aParent ? PARENT_STYLE : MODAL_STYLE ) + : NONMODAL_STYLE, + aFrameType == FRAME_FOOTPRINT_VIEWER_MODAL ? FOOTPRINT_VIEWER_FRAME_NAME_MODAL + : FOOTPRINT_VIEWER_FRAME_NAME ) { - wxASSERT( aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL || - aFrameType == FRAME_PCB_MODULE_VIEWER ); + wxASSERT( aFrameType == FRAME_FOOTPRINT_VIEWER_MODAL || aFrameType == FRAME_FOOTPRINT_VIEWER ); - if( aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ) + if( aFrameType == FRAME_FOOTPRINT_VIEWER_MODAL ) SetModal( true ); // Force the frame name used in config. the footprint viewer frame has a name @@ -651,7 +650,7 @@ void FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB( wxCommandEvent& aEvent ) } else if( GetBoard()->GetFirstModule() ) { - PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB, false ); + PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false ); if( pcbframe == NULL ) // happens when the board editor is not active (or closed) { diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 8e39f0aefe..3b9d8bcae9 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -85,7 +85,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent FOOTPRINT_WIZARD_FRAME_NAME ), m_wizardListShown( false ) { - wxASSERT( aFrameType == FRAME_PCB_FOOTPRINT_WIZARD ); + wxASSERT( aFrameType == FRAME_FOOTPRINT_WIZARD ); // This frame is always show modal: SetModal( true ); @@ -626,8 +626,7 @@ void FOOTPRINT_WIZARD_FRAME::PythonPluginsReload() // Because the board editor has also a plugin python menu, // call PCB_EDIT_FRAME::PythonPluginsReload() if the board editor // is running - PCB_EDIT_FRAME* brd_frame = - static_cast( Kiway().Player( FRAME_PCB, false ) ); + auto brd_frame = static_cast( Kiway().Player( FRAME_PCB_EDITOR, false ) ); if( brd_frame ) brd_frame->PythonPluginsReload(); diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index f0e1dd5f41..cc10462022 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -92,7 +92,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) bool is_last_fp_from_brd = IsCurrentFPFromBoard(); MODULE* newModule; - PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB, false ); + PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false ); if( frame == NULL ) // happens if no board editor opened return false; @@ -167,7 +167,7 @@ wxString PCB_BASE_FRAME::SelectFootprintFromLibBrowser() { // Close the current non-modal Lib browser if opened, and open a new one, in "modal" mode: FOOTPRINT_VIEWER_FRAME* viewer; - viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, false ); + viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_FOOTPRINT_VIEWER, false ); if( viewer ) { @@ -183,7 +183,7 @@ wxString PCB_BASE_FRAME::SelectFootprintFromLibBrowser() SetFocus(); // Creates the modal Lib browser: - viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true, this ); + viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true, this ); wxString fpid; int ret = viewer->ShowModal( &fpid, this ); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index b79a0e2e4f..590df0338e 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -174,8 +174,8 @@ END_EVENT_TABLE() PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : - PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_PCB, wxT( "Pcbnew" ), wxDefaultPosition, - wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, PCB_EDIT_FRAME_NAME ) + PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_PCB_EDITOR, wxT( "Pcbnew" ), wxDefaultPosition, + wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, PCB_EDIT_FRAME_NAME ) { m_showBorderAndTitleBlock = true; // true to display sheet references m_SelTrackWidthBox = NULL; @@ -1095,7 +1095,7 @@ void PCB_EDIT_FRAME::InstallFootprintPropertiesDialog( MODULE* Module ) } else if( retvalue == DIALOG_FOOTPRINT_BOARD_EDITOR::PRM_EDITOR_EDIT_BOARD_FOOTPRINT ) { - FOOTPRINT_EDIT_FRAME* editor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_PCB_MODULE_EDITOR, true ); + auto editor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_FOOTPRINT_EDITOR, true ); editor->Load_Module_From_BOARD( Module ); @@ -1105,7 +1105,7 @@ void PCB_EDIT_FRAME::InstallFootprintPropertiesDialog( MODULE* Module ) else if( retvalue == DIALOG_FOOTPRINT_BOARD_EDITOR::PRM_EDITOR_EDIT_LIBRARY_FOOTPRINT ) { - FOOTPRINT_EDIT_FRAME* editor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_PCB_MODULE_EDITOR, true ); + auto editor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_FOOTPRINT_EDITOR, true ); editor->LoadModuleFromLibrary( Module->GetFPID() ); diff --git a/pcbnew/pcb_general_settings.cpp b/pcbnew/pcb_general_settings.cpp index 0c276d842c..0c58e81dae 100644 --- a/pcbnew/pcb_general_settings.cpp +++ b/pcbnew/pcb_general_settings.cpp @@ -37,7 +37,7 @@ PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS( FRAME_T aFrameType ) : { switch( m_frameType ) { - case FRAME_PCB: + case FRAME_PCB_EDITOR: Add( "Use45DegreeGraphicSegments", &m_Use45DegreeGraphicSegments, false); Add( "MagneticPads", reinterpret_cast( &m_MagneticPads ), CAPTURE_CURSOR_IN_TRACK_TOOL ); Add( "MagneticTracks", reinterpret_cast( &m_MagneticTracks ), CAPTURE_CURSOR_IN_TRACK_TOOL ); @@ -46,7 +46,7 @@ PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS( FRAME_T aFrameType ) : Add( "FlipLeftRight", &m_FlipLeftRight, false ); break; - case FRAME_PCB_MODULE_EDITOR: + case FRAME_FOOTPRINT_EDITOR: m_params.push_back( new PARAM_CFG_BOOL( "FpEditorUse45DegreeGraphicSegments", &m_Use45DegreeGraphicSegments, false, nullptr, "Use45DegreeGraphicSegments" ) ); // legacy location diff --git a/pcbnew/pcb_layer_widget.cpp b/pcbnew/pcb_layer_widget.cpp index d33d1d2676..edf0992f7c 100644 --- a/pcbnew/pcb_layer_widget.cpp +++ b/pcbnew/pcb_layer_widget.cpp @@ -686,7 +686,7 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) BOARD* brd = myframe->GetBoard(); wxASSERT( aId > GAL_LAYER_ID_START && aId < GAL_LAYER_ID_END ); - if( myframe->IsType( FRAME_PCB ) ) + if( myframe->IsType( FRAME_PCB_EDITOR ) ) { // The layer visibility status is saved in the board file so set the board // modified state so the user has the option to save the changes. @@ -707,7 +707,7 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) myframe->GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); myframe->GetCanvas()->GetView()->SetLayerVisible( aId, true ); - if( myframe->IsType( FRAME_PCB ) ) + if( myframe->IsType( FRAME_PCB_EDITOR ) ) { auto opt = static_cast( myframe->GetDisplayOptions() ); opt->m_ShowGlobalRatsnest = isEnabled; diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 0ca6cf9c02..7e6dcdf729 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -69,7 +69,7 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS() m_sketchMode[i] = false; } - COLORS_DESIGN_SETTINGS dummyCds( FRAME_PCB ); + COLORS_DESIGN_SETTINGS dummyCds( FRAME_PCB_EDITOR ); ImportLegacyColors( &dummyCds ); update(); diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index b2ebb44379..ae85589a0e 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -80,7 +80,7 @@ static struct IFACE : public KIFACE_I { switch( aClassId ) { - case FRAME_PCB: + case FRAME_PCB_EDITOR: { auto frame = new PCB_EDIT_FRAME( aKiway, aParent ); @@ -98,18 +98,18 @@ static struct IFACE : public KIFACE_I return frame; } - case FRAME_PCB_MODULE_EDITOR: + case FRAME_FOOTPRINT_EDITOR: return new FOOTPRINT_EDIT_FRAME( aKiway, aParent, EDA_DRAW_PANEL_GAL::GAL_TYPE_UNKNOWN ); - case FRAME_PCB_MODULE_VIEWER: - case FRAME_PCB_MODULE_VIEWER_MODAL: + case FRAME_FOOTPRINT_VIEWER: + case FRAME_FOOTPRINT_VIEWER_MODAL: return new FOOTPRINT_VIEWER_FRAME( aKiway, aParent, FRAME_T( aClassId ) ); - case FRAME_PCB_FOOTPRINT_WIZARD: + case FRAME_FOOTPRINT_WIZARD: return new FOOTPRINT_WIZARD_FRAME( aKiway, aParent, FRAME_T( aClassId ) ); - case FRAME_PCB_FOOTPRINT_PREVIEW: + case FRAME_FOOTPRINT_PREVIEW: return dynamic_cast< wxWindow* >( FOOTPRINT_PREVIEW_PANEL::New( aKiway, aParent ) ); case DIALOG_CONFIGUREPATHS: diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index a548487419..6b92a43169 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1267,7 +1267,7 @@ int EDIT_TOOL::EditFpInFpEditor( const TOOL_EVENT& aEvent ) editFrame->OnModify(); } - auto editor = (FOOTPRINT_EDIT_FRAME*) editFrame->Kiway().Player( FRAME_PCB_MODULE_EDITOR, true ); + auto editor = (FOOTPRINT_EDIT_FRAME*) editFrame->Kiway().Player( FRAME_FOOTPRINT_EDITOR, true ); editor->Load_Module_From_BOARD( mod ); diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index b384be5406..bc13243422 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -93,7 +93,7 @@ void PCBNEW_CONTROL::Reset( RESET_REASON aReason ) int PCBNEW_CONTROL::AddLibrary( const TOOL_EVENT& aEvent ) { - if( m_frame->IsType( FRAME_PCB_MODULE_EDITOR ) || m_frame->IsType( FRAME_PCB ) ) + if( m_frame->IsType( FRAME_FOOTPRINT_EDITOR ) || m_frame->IsType( FRAME_PCB_EDITOR ) ) { if( aEvent.IsAction( &ACTIONS::newLibrary ) ) static_cast( m_frame )->CreateNewLibrary(); @@ -586,7 +586,7 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) if( clipItem->Type() == PCB_T ) static_cast( clipItem )->ClearAllNetCodes(); - bool editModules = m_editModules || frame()->IsType( FRAME_PCB_MODULE_EDITOR ); + bool editModules = m_editModules || frame()->IsType( FRAME_FOOTPRINT_EDITOR ); // The clipboard can contain two different things, an entire kicad_pcb // or a single module @@ -899,9 +899,9 @@ int PCBNEW_CONTROL::Show3DViewer( const TOOL_EVENT& aEvent ) // Suppress warnings on non-Mac systems [&draw3DFrame] {}(); - if( m_frame->IsType( FRAME_PCB_MODULE_VIEWER ) - || m_frame->IsType( FRAME_PCB_MODULE_VIEWER_MODAL ) - || m_frame->IsType( FRAME_PCB_FOOTPRINT_WIZARD ) ) + if( m_frame->IsType( FRAME_FOOTPRINT_VIEWER ) + || m_frame->IsType( FRAME_FOOTPRINT_VIEWER_MODAL ) + || m_frame->IsType( FRAME_FOOTPRINT_WIZARD ) ) { m_frame->Update3DView( true ); diff --git a/pcbnew/tools/placement_tool.cpp b/pcbnew/tools/placement_tool.cpp index 8710d66d44..9d837000b5 100644 --- a/pcbnew/tools/placement_tool.cpp +++ b/pcbnew/tools/placement_tool.cpp @@ -187,7 +187,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignTop( const TOOL_EVENT& aEvent ) BOARD_ITEM* item = i.first; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); item->Move( wxPoint( 0, difference ) ); @@ -220,7 +220,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignBottom( const TOOL_EVENT& aEvent ) BOARD_ITEM* item = i.first; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); item->Move( wxPoint( 0, difference ) ); @@ -268,7 +268,7 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignLeft() BOARD_ITEM* item = i.first; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); item->Move( wxPoint( difference, 0 ) ); @@ -316,7 +316,7 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignRight() BOARD_ITEM* item = i.first; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); item->Move( wxPoint( difference, 0 ) ); @@ -349,7 +349,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterX( const TOOL_EVENT& aEvent ) BOARD_ITEM* item = i.first; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); item->Move( wxPoint( difference, 0 ) ); @@ -382,7 +382,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterY( const TOOL_EVENT& aEvent ) BOARD_ITEM* item = i.first; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); item->Move( wxPoint( 0, difference ) ); @@ -461,7 +461,7 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally( ALIGNMENT_RECTS& items continue; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); int difference = targetX - i.second.GetX(); @@ -486,7 +486,7 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally( ALIGNMENT_RECTS &it BOARD_ITEM* item = i.first; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); int difference = targetX - i.second.GetCenter().x; @@ -563,7 +563,7 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically( ALIGNMENT_RECTS& itemsTo continue; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); int difference = targetY - i.second.GetY(); @@ -588,7 +588,7 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically( ALIGNMENT_RECTS& item BOARD_ITEM* item = i.first; // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); int difference = targetY - i.second.GetCenter().y; diff --git a/pcbnew/tools/position_relative_tool.cpp b/pcbnew/tools/position_relative_tool.cpp index f8cde51e94..63d1e061df 100644 --- a/pcbnew/tools/position_relative_tool.cpp +++ b/pcbnew/tools/position_relative_tool.cpp @@ -101,7 +101,7 @@ int POSITION_RELATIVE_TOOL::RelativeItemSelectionMove( wxPoint aPosAnchor, wxPoi for( auto item : m_selection ) { // Don't move a pad by itself unless editing the footprint - if( item->Type() == PCB_PAD_T && frame()->IsType( FRAME_PCB ) ) + if( item->Type() == PCB_PAD_T && frame()->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); m_commit->Modify( item ); diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 3b45a92371..ab28d73376 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -133,8 +133,8 @@ bool SELECTION_TOOL::Init() { auto frame = getEditFrame(); - if( frame && ( frame->IsType( FRAME_PCB_MODULE_VIEWER ) - || frame->IsType( FRAME_PCB_MODULE_VIEWER_MODAL ) ) ) + if( frame && ( frame->IsType( FRAME_FOOTPRINT_VIEWER ) + || frame->IsType( FRAME_FOOTPRINT_VIEWER_MODAL ) ) ) { frame->AddStandardSubMenus( m_menu ); return true; diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index 1f6af0e5ba..92796e8d3b 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -565,7 +565,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool // Rebuild pointers and connectivity that can be changed. // connectivity can be rebuilt only in the board editor frame - if( IsType( FRAME_PCB ) && ( reBuild_ratsnest || deep_reBuild_ratsnest ) ) + if( IsType( FRAME_PCB_EDITOR ) && ( reBuild_ratsnest || deep_reBuild_ratsnest ) ) { Compile_Ratsnest( false ); }