KiCad PCB EDA Suite
Loading...
Searching...
No Matches
toolbars_sch_editor.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 * Copyright (C) 2019 CERN
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#include <advanced_config.h>
29#include <sch_draw_panel.h>
30#include <sch_edit_frame.h>
31#include <kiface_base.h>
32#include <bitmaps.h>
33#include <eeschema_id.h>
34#include <pgm_base.h>
35#include <tool/action_menu.h>
36#include <tool/tool_manager.h>
38#include <tool/action_toolbar.h>
40#include <widgets/wx_infobar.h>
41#include <tools/sch_actions.h>
48#include <toolbars_sch_editor.h>
49#include <wx/choice.h>
50#include <wx/stattext.h>
51
52
54 _( "Current variant" ),
55 _( "Selects the current schematic variant" ),
56 { FRAME_SCH } );
57
58
59std::optional<TOOLBAR_CONFIGURATION> SCH_EDIT_TOOLBAR_SETTINGS::DefaultToolbarConfig( TOOLBAR_LOC aToolbar )
60{
62
63 // clang-format off
64 switch( aToolbar )
65 {
67 return std::nullopt;
68
70 config.AppendAction( ACTIONS::toggleGrid )
71 .WithContextMenu(
72 []( TOOL_MANAGER* aToolMgr )
73 {
74 SCH_SELECTION_TOOL* selTool = aToolMgr->GetTool<SCH_SELECTION_TOOL>();
75 auto menu = std::make_unique<ACTION_MENU>( false, selTool );
76 menu->Add( ACTIONS::gridProperties );
77 return menu;
78 } )
79 .AppendAction( ACTIONS::toggleGridOverrides )
80 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Units" ) )
81 .AddAction( ACTIONS::inchesUnits )
82 .AddAction( ACTIONS::milsUnits )
83 .AddAction( ACTIONS::millimetersUnits ) )
84 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) )
87 .AddAction( ACTIONS::cursor45Crosshairs ) );
88
89 config.AppendSeparator()
90 .AppendAction( SCH_ACTIONS::toggleHiddenPins );
91
92 config.AppendSeparator()
93 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Line modes" ) )
94 .AddAction( SCH_ACTIONS::lineModeFree )
95 .AddAction( SCH_ACTIONS::lineMode90 )
96 .AddAction( SCH_ACTIONS::lineMode45 ) );
97
98 config.AppendSeparator()
99 .AppendAction( SCH_ACTIONS::toggleAnnotateAuto );
100
101 config.AppendSeparator()
102 .AppendAction( SCH_ACTIONS::showHierarchy )
103 .AppendAction( ACTIONS::showProperties );
104
105 if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
106 config.AppendAction( ACTIONS::toggleBoundingBoxes );
107
108 break;
109
111 config.AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Selection modes" ) )
112 .AddAction( ACTIONS::selectSetRect )
113 .AddAction( ACTIONS::selectSetLasso ) )
114 .AppendAction( SCH_ACTIONS::highlightNetTool );
115
116 config.AppendSeparator()
117 .AppendAction( SCH_ACTIONS::placeSymbol )
118 .AppendAction( SCH_ACTIONS::placePower )
119 .AppendAction( SCH_ACTIONS::drawWire )
120 .AppendAction( SCH_ACTIONS::drawBus )
121 .AppendAction( SCH_ACTIONS::placeBusWireEntry )
122 .AppendAction( SCH_ACTIONS::placeNoConnect )
123 .AppendAction( SCH_ACTIONS::placeJunction )
124 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Labels" ) )
125 .AddAction( SCH_ACTIONS::placeLabel )
126 .AddAction( SCH_ACTIONS::placeClassLabel )
128 .AddAction( SCH_ACTIONS::placeHierLabel ) )
129 .AppendAction( SCH_ACTIONS::drawRuleArea )
130 .AppendAction( SCH_ACTIONS::drawSheet )
131 .AppendAction( SCH_ACTIONS::placeSheetPin )
132 .AppendAction( SCH_ACTIONS::syncAllSheetsPins );
133
134 config.AppendSeparator()
135 .AppendAction( SCH_ACTIONS::placeSchematicText )
136 .AppendAction( SCH_ACTIONS::drawTextBox )
137 .AppendAction( SCH_ACTIONS::drawTable )
138 .AppendAction( SCH_ACTIONS::drawRectangle )
139 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Circle" ) )
140 .AddAction( SCH_ACTIONS::drawCircle )
141 .AddAction( SCH_ACTIONS::drawEllipse ) )
142 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Arc" ) )
143 .AddAction( SCH_ACTIONS::drawArc )
144 .AddAction( SCH_ACTIONS::drawEllipseArc ) )
145 .AppendAction( SCH_ACTIONS::drawBezier )
146 .AppendAction( SCH_ACTIONS::drawLines )
147 .AppendAction( SCH_ACTIONS::placeImage )
148 .AppendAction( ACTIONS::deleteTool );
149
150 break;
151
153 if( Kiface().IsSingle() ) // not when under a project mgr
154 {
155 config.AppendAction( ACTIONS::doNew );
156 config.AppendAction( ACTIONS::open );
157 }
158
159 config.AppendAction( ACTIONS::save );
160
161 config.AppendSeparator()
162 .AppendAction( SCH_ACTIONS::schematicSetup );
163
164 config.AppendSeparator()
165 .AppendAction( ACTIONS::pageSettings )
166 .AppendAction( ACTIONS::print )
167 .AppendAction( ACTIONS::plot );
168
169 config.AppendSeparator()
170 .AppendAction( ACTIONS::paste );
171
172 config.AppendSeparator()
173 .AppendAction( ACTIONS::undo )
174 .AppendAction( ACTIONS::redo );
175
176 config.AppendSeparator()
177 .AppendAction( ACTIONS::find )
178 .AppendAction( ACTIONS::findAndReplace );
179
180 config.AppendSeparator()
181 .AppendAction( ACTIONS::zoomRedraw )
182 .AppendAction( ACTIONS::zoomInCenter )
183 .AppendAction( ACTIONS::zoomOutCenter )
184 .AppendAction( ACTIONS::zoomFitScreen )
185 .AppendAction( ACTIONS::zoomFitObjects )
186 .AppendAction( ACTIONS::zoomTool );
187
188 config.AppendSeparator()
189 .AppendAction( SCH_ACTIONS::navigateBack )
190 .AppendAction( SCH_ACTIONS::navigateUp )
191 .AppendAction( SCH_ACTIONS::navigateForward );
192
193 config.AppendSeparator()
194 .AppendAction( SCH_ACTIONS::rotateCCW )
195 .AppendAction( SCH_ACTIONS::rotateCW )
196 .AppendAction( SCH_ACTIONS::mirrorV )
197 .AppendAction( SCH_ACTIONS::mirrorH )
198 .AppendAction( ACTIONS::group )
199 .AppendAction( ACTIONS::ungroup );
200
201 config.AppendSeparator()
202 .AppendAction( ACTIONS::showSymbolEditor )
203 .AppendAction( ACTIONS::showSymbolBrowser )
204 .AppendAction( ACTIONS::showFootprintEditor );
205
206 config.AppendSeparator()
207 .AppendAction( SCH_ACTIONS::annotate )
208 .AppendAction( SCH_ACTIONS::runERC )
209 .AppendAction( SCH_ACTIONS::showSimulator )
210 .AppendAction( SCH_ACTIONS::assignFootprints )
211 .AppendAction( SCH_ACTIONS::editSymbolFields )
212 .AppendAction( SCH_ACTIONS::generateBOM );
213
214 config.AppendSeparator()
215 .AppendAction( SCH_ACTIONS::showPcbNew );
216
218
219 // Insert all the IPC plugins here on the toolbar
220 // TODO (ISM): Move this to individual actions for each script
222
224
225 break;
226 }
227
228 // clang-format on
229 return config;
230}
231
232
234{
236
237 // Variant selection drop down control on main tool bar.
238 auto variantSelectionCtrlFactory =
239 [this]( ACTION_TOOLBAR* aToolbar )
240 {
241 std::optional<wxString> currentVariantName = Schematic().GetCurrentVariant();
242 wxString tmp = currentVariantName ? *currentVariantName : GetDefaultVariantName();
243
244 m_currentVariantCtrl = new wxChoice( aToolbar, ID_TOOLBAR_SCH_SELECT_VARAIANT, wxDefaultPosition,
245 wxDefaultSize, Schematic().GetVariantNamesForUI(), 0,
246 wxDefaultValidator, tmp );
247
248 m_currentVariantCtrl->SetToolTip( _( "Select the current variant to display and edit." ) );
249 aToolbar->Add( m_currentVariantCtrl );
250 UpdateVariantSelectionCtrl( Schematic().GetVariantNamesForUI() );
251 };
252
254
255 // IPC/Scripting plugin control
256 // TODO (ISM): Clean this up to make IPC actions just normal tool actions to get rid of this entire
257 // control
258 auto pluginControlFactory =
259 [this]( ACTION_TOOLBAR* aToolbar )
260 {
261
262#ifdef KICAD_IPC_API
263 bool haveApiPlugins = Pgm().GetCommonSettings()->m_Api.enable_server
264 && !Pgm().GetPluginManager().GetActionsForScope( PluginActionScope() ).empty();
265#else
266 bool haveApiPlugins = false;
267#endif
268
269 if( haveApiPlugins )
270 {
271 aToolbar->AddScaledSeparator( aToolbar->GetParent() );
272 AddApiPluginTools( aToolbar );
273 }
274 };
275
277}
278
279
281{
283
284 switch( aId )
285 {
287 }
288}
289
290
291void SCH_EDIT_FRAME::UpdateVariantSelectionCtrl( const wxArrayString& aVariantNames )
292{
294 return;
295
296 // Fall back to the default if nothing is currently selected.
297 wxString currentSelection = GetDefaultVariantName();
298 int selectionIndex = m_currentVariantCtrl->GetSelection();
299
300 if( selectionIndex != wxNOT_FOUND )
301 currentSelection = m_currentVariantCtrl->GetString( selectionIndex );
302
303 // Add all variant names, a separator, and "Add New Variant..." at the end
304 wxArrayString contents = aVariantNames;
305 contents.Add( wxS( "---" ) );
306 contents.Add( _( "Add New Design Variant..." ) );
307
308 m_currentVariantCtrl->Set( contents );
309
310 selectionIndex = m_currentVariantCtrl->FindString( currentSelection );
311
312 if( ( selectionIndex == wxNOT_FOUND ) && ( m_currentVariantCtrl->GetCount() != 0 ) )
313 selectionIndex = 0;
314
315 m_currentVariantCtrl->SetSelection( selectionIndex );
316}
317
318
319void SCH_EDIT_FRAME::onVariantSelected( wxCommandEvent& aEvent )
320{
321 if( aEvent.GetId() != ID_TOOLBAR_SCH_SELECT_VARAIANT )
322 return;
323
324 wxCHECK( m_currentVariantCtrl, /* void */ );
325
326 int selection = m_currentVariantCtrl->GetSelection();
327 int count = m_currentVariantCtrl->GetCount();
328
329 if( selection == wxNOT_FOUND || count == 0 )
330 return;
331
332 // "Add New Variant..." is always the last item, separator is second-to-last
333 if( selection == count - 1 )
334 {
335 // Restore previous selection before showing dialog
336 int previousSelection = m_currentVariantCtrl->FindString(
337 Schematic().GetCurrentVariant().IsEmpty() ? GetDefaultVariantName()
338 : Schematic().GetCurrentVariant() );
339
340 if( previousSelection != wxNOT_FOUND )
341 m_currentVariantCtrl->SetSelection( previousSelection );
342
344 return;
345 }
346
347 // Separator line - ignore selection
348 if( selection == count - 2 )
349 {
350 int previousSelection = m_currentVariantCtrl->FindString(
351 Schematic().GetCurrentVariant().IsEmpty() ? GetDefaultVariantName()
352 : Schematic().GetCurrentVariant() );
353
354 if( previousSelection != wxNOT_FOUND )
355 m_currentVariantCtrl->SetSelection( previousSelection );
356
357 return;
358 }
359
360 wxString selectedString = m_currentVariantCtrl->GetString( selection );
361 wxString selectedVariant;
362
363 if( selectedString != GetDefaultVariantName() )
364 selectedVariant = selectedString;
365
366 Schematic().SetCurrentVariant( selectedVariant );
368 HardRedraw();
369
370 // Refresh message panel for current selection
372
373 if( selTool )
374 {
375 SCH_SELECTION& sub_sel = selTool->GetSelection();
376
377 if( sub_sel.GetSize() == 1 )
378 SetMsgPanel( static_cast<EDA_ITEM*>( sub_sel.Front() ) );
379 }
380}
381
382
384{
385 // Create a dialog with both name and description fields
386 wxDialog dlg( this, wxID_ANY, _( "New Design Variant" ), wxDefaultPosition, wxDefaultSize,
387 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
388
389 wxBoxSizer* mainSizer = new wxBoxSizer( wxVERTICAL );
390
391 // Name field
392 wxStaticText* nameLabel = new wxStaticText( &dlg, wxID_ANY, _( "Variant name:" ) );
393 mainSizer->Add( nameLabel, 0, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 10 );
394
395 mainSizer->AddSpacer( 3 );
396
397 wxTextCtrl* nameCtrl = new wxTextCtrl( &dlg, wxID_ANY );
398 mainSizer->Add( nameCtrl, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 10 );
399
400 // Description field
401 wxStaticText* descLabel = new wxStaticText( &dlg, wxID_ANY, _( "Description (optional):" ) );
402 mainSizer->Add( descLabel, 0, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 10 );
403
404 mainSizer->AddSpacer( 3 );
405
406 wxTextCtrl* descCtrl = new wxTextCtrl( &dlg, wxID_ANY, wxEmptyString, wxDefaultPosition,
407 wxSize( 300, 60 ), wxTE_MULTILINE );
408 mainSizer->Add( descCtrl, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 10 );
409
410 // Buttons
411 wxStdDialogButtonSizer* btnSizer = new wxStdDialogButtonSizer();
412 btnSizer->AddButton( new wxButton( &dlg, wxID_OK ) );
413 btnSizer->AddButton( new wxButton( &dlg, wxID_CANCEL ) );
414 btnSizer->Realize();
415 mainSizer->Add( btnSizer, 0, wxALL | wxALIGN_RIGHT, 5 );
416
417 dlg.SetSizer( mainSizer );
418 dlg.Fit();
419 dlg.Centre();
420 nameLabel->SetFocus();
421
422 if( dlg.ShowModal() == wxID_CANCEL )
423 return false;
424
425 wxString variantName = nameCtrl->GetValue().Trim().Trim( false );
426 wxString variantDesc = descCtrl->GetValue().Trim().Trim( false );
427
428 // Empty strings, reserved names, and duplicate variant names are not allowed.
429 if( variantName.IsEmpty() )
430 {
431 GetInfoBar()->ShowMessageFor( _( "Variant name cannot be empty." ), 10000, wxICON_ERROR );
432 return false;
433 }
434
435 // Check for reserved name (case-insensitive)
436 if( variantName.CmpNoCase( GetDefaultVariantName() ) == 0 )
437 {
438 GetInfoBar()->ShowMessageFor( wxString::Format( _( "'%s' is a reserved variant name." ),
440 10000, wxICON_ERROR );
441 return false;
442 }
443
444 // Check for duplicate variant names (case-insensitive)
445 for( const wxString& existingName : Schematic().GetVariantNames() )
446 {
447 if( existingName.CmpNoCase( variantName ) == 0 )
448 {
449 GetInfoBar()->ShowMessageFor( wxString::Format( _( "Variant '%s' already exists." ),
450 existingName ),
451 10000, wxICON_ERROR );
452 return false;
453 }
454 }
455
456 // Add variant to the schematic
457 Schematic().AddVariant( variantName );
458
459 if( !variantDesc.IsEmpty() )
460 Schematic().SetVariantDescription( variantName, variantDesc );
461
462 // Update the variant selector and select the new variant
463 UpdateVariantSelectionCtrl( Schematic().GetVariantNamesForUI() );
464 SetCurrentVariant( variantName );
465 OnModify();
466 return true;
467}
468
469
470void SCH_EDIT_FRAME::SetCurrentVariant( const wxString& aVariantName )
471{
473 return;
474
475 wxString name = aVariantName.IsEmpty() ? GetDefaultVariantName() : aVariantName;
476
477 int newSelection = m_currentVariantCtrl->FindString( name );
478
479 if( newSelection == wxNOT_FOUND )
480 return;
481
482 int currentSelection = m_currentVariantCtrl->GetSelection();
483
484 wxString selectedString;
485
486 if( currentSelection != wxNOT_FOUND )
487 selectedString = m_currentVariantCtrl->GetString( currentSelection );
488
489 if( selectedString != name )
490 {
491 m_currentVariantCtrl->SetSelection( newSelection );
492 Schematic().SetCurrentVariant( aVariantName );
493
495 HardRedraw();
496 }
497}
const char * name
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static TOOL_ACTION gridProperties
Definition actions.h:200
static TOOL_ACTION toggleGrid
Definition actions.h:198
static TOOL_ACTION paste
Definition actions.h:80
static TOOL_ACTION zoomRedraw
Definition actions.h:132
static TOOL_ACTION millimetersUnits
Definition actions.h:206
static TOOL_ACTION cursorSmallCrosshairs
Definition actions.h:152
static TOOL_ACTION zoomOutCenter
Definition actions.h:136
static TOOL_ACTION selectSetLasso
Definition actions.h:221
static TOOL_ACTION selectSetRect
Set lasso selection mode.
Definition actions.h:220
static TOOL_ACTION group
Definition actions.h:239
static TOOL_ACTION showSymbolEditor
Definition actions.h:260
static TOOL_ACTION showSymbolBrowser
Definition actions.h:259
static TOOL_ACTION findAndReplace
Definition actions.h:118
static TOOL_ACTION milsUnits
Definition actions.h:205
static TOOL_ACTION ungroup
Definition actions.h:240
static TOOL_ACTION toggleBoundingBoxes
Definition actions.h:157
static TOOL_ACTION plot
Definition actions.h:65
static TOOL_ACTION open
Definition actions.h:57
static TOOL_ACTION pageSettings
Definition actions.h:63
static TOOL_ACTION undo
Definition actions.h:75
static TOOL_ACTION inchesUnits
Definition actions.h:204
static TOOL_ACTION save
Definition actions.h:58
static TOOL_ACTION zoomFitScreen
Definition actions.h:142
static TOOL_ACTION redo
Definition actions.h:76
static TOOL_ACTION deleteTool
Definition actions.h:86
static TOOL_ACTION zoomTool
Definition actions.h:146
static TOOL_ACTION cursor45Crosshairs
Definition actions.h:154
static TOOL_ACTION showFootprintEditor
Definition actions.h:262
static TOOL_ACTION print
Definition actions.h:64
static TOOL_ACTION showProperties
Definition actions.h:266
static TOOL_ACTION doNew
Definition actions.h:54
static TOOL_ACTION zoomFitObjects
Definition actions.h:143
static TOOL_ACTION zoomInCenter
Definition actions.h:135
static TOOL_ACTION toggleGridOverrides
Definition actions.h:199
static TOOL_ACTION cursorFullCrosshairs
Definition actions.h:153
static TOOL_ACTION find
Definition actions.h:117
static ACTION_TOOLBAR_CONTROL overrideLocks
static ACTION_TOOLBAR_CONTROL ipcScripting
Class to hold basic information about controls that can be added to the toolbars.
Define the structure of a toolbar with buttons that invoke ACTIONs.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
virtual void ClearToolbarControl(int aId)
void RegisterCustomToolbarControlFactory(const ACTION_TOOLBAR_CONTROL &aControlDesc, const ACTION_TOOLBAR_CONTROL_FACTORY &aControlFactory)
Register a creation factory for toolbar controls that are present in this frame.
virtual void configureToolbars()
WX_INFOBAR * GetInfoBar()
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual void AddApiPluginTools(ACTION_TOOLBAR *aToolbar)
Append actions from API plugins to the given toolbar.
virtual void UpdateProperties()
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:100
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:541
void SetCurrentVariant(const wxString &aVariantName)
void AddVariant(const wxString &aVariantName)
wxString GetCurrentVariant() const
Return the current variant being edited.
void SetVariantDescription(const wxString &aVariantName, const wxString &aDescription)
Set the description for a variant.
static TOOL_ACTION showPcbNew
static TOOL_ACTION rotateCCW
static TOOL_ACTION placeClassLabel
Definition sch_actions.h:79
static TOOL_ACTION placeSheetPin
Definition sch_actions.h:85
static TOOL_ACTION assignFootprints
static TOOL_ACTION mirrorV
static TOOL_ACTION placeGlobalLabel
Definition sch_actions.h:80
static TOOL_ACTION editSymbolFields
static TOOL_ACTION drawEllipseArc
Definition sch_actions.h:98
static TOOL_ACTION drawTextBox
Definition sch_actions.h:93
static TOOL_ACTION toggleAnnotateAuto
static TOOL_ACTION syncAllSheetsPins
Definition sch_actions.h:91
static TOOL_ACTION drawArc
Definition sch_actions.h:99
static TOOL_ACTION drawSheet
Definition sch_actions.h:82
static TOOL_ACTION navigateBack
static TOOL_ACTION schematicSetup
static TOOL_ACTION highlightNetTool
static TOOL_ACTION drawRectangle
Definition sch_actions.h:95
static TOOL_ACTION drawLines
static TOOL_ACTION placeHierLabel
Definition sch_actions.h:81
static TOOL_ACTION drawEllipse
Definition sch_actions.h:97
static TOOL_ACTION placeLabel
Definition sch_actions.h:78
static TOOL_ACTION drawCircle
Definition sch_actions.h:96
static TOOL_ACTION placeBusWireEntry
Definition sch_actions.h:77
static TOOL_ACTION drawBezier
static TOOL_ACTION drawWire
Definition sch_actions.h:72
static TOOL_ACTION lineMode45
static TOOL_ACTION rotateCW
static TOOL_ACTION generateBOM
static TOOL_ACTION showHierarchy
static TOOL_ACTION placeJunction
Definition sch_actions.h:76
static TOOL_ACTION drawRuleArea
static TOOL_ACTION placeSymbol
Definition sch_actions.h:66
static TOOL_ACTION placeImage
static TOOL_ACTION navigateForward
static TOOL_ACTION mirrorH
static TOOL_ACTION showSimulator
static TOOL_ACTION drawBus
Definition sch_actions.h:73
static TOOL_ACTION runERC
Inspection and Editing.
static TOOL_ACTION drawTable
Definition sch_actions.h:94
static TOOL_ACTION lineMode90
static TOOL_ACTION placeSchematicText
Definition sch_actions.h:92
static TOOL_ACTION lineModeFree
static TOOL_ACTION annotate
static TOOL_ACTION placeNoConnect
Definition sch_actions.h:75
static TOOL_ACTION toggleHiddenPins
static TOOL_ACTION placePower
Definition sch_actions.h:68
static TOOL_ACTION navigateUp
static ACTION_TOOLBAR_CONTROL currentVariant
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
wxChoice * m_currentVariantCtrl
void SetCurrentVariant(const wxString &aVariantName)
void UpdateVariantSelectionCtrl(const wxArrayString &aVariantNames)
Update the variant name control on the main toolbar.
bool ShowAddVariantDialog()
Show a dialog to create a new variant with name and description.
void configureToolbars() override
void HardRedraw() override
Rebuild the GAL and redraw the screen.
PLUGIN_ACTION_SCOPE PluginActionScope() const override
SCHEMATIC & Schematic() const
void onVariantSelected(wxCommandEvent &aEvent)
void ClearToolbarControl(int aId) override
std::optional< TOOLBAR_CONFIGURATION > DefaultToolbarConfig(TOOLBAR_LOC aToolbar) override
Get the default tools to show on the specified canvas toolbar.
SCH_SELECTION & GetSelection()
virtual unsigned int GetSize() const override
Return the number of stored items.
Definition selection.h:105
EDA_ITEM * Front() const
Definition selection.h:177
TOOL_MANAGER * m_toolManager
Master controller class:
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
#define _(s)
@ ID_TOOLBAR_SCH_SELECT_VARAIANT
@ FRAME_SCH
Definition frame_type.h:34
PGM_BASE & Pgm()
The global program "get" accessor.
see class PGM_BASE
wxString GetDefaultVariantName()
@ RIGHT
Toolbar on the right side of the canvas.
@ LEFT
Toolbar on the left side of the canvas.
@ TOP_AUX
Toolbar on the top of the canvas.
@ TOP_MAIN
Toolbar on the top of the canvas.