7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

Update frame type enum to match current class names.

This commit is contained in:
Jeff Young 2019-09-05 23:00:47 +01:00
parent c3226653cc
commit 10c25a2290
45 changed files with 134 additions and 142 deletions

View File

@ -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 );

View File

@ -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
};

View File

@ -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;

View File

@ -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 )

View File

@ -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,

View File

@ -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() );

View File

@ -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<FOOTPRINT_PREVIEW_PANEL_BASE*>( window );

View File

@ -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 );
}

View File

@ -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 );

View File

@ -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 );
}
}

View File

@ -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 ) )
{

View File

@ -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 );

View File

@ -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 );

View File

@ -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

View File

@ -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,

View File

@ -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() )

View File

@ -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,

View File

@ -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() );

View File

@ -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:

View File

@ -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.

View File

@ -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 );
}

View File

@ -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 ),

View File

@ -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 ) )
{

View File

@ -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();

View File

@ -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()

Some files were not shown because too many files have changed in this diff Show More