2007-08-30 08:15:05 +00:00
|
|
|
/*****************************************************/
|
|
|
|
/* toolsch.cpp; vreate toolbars for schematic frame */
|
|
|
|
/*****************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "class_drawpanel.h"
|
|
|
|
#include "confirm.h"
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#include "program.h"
|
|
|
|
#include "libcmp.h"
|
|
|
|
#include "general.h"
|
|
|
|
#include "protos.h"
|
2007-08-30 08:15:05 +00:00
|
|
|
#include "hotkeys.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-05-22 14:26:26 +00:00
|
|
|
#include "bitmaps.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
#include "id.h"
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************/
|
2007-09-01 12:00:30 +00:00
|
|
|
void WinEDA_SchematicFrame::ReCreateHToolbar()
|
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
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2007-08-30 08:15:05 +00:00
|
|
|
if( m_HToolBar != NULL )
|
|
|
|
return;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
wxString msg;
|
|
|
|
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
|
|
|
|
SetToolBar( m_HToolBar );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
// Set up toolbar
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, wxBitmap( new_xpm ),
|
|
|
|
_( "New schematic project" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString, wxBitmap( open_xpm ),
|
|
|
|
_( "Open schematic project" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString, wxBitmap( save_project_xpm ),
|
|
|
|
_( "Save schematic project" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_SHEET_SET, wxEmptyString, wxBitmap( sheetset_xpm ),
|
|
|
|
_( "Page settings" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_TO_LIBRARY, wxEmptyString, wxBitmap( libedit_xpm ),
|
|
|
|
_( "Library editor" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_TO_LIBVIEW, wxEmptyString, wxBitmap( library_browse_xpm ),
|
|
|
|
_( "Library browser" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_HIERARCHY, wxEmptyString, wxBitmap( hierarchy_nav_xpm ),
|
|
|
|
_( "Schematic hierarchy navigator" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( wxID_CUT, wxEmptyString, wxBitmap( cut_button ),
|
|
|
|
_( "Cut selected item" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( wxID_COPY, wxEmptyString, wxBitmap( copy_button ),
|
|
|
|
_( "Copy selected item" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( wxID_PASTE, wxEmptyString, wxBitmap( paste_xpm ),
|
|
|
|
_( "Paste" ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2007-09-19 15:29:50 +00:00
|
|
|
msg = AddHotkeyName( _( "Undo last edition" ), s_Schematic_Hokeys_Descr, HK_UNDO );
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_SCHEMATIC_UNDO, wxEmptyString, wxBitmap( undo_xpm ), msg );
|
2007-09-19 15:29:50 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Redo the last undo command" ), s_Schematic_Hokeys_Descr, HK_REDO );
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_SCHEMATIC_REDO, wxEmptyString, wxBitmap( redo_xpm ), msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_GEN_PRINT, wxEmptyString, wxBitmap( print_button ),
|
|
|
|
_( "Print schematic" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_TO_CVPCB, wxEmptyString, wxBitmap( cvpcb_xpm ),
|
|
|
|
_( "Run Cvpcb" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_TO_PCB, wxEmptyString, wxBitmap( pcbnew_xpm ),
|
|
|
|
_( "Run pcbnew" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2008-10-03 13:13:21 +00:00
|
|
|
msg = AddHotkeyName( _( "Zoom in" ), s_Schematic_Hokeys_Descr, HK_ZOOM_IN );
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, wxBitmap( zoom_in_xpm ),
|
2007-08-30 08:15:05 +00:00
|
|
|
msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-10-03 13:13:21 +00:00
|
|
|
msg = AddHotkeyName( _( "Zoom out" ), s_Schematic_Hokeys_Descr, HK_ZOOM_OUT );
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, wxBitmap( zoom_out_xpm ),
|
2007-08-30 08:15:05 +00:00
|
|
|
msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-10-03 13:13:21 +00:00
|
|
|
msg = AddHotkeyName( _( "Redraw view" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, wxBitmap( zoom_redraw_xpm ),
|
2007-08-30 08:15:05 +00:00
|
|
|
msg );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, wxBitmap( zoom_auto_xpm ),
|
|
|
|
_( "Zoom auto" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, wxBitmap( find_xpm ),
|
|
|
|
_( "Find components and texts" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_GET_NETLIST, wxEmptyString, wxBitmap( netlist_xpm ),
|
|
|
|
_( "Netlist generation" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_GET_ANNOTATE, wxEmptyString, wxBitmap( annotate_xpm ),
|
|
|
|
_( "Schematic Annotation" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_GET_ERC, wxEmptyString, wxBitmap( erc_xpm ),
|
|
|
|
_( "Schematic Electric Rules Check" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_GET_TOOLS, wxEmptyString, wxBitmap( tools_xpm ),
|
|
|
|
_( "Bill of material and/or Crossreferences" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
m_HToolBar->AddTool( ID_BACKANNO_ITEMS, wxEmptyString, wxBitmap( backanno_xpm ),
|
|
|
|
_( "Backannotate footprint" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
// after adding the tools to the toolbar, must call Realize() to reflect the changes
|
|
|
|
m_HToolBar->Realize();
|
|
|
|
SetToolbars();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
/*************************************************/
|
2007-09-01 12:00:30 +00:00
|
|
|
void WinEDA_SchematicFrame::ReCreateVToolbar()
|
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
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2007-08-30 08:15:05 +00:00
|
|
|
if( m_VToolBar )
|
|
|
|
return;
|
|
|
|
m_VToolBar = new WinEDA_Toolbar( TOOLBAR_TOOL, this, ID_V_TOOLBAR, FALSE );
|
|
|
|
|
|
|
|
// Set up toolbar
|
|
|
|
m_VToolBar->AddTool( ID_NO_SELECT_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( cursor_xpm ), wxEmptyString, wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, TRUE );
|
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_HIERARCHY_PUSH_POP_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( hierarchy_cursor_xpm ),
|
2007-08-30 08:15:05 +00:00
|
|
|
_( "Hierarchy Push/Pop" ), wxITEM_CHECK );
|
|
|
|
|
|
|
|
m_VToolBar->AddSeparator();
|
|
|
|
m_VToolBar->AddTool( ID_COMPONENT_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_component_xpm ),
|
2008-11-22 11:10:40 +00:00
|
|
|
_( "Place a component" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_PLACE_POWER_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_power_xpm ),
|
2008-11-22 11:10:40 +00:00
|
|
|
_( "Place a power port" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddSeparator();
|
|
|
|
m_VToolBar->AddTool( ID_WIRE_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_line_xpm ),
|
2008-11-22 11:10:40 +00:00
|
|
|
_( "Place a wire" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_BUS_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_bus_xpm ),
|
2008-11-22 11:10:40 +00:00
|
|
|
_( "Place a bus" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_WIRETOBUS_ENTRY_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_line2bus_xpm ),
|
2008-11-22 11:10:40 +00:00
|
|
|
_( "Place a wire to bus entry" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_BUSTOBUS_ENTRY_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_bus2bus_xpm ),
|
2008-11-22 11:10:40 +00:00
|
|
|
_( "Place a bus to bus entry" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddSeparator();
|
|
|
|
m_VToolBar->AddTool( ID_NOCONN_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( noconn_button ),
|
2008-10-13 18:28:30 +00:00
|
|
|
_( "Place no connect flag" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_LABEL_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_line_label_xpm ),
|
2008-10-13 18:28:30 +00:00
|
|
|
_( "Place net name" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_GLABEL_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_glabel_xpm ),
|
2008-11-22 11:10:40 +00:00
|
|
|
_( "Place a global label.\nWarning: all global labels with the same name are connected in whole hierarchy" ),
|
2008-02-15 22:50:52 +00:00
|
|
|
wxITEM_CHECK );
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_VToolBar->AddTool( ID_JUNCTION_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_junction_xpm ),
|
2008-11-22 11:10:40 +00:00
|
|
|
_( "Place a junction" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddSeparator();
|
2008-02-15 22:50:52 +00:00
|
|
|
m_VToolBar->AddTool( ID_HIERLABEL_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_hierarchical_label_xpm ),
|
2008-11-22 11:10:40 +00:00
|
|
|
_( "Place a hierarchical label. This label will be seen as a pin sheet in the sheet symbol" ),
|
2008-02-15 22:50:52 +00:00
|
|
|
wxITEM_CHECK );
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_VToolBar->AddTool( ID_SHEET_SYMBOL_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_hierarchical_subsheet_xpm ),
|
2008-10-13 18:28:30 +00:00
|
|
|
_( "Place hierarchical sheet" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_IMPORT_GLABEL_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( import_hierarchical_label_xpm ),
|
2008-10-15 11:46:53 +00:00
|
|
|
_( "Place a pin sheet , imported from a hierarchical label in sheet" ),
|
2008-02-15 22:50:52 +00:00
|
|
|
wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_SHEET_LABEL_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_hierar_pin_xpm ),
|
2008-10-15 11:46:53 +00:00
|
|
|
_( "Place hierarchical pin to sheet" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddSeparator();
|
|
|
|
m_VToolBar->AddTool( ID_LINE_COMMENT_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_dashed_line_xpm ),
|
2008-10-13 18:28:30 +00:00
|
|
|
_( "Place graphic line or polygon" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( add_text_xpm ),
|
2008-10-13 18:28:30 +00:00
|
|
|
_( "Place graphic text (comment)" ), wxITEM_CHECK );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
m_VToolBar->AddSeparator();
|
|
|
|
m_VToolBar->AddTool( ID_SCHEMATIC_DELETE_ITEM_BUTT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( delete_body_xpm ),
|
2007-08-30 08:15:05 +00:00
|
|
|
_( "Delete items" ), wxITEM_CHECK );
|
|
|
|
|
|
|
|
m_VToolBar->Realize();
|
|
|
|
SetToolbars();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************/
|
2007-09-01 12:00:30 +00:00
|
|
|
void WinEDA_SchematicFrame::ReCreateOptToolbar()
|
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 Left Toolbar (Option Toolbar)
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2007-08-30 08:15:05 +00:00
|
|
|
if( m_OptionsToolBar )
|
|
|
|
return;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
// creation du tool bar options
|
|
|
|
m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, FALSE );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( grid_xpm ),
|
2007-08-30 08:15:05 +00:00
|
|
|
_( "Display Grid OFF" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( unit_inch_xpm ),
|
2008-10-22 20:51:21 +00:00
|
|
|
_( "Units in inches" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( unit_mm_xpm ),
|
2008-10-22 20:51:21 +00:00
|
|
|
_( "Units in millimeters" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( cursor_shape_xpm ),
|
2007-08-30 08:15:05 +00:00
|
|
|
_( "Change Cursor Shape" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_OptionsToolBar->AddSeparator();
|
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_HIDDEN_PINS, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( hidden_pin_xpm ),
|
2007-08-30 08:15:05 +00:00
|
|
|
_( "Show Hidden Pins" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_OptionsToolBar->AddSeparator();
|
|
|
|
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_BUS_WIRES_ORIENT, wxEmptyString,
|
2009-01-07 15:59:49 +00:00
|
|
|
wxBitmap( lines90_xpm ),
|
2007-08-30 08:15:05 +00:00
|
|
|
_( "HV orientation for Wires and Bus" ), wxITEM_CHECK );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
m_OptionsToolBar->Realize();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
SetToolbars();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************************/
|
2007-08-30 08:15:05 +00:00
|
|
|
void WinEDA_SchematicFrame::OnSelectOptionToolbar( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
/*******************************************************************************************/
|
|
|
|
{
|
2007-08-30 08:15:05 +00:00
|
|
|
if( DrawPanel == NULL )
|
|
|
|
return;
|
|
|
|
|
|
|
|
int id = event.GetId();
|
|
|
|
wxClientDC dc( DrawPanel );
|
|
|
|
|
|
|
|
DrawPanel->PrepareGraphicContext( &dc );
|
|
|
|
|
|
|
|
switch( id )
|
|
|
|
{
|
|
|
|
case ID_TB_OPTIONS_SHOW_GRID:
|
2009-04-05 20:49:15 +00:00
|
|
|
m_Draw_Grid = m_OptionsToolBar->GetToolState( id );
|
2008-12-20 13:12:57 +00:00
|
|
|
DrawPanel->Refresh();
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SELECT_UNIT_MM:
|
|
|
|
g_UnitMetric = MILLIMETRE;
|
2009-04-05 20:49:15 +00:00
|
|
|
UpdateStatusBar(); /* Reaffichage des coord curseur */
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SELECT_UNIT_INCH:
|
|
|
|
g_UnitMetric = INCHES;
|
2009-04-05 20:49:15 +00:00
|
|
|
UpdateStatusBar(); /* Reaffichage des coord curseur */
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_SELECT_CURSOR:
|
|
|
|
DrawPanel->CursorOff( &dc );
|
2009-04-05 20:49:15 +00:00
|
|
|
m_CursorShape = m_OptionsToolBar->GetToolState( id );
|
2007-08-30 08:15:05 +00:00
|
|
|
DrawPanel->CursorOn( &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_HIDDEN_PINS:
|
|
|
|
g_ShowAllPins = m_OptionsToolBar->GetToolState( id );
|
|
|
|
DrawPanel->ReDraw( &dc, TRUE );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_TB_OPTIONS_BUS_WIRES_ORIENT:
|
|
|
|
g_HVLines = m_OptionsToolBar->GetToolState( id );
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
DisplayError( this, wxT( "OnSelectOptionToolbar() error" ) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetToolbars();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|