More ACTIONS work. Nearly done now.
This commit is contained in:
parent
eb1faebf1f
commit
1ea5b04e22
|
@ -358,6 +358,16 @@ TOOL_ACTION ACTIONS::show3DViewer( "common.Control.show3DViewer",
|
|||
_( "3D Viewer" ), _( "Show 3D viewer window" ),
|
||||
three_d_xpm );
|
||||
|
||||
TOOL_ACTION ACTIONS::showSymbolBrowser( "common.Control.showSymbolBrowser",
|
||||
AS_GLOBAL, 0,
|
||||
_( "Symbol Library Browser" ), _( "Browse symbol libraries" ),
|
||||
library_browse_xpm );
|
||||
|
||||
TOOL_ACTION ACTIONS::showFootprintBrowser( "common.Control.showFootprintBrowser",
|
||||
AS_GLOBAL, 0,
|
||||
_( "Footprint Library Browser" ), _( "Browse footprint libraries" ),
|
||||
modview_icon_xpm );
|
||||
|
||||
TOOL_ACTION ACTIONS::updatePcbFromSchematic( "common.Control.updatePcbFromSchematic",
|
||||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_UPDATE_PCB_FROM_SCH ),
|
||||
_( "Update PCB from Schematic..." ), _( "Push changes from schematic to PCB" ),
|
||||
|
|
|
@ -147,7 +147,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
|
|||
return IsSearchTreeShown();
|
||||
};
|
||||
|
||||
viewMenu->AddItem( EE_ACTIONS::showLibraryBrowser, EE_CONDITIONS::ShowAlways );
|
||||
viewMenu->AddItem( ACTIONS::showSymbolBrowser, EE_CONDITIONS::ShowAlways );
|
||||
|
||||
viewMenu->AddSeparator();
|
||||
viewMenu->AddItem( ACTIONS::zoomInCenter, EE_CONDITIONS::ShowAlways );
|
||||
|
|
|
@ -188,7 +188,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
return GetShowAllPins();
|
||||
};
|
||||
|
||||
viewMenu->AddItem( EE_ACTIONS::showLibraryBrowser, EE_CONDITIONS::ShowAlways );
|
||||
viewMenu->AddItem( ACTIONS::showSymbolBrowser, EE_CONDITIONS::ShowAlways );
|
||||
viewMenu->AddItem( EE_ACTIONS::navigateHierarchy, EE_CONDITIONS::ShowAlways );
|
||||
viewMenu->AddItem( EE_ACTIONS::leaveSheet, belowRootSheetCondition );
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
|
|||
|
||||
m_mainToolBar->AddSeparator();
|
||||
m_mainToolBar->Add( EE_ACTIONS::showSymbolEditor );
|
||||
m_mainToolBar->Add( EE_ACTIONS::showLibraryBrowser );
|
||||
m_mainToolBar->Add( ACTIONS::showSymbolBrowser );
|
||||
|
||||
// modedit is with libedit in a "library section" because the user must have footprints before
|
||||
// they can be assigned.
|
||||
|
|
|
@ -161,9 +161,7 @@ public:
|
|||
// Suite operations
|
||||
static TOOL_ACTION showSymbolEditor;
|
||||
static TOOL_ACTION editWithLibEdit;
|
||||
static TOOL_ACTION showLibraryBrowser;
|
||||
static TOOL_ACTION showPcbNew;
|
||||
static TOOL_ACTION updatePcbFromSchematic;
|
||||
static TOOL_ACTION generateBOM;
|
||||
static TOOL_ACTION runSimulation;
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ void LIB_CONTROL::setTransitions()
|
|||
Go( &LIB_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganStandard.MakeEvent() );
|
||||
Go( &LIB_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganAlternate.MakeEvent() );
|
||||
|
||||
Go( &LIB_CONTROL::ShowLibraryBrowser, EE_ACTIONS::showLibraryBrowser.MakeEvent() );
|
||||
Go( &LIB_CONTROL::ShowLibraryBrowser, ACTIONS::showSymbolBrowser.MakeEvent() );
|
||||
Go( &LIB_CONTROL::ShowElectricalTypes, EE_ACTIONS::showElectricalTypes.MakeEvent() );
|
||||
Go( &LIB_CONTROL::ShowComponentTree, EE_ACTIONS::showComponentTree.MakeEvent() );
|
||||
}
|
||||
|
|
|
@ -86,11 +86,6 @@ TOOL_ACTION EE_ACTIONS::editWithLibEdit( "eeschema.EditorControl.editWithSymbolE
|
|||
_( "Edit with Symbol Editor" ), _( "Open the symbol editor to edit the symbol" ),
|
||||
libedit_xpm );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::showLibraryBrowser( "eeschema.EditorControl.showLibraryBrowser",
|
||||
AS_GLOBAL, 0,
|
||||
_( "Symbol Library Browser" ), _( "Browse symbol libraries" ),
|
||||
library_browse_xpm );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::editSymbolFields( "eeschema.EditorControl.editSymbolFields",
|
||||
AS_GLOBAL, 0,
|
||||
_( "Edit Symbol Fields..." ), _( "Bulk-edit fields of all symbols in schematic" ),
|
||||
|
@ -1265,7 +1260,7 @@ void SCH_EDITOR_CONTROL::setTransitions()
|
|||
|
||||
Go( &SCH_EDITOR_CONTROL::EditWithLibEdit, EE_ACTIONS::editWithLibEdit.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::ShowSymbolEditor, EE_ACTIONS::showSymbolEditor.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::ShowLibraryBrowser, EE_ACTIONS::showLibraryBrowser.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::ShowLibraryBrowser, ACTIONS::showSymbolBrowser.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::ShowCvpcb, EE_ACTIONS::assignFootprints.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::Annotate, EE_ACTIONS::annotate.MakeEvent() );
|
||||
Go( &SCH_EDITOR_CONTROL::EditSymbolFields, EE_ACTIONS::editSymbolFields.MakeEvent() );
|
||||
|
|
|
@ -141,6 +141,8 @@ public:
|
|||
|
||||
// Misc
|
||||
static TOOL_ACTION show3DViewer;
|
||||
static TOOL_ACTION showSymbolBrowser;
|
||||
static TOOL_ACTION showFootprintBrowser;
|
||||
static TOOL_ACTION updatePcbFromSchematic;
|
||||
static TOOL_ACTION configurePaths;
|
||||
static TOOL_ACTION showSymbolLibTable;
|
||||
|
|
|
@ -111,31 +111,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
}
|
||||
break;
|
||||
|
||||
case ID_OPEN_MODULE_VIEWER:
|
||||
{
|
||||
FOOTPRINT_VIEWER_FRAME* viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, false );
|
||||
|
||||
if( !viewer )
|
||||
{
|
||||
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Needed on Windows, other platforms do not use it,
|
||||
// but it creates no issue
|
||||
if( viewer->IsIconized() )
|
||||
viewer->Iconize( false );
|
||||
|
||||
viewer->Raise();
|
||||
|
||||
// Raising the window does not set the focus on Linux. This should work on
|
||||
// any platform.
|
||||
if( wxWindow::FindFocus() != viewer )
|
||||
viewer->SetFocus();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_GET_NETLIST:
|
||||
InstallNetlistFrame();
|
||||
break;
|
||||
|
|
|
@ -85,14 +85,11 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
|
|||
EVT_CHOICE( ID_ON_ZOOM_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectZoom )
|
||||
EVT_CHOICE( ID_ON_GRID_SELECT, FOOTPRINT_EDIT_FRAME::OnSelectGrid )
|
||||
|
||||
EVT_TOOL( ID_OPEN_MODULE_VIEWER, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_MODEDIT_SAVE_PNG, FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng )
|
||||
|
||||
EVT_TOOL( ID_MODEDIT_CUT_PART, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_MODEDIT_COPY_PART, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_MODEDIT_PASTE_PART, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_MODEDIT_NEW_MODULE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_MODEDIT_NEW_MODULE_FROM_WIZARD, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_MODEDIT_IMPORT_PART, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_MODEDIT_EXPORT_PART, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_MODEDIT_SHEET_SET, FOOTPRINT_EDIT_FRAME::Process_Special_Functions )
|
||||
|
|
|
@ -156,32 +156,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
switch( id )
|
||||
{
|
||||
case ID_OPEN_MODULE_VIEWER:
|
||||
{
|
||||
FOOTPRINT_VIEWER_FRAME* viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, false );
|
||||
|
||||
if( !viewer )
|
||||
{
|
||||
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER, true );
|
||||
viewer->Show( true );
|
||||
viewer->Zoom_Automatique( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
// On Windows, Raise() does not bring the window on screen, when iconized
|
||||
if( viewer->IsIconized() )
|
||||
viewer->Iconize( false );
|
||||
|
||||
viewer->Raise();
|
||||
|
||||
// Raising the window does not set the focus on Linux. This should work on
|
||||
// any platform.
|
||||
if( wxWindow::FindFocus() != viewer )
|
||||
viewer->SetFocus();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_MODEDIT_NEW_MODULE:
|
||||
{
|
||||
LIB_ID selected = m_treePane->GetLibTree()->GetSelectedLibId();
|
||||
|
|
|
@ -54,9 +54,9 @@ FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE( FOOTPRINT_EDIT_FRAME* aParent )
|
|||
menuLibrary->Add( ACTIONS::saveAs );
|
||||
|
||||
menuLibrary->AppendSeparator();
|
||||
menuLibrary->Add( _( "New Footprint..." ), ID_MODEDIT_NEW_MODULE, new_footprint_xpm );
|
||||
menuLibrary->Add( PCB_ACTIONS::newFootprint );
|
||||
#ifdef KICAD_SCRIPTING
|
||||
menuLibrary->Add( _( "Create Footprint from Wizard..." ), ID_MODEDIT_NEW_MODULE_FROM_WIZARD, module_wizard_xpm );
|
||||
menuLibrary->Add( PCB_ACTIONS::createFootprint );
|
||||
#endif
|
||||
menuLibrary->Add( _( "Import Footprint..." ), ID_MODEDIT_IMPORT_PART, import_module_xpm );
|
||||
menuLibrary->Add( _( "Paste Footprint" ), ID_MODEDIT_PASTE_PART, paste_xpm );
|
||||
|
|
|
@ -64,16 +64,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
|
||||
fileMenu->AddItem( ACTIONS::newLibrary, SELECTION_CONDITIONS::ShowAlways );
|
||||
fileMenu->AddItem( ACTIONS::addLibrary, SELECTION_CONDITIONS::ShowAlways );
|
||||
fileMenu->AddItem( ID_MODEDIT_NEW_MODULE,
|
||||
AddHotkeyName( _( "&New Footprint..." ), m_hotkeysDescrList, HK_NEW ),
|
||||
_( "Create a new footprint" ),
|
||||
new_footprint_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
fileMenu->AddItem( PCB_ACTIONS::newFootprint, SELECTION_CONDITIONS::ShowAlways );
|
||||
#ifdef KICAD_SCRIPTING
|
||||
fileMenu->AddItem( ID_MODEDIT_NEW_MODULE_FROM_WIZARD,
|
||||
_( "&Create Footprint..." ),
|
||||
_( "Create a new footprint using the footprint wizard" ),
|
||||
module_wizard_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
fileMenu->AddItem( PCB_ACTIONS::createFootprint, SELECTION_CONDITIONS::ShowAlways );
|
||||
#endif
|
||||
|
||||
fileMenu->AddSeparator();
|
||||
|
@ -185,11 +178,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
return IsSearchTreeShown();
|
||||
};
|
||||
|
||||
viewMenu->AddItem( ID_OPEN_MODULE_VIEWER,
|
||||
_( "Footprint &Library Browser" ),
|
||||
_( "Browse footprint libraries" ),
|
||||
modview_icon_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
viewMenu->AddItem( ACTIONS::showFootprintBrowser, SELECTION_CONDITIONS::ShowAlways );
|
||||
viewMenu->AddItem( ACTIONS::show3DViewer, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
viewMenu->AddSeparator();
|
||||
|
|
|
@ -324,10 +324,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
_( "Show Microwa&ve Toolbar" ), HELP_SHOW_HIDE_MICROWAVE_TOOLS,
|
||||
mw_toolbar_xpm, microwaveToolbarShownCondition );
|
||||
|
||||
viewMenu->AddItem( ID_OPEN_MODULE_VIEWER,
|
||||
_( "Footprint &Library Browser" ), _( "Browse footprint libraries" ),
|
||||
modview_icon_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
viewMenu->AddItem( ACTIONS::showFootprintBrowser, SELECTION_CONDITIONS::ShowAlways );
|
||||
viewMenu->AddItem( ACTIONS::show3DViewer, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
viewMenu->AddSeparator();
|
||||
|
|
|
@ -120,7 +120,6 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
|
|||
EVT_TOOL( ID_MENU_READ_BOARD_BACKUP_FILE, PCB_EDIT_FRAME::Files_io )
|
||||
EVT_TOOL( ID_MENU_RECOVER_BOARD_AUTOSAVE, PCB_EDIT_FRAME::Files_io )
|
||||
EVT_TOOL( ID_OPEN_MODULE_EDITOR, PCB_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_OPEN_MODULE_VIEWER, PCB_EDIT_FRAME::Process_Special_Functions )
|
||||
|
||||
// Menu Files:
|
||||
EVT_MENU( ID_MAIN_MENUBAR, PCB_EDIT_FRAME::Process_Special_Functions )
|
||||
|
|
|
@ -16,7 +16,6 @@ enum pcbnew_ids
|
|||
ID_MAIN_MENUBAR = ID_END_LIST,
|
||||
ID_MICROWAVE_V_TOOLBAR,
|
||||
ID_OPEN_MODULE_EDITOR,
|
||||
ID_OPEN_MODULE_VIEWER,
|
||||
ID_SET_RELATIVE_OFFSET,
|
||||
ID_COPY_BOARD_AS,
|
||||
ID_IMPORT_NON_KICAD_BOARD,
|
||||
|
|
|
@ -49,14 +49,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
|
|||
wxString msg;
|
||||
|
||||
// Set up toolbar
|
||||
m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE, wxEmptyString,
|
||||
KiScaledBitmap( new_footprint_xpm, this ),
|
||||
_( "New footprint" ) );
|
||||
|
||||
m_mainToolBar->Add( PCB_ACTIONS::newFootprint );
|
||||
#ifdef KICAD_SCRIPTING
|
||||
m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE_FROM_WIZARD, wxEmptyString,
|
||||
KiScaledBitmap( module_wizard_xpm, this ),
|
||||
_( "New footprint using footprint wizard" ) );
|
||||
m_mainToolBar->Add( PCB_ACTIONS::createFootprint );
|
||||
#endif
|
||||
|
||||
if( IsCurrentFPFromBoard() )
|
||||
|
|
|
@ -268,7 +268,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
|
|||
|
||||
KiScaledSeparator( m_mainToolBar, this );
|
||||
ADD_TOOL( ID_OPEN_MODULE_EDITOR, module_editor_xpm, _( "Open footprint editor" ) );
|
||||
ADD_TOOL( ID_OPEN_MODULE_VIEWER, modview_icon_xpm, _( "Open footprint viewer" ) );
|
||||
m_mainToolBar->Add( ACTIONS::showFootprintBrowser );
|
||||
|
||||
KiScaledSeparator( m_mainToolBar, this );
|
||||
m_mainToolBar->Add( ACTIONS::updatePcbFromSchematic );
|
||||
|
|
|
@ -55,6 +55,16 @@ using namespace std::placeholders;
|
|||
#include <wx/defs.h>
|
||||
|
||||
|
||||
TOOL_ACTION PCB_ACTIONS::newFootprint( "pcbnew.ModuleEditor.newFootprint",
|
||||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_NEW ),
|
||||
_( "New Footprint..." ), _( "Create a new, empty footprint" ),
|
||||
new_footprint_xpm );
|
||||
|
||||
TOOL_ACTION PCB_ACTIONS::createFootprint( "pcbnew.ModuleEditor.createFootprint",
|
||||
AS_GLOBAL, 0,
|
||||
_( "Create Footprint..." ), _( "Create a new footprint using the Footprint Wizard" ),
|
||||
module_wizard_xpm );
|
||||
|
||||
TOOL_ACTION PCB_ACTIONS::saveToBoard( "pcbnew.ModuleEditor.saveToBoard",
|
||||
AS_GLOBAL, 0,
|
||||
_( "Save to Board" ), _( "Update footprint on board" ),
|
||||
|
@ -120,6 +130,22 @@ void MODULE_EDITOR_TOOLS::Reset( RESET_REASON aReason )
|
|||
}
|
||||
|
||||
|
||||
int MODULE_EDITOR_TOOLS::NewFootprint( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
wxCommandEvent evt( wxEVT_NULL, ID_MODEDIT_NEW_MODULE );
|
||||
getEditFrame<FOOTPRINT_EDIT_FRAME>()->Process_Special_Functions( evt );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int MODULE_EDITOR_TOOLS::CreateFootprint( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
wxCommandEvent evt( wxEVT_NULL, ID_MODEDIT_NEW_MODULE_FROM_WIZARD );
|
||||
getEditFrame<FOOTPRINT_EDIT_FRAME>()->Process_Special_Functions( evt );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int MODULE_EDITOR_TOOLS::Save( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
wxCommandEvent evt( wxEVT_NULL, ID_MODEDIT_SAVE );
|
||||
|
@ -623,6 +649,8 @@ int MODULE_EDITOR_TOOLS::CreatePadFromShapes( const TOOL_EVENT& aEvent )
|
|||
|
||||
void MODULE_EDITOR_TOOLS::setTransitions()
|
||||
{
|
||||
Go( &MODULE_EDITOR_TOOLS::NewFootprint, PCB_ACTIONS::newFootprint.MakeEvent() );
|
||||
Go( &MODULE_EDITOR_TOOLS::CreateFootprint, PCB_ACTIONS::createFootprint.MakeEvent() );
|
||||
Go( &MODULE_EDITOR_TOOLS::Save, ACTIONS::save.MakeEvent() );
|
||||
Go( &MODULE_EDITOR_TOOLS::Save, PCB_ACTIONS::saveToBoard.MakeEvent() );
|
||||
Go( &MODULE_EDITOR_TOOLS::Save, PCB_ACTIONS::saveToLibrary.MakeEvent() );
|
||||
|
|
|
@ -49,6 +49,9 @@ public:
|
|||
/// @copydoc TOOL_INTERACTIVE::Reset()
|
||||
void Reset( RESET_REASON aReason ) override;
|
||||
|
||||
int NewFootprint( const TOOL_EVENT& aEvent );
|
||||
int CreateFootprint( const TOOL_EVENT& aEvent );
|
||||
|
||||
int Save( const TOOL_EVENT& aEvent );
|
||||
int SaveAs( const TOOL_EVENT& aEvent );
|
||||
int Revert( const TOOL_EVENT& aEvent );
|
||||
|
|
|
@ -263,20 +263,31 @@ public:
|
|||
static TOOL_ACTION changeFootprints;
|
||||
static TOOL_ACTION swapLayers;
|
||||
|
||||
|
||||
static TOOL_ACTION listNets;
|
||||
static TOOL_ACTION runDRC;
|
||||
static TOOL_ACTION updatePcbFromSchematic;
|
||||
|
||||
static TOOL_ACTION editFootprintInFpEditor;
|
||||
static TOOL_ACTION showPythonConsole;
|
||||
static TOOL_ACTION showHelp;
|
||||
|
||||
// Module editor tools
|
||||
|
||||
// These are distinct so that they can have individual tooltips and icons.
|
||||
// We don't use ACTION::new here because we need to distinguish between New Library
|
||||
// and New Footprint.
|
||||
static TOOL_ACTION newFootprint;
|
||||
|
||||
// Create a new footprint using the Footprint Wizard
|
||||
static TOOL_ACTION createFootprint;
|
||||
|
||||
// We don't use ACTION::save here because we need to distinguish between saving to
|
||||
// the library and saving to the board (which have different tooltips and icons).
|
||||
static TOOL_ACTION saveToBoard;
|
||||
static TOOL_ACTION saveToLibrary;
|
||||
|
||||
static TOOL_ACTION deleteFootprint;
|
||||
|
||||
static TOOL_ACTION footprintProperties;
|
||||
static TOOL_ACTION defaultPadProperties;
|
||||
|
||||
/// Activation of the drawing tool (placing a PAD)
|
||||
static TOOL_ACTION placePad;
|
||||
|
@ -294,12 +305,11 @@ public:
|
|||
static TOOL_ACTION moduleEdgeOutlines;
|
||||
|
||||
// Pad tools
|
||||
static TOOL_ACTION defaultPadProperties;
|
||||
|
||||
/// Copy the selected pad's settings to the board design settings
|
||||
static TOOL_ACTION copyPadSettings;
|
||||
|
||||
/// Copy the pad settings in the board design settings to the selected pad
|
||||
/// Copy the default pad settings to the selected pad
|
||||
static TOOL_ACTION applyPadSettings;
|
||||
|
||||
/// Copy the current pad's settings to other pads in the module or on the board
|
||||
|
@ -334,7 +344,6 @@ public:
|
|||
static TOOL_ACTION drillOrigin;
|
||||
static TOOL_ACTION crossProbeSchToPcb;
|
||||
static TOOL_ACTION appendBoard;
|
||||
static TOOL_ACTION showHelp;
|
||||
static TOOL_ACTION toBeDone;
|
||||
|
||||
// Ratsnest
|
||||
|
@ -348,8 +357,6 @@ public:
|
|||
/// Find an item and start moving
|
||||
static TOOL_ACTION findMove;
|
||||
|
||||
static TOOL_ACTION editFootprintInFpEditor;
|
||||
|
||||
static TOOL_ACTION autoplaceOffboardComponents;
|
||||
static TOOL_ACTION autoplaceSelectedComponents;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "pcbnew_picker_tool.h"
|
||||
#include "pcb_editor_control.h"
|
||||
#include "grid_helper.h"
|
||||
|
||||
#include <kiway.h>
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <class_track.h>
|
||||
|
@ -58,6 +58,8 @@
|
|||
#include <bitmaps.h>
|
||||
|
||||
#include <functional>
|
||||
#include <footprint_viewer_frame.h>
|
||||
|
||||
using namespace std::placeholders;
|
||||
|
||||
|
||||
|
@ -999,6 +1001,28 @@ int PCBNEW_CONTROL::Show3DViewer( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
|
||||
int PCBNEW_CONTROL::ShowFootprintBrowser( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
auto* viewer = (FOOTPRINT_VIEWER_FRAME*) m_frame->Kiway().Player( FRAME_PCB_MODULE_VIEWER );
|
||||
|
||||
viewer->Show( true );
|
||||
|
||||
// On Windows, Raise() does not bring the window on screen, when iconized
|
||||
if( viewer->IsIconized() )
|
||||
viewer->Iconize( false );
|
||||
|
||||
viewer->Raise();
|
||||
|
||||
// Raising the window does not set the focus on Linux. This should work on
|
||||
// any platform.
|
||||
if( wxWindow::FindFocus() != viewer )
|
||||
viewer->SetFocus();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int PCBNEW_CONTROL::ToBeDone( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
DisplayInfoMessage( m_frame, _( "Not available in OpenGL/Cairo canvases." ) );
|
||||
|
@ -1095,6 +1119,7 @@ void PCBNEW_CONTROL::setTransitions()
|
|||
Go( &PCBNEW_CONTROL::DeleteItemCursor, PCB_ACTIONS::deleteTool.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::ShowHelp, PCB_ACTIONS::showHelp.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::Show3DViewer, ACTIONS::show3DViewer.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::ShowFootprintBrowser, ACTIONS::showFootprintBrowser.MakeEvent() );
|
||||
Go( &PCBNEW_CONTROL::ToBeDone, PCB_ACTIONS::toBeDone.MakeEvent() );
|
||||
|
||||
// Append control
|
||||
|
|
|
@ -98,6 +98,7 @@ public:
|
|||
int AppendBoard( PLUGIN& pi, wxString& fileName );
|
||||
int ShowHelp( const TOOL_EVENT& aEvent );
|
||||
int Show3DViewer( const TOOL_EVENT& aEvent );
|
||||
int ShowFootprintBrowser( const TOOL_EVENT& aEvent );
|
||||
int ToBeDone( const TOOL_EVENT& aEvent );
|
||||
int UpdateMessagePanel( const TOOL_EVENT& aEvent );
|
||||
|
||||
|
|
Loading…
Reference in New Issue