Implement common file menu actions and move Eeschema over.
This commit is contained in:
parent
ba4ba5b668
commit
a3dfce5adb
|
@ -210,17 +210,7 @@ void ACTION_MANAGER::UpdateHotKeys()
|
||||||
it != m_actionHotKeys[hotkey].end(); )
|
it != m_actionHotKeys[hotkey].end(); )
|
||||||
{
|
{
|
||||||
if( (*it)->GetScope() == AS_GLOBAL )
|
if( (*it)->GetScope() == AS_GLOBAL )
|
||||||
{
|
|
||||||
// Users are free to define colliding hotkeys, but we want to know if
|
|
||||||
// our default set has any collisions.
|
|
||||||
wxMessageBox( wxString::Format(
|
|
||||||
"Duplicate hotkey definitions for '%s': %s and %s",
|
|
||||||
KeyNameFromKeyCode( hotkey ),
|
|
||||||
actionName.first,
|
|
||||||
m_actionHotKeys[hotkey].front()->GetName() ) );
|
|
||||||
|
|
||||||
it = m_actionHotKeys[hotkey].erase( it );
|
it = m_actionHotKeys[hotkey].erase( it );
|
||||||
}
|
|
||||||
else
|
else
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,52 @@
|
||||||
|
|
||||||
// These members are static in class ACTIONS: Build them here:
|
// These members are static in class ACTIONS: Build them here:
|
||||||
|
|
||||||
// Generic Actions
|
TOOL_ACTION ACTIONS::doNew( "common.Control.new",
|
||||||
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_NEW ),
|
||||||
|
_( "New..." ), _( "Create a new document in the editor" ),
|
||||||
|
new_generic_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::open( "common.Control.open",
|
||||||
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_OPEN ),
|
||||||
|
_( "Open..." ), _( "Open existing document" ),
|
||||||
|
directory_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::save( "common.Control.save",
|
||||||
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SAVE ),
|
||||||
|
_( "Save" ), _( "Save changes" ),
|
||||||
|
save_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::saveAs( "common.Control.saveAs",
|
||||||
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SAVEAS ),
|
||||||
|
_( "Save As..." ), _( "Save current document to another location" ),
|
||||||
|
save_as_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::saveAll( "common.Control.saveAll",
|
||||||
|
AS_GLOBAL, 0,
|
||||||
|
_( "Save All" ), _( "Save all changes" ),
|
||||||
|
save_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::pageSetup( "common.Control.pageSetup",
|
||||||
|
AS_GLOBAL, 0,
|
||||||
|
_( "Page Settings..." ), _( "Settings for paper size and frame references" ),
|
||||||
|
sheetset_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::print( "common.Control.print",
|
||||||
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_PRINT ),
|
||||||
|
_( "Print..." ), _( "Print" ),
|
||||||
|
print_button_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::plot( "common.Control.plot",
|
||||||
|
AS_GLOBAL, 0,
|
||||||
|
_( "Plot..." ), _( "Plot" ),
|
||||||
|
plot_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::quit( "common.Control.quit",
|
||||||
|
AS_GLOBAL, 0,
|
||||||
|
_( "Quit" ), _( "Close the current editor" ),
|
||||||
|
exit_xpm );
|
||||||
|
|
||||||
|
// Generic Edit Actions
|
||||||
TOOL_ACTION ACTIONS::cancelInteractive( "common.Interactive.cancel",
|
TOOL_ACTION ACTIONS::cancelInteractive( "common.Interactive.cancel",
|
||||||
AS_GLOBAL, 0, // ESC key is handled in the dispatcher
|
AS_GLOBAL, 0, // ESC key is handled in the dispatcher
|
||||||
_( "Cancel" ), _( "Cancel current tool" ),
|
_( "Cancel" ), _( "Cancel current tool" ),
|
||||||
|
@ -38,6 +83,16 @@ TOOL_ACTION ACTIONS::paste( "common.Interactive.paste",
|
||||||
_( "Paste" ), _( "Paste clipboard into schematic" ),
|
_( "Paste" ), _( "Paste clipboard into schematic" ),
|
||||||
paste_xpm );
|
paste_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::duplicate( "common.Interactive.duplicate",
|
||||||
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DUPLICATE ),
|
||||||
|
_( "Duplicate" ), _( "Duplicates the selected item(s)" ),
|
||||||
|
duplicate_xpm );
|
||||||
|
|
||||||
|
TOOL_ACTION ACTIONS::doDelete( "common.Interactive.delete",
|
||||||
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DELETE ),
|
||||||
|
_( "Delete" ), _( "Deletes selected item(s)" ),
|
||||||
|
delete_xpm );
|
||||||
|
|
||||||
TOOL_ACTION ACTIONS::activatePointEditor( "common.Control.activatePointEditor",
|
TOOL_ACTION ACTIONS::activatePointEditor( "common.Control.activatePointEditor",
|
||||||
AS_GLOBAL, 0, "", "" ); // This is an internal event
|
AS_GLOBAL, 0, "", "" ); // This is an internal event
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ int DIALOG_PLOT_SCHEMATIC::m_pageSizeSelect = PAGE_SIZE_AUTO;
|
||||||
int DIALOG_PLOT_SCHEMATIC::m_HPGLPaperSizeSelect = PAGE_SIZE_AUTO;
|
int DIALOG_PLOT_SCHEMATIC::m_HPGLPaperSizeSelect = PAGE_SIZE_AUTO;
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::PlotSchematic( wxCommandEvent& event )
|
void SCH_EDIT_FRAME::PlotSchematic()
|
||||||
{
|
{
|
||||||
DIALOG_PLOT_SCHEMATIC dlg( this );
|
DIALOG_PLOT_SCHEMATIC dlg( this );
|
||||||
|
|
||||||
|
|
|
@ -54,9 +54,7 @@
|
||||||
|
|
||||||
enum id_eeschema_frm
|
enum id_eeschema_frm
|
||||||
{
|
{
|
||||||
ID_UPDATE_ONE_SHEET = ID_END_LIST,
|
ID_IMPORT_NON_KICAD_SCH = ID_END_LIST,
|
||||||
ID_SAVE_ONE_SHEET_UNDER_NEW_NAME,
|
|
||||||
ID_IMPORT_NON_KICAD_SCH,
|
|
||||||
|
|
||||||
/* Schematic editor main menubar IDs. */
|
/* Schematic editor main menubar IDs. */
|
||||||
ID_RESCUE_CACHED,
|
ID_RESCUE_CACHED,
|
||||||
|
|
|
@ -170,22 +170,16 @@ bool SCH_EDIT_FRAME::SaveEEFile( SCH_SCREEN* aScreen, bool aSaveUnderNewName,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::Save_File( wxCommandEvent& event )
|
void SCH_EDIT_FRAME::Save_File( bool doSaveAs )
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
if( doSaveAs )
|
||||||
|
|
||||||
switch( id )
|
|
||||||
{
|
{
|
||||||
case ID_UPDATE_ONE_SHEET:
|
|
||||||
SaveEEFile( NULL );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ID_SAVE_ONE_SHEET_UNDER_NEW_NAME:
|
|
||||||
if( SaveEEFile( NULL, true ) )
|
if( SaveEEFile( NULL, true ) )
|
||||||
{
|
|
||||||
CreateArchiveLibraryCacheFile( true );
|
CreateArchiveLibraryCacheFile( true );
|
||||||
}
|
}
|
||||||
break;
|
else
|
||||||
|
{
|
||||||
|
SaveEEFile( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateTitle();
|
UpdateTitle();
|
||||||
|
@ -708,12 +702,6 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnSaveProject( wxCommandEvent& aEvent )
|
|
||||||
{
|
|
||||||
SaveProject();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool SCH_EDIT_FRAME::SaveProject()
|
bool SCH_EDIT_FRAME::SaveProject()
|
||||||
{
|
{
|
||||||
SCH_SCREEN* screen;
|
SCH_SCREEN* screen;
|
||||||
|
|
|
@ -42,14 +42,6 @@ class CONDITIONAL_MENU;
|
||||||
|
|
||||||
// helper functions that build specific submenus:
|
// helper functions that build specific submenus:
|
||||||
|
|
||||||
// Build the files menu. Because some commands are available only if
|
|
||||||
// Eeschema is run outside a project (run alone), aIsOutsideProject is false
|
|
||||||
// when Eeschema is run from Kicad manager, and true is run as stand alone app.
|
|
||||||
static void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject );
|
|
||||||
|
|
||||||
// Build the inspect menu
|
|
||||||
static void prepareInspectMenu( wxMenu* aParentMenu );
|
|
||||||
|
|
||||||
// Build the tools menu
|
// Build the tools menu
|
||||||
static void prepareToolsMenu( wxMenu* aParentMenu );
|
static void prepareToolsMenu( wxMenu* aParentMenu );
|
||||||
|
|
||||||
|
@ -66,11 +58,88 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
||||||
wxMenuBar* menuBar = new wxMenuBar();
|
wxMenuBar* menuBar = new wxMenuBar();
|
||||||
wxString text;
|
wxString text;
|
||||||
|
|
||||||
|
auto modifiedDocumentCondition = [] ( const SELECTION& sel ) {
|
||||||
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
return sheetList.IsModified();
|
||||||
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Menu File:
|
// Menu File:
|
||||||
//
|
//
|
||||||
wxMenu* fileMenu = new wxMenu;
|
CONDITIONAL_MENU* fileMenu = new CONDITIONAL_MENU( false, selTool );
|
||||||
prepareFilesMenu( fileMenu, Kiface().IsSingle() );
|
static ACTION_MENU* openRecentMenu;
|
||||||
|
|
||||||
|
if( Kiface().IsSingle() ) // not when under a project mgr
|
||||||
|
{
|
||||||
|
// Add this menu to list menu managed by m_fileHistory
|
||||||
|
// (the file history will be updated when adding/removing files in history)
|
||||||
|
if( openRecentMenu )
|
||||||
|
Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
|
||||||
|
|
||||||
|
openRecentMenu = new ACTION_MENU();
|
||||||
|
openRecentMenu->SetTool( selTool );
|
||||||
|
openRecentMenu->SetTitle( _( "Open Recent" ) );
|
||||||
|
openRecentMenu->SetIcon( recent_xpm );
|
||||||
|
|
||||||
|
Kiface().GetFileHistory().UseMenu( openRecentMenu );
|
||||||
|
Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
|
||||||
|
|
||||||
|
fileMenu->AddItem( ACTIONS::doNew, EE_CONDITIONS::ShowAlways );
|
||||||
|
fileMenu->AddItem( ACTIONS::open, EE_CONDITIONS::ShowAlways );
|
||||||
|
fileMenu->AddMenu( openRecentMenu, EE_CONDITIONS::ShowAlways );
|
||||||
|
fileMenu->AddSeparator();
|
||||||
|
}
|
||||||
|
|
||||||
|
fileMenu->AddItem( ACTIONS::save, modifiedDocumentCondition );
|
||||||
|
fileMenu->AddItem( ACTIONS::saveAs, EE_CONDITIONS::ShowAlways );
|
||||||
|
fileMenu->AddItem( ACTIONS::saveAll, modifiedDocumentCondition );
|
||||||
|
|
||||||
|
fileMenu->AppendSeparator();
|
||||||
|
|
||||||
|
fileMenu->AddItem( ID_APPEND_PROJECT, _( "Append Schematic Sheet Content..." ),
|
||||||
|
_( "Append schematic sheet content from another project to the current sheet" ),
|
||||||
|
add_document_xpm, EE_CONDITIONS::ShowAlways );
|
||||||
|
|
||||||
|
fileMenu->AddItem( ID_IMPORT_NON_KICAD_SCH, _( "Import Non KiCad Schematic..." ),
|
||||||
|
_( "Replace current schematic sheet with one imported from another application" ),
|
||||||
|
import_document_xpm, EE_CONDITIONS::ShowAlways );
|
||||||
|
|
||||||
|
fileMenu->AddSeparator();
|
||||||
|
|
||||||
|
// Import submenu
|
||||||
|
ACTION_MENU* submenuImport = new ACTION_MENU();
|
||||||
|
submenuImport->SetTool( selTool );
|
||||||
|
submenuImport->SetTitle( _( "Import" ) );
|
||||||
|
submenuImport->SetIcon( import_xpm );
|
||||||
|
|
||||||
|
submenuImport->Add( _( "Footprint Association File..." ), HELP_IMPORT_FOOTPRINTS,
|
||||||
|
ID_BACKANNO_ITEMS, import_footprint_names_xpm );
|
||||||
|
|
||||||
|
fileMenu->AddMenu( submenuImport, EE_CONDITIONS::ShowAlways );
|
||||||
|
|
||||||
|
|
||||||
|
// Export submenu
|
||||||
|
ACTION_MENU* submenuExport = new ACTION_MENU();
|
||||||
|
submenuExport->SetTool( selTool );
|
||||||
|
submenuExport->SetTitle( _( "Export" ) );
|
||||||
|
submenuExport->SetIcon( export_xpm );
|
||||||
|
|
||||||
|
submenuExport->Add( _( "Drawing to Clipboard" ), _( "Export drawings to clipboard" ),
|
||||||
|
ID_GEN_COPY_SHEET_TO_CLIPBOARD, copy_xpm );
|
||||||
|
|
||||||
|
submenuExport->Add( _( "Netlist..." ), _( "Export netlist file" ),
|
||||||
|
ID_GET_NETLIST, netlist_xpm );
|
||||||
|
|
||||||
|
fileMenu->AddMenu( submenuExport, EE_CONDITIONS::ShowAlways );
|
||||||
|
|
||||||
|
fileMenu->AddSeparator();
|
||||||
|
fileMenu->AddItem( ACTIONS::pageSetup, EE_CONDITIONS::ShowAlways );
|
||||||
|
fileMenu->AddItem( ACTIONS::print, EE_CONDITIONS::ShowAlways );
|
||||||
|
fileMenu->AddItem( ACTIONS::plot, EE_CONDITIONS::ShowAlways );
|
||||||
|
|
||||||
|
// Quit
|
||||||
|
fileMenu->AddSeparator();
|
||||||
|
fileMenu->AddItem( ACTIONS::quit, EE_CONDITIONS::ShowAlways );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Menu Edit:
|
// Menu Edit:
|
||||||
|
@ -196,7 +265,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
||||||
// Menu Inspect:
|
// Menu Inspect:
|
||||||
//
|
//
|
||||||
wxMenu* inspectMenu = new wxMenu;
|
wxMenu* inspectMenu = new wxMenu;
|
||||||
prepareInspectMenu( inspectMenu );
|
AddMenuItem( inspectMenu, ID_GET_ERC, _( "Electrical Rules &Checker" ),
|
||||||
|
_( "Perform electrical rules check" ), KiBitmap( erc_xpm ) );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Menu Tools:
|
// Menu Tools:
|
||||||
|
@ -225,130 +295,6 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
|
|
||||||
{
|
|
||||||
wxString text;
|
|
||||||
|
|
||||||
// @todo: static probably not OK in multiple open projects.
|
|
||||||
// Open Recent submenu
|
|
||||||
static wxMenu* openRecentMenu;
|
|
||||||
|
|
||||||
// Add this menu to list menu managed by m_fileHistory
|
|
||||||
// (the file history will be updated when adding/removing files in history
|
|
||||||
if( openRecentMenu )
|
|
||||||
Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
|
|
||||||
|
|
||||||
openRecentMenu = new wxMenu();
|
|
||||||
|
|
||||||
Kiface().GetFileHistory().UseMenu( openRecentMenu );
|
|
||||||
Kiface().GetFileHistory().AddFilesToMenu( openRecentMenu );
|
|
||||||
|
|
||||||
if( aIsOutsideProject ) // not when under a project mgr
|
|
||||||
{
|
|
||||||
text = AddHotkeyName( _( "&New..." ), g_Schematic_Hotkeys_Descr, HK_NEW );
|
|
||||||
AddMenuItem( aParentMenu, ID_NEW_PROJECT, text,
|
|
||||||
_( "Start new schematic root sheet" ),
|
|
||||||
KiBitmap( new_document_xpm ) );
|
|
||||||
|
|
||||||
text = AddHotkeyName( _( "&Open..." ), g_Schematic_Hotkeys_Descr, HK_OPEN );
|
|
||||||
AddMenuItem( aParentMenu, ID_LOAD_PROJECT, text,
|
|
||||||
_( "Open existing schematic" ),
|
|
||||||
KiBitmap( open_document_xpm ) );
|
|
||||||
|
|
||||||
AddMenuItem( aParentMenu, openRecentMenu, -1, _( "Open &Recent" ),
|
|
||||||
_( "Open recently opened schematic" ),
|
|
||||||
KiBitmap( recent_xpm ) );
|
|
||||||
|
|
||||||
aParentMenu->AppendSeparator();
|
|
||||||
}
|
|
||||||
|
|
||||||
text = AddHotkeyName( _( "&Save" ), g_Schematic_Hotkeys_Descr, HK_SAVE );
|
|
||||||
AddMenuItem( aParentMenu, ID_SAVE_PROJECT, text,
|
|
||||||
_( "Save changes" ),
|
|
||||||
KiBitmap( save_xpm ) );
|
|
||||||
|
|
||||||
AddMenuItem( aParentMenu, ID_UPDATE_ONE_SHEET, _( "Save &Current Sheet" ),
|
|
||||||
_( "Save only the current sheet" ),
|
|
||||||
KiBitmap( save_xpm ) );
|
|
||||||
|
|
||||||
text = AddHotkeyName( _( "Save C&urrent Sheet As..." ), g_Schematic_Hotkeys_Descr, HK_SAVEAS );
|
|
||||||
AddMenuItem( aParentMenu, ID_SAVE_ONE_SHEET_UNDER_NEW_NAME, text,
|
|
||||||
_( "Save a copy of the current sheet" ),
|
|
||||||
KiBitmap( save_as_xpm ) );
|
|
||||||
|
|
||||||
aParentMenu->AppendSeparator();
|
|
||||||
|
|
||||||
AddMenuItem( aParentMenu, ID_APPEND_PROJECT, _( "App&end Schematic Sheet Content..." ),
|
|
||||||
_( "Append schematic sheet content from another project to the current sheet" ),
|
|
||||||
KiBitmap( add_document_xpm ) );
|
|
||||||
|
|
||||||
AddMenuItem( aParentMenu, ID_IMPORT_NON_KICAD_SCH, _( "&Import Non KiCad Schematic..." ),
|
|
||||||
_( "Replace current schematic sheet with one imported from another application" ),
|
|
||||||
KiBitmap( import_document_xpm ) ); // TODO needs a different icon
|
|
||||||
|
|
||||||
aParentMenu->AppendSeparator();
|
|
||||||
|
|
||||||
// Import submenu
|
|
||||||
wxMenu* submenuImport = new wxMenu();
|
|
||||||
|
|
||||||
AddMenuItem( submenuImport, ID_BACKANNO_ITEMS, _( "&Footprint Association File..." ),
|
|
||||||
HELP_IMPORT_FOOTPRINTS,
|
|
||||||
KiBitmap( import_footprint_names_xpm ) );
|
|
||||||
|
|
||||||
AddMenuItem( aParentMenu, submenuImport, ID_GEN_IMPORT_FILE, _( "&Import" ),
|
|
||||||
_( "Import files" ),
|
|
||||||
KiBitmap( import_xpm ) );
|
|
||||||
|
|
||||||
|
|
||||||
// Export submenu
|
|
||||||
wxMenu* submenuExport = new wxMenu();
|
|
||||||
|
|
||||||
AddMenuItem( submenuExport, ID_GEN_COPY_SHEET_TO_CLIPBOARD, _( "Drawing to C&lipboard" ),
|
|
||||||
_( "Export drawings to clipboard" ),
|
|
||||||
KiBitmap( copy_xpm ) );
|
|
||||||
|
|
||||||
AddMenuItem( submenuExport, ID_GET_NETLIST, _( "&Netlist..." ),
|
|
||||||
_( "Export netlist file" ),
|
|
||||||
KiBitmap( netlist_xpm ) );
|
|
||||||
|
|
||||||
AddMenuItem( aParentMenu, submenuExport, ID_GEN_EXPORT_FILE, _( "E&xport" ),
|
|
||||||
_( "Export files" ),
|
|
||||||
KiBitmap( export_xpm ) );
|
|
||||||
|
|
||||||
aParentMenu->AppendSeparator();
|
|
||||||
|
|
||||||
// Edit page layout:
|
|
||||||
AddMenuItem( aParentMenu, ID_SHEET_SET, _( "Page S&ettings..." ),
|
|
||||||
_( "Settings for sheet size and frame references" ),
|
|
||||||
KiBitmap( sheetset_xpm ) );
|
|
||||||
|
|
||||||
text = AddHotkeyName( _( "&Print..." ), g_Schematic_Hotkeys_Descr, HK_PRINT );
|
|
||||||
AddMenuItem( aParentMenu, wxID_PRINT, text,
|
|
||||||
_( "Print schematic sheet" ),
|
|
||||||
KiBitmap( print_button_xpm ) );
|
|
||||||
|
|
||||||
AddMenuItem( aParentMenu, ID_GEN_PLOT_SCHEMATIC, _( "P&lot..." ),
|
|
||||||
_( "Plot schematic sheet in PostScript, PDF, SVG, DXF or HPGL format" ),
|
|
||||||
KiBitmap( plot_xpm ) );
|
|
||||||
|
|
||||||
aParentMenu->AppendSeparator();
|
|
||||||
|
|
||||||
// Quit
|
|
||||||
AddMenuItem( aParentMenu, wxID_EXIT, _( "&Exit" ),
|
|
||||||
_( "Close Eeschema" ),
|
|
||||||
KiBitmap( exit_xpm ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void prepareInspectMenu( wxMenu* aParentMenu )
|
|
||||||
{
|
|
||||||
AddMenuItem( aParentMenu, ID_GET_ERC,
|
|
||||||
_( "Electrical Rules &Checker" ),
|
|
||||||
_( "Perform electrical rules check" ),
|
|
||||||
KiBitmap( erc_xpm ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void prepareToolsMenu( wxMenu* aParentMenu )
|
void prepareToolsMenu( wxMenu* aParentMenu )
|
||||||
{
|
{
|
||||||
wxString text;
|
wxString text;
|
||||||
|
|
|
@ -216,23 +216,12 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
|
||||||
EVT_CLOSE( SCH_EDIT_FRAME::OnCloseWindow )
|
EVT_CLOSE( SCH_EDIT_FRAME::OnCloseWindow )
|
||||||
EVT_SIZE( SCH_EDIT_FRAME::OnSize )
|
EVT_SIZE( SCH_EDIT_FRAME::OnSize )
|
||||||
|
|
||||||
EVT_MENU( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject )
|
|
||||||
EVT_MENU( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject )
|
|
||||||
|
|
||||||
EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, SCH_EDIT_FRAME::OnLoadFile )
|
EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, SCH_EDIT_FRAME::OnLoadFile )
|
||||||
|
|
||||||
EVT_MENU( ID_APPEND_PROJECT, SCH_EDIT_FRAME::OnAppendProject )
|
EVT_MENU( ID_APPEND_PROJECT, SCH_EDIT_FRAME::OnAppendProject )
|
||||||
EVT_MENU( ID_IMPORT_NON_KICAD_SCH, SCH_EDIT_FRAME::OnImportProject )
|
EVT_MENU( ID_IMPORT_NON_KICAD_SCH, SCH_EDIT_FRAME::OnImportProject )
|
||||||
|
|
||||||
EVT_TOOL( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject )
|
|
||||||
EVT_TOOL( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject )
|
|
||||||
|
|
||||||
EVT_MENU( ID_SAVE_PROJECT, SCH_EDIT_FRAME::OnSaveProject )
|
|
||||||
EVT_MENU( ID_UPDATE_ONE_SHEET, SCH_EDIT_FRAME::Save_File )
|
|
||||||
EVT_MENU( ID_SAVE_ONE_SHEET_UNDER_NEW_NAME, SCH_EDIT_FRAME::Save_File )
|
|
||||||
EVT_MENU( ID_GEN_PLOT_SCHEMATIC, SCH_EDIT_FRAME::PlotSchematic )
|
|
||||||
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, EDA_DRAW_FRAME::CopyToClipboard )
|
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, EDA_DRAW_FRAME::CopyToClipboard )
|
||||||
EVT_MENU( wxID_EXIT, SCH_EDIT_FRAME::OnExit )
|
|
||||||
|
|
||||||
EVT_MENU( ID_CONFIG_SAVE, SCH_EDIT_FRAME::Process_Config )
|
EVT_MENU( ID_CONFIG_SAVE, SCH_EDIT_FRAME::Process_Config )
|
||||||
EVT_MENU( ID_CONFIG_READ, SCH_EDIT_FRAME::Process_Config )
|
EVT_MENU( ID_CONFIG_READ, SCH_EDIT_FRAME::Process_Config )
|
||||||
|
@ -251,9 +240,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
|
||||||
|
|
||||||
EVT_TOOL( ID_RUN_CVPCB, SCH_EDIT_FRAME::OnOpenCvpcb )
|
EVT_TOOL( ID_RUN_CVPCB, SCH_EDIT_FRAME::OnOpenCvpcb )
|
||||||
|
|
||||||
EVT_TOOL( ID_SHEET_SET, EDA_DRAW_FRAME::Process_PageSettings )
|
|
||||||
EVT_TOOL( ID_GET_ANNOTATE, SCH_EDIT_FRAME::OnAnnotate )
|
EVT_TOOL( ID_GET_ANNOTATE, SCH_EDIT_FRAME::OnAnnotate )
|
||||||
EVT_TOOL( wxID_PRINT, SCH_EDIT_FRAME::OnPrint )
|
|
||||||
EVT_TOOL( ID_GET_ERC, SCH_EDIT_FRAME::OnErc )
|
EVT_TOOL( ID_GET_ERC, SCH_EDIT_FRAME::OnErc )
|
||||||
EVT_TOOL( ID_GET_NETLIST, SCH_EDIT_FRAME::OnCreateNetlist )
|
EVT_TOOL( ID_GET_NETLIST, SCH_EDIT_FRAME::OnCreateNetlist )
|
||||||
EVT_TOOL( ID_UPDATE_PCB_FROM_SCH, SCH_EDIT_FRAME::OnUpdatePCB )
|
EVT_TOOL( ID_UPDATE_PCB_FROM_SCH, SCH_EDIT_FRAME::OnUpdatePCB )
|
||||||
|
@ -272,8 +259,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
|
||||||
EVT_MENU( ID_MENU_CANVAS_OPENGL, SCH_EDIT_FRAME::OnSwitchCanvas )
|
EVT_MENU( ID_MENU_CANVAS_OPENGL, SCH_EDIT_FRAME::OnSwitchCanvas )
|
||||||
|
|
||||||
/* Handle user interface update events. */
|
/* Handle user interface update events. */
|
||||||
EVT_UPDATE_UI( ID_SAVE_PROJECT, SCH_EDIT_FRAME::OnUpdateSave )
|
|
||||||
EVT_UPDATE_UI( ID_UPDATE_ONE_SHEET, SCH_EDIT_FRAME::OnUpdateSaveSheet )
|
|
||||||
EVT_UPDATE_UI( ID_REMAP_SYMBOLS, SCH_EDIT_FRAME::OnUpdateRemapSymbols )
|
EVT_UPDATE_UI( ID_REMAP_SYMBOLS, SCH_EDIT_FRAME::OnUpdateRemapSymbols )
|
||||||
EVT_UPDATE_UI( ID_MENU_CANVAS_CAIRO, SCH_EDIT_FRAME::OnUpdateSwitchCanvas )
|
EVT_UPDATE_UI( ID_MENU_CANVAS_CAIRO, SCH_EDIT_FRAME::OnUpdateSwitchCanvas )
|
||||||
EVT_UPDATE_UI( ID_MENU_CANVAS_OPENGL, SCH_EDIT_FRAME::OnUpdateSwitchCanvas )
|
EVT_UPDATE_UI( ID_MENU_CANVAS_OPENGL, SCH_EDIT_FRAME::OnUpdateSwitchCanvas )
|
||||||
|
@ -692,14 +677,6 @@ void SCH_EDIT_FRAME::OnModify()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent )
|
|
||||||
{
|
|
||||||
SCH_SHEET_LIST sheetList( g_RootSheet );
|
|
||||||
|
|
||||||
aEvent.Enable( sheetList.IsModified() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnUpdateRemapSymbols( wxUpdateUIEvent& aEvent )
|
void SCH_EDIT_FRAME::OnUpdateRemapSymbols( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
SCH_SCREENS schematic;
|
SCH_SCREENS schematic;
|
||||||
|
@ -709,17 +686,6 @@ void SCH_EDIT_FRAME::OnUpdateRemapSymbols( wxUpdateUIEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnUpdateSaveSheet( wxUpdateUIEvent& aEvent )
|
|
||||||
{
|
|
||||||
auto screen = GetScreen();
|
|
||||||
|
|
||||||
if( !screen )
|
|
||||||
return;
|
|
||||||
|
|
||||||
aEvent.Enable( screen->IsModify() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnErc( wxCommandEvent& event )
|
void SCH_EDIT_FRAME::OnErc( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
// See if it's already open...
|
// See if it's already open...
|
||||||
|
@ -909,7 +875,7 @@ void SCH_EDIT_FRAME::OnUpdateFields( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnNewProject( wxCommandEvent& event )
|
void SCH_EDIT_FRAME::NewProject()
|
||||||
{
|
{
|
||||||
wxString pro_dir = m_mruPath;
|
wxString pro_dir = m_mruPath;
|
||||||
|
|
||||||
|
@ -939,7 +905,7 @@ void SCH_EDIT_FRAME::OnNewProject( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnLoadProject( wxCommandEvent& event )
|
void SCH_EDIT_FRAME::LoadProject()
|
||||||
{
|
{
|
||||||
wxString pro_dir = m_mruPath;
|
wxString pro_dir = m_mruPath;
|
||||||
|
|
||||||
|
@ -1101,13 +1067,7 @@ void SCH_EDIT_FRAME::OnEditComponentSymbolsId( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnExit( wxCommandEvent& event )
|
void SCH_EDIT_FRAME::Print()
|
||||||
{
|
|
||||||
Close( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnPrint( wxCommandEvent& event )
|
|
||||||
{
|
{
|
||||||
InvokeDialogPrintUsingPrinter( this );
|
InvokeDialogPrintUsingPrinter( this );
|
||||||
|
|
||||||
|
|
|
@ -598,7 +598,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Show the print dialog.
|
* Show the print dialog.
|
||||||
*/
|
*/
|
||||||
void OnPrint( wxCommandEvent& event );
|
void Print();
|
||||||
|
|
||||||
wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
|
wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
|
||||||
|
|
||||||
|
@ -608,17 +608,14 @@ public:
|
||||||
void SetPrintSheetReference( bool aShow ) { m_printSheetReference = aShow; }
|
void SetPrintSheetReference( bool aShow ) { m_printSheetReference = aShow; }
|
||||||
|
|
||||||
// Plot functions:
|
// Plot functions:
|
||||||
void PlotSchematic( wxCommandEvent& event );
|
void PlotSchematic();
|
||||||
|
|
||||||
|
void NewProject();
|
||||||
|
void LoadProject();
|
||||||
|
|
||||||
// read and save files
|
// read and save files
|
||||||
void Save_File( wxCommandEvent& event );
|
void Save_File( bool doSaveAs = false );
|
||||||
|
|
||||||
/**
|
|
||||||
* Command event handler to save the entire project and create a component library archive.
|
|
||||||
*
|
|
||||||
* The component library archive name is <root_name>-cache.lib
|
|
||||||
*/
|
|
||||||
void OnSaveProject( wxCommandEvent& aEvent );
|
|
||||||
bool SaveProject();
|
bool SaveProject();
|
||||||
|
|
||||||
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
|
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
|
||||||
|
@ -754,7 +751,6 @@ private:
|
||||||
// Sets up the tool framework
|
// Sets up the tool framework
|
||||||
void setupTools();
|
void setupTools();
|
||||||
|
|
||||||
void OnExit( wxCommandEvent& event );
|
|
||||||
void OnAnnotate( wxCommandEvent& event );
|
void OnAnnotate( wxCommandEvent& event );
|
||||||
void OnErc( wxCommandEvent& event );
|
void OnErc( wxCommandEvent& event );
|
||||||
void OnCreateNetlist( wxCommandEvent& event );
|
void OnCreateNetlist( wxCommandEvent& event );
|
||||||
|
@ -767,8 +763,6 @@ private:
|
||||||
void OnLoadFile( wxCommandEvent& event );
|
void OnLoadFile( wxCommandEvent& event );
|
||||||
void OnLoadCmpToFootprintLinkFile( wxCommandEvent& event );
|
void OnLoadCmpToFootprintLinkFile( wxCommandEvent& event );
|
||||||
void OnUpdateFields( wxCommandEvent& event );
|
void OnUpdateFields( wxCommandEvent& event );
|
||||||
void OnNewProject( wxCommandEvent& event );
|
|
||||||
void OnLoadProject( wxCommandEvent& event );
|
|
||||||
void OnAppendProject( wxCommandEvent& event );
|
void OnAppendProject( wxCommandEvent& event );
|
||||||
void OnImportProject( wxCommandEvent& event );
|
void OnImportProject( wxCommandEvent& event );
|
||||||
void OnOpenPcbnew( wxCommandEvent& event );
|
void OnOpenPcbnew( wxCommandEvent& event );
|
||||||
|
@ -784,8 +778,6 @@ private:
|
||||||
void OnPreferencesOptions( wxCommandEvent& event );
|
void OnPreferencesOptions( wxCommandEvent& event );
|
||||||
|
|
||||||
/* User interface update event handlers. */
|
/* User interface update event handlers. */
|
||||||
void OnUpdateSave( wxUpdateUIEvent& aEvent );
|
|
||||||
void OnUpdateSaveSheet( wxUpdateUIEvent& aEvent );
|
|
||||||
void OnUpdateRemapSymbols( wxUpdateUIEvent& aEvent );
|
void OnUpdateRemapSymbols( wxUpdateUIEvent& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -50,30 +50,16 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
|
||||||
// Set up toolbar
|
// Set up toolbar
|
||||||
if( Kiface().IsSingle() ) // not when under a project mgr
|
if( Kiface().IsSingle() ) // not when under a project mgr
|
||||||
{
|
{
|
||||||
// These 2 menus have meaning only outside a project, i.e. not under a project manager:
|
m_mainToolBar->Add( ACTIONS::doNew );
|
||||||
m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
|
m_mainToolBar->Add( ACTIONS::open );
|
||||||
KiScaledBitmap( new_document_xpm, this ),
|
|
||||||
_( "New schematic" ) );
|
|
||||||
|
|
||||||
m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
|
|
||||||
KiScaledBitmap( open_document_xpm, this ),
|
|
||||||
_( "Open schematic" ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
|
m_mainToolBar->Add( ACTIONS::saveAll );
|
||||||
KiScaledBitmap( save_xpm, this ),
|
|
||||||
_( "Save (all sheets)" ) );
|
|
||||||
|
|
||||||
KiScaledSeparator( m_mainToolBar, this );
|
KiScaledSeparator( m_mainToolBar, this );
|
||||||
|
m_mainToolBar->Add( ACTIONS::pageSetup );
|
||||||
m_mainToolBar->AddTool( ID_SHEET_SET, wxEmptyString, KiScaledBitmap( sheetset_xpm, this ),
|
m_mainToolBar->Add( ACTIONS::print );
|
||||||
_( "Edit Page settings" ) );
|
m_mainToolBar->Add( ACTIONS::plot );
|
||||||
|
|
||||||
m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiScaledBitmap( print_button_xpm, this ),
|
|
||||||
_( "Print schematic" ) );
|
|
||||||
|
|
||||||
m_mainToolBar->AddTool( ID_GEN_PLOT_SCHEMATIC, wxEmptyString, KiScaledBitmap( plot_xpm, this ),
|
|
||||||
_( "Plot schematic" ) );
|
|
||||||
|
|
||||||
m_mainToolBar->AddSeparator();
|
m_mainToolBar->AddSeparator();
|
||||||
m_mainToolBar->Add( ACTIONS::paste );
|
m_mainToolBar->Add( ACTIONS::paste );
|
||||||
|
@ -203,7 +189,9 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
|
||||||
void SCH_EDIT_FRAME::SyncMenusAndToolbars()
|
void SCH_EDIT_FRAME::SyncMenusAndToolbars()
|
||||||
{
|
{
|
||||||
KIGFX::GAL_DISPLAY_OPTIONS& galOpts = GetGalDisplayOptions();
|
KIGFX::GAL_DISPLAY_OPTIONS& galOpts = GetGalDisplayOptions();
|
||||||
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
|
m_mainToolBar->Toggle( ACTIONS::saveAll, sheetList.IsModified() );
|
||||||
m_mainToolBar->Toggle( ACTIONS::undo, GetScreen() && GetScreen()->GetUndoCommandCount() > 0 );
|
m_mainToolBar->Toggle( ACTIONS::undo, GetScreen() && GetScreen()->GetUndoCommandCount() > 0 );
|
||||||
m_mainToolBar->Toggle( ACTIONS::redo, GetScreen() && GetScreen()->GetRedoCommandCount() > 0 );
|
m_mainToolBar->Toggle( ACTIONS::redo, GetScreen() && GetScreen()->GetRedoCommandCount() > 0 );
|
||||||
m_mainToolBar->Toggle( ACTIONS::zoomTool, GetToolId() == ID_ZOOM_SELECTION );
|
m_mainToolBar->Toggle( ACTIONS::zoomTool, GetToolId() == ID_ZOOM_SELECTION );
|
||||||
|
|
|
@ -116,7 +116,6 @@ public:
|
||||||
static TOOL_ACTION moveActivate;
|
static TOOL_ACTION moveActivate;
|
||||||
static TOOL_ACTION move;
|
static TOOL_ACTION move;
|
||||||
static TOOL_ACTION drag;
|
static TOOL_ACTION drag;
|
||||||
static TOOL_ACTION duplicate;
|
|
||||||
static TOOL_ACTION repeatDrawItem;
|
static TOOL_ACTION repeatDrawItem;
|
||||||
static TOOL_ACTION rotateCW;
|
static TOOL_ACTION rotateCW;
|
||||||
static TOOL_ACTION rotateCCW;
|
static TOOL_ACTION rotateCCW;
|
||||||
|
@ -129,7 +128,6 @@ public:
|
||||||
static TOOL_ACTION autoplaceFields;
|
static TOOL_ACTION autoplaceFields;
|
||||||
static TOOL_ACTION convertDeMorgan;
|
static TOOL_ACTION convertDeMorgan;
|
||||||
static TOOL_ACTION editSymbolUnit;
|
static TOOL_ACTION editSymbolUnit;
|
||||||
static TOOL_ACTION doDelete;
|
|
||||||
static TOOL_ACTION addJunction;
|
static TOOL_ACTION addJunction;
|
||||||
static TOOL_ACTION addLabel;
|
static TOOL_ACTION addLabel;
|
||||||
static TOOL_ACTION addGlobalLabel;
|
static TOOL_ACTION addGlobalLabel;
|
||||||
|
|
|
@ -49,11 +49,6 @@
|
||||||
#include "sch_drawing_tools.h"
|
#include "sch_drawing_tools.h"
|
||||||
|
|
||||||
|
|
||||||
TOOL_ACTION EE_ACTIONS::duplicate( "eeschema.InteractiveEdit.duplicate",
|
|
||||||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DUPLICATE ),
|
|
||||||
_( "Duplicate" ), _( "Duplicates the selected item(s)" ),
|
|
||||||
duplicate_xpm );
|
|
||||||
|
|
||||||
TOOL_ACTION EE_ACTIONS::repeatDrawItem( "eeschema.InteractiveEdit.repeatDrawItem",
|
TOOL_ACTION EE_ACTIONS::repeatDrawItem( "eeschema.InteractiveEdit.repeatDrawItem",
|
||||||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_REPEAT_LAST ),
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_REPEAT_LAST ),
|
||||||
_( "Repeat Last Item" ), _( "Duplicates the last drawn item" ),
|
_( "Repeat Last Item" ), _( "Duplicates the last drawn item" ),
|
||||||
|
@ -154,11 +149,6 @@ TOOL_ACTION EE_ACTIONS::pinTable( "eeschema.InteractiveEdit.pinTable",
|
||||||
_( "Pin Table..." ), _( "Displays pin table for bulk editing of pins" ),
|
_( "Pin Table..." ), _( "Displays pin table for bulk editing of pins" ),
|
||||||
pin_table_xpm );
|
pin_table_xpm );
|
||||||
|
|
||||||
TOOL_ACTION EE_ACTIONS::doDelete( "eeschema.InteractiveEdit.delete",
|
|
||||||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DELETE ),
|
|
||||||
_( "Delete" ), _( "Deletes selected item(s)" ),
|
|
||||||
delete_xpm );
|
|
||||||
|
|
||||||
TOOL_ACTION EE_ACTIONS::deleteItemCursor( "eeschema.InteractiveEdit.deleteTool",
|
TOOL_ACTION EE_ACTIONS::deleteItemCursor( "eeschema.InteractiveEdit.deleteTool",
|
||||||
AS_GLOBAL, 0,
|
AS_GLOBAL, 0,
|
||||||
_( "Delete Items" ), _( "Delete clicked items" ),
|
_( "Delete Items" ), _( "Delete clicked items" ),
|
||||||
|
|
|
@ -118,6 +118,70 @@ TOOL_ACTION EE_ACTIONS::toggleForceHV( "eeschema.EditorControl.forceHVLines",
|
||||||
lines90_xpm );
|
lines90_xpm );
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_EDITOR_CONTROL::New( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
m_frame->NewProject();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_EDITOR_CONTROL::Open( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
m_frame->LoadProject();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
m_frame->Save_File();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_EDITOR_CONTROL::SaveAs( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
m_frame->Save_File( true );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_EDITOR_CONTROL::SaveAll( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
m_frame->SaveProject();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_EDITOR_CONTROL::PageSetup( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
wxCommandEvent dummy;
|
||||||
|
m_frame->Process_PageSettings( dummy );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_EDITOR_CONTROL::Print( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
m_frame->Print();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_EDITOR_CONTROL::Plot( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
m_frame->PlotSchematic();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_EDITOR_CONTROL::Quit( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
m_frame->Close( false );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// A dummy wxFindReplaceData signalling any marker should be found
|
// A dummy wxFindReplaceData signalling any marker should be found
|
||||||
static wxFindReplaceData g_markersOnly;
|
static wxFindReplaceData g_markersOnly;
|
||||||
|
|
||||||
|
@ -1026,6 +1090,15 @@ int SCH_EDITOR_CONTROL::ToggleForceHV( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
void SCH_EDITOR_CONTROL::setTransitions()
|
void SCH_EDITOR_CONTROL::setTransitions()
|
||||||
{
|
{
|
||||||
|
Go( &SCH_EDITOR_CONTROL::New, ACTIONS::doNew.MakeEvent() );
|
||||||
|
Go( &SCH_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() );
|
||||||
|
Go( &SCH_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() );
|
||||||
|
Go( &SCH_EDITOR_CONTROL::SaveAs, ACTIONS::saveAs.MakeEvent() );
|
||||||
|
Go( &SCH_EDITOR_CONTROL::PageSetup, ACTIONS::pageSetup.MakeEvent() );
|
||||||
|
Go( &SCH_EDITOR_CONTROL::Print, ACTIONS::print.MakeEvent() );
|
||||||
|
Go( &SCH_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() );
|
||||||
|
Go( &SCH_EDITOR_CONTROL::Quit, ACTIONS::quit.MakeEvent() );
|
||||||
|
|
||||||
Go( &SCH_EDITOR_CONTROL::FindAndReplace, ACTIONS::find.MakeEvent() );
|
Go( &SCH_EDITOR_CONTROL::FindAndReplace, ACTIONS::find.MakeEvent() );
|
||||||
Go( &SCH_EDITOR_CONTROL::FindAndReplace, ACTIONS::findAndReplace.MakeEvent() );
|
Go( &SCH_EDITOR_CONTROL::FindAndReplace, ACTIONS::findAndReplace.MakeEvent() );
|
||||||
Go( &SCH_EDITOR_CONTROL::FindNext, ACTIONS::findNext.MakeEvent() );
|
Go( &SCH_EDITOR_CONTROL::FindNext, ACTIONS::findNext.MakeEvent() );
|
||||||
|
|
|
@ -46,6 +46,16 @@ public:
|
||||||
|
|
||||||
~SCH_EDITOR_CONTROL() { }
|
~SCH_EDITOR_CONTROL() { }
|
||||||
|
|
||||||
|
int New( const TOOL_EVENT& aEvent );
|
||||||
|
int Open( const TOOL_EVENT& aEvent );
|
||||||
|
int Save( const TOOL_EVENT& aEvent );
|
||||||
|
int SaveAs( const TOOL_EVENT& aEvent );
|
||||||
|
int SaveAll( const TOOL_EVENT& aEvent );
|
||||||
|
int PageSetup( const TOOL_EVENT& aEvent );
|
||||||
|
int Print( const TOOL_EVENT& aEvent );
|
||||||
|
int Plot( const TOOL_EVENT& aEvent );
|
||||||
|
int Quit( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
int FindAndReplace( const TOOL_EVENT& aEvent );
|
int FindAndReplace( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
int FindNext( const TOOL_EVENT& aEvent );
|
int FindNext( const TOOL_EVENT& aEvent );
|
||||||
|
|
|
@ -44,7 +44,18 @@ public:
|
||||||
|
|
||||||
virtual ~ACTIONS() {};
|
virtual ~ACTIONS() {};
|
||||||
|
|
||||||
// Generic actions
|
// Generic document actions
|
||||||
|
static TOOL_ACTION doNew; // sadly 'new' is a reserved word
|
||||||
|
static TOOL_ACTION open;
|
||||||
|
static TOOL_ACTION save;
|
||||||
|
static TOOL_ACTION saveAs;
|
||||||
|
static TOOL_ACTION saveAll;
|
||||||
|
static TOOL_ACTION pageSetup;
|
||||||
|
static TOOL_ACTION print;
|
||||||
|
static TOOL_ACTION plot;
|
||||||
|
static TOOL_ACTION quit;
|
||||||
|
|
||||||
|
// Generic edit actions
|
||||||
static TOOL_ACTION cancelInteractive;
|
static TOOL_ACTION cancelInteractive;
|
||||||
static TOOL_ACTION updateMenu;
|
static TOOL_ACTION updateMenu;
|
||||||
static TOOL_ACTION undo;
|
static TOOL_ACTION undo;
|
||||||
|
@ -52,6 +63,8 @@ public:
|
||||||
static TOOL_ACTION cut;
|
static TOOL_ACTION cut;
|
||||||
static TOOL_ACTION copy;
|
static TOOL_ACTION copy;
|
||||||
static TOOL_ACTION paste;
|
static TOOL_ACTION paste;
|
||||||
|
static TOOL_ACTION duplicate;
|
||||||
|
static TOOL_ACTION doDelete; // sadly 'delete' is a reserved word
|
||||||
static TOOL_ACTION activatePointEditor;
|
static TOOL_ACTION activatePointEditor;
|
||||||
|
|
||||||
// Find and Replace
|
// Find and Replace
|
||||||
|
|
Loading…
Reference in New Issue