3
* @file toolbars_gerber.cpp
4
* @brief Build tool bars
8
* This program source code file is part of KiCad, a free EDA CAD application.
10
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
11
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
13
* This program is free software; you can redistribute it and/or
14
* modify it under the terms of the GNU General Public License
15
* as published by the Free Software Foundation; either version 2
16
* of the License, or (at your option) any later version.
18
* This program is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program; if not, you may find one here:
25
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
26
* or you may search the http://www.gnu.org website for the version 2 license,
27
* or you may write to the Free Software Foundation, Inc.,
28
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
36
#include <pl_editor_id.h>
37
#include <pl_editor_frame.h>
40
void PL_EDITOR_FRAME::ReCreateHToolbar( void )
42
if( m_mainToolBar != NULL )
47
// Standard file commands
48
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
49
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
51
m_mainToolBar->AddTool( wxID_NEW, wxEmptyString, KiBitmap( pagelayout_new_xpm ),
52
_( "New page layout design" ) );
54
m_mainToolBar->AddTool( wxID_OPEN, wxEmptyString, KiBitmap( pagelayout_load_xpm ),
55
_( "Load a page layout file. Previous data will be deleted" ) );
57
m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_project_xpm ),
58
_( "Save page layout design" ) );
60
m_mainToolBar->AddSeparator();
61
m_mainToolBar->AddTool( ID_SHEET_SET, wxEmptyString, KiBitmap( sheetset_xpm ),
62
_( "Page settings" ) );
64
m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ),
65
_( "Print page layout" ) );
67
m_mainToolBar->AddSeparator();
68
m_mainToolBar->AddTool( wxID_CUT, wxEmptyString, KiBitmap( delete_xpm ),
69
_( "Delete selected item" ) );
71
m_mainToolBar->AddSeparator();
72
m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString,
73
KiBitmap( undo_xpm ), wxEmptyString );
74
m_mainToolBar->AddTool( wxID_REDO, wxEmptyString,
75
KiBitmap( redo_xpm ), wxEmptyString );
77
// Standard Zoom controls:
78
m_mainToolBar->AddSeparator();
79
msg = AddHotkeyName( _( "Zoom in" ), s_PlEditor_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
80
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
82
msg = AddHotkeyName( _( "Zoom out" ), s_PlEditor_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
83
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
85
msg = AddHotkeyName( _( "Redraw view" ), s_PlEditor_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
86
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
88
msg = AddHotkeyName( _( "Zoom auto" ), s_PlEditor_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
89
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
91
// Display mode switch
92
m_mainToolBar->AddSeparator();
93
m_mainToolBar->AddTool( ID_SHOW_REAL_MODE, wxEmptyString, KiBitmap( pagelayout_normal_view_mode_xpm ),
94
_( "Show title block like it will be displayed in applications\n"
95
"texts with format are replaced by the full text"),
97
m_mainToolBar->AddTool( ID_SHOW_LPEDITOR_MODE, wxEmptyString, KiBitmap( pagelayout_special_view_mode_xpm ),
98
_( "how title block in edit mode: texts are shown as is\n"
99
"texts with format are displayed with no change"),
102
m_mainToolBar->AddSeparator();
104
wxString choiceList[5] =
106
_("Left Top paper corner"),
107
_("Right Bottom page corner"),
108
_("Left Bottom page corner"),
109
_("Right Top page corner"),
110
_("Left Top page corner")
113
m_originSelectBox = new wxChoice( m_mainToolBar, ID_SELECT_COORDINATE_ORIGIN,
114
wxDefaultPosition, wxDefaultSize,
116
m_mainToolBar->AddControl( m_originSelectBox );
117
m_originSelectBox->SetToolTip( _(" Origin of coordinates displayed to the status bar") );
120
for( int ii = 0; ii < 5; ii++ )
122
int width = GetTextSize( choiceList[ii], m_originSelectBox ).x;
123
minwidth = std::max( minwidth, width );
125
m_originSelectBox->SetMinSize( wxSize( minwidth, -1 ) );
126
m_originSelectBox->SetSelection( m_originSelectChoice );
128
wxString pageList[5] =
134
m_pageSelectBox = new wxChoice( m_mainToolBar, ID_SELECT_PAGE_NUMBER,
135
wxDefaultPosition, wxDefaultSize,
137
m_mainToolBar->AddControl( m_pageSelectBox );
138
m_pageSelectBox->SetToolTip( _("Simulate page 1 or other pages to show how items\n"\
139
"which are not on all page are displayed") );
140
m_pageSelectBox->SetSelection( 0 );
143
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
144
m_mainToolBar->Realize();
148
void PL_EDITOR_FRAME::ReCreateVToolbar( void )
153
m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
154
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
157
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ) );
158
m_drawToolBar->AddSeparator();
160
m_drawToolBar->Realize();
164
void PL_EDITOR_FRAME::ReCreateOptToolbar( void )