Move the import graphics menu item to the action
This commit is contained in:
parent
7bfa8575fa
commit
9535153f9e
|
@ -102,8 +102,6 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
|
||||||
EVT_UPDATE_UI( ID_ADD_FOOTPRINT_TO_BOARD,
|
EVT_UPDATE_UI( ID_ADD_FOOTPRINT_TO_BOARD,
|
||||||
FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard )
|
FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard )
|
||||||
EVT_UPDATE_UI( ID_TOOLBARH_PCB_SELECT_LAYER, FOOTPRINT_EDIT_FRAME::OnUpdateLayerSelectBox )
|
EVT_UPDATE_UI( ID_TOOLBARH_PCB_SELECT_LAYER, FOOTPRINT_EDIT_FRAME::OnUpdateLayerSelectBox )
|
||||||
EVT_UPDATE_UI( ID_GEN_IMPORT_GRAPHICS_FILE, FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected )
|
|
||||||
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
|
@ -663,12 +661,6 @@ void FOOTPRINT_EDIT_FRAME::CloseFootprintEditor( wxCommandEvent& Event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected( wxUpdateUIEvent& aEvent )
|
|
||||||
{
|
|
||||||
aEvent.Enable( GetBoard()->GetFirstFootprint() != NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard( wxUpdateUIEvent& aEvent )
|
void FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false );
|
PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false );
|
||||||
|
@ -1043,14 +1035,15 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions()
|
||||||
return IsSearchTreeShown();
|
return IsSearchTreeShown();
|
||||||
};
|
};
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) );
|
mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) );
|
||||||
mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) );
|
mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) );
|
||||||
mgr->SetConditions( PCB_ACTIONS::toggleFootprintTree, CHECK( footprintTreeCond ) );
|
mgr->SetConditions( PCB_ACTIONS::toggleFootprintTree, CHECK( footprintTreeCond ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::print, ENABLE( haveFootprintCond ) );
|
mgr->SetConditions( ACTIONS::print, ENABLE( haveFootprintCond ) );
|
||||||
mgr->SetConditions( PCB_ACTIONS::exportFootprint, ENABLE( haveFootprintCond ) );
|
mgr->SetConditions( PCB_ACTIONS::exportFootprint, ENABLE( haveFootprintCond ) );
|
||||||
mgr->SetConditions( PCB_ACTIONS::footprintProperties, ENABLE( haveFootprintCond ) );
|
mgr->SetConditions( PCB_ACTIONS::footprintProperties, ENABLE( haveFootprintCond ) );
|
||||||
mgr->SetConditions( PCB_ACTIONS::cleanupGraphics, ENABLE( haveFootprintCond ) );
|
mgr->SetConditions( PCB_ACTIONS::cleanupGraphics, ENABLE( haveFootprintCond ) );
|
||||||
|
mgr->SetConditions( PCB_ACTIONS::placeImportedGraphics, ENABLE( haveFootprintCond ) );
|
||||||
|
|
||||||
|
|
||||||
// Only enable a tool if the part is edtable
|
// Only enable a tool if the part is edtable
|
||||||
|
|
|
@ -144,7 +144,6 @@ public:
|
||||||
*/
|
*/
|
||||||
bool SaveLibraryAs( const wxString& aLibraryPath );
|
bool SaveLibraryAs( const wxString& aLibraryPath );
|
||||||
|
|
||||||
void OnUpdateModuleSelected( wxUpdateUIEvent& aEvent );
|
|
||||||
void OnUpdateLoadFootprintFromBoard( wxUpdateUIEvent& aEvent );
|
void OnUpdateLoadFootprintFromBoard( wxUpdateUIEvent& aEvent );
|
||||||
void OnUpdateSaveFootprintToBoard( wxUpdateUIEvent& aEvent );
|
void OnUpdateSaveFootprintToBoard( wxUpdateUIEvent& aEvent );
|
||||||
|
|
||||||
|
|
|
@ -69,11 +69,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
||||||
submenuImport->SetTitle( _( "Import" ) );
|
submenuImport->SetTitle( _( "Import" ) );
|
||||||
submenuImport->SetIcon( BITMAPS::import );
|
submenuImport->SetIcon( BITMAPS::import );
|
||||||
|
|
||||||
submenuImport->Add( PCB_ACTIONS::importFootprint, ACTION_MENU::NORMAL, _( "Footprint..." ) );
|
submenuImport->Add( PCB_ACTIONS::importFootprint, ACTION_MENU::NORMAL, _( "Footprint..." ) );
|
||||||
submenuImport->Add( _( "&Graphics..." ),
|
submenuImport->Add( PCB_ACTIONS::placeImportedGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) );
|
||||||
_( "Import 2D drawing file to current footprint" ),
|
|
||||||
ID_GEN_IMPORT_GRAPHICS_FILE,
|
|
||||||
BITMAPS::import_vector );
|
|
||||||
|
|
||||||
fileMenu->Add( submenuImport );
|
fileMenu->Add( submenuImport );
|
||||||
|
|
||||||
|
|
|
@ -109,8 +109,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
||||||
|
|
||||||
submenuImport->Add( PCB_ACTIONS::importNetlist, ACTION_MENU::NORMAL, _( "Netlist..." ) );
|
submenuImport->Add( PCB_ACTIONS::importNetlist, ACTION_MENU::NORMAL, _( "Netlist..." ) );
|
||||||
submenuImport->Add( PCB_ACTIONS::importSpecctraSession, ACTION_MENU::NORMAL, _( "Specctra Session..." ) );
|
submenuImport->Add( PCB_ACTIONS::importSpecctraSession, ACTION_MENU::NORMAL, _( "Specctra Session..." ) );
|
||||||
submenuImport->Add( _( "Graphics..." ), _( "Import 2D drawing file" ),
|
submenuImport->Add( PCB_ACTIONS::placeImportedGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) );
|
||||||
ID_GEN_IMPORT_GRAPHICS_FILE, BITMAPS::import_vector );
|
|
||||||
|
|
||||||
if( Kiface().IsSingle() )
|
if( Kiface().IsSingle() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,7 +86,6 @@ enum pcbnew_ids
|
||||||
ID_GEN_EXPORT_FILE_STEP,
|
ID_GEN_EXPORT_FILE_STEP,
|
||||||
ID_GEN_EXPORT_FILE_HYPERLYNX,
|
ID_GEN_EXPORT_FILE_HYPERLYNX,
|
||||||
ID_GEN_EXPORT_FILE_GENCADFORMAT,
|
ID_GEN_EXPORT_FILE_GENCADFORMAT,
|
||||||
ID_GEN_IMPORT_GRAPHICS_FILE,
|
|
||||||
|
|
||||||
ID_TOOLBARH_PCB_ACTION_PLUGIN,
|
ID_TOOLBARH_PCB_ACTION_PLUGIN,
|
||||||
ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH,
|
ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH,
|
||||||
|
|
|
@ -35,12 +35,6 @@
|
||||||
|
|
||||||
OPT<TOOL_EVENT> PCB_ACTIONS::TranslateLegacyId( int aId )
|
OPT<TOOL_EVENT> PCB_ACTIONS::TranslateLegacyId( int aId )
|
||||||
{
|
{
|
||||||
switch( aId )
|
|
||||||
{
|
|
||||||
case ID_GEN_IMPORT_GRAPHICS_FILE:
|
|
||||||
return PCB_ACTIONS::placeImportedGraphics.MakeEvent();
|
|
||||||
}
|
|
||||||
|
|
||||||
return OPT<TOOL_EVENT>();
|
return OPT<TOOL_EVENT>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +188,7 @@ TOOL_ACTION PCB_ACTIONS::drawSimilarZone( "pcbnew.InteractiveDrawing.similarZone
|
||||||
TOOL_ACTION PCB_ACTIONS::placeImportedGraphics( "pcbnew.InteractiveDrawing.placeImportedGraphics",
|
TOOL_ACTION PCB_ACTIONS::placeImportedGraphics( "pcbnew.InteractiveDrawing.placeImportedGraphics",
|
||||||
AS_GLOBAL,
|
AS_GLOBAL,
|
||||||
MD_SHIFT + MD_CTRL + 'F', LEGACY_HK_NAME( "Place DXF" ),
|
MD_SHIFT + MD_CTRL + 'F', LEGACY_HK_NAME( "Place DXF" ),
|
||||||
_( "Place Imported Graphics" ), "",
|
_( "Import Graphics..." ), _( "Import 2D drawing file" ),
|
||||||
BITMAPS::import_vector, AF_ACTIVATE );
|
BITMAPS::import_vector, AF_ACTIVATE );
|
||||||
|
|
||||||
TOOL_ACTION PCB_ACTIONS::setAnchor( "pcbnew.InteractiveDrawing.setAnchor",
|
TOOL_ACTION PCB_ACTIONS::setAnchor( "pcbnew.InteractiveDrawing.setAnchor",
|
||||||
|
|
Loading…
Reference in New Issue