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
|
2018-03-16 12:38:36 +00:00
|
|
|
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
2018-01-08 04:05:03 +00:00
|
|
|
* Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.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>
|
2018-08-03 12:18:26 +00:00
|
|
|
#include <sch_draw_panel.h>
|
2018-01-30 10:49:51 +00:00
|
|
|
#include <sch_edit_frame.h>
|
2014-05-05 17:28:40 +00:00
|
|
|
#include <kiface_i.h>
|
2017-02-20 12:20:39 +00:00
|
|
|
#include <bitmaps.h>
|
2018-09-04 16:12:15 +00:00
|
|
|
#include <sch_view.h>
|
|
|
|
#include <sch_painter.h>
|
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
|
|
|
{
|
2018-01-08 04:05:03 +00:00
|
|
|
if( m_mainToolBar )
|
|
|
|
m_mainToolBar->Clear();
|
|
|
|
else
|
|
|
|
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
wxString msg;
|
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:
|
2018-01-16 11:19:22 +00:00
|
|
|
m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
|
|
|
|
KiScaledBitmap( new_document_xpm, this ),
|
|
|
|
_( "New schematic" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
|
|
|
|
KiScaledBitmap( open_document_xpm, this ),
|
2018-01-16 11:19:22 +00:00
|
|
|
_( "Open schematic" ) );
|
2015-06-01 18:02:32 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
|
2018-01-16 11:19:22 +00:00
|
|
|
KiScaledBitmap( save_xpm, this ),
|
|
|
|
_( "Save (all sheets)" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_SHEET_SET, wxEmptyString, KiScaledBitmap( sheetset_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Edit Page settings" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiScaledBitmap( print_button_xpm, this ),
|
2011-12-16 13:32:23 +00:00
|
|
|
_( "Print schematic" ) );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_GEN_PLOT_SCHEMATIC, wxEmptyString, KiScaledBitmap( plot_xpm, this ),
|
2017-01-28 20:48:55 +00:00
|
|
|
_( "Plot schematic" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_PASTE, wxEmptyString, KiScaledBitmap( paste_xpm, this ),
|
2011-12-16 13:32:23 +00:00
|
|
|
_( "Paste" ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2019-04-01 17:14:16 +00:00
|
|
|
msg = AddHotkeyName( HELP_UNDO, g_Schematic_Hotkeys_Descr, HK_UNDO, IS_COMMENT );
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString, KiScaledBitmap( undo_xpm, this ), msg );
|
2007-09-19 15:29:50 +00:00
|
|
|
|
2019-04-01 17:14:16 +00:00
|
|
|
msg = AddHotkeyName( HELP_REDO, g_Schematic_Hotkeys_Descr, HK_REDO, IS_COMMENT );
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_REDO, wxEmptyString, KiScaledBitmap( redo_xpm, this ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2019-04-01 17:14:16 +00:00
|
|
|
msg = AddHotkeyName( HELP_FIND, g_Schematic_Hotkeys_Descr, HK_FIND_ITEM, IS_COMMENT );
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, KiScaledBitmap( find_xpm, this ), msg );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_REPLACE, wxEmptyString, KiScaledBitmap( find_replace_xpm, this ),
|
2011-12-16 13:32:23 +00:00
|
|
|
wxNullBitmap, wxITEM_NORMAL, _( "Find and replace text" ),
|
2018-01-08 04:05:03 +00:00
|
|
|
HELP_REPLACE, nullptr );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2019-04-01 17:14:16 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Schematic_Hotkeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
|
|
|
|
KiScaledBitmap( zoom_redraw_xpm, this ), msg );
|
2017-06-06 13:35:20 +00:00
|
|
|
|
2019-04-01 17:14:16 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_IN, g_Schematic_Hotkeys_Descr, HK_ZOOM_IN, IS_COMMENT );
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiScaledBitmap( zoom_in_xpm, this ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2019-04-01 17:14:16 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_OUT, g_Schematic_Hotkeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiScaledBitmap( zoom_out_xpm, this ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2019-04-01 17:14:16 +00:00
|
|
|
msg = AddHotkeyName( HELP_ZOOM_FIT, g_Schematic_Hotkeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
|
|
|
|
KiScaledBitmap( zoom_fit_in_page_xpm, this ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiScaledBitmap( zoom_area_xpm, this ),
|
2017-06-06 13:35:20 +00:00
|
|
|
_( "Zoom to selection" ), wxITEM_CHECK );
|
|
|
|
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_HIERARCHY, wxEmptyString, KiScaledBitmap( hierarchy_nav_xpm, this ),
|
2011-12-16 13:32:23 +00:00
|
|
|
_( "Navigate schematic hierarchy" ) );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2019-05-06 20:37:54 +00:00
|
|
|
m_mainToolBar->AddTool( ID_SCH_LEAVE_SHEET, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( leave_sheet_xpm, this ), _( "Leave sheet" ) );
|
2015-06-11 17:27:36 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_RUN_LIBRARY, wxEmptyString, KiScaledBitmap( libedit_xpm, this ),
|
2012-01-21 15:02:49 +00:00
|
|
|
HELP_RUN_LIB_EDITOR );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_TO_LIBVIEW, wxEmptyString,
|
|
|
|
KiScaledBitmap( library_browse_xpm, this ), HELP_RUN_LIB_VIEWER );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2017-01-28 20:48:55 +00:00
|
|
|
// modedit is with libedit in a "library section" because the user must have footprints before
|
|
|
|
// they can be assigned.
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_RUN_PCB_MODULE_EDITOR, wxEmptyString,
|
|
|
|
KiScaledBitmap( module_editor_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Footprint Editor - Create/edit footprints" ) );
|
2015-06-01 18:02:32 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_GET_ANNOTATE, wxEmptyString, KiScaledBitmap( annotate_xpm, this ),
|
2012-01-21 15:02:49 +00:00
|
|
|
HELP_ANNOTATE );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_GET_ERC, wxEmptyString, KiScaledBitmap( erc_xpm, this ),
|
2015-01-05 21:01:35 +00:00
|
|
|
_( "Perform electrical rules check" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_RUN_CVPCB, wxEmptyString, KiScaledBitmap( cvpcb_xpm, this ),
|
2018-06-23 20:05:16 +00:00
|
|
|
_( "Assign PCB footprints to schematic symbols" ) );
|
2017-01-28 20:48:55 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_OPEN_CMP_TABLE, wxEmptyString,
|
|
|
|
KiScaledBitmap( spreadsheet_xpm, this ), _( "Edit symbol fields" ) );
|
2017-04-02 12:09:01 +00:00
|
|
|
|
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_GET_TOOLS, wxEmptyString, KiScaledBitmap( bom_xpm, this ),
|
2012-01-21 15:02:49 +00:00
|
|
|
HELP_GENERATE_BOM );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-08-29 20:45:22 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_RUN_PCB, wxEmptyString, KiScaledBitmap( pcbnew_xpm, this ),
|
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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( import_footprint_names_xpm, this ),
|
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 )
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->Clear();
|
|
|
|
else
|
|
|
|
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
// Set up toolbar
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiScaledBitmap( cursor_xpm, this ),
|
2018-06-03 21:42:04 +00:00
|
|
|
HELP_SELECT, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2019-04-14 00:44:05 +00:00
|
|
|
m_drawToolBar->AddTool( ID_HIGHLIGHT_BUTT, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( net_highlight_schematic_xpm, this ),
|
2018-06-03 21:42:04 +00:00
|
|
|
HELP_HIGHLIGHT, wxITEM_CHECK );
|
2016-11-16 10:07:02 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_SCH_PLACE_COMPONENT, wxEmptyString,
|
|
|
|
KiScaledBitmap( add_component_xpm, this ), HELP_PLACE_COMPONENTS,
|
|
|
|
wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_PLACE_POWER_BUTT, wxEmptyString,
|
|
|
|
KiScaledBitmap( add_power_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_PLACE_POWERPORT, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_WIRE_BUTT, wxEmptyString, KiScaledBitmap( add_line_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_PLACE_WIRE, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_BUS_BUTT, wxEmptyString, KiScaledBitmap( add_bus_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_PLACE_BUS, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_WIRETOBUS_ENTRY_BUTT, wxEmptyString,
|
|
|
|
KiScaledBitmap( add_line2bus_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_PLACE_WIRE2BUS_ENTRY, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_BUSTOBUS_ENTRY_BUTT, wxEmptyString,
|
|
|
|
KiScaledBitmap( add_bus2bus_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_PLACE_BUS2BUS_ENTRY, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_NOCONN_BUTT, wxEmptyString, KiScaledBitmap( noconn_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_PLACE_NC_FLAG, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_JUNCTION_BUTT, wxEmptyString,
|
|
|
|
KiScaledBitmap( add_junction_xpm, this ),
|
2012-01-18 15:06:48 +00:00
|
|
|
HELP_PLACE_JUNCTION, wxITEM_CHECK );
|
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_LABEL_BUTT, wxEmptyString,
|
|
|
|
KiScaledBitmap( add_line_label_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_PLACE_NETLABEL, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2019-04-15 23:56:41 +00:00
|
|
|
m_drawToolBar->AddTool( ID_GLOBALLABEL_BUTT, wxEmptyString, KiScaledBitmap( add_glabel_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( add_hierarchical_label_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( add_hierarchical_subsheet_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( import_hierarchical_label_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( add_hierar_pin_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( add_dashed_line_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_PLACE_GRAPHICLINES, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString, KiScaledBitmap( text_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
HELP_PLACE_GRAPHICTEXTS, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_ADD_IMAGE_BUTT, wxEmptyString, KiScaledBitmap( image_xpm, this ),
|
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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( delete_xpm, this ),
|
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 )
|
2018-01-08 04:05:03 +00:00
|
|
|
m_optionsToolBar->Clear();
|
|
|
|
else
|
|
|
|
m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
KICAD_AUI_TB_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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( grid_xpm, this ),
|
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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( unit_inch_xpm, this ),
|
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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( unit_mm_xpm, this ),
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "Set unit to mm" ), 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_CURSOR, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( cursor_shape_xpm, this ),
|
2009-11-04 20:46:53 +00:00
|
|
|
_( "Change cursor shape" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
//KiScaledSeparator( m_optionsToolBar, this );
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_HIDDEN_PINS, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( hidden_pin_xpm, this ),
|
2009-11-04 20:46:53 +00:00
|
|
|
_( "Show hidden pins" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
//KiScaledSeparator( m_optionsToolBar, this );
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_BUS_WIRES_ORIENT, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( lines90_xpm, this ),
|
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-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:
|
2018-09-04 16:12:15 +00:00
|
|
|
{
|
2018-02-22 19:05:10 +00:00
|
|
|
m_showAllPins = !m_showAllPins;
|
2018-01-16 18:39:31 +00:00
|
|
|
|
2018-09-04 16:12:15 +00:00
|
|
|
auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
|
|
|
|
painter->GetSettings()->m_ShowHiddenPins = m_showAllPins;
|
|
|
|
|
|
|
|
GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT );
|
|
|
|
GetCanvas()->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
|
|
|
}
|