2011-12-16 13:32:23 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2013-02-11 18:50:55 +00:00
|
|
|
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2011-12-16 13:32:23 +00:00
|
|
|
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
2013-02-04 08:52:56 +00:00
|
|
|
* Copyright (C) 2004-2013 KiCad Developers, see change_log.txt for contributors.
|
2011-12-16 13:32:23 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
/**
|
|
|
|
* @file tool_sch.cpp
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
|
|
|
#include <class_drawpanel.h>
|
2015-02-21 09:46:44 +00:00
|
|
|
#include <schframe.h>
|
2014-05-05 17:28:40 +00:00
|
|
|
#include <kiface_i.h>
|
2009-02-04 15:25:03 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <general.h>
|
|
|
|
#include <hotkeys.h>
|
|
|
|
#include <eeschema_id.h>
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <help_common_strings.h>
|
2010-06-30 11:15:34 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
/* Create the main Horizontal Toolbar for the schematic editor
|
|
|
|
*/
|
2010-12-08 20:12:46 +00:00
|
|
|
void SCH_EDIT_FRAME::ReCreateHToolbar()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-12-16 13:32:23 +00:00
|
|
|
if( m_mainToolBar != NULL )
|
2007-08-30 08:15:05 +00:00
|
|
|
return;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
wxString msg;
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
// Set up toolbar
|
2015-06-01 18:02:32 +00:00
|
|
|
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:
|
2015-06-16 18:04:02 +00:00
|
|
|
m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, KiBitmap( new_sch_xpm ),
|
2015-06-01 18:02:32 +00:00
|
|
|
_( "New schematic project" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2015-06-01 18:02:32 +00:00
|
|
|
m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString, KiBitmap( open_document_xpm ),
|
|
|
|
_( "Open schematic project" ) );
|
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString, KiBitmap( save_project_xpm ),
|
|
|
|
_( "Save schematic project" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_SHEET_SET, wxEmptyString, KiBitmap( sheetset_xpm ),
|
|
|
|
_( "Page settings" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ),
|
|
|
|
_( "Print schematic" ) );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_CUT, wxEmptyString, KiBitmap( cut_button_xpm ),
|
|
|
|
_( "Cut selected item" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_COPY, wxEmptyString, KiBitmap( copy_button_xpm ),
|
|
|
|
_( "Copy selected item" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_PASTE, wxEmptyString, KiBitmap( paste_xpm ),
|
|
|
|
_( "Paste" ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
msg = AddHotkeyName( HELP_UNDO, g_Schematic_Hokeys_Descr, HK_UNDO, IS_COMMENT );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), msg );
|
2007-09-19 15:29:50 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
msg = AddHotkeyName( HELP_REDO, g_Schematic_Hokeys_Descr, HK_REDO, IS_COMMENT );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
msg = AddHotkeyName( HELP_FIND, g_Schematic_Hokeys_Descr, HK_FIND_ITEM, IS_COMMENT );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, KiBitmap( find_xpm ), msg );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_REPLACE, wxEmptyString, KiBitmap( find_replace_xpm ),
|
|
|
|
wxNullBitmap, wxITEM_NORMAL, _( "Find and replace text" ),
|
|
|
|
HELP_REPLACE, NULL );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2015-06-01 18:02:32 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_IN, g_Schematic_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_OUT, g_Schematic_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_FIT, g_Schematic_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_HIERARCHY, wxEmptyString, KiBitmap( hierarchy_nav_xpm ),
|
|
|
|
_( "Navigate schematic hierarchy" ) );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2015-06-11 17:27:36 +00:00
|
|
|
m_mainToolBar->AddTool( ID_POPUP_SCH_LEAVE_SHEET, wxEmptyString, KiBitmap( leave_sheet_xpm ),
|
|
|
|
_( "Leave sheet" ) );
|
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2011-08-29 20:45:22 +00:00
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
m_mainToolBar->AddTool( ID_RUN_LIBRARY, wxEmptyString, KiBitmap( libedit_xpm ),
|
2012-01-21 15:02:49 +00:00
|
|
|
HELP_RUN_LIB_EDITOR );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_TO_LIBVIEW, wxEmptyString, KiBitmap( library_browse_xpm ),
|
2012-01-21 15:02:49 +00:00
|
|
|
HELP_RUN_LIB_VIEWER );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2015-06-01 18:02:32 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_GET_ANNOTATE, wxEmptyString, KiBitmap( annotate_xpm ),
|
2012-01-21 15:02:49 +00:00
|
|
|
HELP_ANNOTATE );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_GET_ERC, wxEmptyString, KiBitmap( erc_xpm ),
|
2015-01-05 21:01:35 +00:00
|
|
|
_( "Perform electrical rules check" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_GET_NETLIST, wxEmptyString, KiBitmap( netlist_xpm ),
|
|
|
|
_( "Generate netlist" ) );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_GET_TOOLS, wxEmptyString, KiBitmap( bom_xpm ),
|
2012-01-21 15:02:49 +00:00
|
|
|
HELP_GENERATE_BOM );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2015-09-08 18:45:11 +00:00
|
|
|
// The user must have footprints before he can assign them. So put this before CvPcb.
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2015-09-08 18:45:11 +00:00
|
|
|
m_mainToolBar->AddTool( ID_RUN_PCB_MODULE_EDITOR, wxEmptyString, KiBitmap( module_editor_xpm ),
|
|
|
|
_( "Footprint Editor" ) );
|
|
|
|
|
|
|
|
m_mainToolBar->AddTool( ID_RUN_CVPCB, wxEmptyString, KiBitmap( cvpcb_xpm ),
|
|
|
|
_( "Run CvPcb to associate components and footprints" ) );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
m_mainToolBar->AddTool( ID_RUN_PCB, wxEmptyString, KiBitmap( pcbnew_xpm ),
|
2011-12-16 13:32:23 +00:00
|
|
|
_( "Run Pcbnew to layout printed circuit board" ) );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_BACKANNO_ITEMS, wxEmptyString,
|
|
|
|
KiBitmap( import_footprint_names_xpm ),
|
2012-01-21 15:02:49 +00:00
|
|
|
HELP_IMPORT_FOOTPRINTS );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
// after adding the tools to the toolbar, must call Realize() to reflect the changes
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->Realize();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
/* Create Vertical Right Toolbar
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2010-12-08 20:12:46 +00:00
|
|
|
void SCH_EDIT_FRAME::ReCreateVToolbar()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-12-14 20:03:15 +00:00
|
|
|
if( m_drawToolBar )
|
2007-08-30 08:15:05 +00:00
|
|
|
return;
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
// Set up toolbar
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
|
|
|
|
wxEmptyString, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_HIERARCHY_PUSH_POP_BUTT, wxEmptyString,
|
|
|
|
KiBitmap( hierarchy_cursor_xpm ),
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "Ascend/descend hierarchy" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_SCH_PLACE_COMPONENT, wxEmptyString, KiBitmap( add_component_xpm ),
|
|
|
|
HELP_PLACE_COMPONENTS, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_PLACE_POWER_BUTT, wxEmptyString, KiBitmap( add_power_xpm ),
|
|
|
|
HELP_PLACE_POWERPORT, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_WIRE_BUTT, wxEmptyString, KiBitmap( add_line_xpm ),
|
|
|
|
HELP_PLACE_WIRE, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_BUS_BUTT, wxEmptyString, KiBitmap( add_bus_xpm ),
|
|
|
|
HELP_PLACE_BUS, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_WIRETOBUS_ENTRY_BUTT, wxEmptyString, KiBitmap( add_line2bus_xpm ),
|
|
|
|
HELP_PLACE_WIRE2BUS_ENTRY, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_BUSTOBUS_ENTRY_BUTT, wxEmptyString, KiBitmap( add_bus2bus_xpm ),
|
|
|
|
HELP_PLACE_BUS2BUS_ENTRY, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_NOCONN_BUTT, wxEmptyString, KiBitmap( noconn_xpm ),
|
|
|
|
HELP_PLACE_NC_FLAG, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2012-01-18 15:06:48 +00:00
|
|
|
m_drawToolBar->AddTool( ID_JUNCTION_BUTT, wxEmptyString, KiBitmap( add_junction_xpm ),
|
|
|
|
HELP_PLACE_JUNCTION, wxITEM_CHECK );
|
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_LABEL_BUTT, wxEmptyString, KiBitmap( add_line_label_xpm ),
|
|
|
|
HELP_PLACE_NETLABEL, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_GLABEL_BUTT, wxEmptyString, KiBitmap( add_glabel_xpm ),
|
|
|
|
HELP_PLACE_GLOBALLABEL, wxITEM_CHECK );
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_HIERLABEL_BUTT, wxEmptyString,
|
|
|
|
KiBitmap( add_hierarchical_label_xpm ),
|
|
|
|
HELP_PLACE_HIER_LABEL, wxITEM_CHECK );
|
2008-02-15 22:50:52 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_SHEET_SYMBOL_BUTT, wxEmptyString,
|
|
|
|
KiBitmap( add_hierarchical_subsheet_xpm ),
|
|
|
|
HELP_PLACE_SHEET, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_IMPORT_HLABEL_BUTT, wxEmptyString,
|
|
|
|
KiBitmap( import_hierarchical_label_xpm ),
|
|
|
|
HELP_IMPORT_SHEETPIN, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_SHEET_PIN_BUTT, wxEmptyString,
|
|
|
|
KiBitmap( add_hierar_pin_xpm ),
|
|
|
|
HELP_PLACE_SHEETPIN, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_LINE_COMMENT_BUTT, wxEmptyString,
|
|
|
|
KiBitmap( add_dashed_line_xpm ),
|
|
|
|
HELP_PLACE_GRAPHICLINES, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString, KiBitmap( add_text_xpm ),
|
|
|
|
HELP_PLACE_GRAPHICTEXTS, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_ADD_IMAGE_BUTT, wxEmptyString, KiBitmap( image_xpm ),
|
2014-02-28 17:31:00 +00:00
|
|
|
_("Add bitmap image"), wxITEM_CHECK );
|
2011-08-31 14:59:20 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_SCHEMATIC_DELETE_ITEM_BUTT, wxEmptyString,
|
2012-03-20 14:17:58 +00:00
|
|
|
KiBitmap( delete_xpm ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_DELETE_ITEMS, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->Realize();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Create Vertical Left Toolbar (Option Toolbar)
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2010-12-08 20:12:46 +00:00
|
|
|
void SCH_EDIT_FRAME::ReCreateOptToolbar()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-12-14 20:03:15 +00:00
|
|
|
if( m_optionsToolBar )
|
2007-08-30 08:15:05 +00:00
|
|
|
return;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( grid_xpm ),
|
2009-11-04 20:46:53 +00:00
|
|
|
_( "Turn grid off" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( unit_inch_xpm ),
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "Set unit to inch" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( unit_mm_xpm ),
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "Set unit to mm" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2016-05-11 03:33:24 +00:00
|
|
|
#ifndef __APPLE__
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( cursor_shape_xpm ),
|
2009-11-04 20:46:53 +00:00
|
|
|
_( "Change cursor shape" ), wxITEM_CHECK );
|
2016-05-11 03:33:24 +00:00
|
|
|
#endif // !__APPLE__
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
//m_optionsToolBar->AddSeparator();
|
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_HIDDEN_PINS, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( hidden_pin_xpm ),
|
2009-11-04 20:46:53 +00:00
|
|
|
_( "Show hidden pins" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
//m_optionsToolBar->AddSeparator();
|
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_BUS_WIRES_ORIENT, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( lines90_xpm ),
|
2009-11-04 20:46:53 +00:00
|
|
|
_( "HV orientation for wires and bus" ),
|
|
|
|
wxITEM_CHECK );
|
2011-12-22 13:28:11 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->Realize();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-08 20:12:46 +00:00
|
|
|
void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-12-22 13:28:11 +00:00
|
|
|
if( m_canvas == NULL )
|
2007-08-30 08:15:05 +00:00
|
|
|
return;
|
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
int id = event.GetId();
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
switch( id )
|
|
|
|
{
|
|
|
|
case ID_TB_OPTIONS_HIDDEN_PINS:
|
2011-12-16 13:32:23 +00:00
|
|
|
m_showAllPins = m_optionsToolBar->GetToolToggled( id );
|
2011-12-22 13:28:11 +00:00
|
|
|
m_canvas->Refresh();
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_BUS_WIRES_ORIENT:
|
2012-09-28 17:47:41 +00:00
|
|
|
SetForceHVLines( m_optionsToolBar->GetToolToggled( id ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2011-03-28 18:23:01 +00:00
|
|
|
wxFAIL_MSG( wxT( "Unexpected select option tool bar ID." ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|