2011-12-16 13:32:23 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-04-02 11:18:19 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2012-06-08 09:56:42 +00:00
|
|
|
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
|
|
|
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
|
2018-01-08 04:05:03 +00:00
|
|
|
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-12-16 13:32:23 +00:00
|
|
|
*
|
2018-01-08 04:05:03 +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 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
2011-12-16 13:32:23 +00:00
|
|
|
*
|
2018-01-08 04:05:03 +00:00
|
|
|
* 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.
|
2011-12-16 13:32:23 +00:00
|
|
|
*
|
2018-01-08 04:05:03 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-12-16 13:32:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-01-31 16:09:26 +00:00
|
|
|
* @file tool_footprint_editor.cpp
|
2011-12-16 13:32:23 +00:00
|
|
|
* @brief Footprint editor tool bars
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <pcbnew.h>
|
2018-01-29 20:58:58 +00:00
|
|
|
#include <footprint_edit_frame.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_helpers.h>
|
|
|
|
#include <pcbnew_id.h>
|
|
|
|
#include <hotkeys.h>
|
2017-02-20 12:20:39 +00:00
|
|
|
#include <bitmaps.h>
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2009-11-20 14:55:20 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
|
2007-06-05 12:10:51 +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-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
wxString msg;
|
|
|
|
|
|
|
|
// Set up toolbar
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_SELECT_CURRENT_LIB, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( open_library_xpm, this ),
|
2011-12-16 13:32:23 +00:00
|
|
|
_( "Select active library" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_SAVE_LIBMODULE, wxEmptyString, KiScaledBitmap( save_library_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Save footprint in active library" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( new_library_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Create new library and save current footprint" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_OPEN_MODULE_VIEWER, wxEmptyString, KiScaledBitmap( modview_icon_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Open footprint viewer" ) );
|
2012-02-09 20:33:38 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_DELETE_PART, wxEmptyString, KiScaledBitmap( delete_xpm, this ),
|
2011-12-16 13:32:23 +00:00
|
|
|
_( "Delete part from active library" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE, wxEmptyString, KiScaledBitmap( new_footprint_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "New footprint" ) );
|
2012-10-07 15:37:25 +00:00
|
|
|
|
2013-03-12 00:37:45 +00:00
|
|
|
#ifdef KICAD_SCRIPTING
|
2012-05-09 17:37:25 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE_FROM_WIZARD, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( module_wizard_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "New footprint using footprint wizard" ) );
|
2013-02-24 17:31:18 +00:00
|
|
|
#endif
|
2012-10-07 15:37:25 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_LOAD_MODULE, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( load_module_lib_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Load footprint from library" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( load_module_board_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Load footprint from current board" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_UPDATE_MODULE_IN_BOARD, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( update_module_board_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Update footprint into current board" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_INSERT_MODULE_IN_BOARD, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( insert_module_board_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Insert footprint into current board" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_IMPORT_PART, wxEmptyString, KiScaledBitmap( import_module_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Import footprint" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_EXPORT_PART, wxEmptyString, KiScaledBitmap( export_module_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Export footprint" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString, KiScaledBitmap( undo_xpm, this ),
|
2011-12-16 13:32:23 +00:00
|
|
|
_( "Undo last edition" ) );
|
2018-01-08 04:05:03 +00:00
|
|
|
m_mainToolBar->AddTool( wxID_REDO, wxEmptyString, KiScaledBitmap( redo_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Redo last undo command" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_EDIT_MODULE_PROPERTIES, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( module_options_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Footprint properties" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiScaledBitmap( print_button_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Print footprint" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2017-06-06 13:35:20 +00:00
|
|
|
msg = AddHotkeyName( _( "Redraw view" ), g_Module_Editor_Hokeys_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
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( _( "Zoom in" ), g_Module_Editor_Hokeys_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 );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( _( "Zoom out" ), g_Module_Editor_Hokeys_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 );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
msg = AddHotkeyName( _( "Zoom auto" ), g_Module_Editor_Hokeys_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-08-30 08:15:05 +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 );
|
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_PAD_SETTINGS, wxEmptyString, KiScaledBitmap( options_pad_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Pad properties" ) );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2015-04-02 11:18:19 +00:00
|
|
|
#if 0 // Currently there is no check footprint function defined, so do not show this tool
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MODEDIT_CHECK, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( module_check_xpm, this ),
|
2014-10-08 05:50:56 +00:00
|
|
|
_( "Check footprint" ) );
|
2015-04-02 11:18:19 +00:00
|
|
|
#endif
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->Realize();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
void FOOTPRINT_EDIT_FRAME::ReCreateVToolbar()
|
2007-06-05 12:10:51 +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-06-05 12:10:51 +00:00
|
|
|
|
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 ),
|
2011-12-14 20:03:15 +00:00
|
|
|
wxEmptyString, wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_drawToolBar, this );
|
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_PAD_TOOL, wxEmptyString, KiScaledBitmap( pad_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Add pad" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_drawToolBar, this );
|
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_LINE_TOOL, wxEmptyString, KiScaledBitmap( add_graphical_segments_xpm, this ),
|
2017-10-19 21:14:01 +00:00
|
|
|
_( "Add graphic line" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_CIRCLE_TOOL, wxEmptyString, KiScaledBitmap( add_circle_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
_( "Add graphic circle" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_ARC_TOOL, wxEmptyString, KiScaledBitmap( add_arc_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
_( "Add graphic arc" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_POLYGON_TOOL, wxEmptyString, KiScaledBitmap( add_graphical_polygon_xpm, this ),
|
2017-10-19 21:14:01 +00:00
|
|
|
_( "Add graphic polygon" ), wxITEM_CHECK );
|
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_TEXT_TOOL, wxEmptyString, KiScaledBitmap( text_xpm, this ),
|
2011-12-14 20:03:15 +00:00
|
|
|
_( "Add Text" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_drawToolBar, this );
|
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_ANCHOR_TOOL, wxEmptyString, KiScaledBitmap( anchor_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Place footprint reference anchor" ),
|
2011-12-14 20:03:15 +00:00
|
|
|
wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_drawToolBar, this );
|
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_DELETE_TOOL, wxEmptyString, KiScaledBitmap( delete_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Delete item" ), wxITEM_CHECK );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_PLACE_GRID_COORD, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( grid_select_axis_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Set grid origin" ),
|
2011-12-14 20:03:15 +00:00
|
|
|
wxITEM_CHECK );
|
2010-07-13 10:42:32 +00:00
|
|
|
|
2017-03-09 09:09:13 +00:00
|
|
|
m_drawToolBar->AddTool( ID_MODEDIT_MEASUREMENT_TOOL, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( measurement_xpm, this ),
|
2017-06-02 09:51:11 +00:00
|
|
|
_( "Measure distance" ),
|
2017-03-09 09:09:13 +00:00
|
|
|
wxITEM_CHECK );
|
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_drawToolBar->Realize();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar()
|
2007-06-05 12:10:51 +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-08-30 08:15:05 +00:00
|
|
|
|
2018-01-08 04:05:03 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiScaledBitmap( grid_xpm, this ),
|
2009-11-20 19:51:39 +00:00
|
|
|
_( "Hide grid" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( polar_coord_xpm, this ),
|
2007-08-30 08:15:05 +00:00
|
|
|
_( "Display Polar Coord ON" ), wxITEM_CHECK );
|
|
|
|
|
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 ),
|
2016-10-10 22:54:58 +00:00
|
|
|
_( "Set units to inches" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +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 ),
|
2016-10-10 22:54:58 +00:00
|
|
|
_( "Set units to millimeters" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +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,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( cursor_shape_xpm, this ),
|
2009-11-20 19:51:39 +00:00
|
|
|
_( "Change Cursor Shape" ), wxITEM_CHECK );
|
2018-01-27 18:11:56 +00:00
|
|
|
#else
|
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
|
|
|
|
KiScaledBitmap( cursor_shape_xpm, this ),
|
|
|
|
_( "Change cursor shape (not supported in Legacy graphics)" ),
|
|
|
|
wxITEM_CHECK );
|
|
|
|
#endif
|
2007-08-30 08:15:05 +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_SHOW_PADS_SKETCH, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( pad_sketch_xpm, this ),
|
2009-11-20 19:51:39 +00:00
|
|
|
_( "Show Pads Sketch" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( text_sketch_xpm, this ),
|
2009-11-20 19:51:39 +00:00
|
|
|
_( "Show Texts Sketch" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( show_mod_edge_xpm, this ),
|
2009-11-20 19:51:39 +00:00
|
|
|
_( "Show Edges Sketch" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2015-01-10 10:27:49 +00:00
|
|
|
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, wxEmptyString,
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledBitmap( contrast_mode_xpm, this ),
|
2015-01-10 10:27:49 +00:00
|
|
|
_( "Enable high contrast display mode" ),
|
|
|
|
wxITEM_CHECK );
|
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
m_optionsToolBar->Realize();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
void FOOTPRINT_EDIT_FRAME::ReCreateAuxiliaryToolbar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2011-12-14 20:03:15 +00:00
|
|
|
if( m_auxiliaryToolBar )
|
2018-01-08 04:05:03 +00:00
|
|
|
m_auxiliaryToolBar->Clear();
|
|
|
|
else
|
|
|
|
m_auxiliaryToolBar = new wxAuiToolBar( this, ID_AUX_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
|
|
|
// Set up toolbar
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_auxiliaryToolBar, this );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
|
|
|
// Grid selection choice box.
|
2015-07-02 09:50:38 +00:00
|
|
|
m_gridSelectBox = new wxChoice( m_auxiliaryToolBar,
|
2011-12-14 20:03:15 +00:00
|
|
|
ID_ON_GRID_SELECT,
|
2015-01-10 11:08:12 +00:00
|
|
|
wxDefaultPosition, wxDefaultSize,
|
2015-07-02 09:50:38 +00:00
|
|
|
0, NULL );
|
2015-01-10 11:08:12 +00:00
|
|
|
// Update tool bar to reflect setting.
|
|
|
|
updateGridSelectBox();
|
2011-12-14 20:03:15 +00:00
|
|
|
m_auxiliaryToolBar->AddControl( m_gridSelectBox );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
|
|
|
// Zoom selection choice box.
|
2018-01-08 04:05:03 +00:00
|
|
|
KiScaledSeparator( m_auxiliaryToolBar, this );
|
2015-07-02 09:50:38 +00:00
|
|
|
m_zoomSelectBox = new wxChoice( m_auxiliaryToolBar,
|
2011-12-14 20:03:15 +00:00
|
|
|
ID_ON_ZOOM_SELECT,
|
2015-01-10 11:08:12 +00:00
|
|
|
wxDefaultPosition, wxDefaultSize,
|
2015-07-02 09:50:38 +00:00
|
|
|
0, NULL );
|
2011-02-21 13:54:29 +00:00
|
|
|
updateZoomSelectBox();
|
2015-01-10 11:08:12 +00:00
|
|
|
m_auxiliaryToolBar->AddControl( m_zoomSelectBox );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
|
|
|
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
|
2011-12-14 20:03:15 +00:00
|
|
|
m_auxiliaryToolBar->Realize();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|