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, see <https://www.gnu.org/licenses/>.
21 */
22
23#include <advanced_config.h>
25#include <sch_draw_panel.h>
26#include <sch_edit_frame.h>
27#include <kiface_base.h>
28#include <bitmaps.h>
29#include <eeschema_id.h>
30#include <pgm_base.h>
31#include <tool/action_menu.h>
32#include <tool/tool_manager.h>
34#include <tool/action_toolbar.h>
36#include <widgets/wx_infobar.h>
37#include <tools/sch_actions.h>
44#include <toolbars_sch_editor.h>
45#include <wx/choice.h>
46#include <wx/stattext.h>
47
48
50 _( "Current variant" ),
51 _( "Selects the current schematic variant" ),
52 { FRAME_SCH } );
53
54
55std::optional<TOOLBAR_CONFIGURATION> SCH_EDIT_TOOLBAR_SETTINGS::DefaultToolbarConfig( TOOLBAR_LOC aToolbar )
56{
58
59 // clang-format off
60 switch( aToolbar )
61 {
63 return std::nullopt;
64
66 config.AppendAction( ACTIONS::toggleGrid )
67 .WithContextMenu(
68 []( TOOL_MANAGER* aToolMgr )
69 {
70 SCH_SELECTION_TOOL* selTool = aToolMgr->GetTool<SCH_SELECTION_TOOL>();
71 auto menu = std::make_unique<ACTION_MENU>( false, selTool );
72 menu->Add( ACTIONS::gridProperties );
73 return menu;
74 } )
75 .AppendAction( ACTIONS::toggleGridOverrides )
76 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Units" ) )
77 .AddAction( ACTIONS::inchesUnits )
78 .AddAction( ACTIONS::milsUnits )
79 .AddAction( ACTIONS::millimetersUnits ) )
80 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) )
83 .AddAction( ACTIONS::cursor45Crosshairs ) );
84
85 config.AppendSeparator()
86 .AppendAction( SCH_ACTIONS::toggleHiddenPins );
87
88 config.AppendSeparator()
89 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Line modes" ) )
90 .AddAction( SCH_ACTIONS::lineModeFree )
91 .AddAction( SCH_ACTIONS::lineMode90 )
92 .AddAction( SCH_ACTIONS::lineMode45 ) );
93
94 config.AppendSeparator()
95 .AppendAction( SCH_ACTIONS::toggleAnnotateAuto );
96
97 config.AppendSeparator()
98 .AppendAction( SCH_ACTIONS::showHierarchy )
99 .AppendAction( ACTIONS::showProperties );
100
101 if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
102 config.AppendAction( ACTIONS::toggleBoundingBoxes );
103
104 break;
105
107 config.AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Selection modes" ) )
108 .AddAction( ACTIONS::selectSetRect )
109 .AddAction( ACTIONS::selectSetLasso ) )
110 .AppendAction( SCH_ACTIONS::highlightNetTool );
111
112 config.AppendSeparator()
113 .AppendAction( SCH_ACTIONS::placeSymbol )
114 .AppendAction( SCH_ACTIONS::placePower )
115 .AppendAction( SCH_ACTIONS::drawWire )
116 .AppendAction( SCH_ACTIONS::drawBus )
117 .AppendAction( SCH_ACTIONS::placeBusWireEntry )
118 .AppendAction( SCH_ACTIONS::placeNoConnect )
119 .AppendAction( SCH_ACTIONS::placeJunction )
120 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Labels" ) )
121 .AddAction( SCH_ACTIONS::placeLabel )
122 .AddAction( SCH_ACTIONS::placeClassLabel )
124 .AddAction( SCH_ACTIONS::placeHierLabel ) )
125 .AppendAction( SCH_ACTIONS::drawRuleArea )
126 .AppendAction( SCH_ACTIONS::drawSheet )
127 .AppendAction( SCH_ACTIONS::placeSheetPin )
128 .AppendAction( SCH_ACTIONS::syncAllSheetsPins );
129
130 config.AppendSeparator()
131 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Text objects" ) )
133 .AddAction( SCH_ACTIONS::drawTextBox ) )
134 .AppendAction( SCH_ACTIONS::drawTable )
135 .AppendAction( SCH_ACTIONS::drawRectangle )
136 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Circle" ) )
137 .AddAction( SCH_ACTIONS::drawCircle )
138 .AddAction( SCH_ACTIONS::drawEllipse ) )
139 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Arc" ) )
140 .AddAction( SCH_ACTIONS::drawArc )
141 .AddAction( SCH_ACTIONS::drawEllipseArc ) )
142 .AppendAction( SCH_ACTIONS::drawBezier )
143 .AppendAction( SCH_ACTIONS::drawLines )
144 .AppendAction( SCH_ACTIONS::placeImage )
145 .AppendAction( ACTIONS::deleteTool );
146
147 break;
148
150 if( Kiface().IsSingle() ) // not when under a project mgr
151 {
152 config.AppendAction( ACTIONS::doNew );
153 config.AppendAction( ACTIONS::open );
154 }
155
156 config.AppendAction( ACTIONS::save );
157
158 config.AppendSeparator()
159 .AppendAction( SCH_ACTIONS::schematicSetup );
160
161 config.AppendSeparator()
162 .AppendAction( ACTIONS::pageSettings )
163 .AppendAction( ACTIONS::print )
164 .AppendAction( ACTIONS::plot );
165
166 config.AppendSeparator()
167 .AppendAction( ACTIONS::paste );
168
169 config.AppendSeparator()
170 .AppendAction( ACTIONS::undo )
171 .AppendAction( ACTIONS::redo );
172
173 config.AppendSeparator()
174 .AppendAction( ACTIONS::find )
175 .AppendAction( ACTIONS::findAndReplace );
176
177 config.AppendSeparator()
178 .AppendAction( ACTIONS::zoomRedraw )
179 .AppendAction( ACTIONS::zoomInCenter )
180 .AppendAction( ACTIONS::zoomOutCenter )
181 .AppendAction( ACTIONS::zoomFitScreen )
182 .AppendAction( ACTIONS::zoomFitObjects )
183 .AppendAction( ACTIONS::zoomTool );
184
185 config.AppendSeparator()
186 .AppendAction( SCH_ACTIONS::navigateBack )
187 .AppendAction( SCH_ACTIONS::navigateUp )
188 .AppendAction( SCH_ACTIONS::navigateForward );
189
190 config.AppendSeparator()
191 .AppendAction( SCH_ACTIONS::rotateCCW )
192 .AppendAction( SCH_ACTIONS::rotateCW )
193 .AppendAction( SCH_ACTIONS::mirrorV )
194 .AppendAction( SCH_ACTIONS::mirrorH )
195 .AppendAction( ACTIONS::group )
196 .AppendAction( ACTIONS::ungroup );
197
198 config.AppendSeparator()
199 .AppendAction( ACTIONS::showSymbolEditor )
200 .AppendAction( ACTIONS::showSymbolBrowser )
201 .AppendAction( ACTIONS::showFootprintEditor );
202
203 config.AppendSeparator()
204 .AppendAction( SCH_ACTIONS::annotate )
205 .AppendAction( SCH_ACTIONS::runERC )
206 .AppendAction( SCH_ACTIONS::showSimulator )
207 .AppendAction( SCH_ACTIONS::assignFootprints )
208 .AppendAction( SCH_ACTIONS::editSymbolFields )
209 .AppendAction( SCH_ACTIONS::generateBOM );
210
211 config.AppendSeparator()
212 .AppendAction( SCH_ACTIONS::showPcbNew );
213
215
216 // Insert all the IPC plugins here on the toolbar
217 // TODO (ISM): Move this to individual actions for each script
219
221
222 break;
223 }
224
225 // clang-format on
226 return config;
227}
228
229
231{
233
234 // Variant selection drop down control on main tool bar.
235 auto variantSelectionCtrlFactory =
236 [this]( ACTION_TOOLBAR* aToolbar )
237 {
238 std::optional<wxString> currentVariantName = Schematic().GetCurrentVariant();
239 wxString tmp = currentVariantName ? *currentVariantName : GetDefaultVariantName();
240
241 m_currentVariantCtrl = new wxChoice( aToolbar, ID_TOOLBAR_SCH_SELECT_VARAIANT, wxDefaultPosition,
242 wxDefaultSize, Schematic().GetVariantNamesForUI(), 0,
243 wxDefaultValidator, tmp );
244
245 m_currentVariantCtrl->SetToolTip( _( "Select the current variant to display and edit." ) );
246 aToolbar->Add( m_currentVariantCtrl );
247 UpdateVariantSelectionCtrl( Schematic().GetVariantNamesForUI() );
248 };
249
251
252 // IPC/Scripting plugin control
253 // TODO (ISM): Clean this up to make IPC actions just normal tool actions to get rid of this entire
254 // control
255 auto pluginControlFactory =
256 [this]( ACTION_TOOLBAR* aToolbar )
257 {
258
259 bool haveApiPlugins = Pgm().GetCommonSettings()->m_Api.enable_server
261
262 if( haveApiPlugins )
263 {
264 aToolbar->AddScaledSeparator( aToolbar->GetParent() );
265 AddApiPluginTools( aToolbar );
266 }
267 };
268
270}
271
272
274{
276
277 switch( aId )
278 {
280 }
281}
282
283
284void SCH_EDIT_FRAME::UpdateVariantSelectionCtrl( const wxArrayString& aVariantNames )
285{
287 return;
288
289 // Fall back to the default if nothing is currently selected.
290 wxString currentSelection = GetDefaultVariantName();
291 int selectionIndex = m_currentVariantCtrl->GetSelection();
292
293 if( selectionIndex != wxNOT_FOUND )
294 currentSelection = m_currentVariantCtrl->GetString( selectionIndex );
295
296 // Add all variant names, a separator, and "Add New Variant..." at the end
297 wxArrayString contents = aVariantNames;
298 contents.Add( wxS( "---" ) );
299 contents.Add( _( "Add New Design Variant..." ) );
300
301 m_currentVariantCtrl->Set( contents );
302
303 selectionIndex = m_currentVariantCtrl->FindString( currentSelection );
304
305 if( ( selectionIndex == wxNOT_FOUND ) && ( m_currentVariantCtrl->GetCount() != 0 ) )
306 selectionIndex = 0;
307
308 m_currentVariantCtrl->SetSelection( selectionIndex );
309}
310
311
312void SCH_EDIT_FRAME::onVariantSelected( wxCommandEvent& aEvent )
313{
314 if( aEvent.GetId() != ID_TOOLBAR_SCH_SELECT_VARAIANT )
315 return;
316
317 wxCHECK( m_currentVariantCtrl, /* void */ );
318
319 int selection = m_currentVariantCtrl->GetSelection();
320 int count = m_currentVariantCtrl->GetCount();
321
322 if( selection == wxNOT_FOUND || count == 0 )
323 return;
324
325 // "Add New Variant..." is always the last item, separator is second-to-last
326 if( selection == count - 1 )
327 {
328 // Restore previous selection before showing dialog
329 int previousSelection = m_currentVariantCtrl->FindString(
330 Schematic().GetCurrentVariant().IsEmpty() ? GetDefaultVariantName()
331 : Schematic().GetCurrentVariant() );
332
333 if( previousSelection != wxNOT_FOUND )
334 m_currentVariantCtrl->SetSelection( previousSelection );
335
337 return;
338 }
339
340 // Separator line - ignore selection
341 if( selection == count - 2 )
342 {
343 int previousSelection = m_currentVariantCtrl->FindString(
344 Schematic().GetCurrentVariant().IsEmpty() ? GetDefaultVariantName()
345 : Schematic().GetCurrentVariant() );
346
347 if( previousSelection != wxNOT_FOUND )
348 m_currentVariantCtrl->SetSelection( previousSelection );
349
350 return;
351 }
352
353 wxString selectedString = m_currentVariantCtrl->GetString( selection );
354 wxString selectedVariant;
355
356 if( selectedString != GetDefaultVariantName() )
357 selectedVariant = selectedString;
358
359 Schematic().SetCurrentVariant( selectedVariant );
361 HardRedraw();
362
363 // Refresh message panel for current selection
365
366 if( selTool )
367 {
368 SCH_SELECTION& sub_sel = selTool->GetSelection();
369
370 if( sub_sel.GetSize() == 1 )
371 SetMsgPanel( static_cast<EDA_ITEM*>( sub_sel.Front() ) );
372 }
373}
374
375
377{
378 if( !aParent )
379 aParent = this;
380
381 // Create a dialog with both name and description fields
382 wxDialog dlg( aParent, wxID_ANY, _( "New Design Variant" ), wxDefaultPosition, wxDefaultSize,
383 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
384
385 wxBoxSizer* mainSizer = new wxBoxSizer( wxVERTICAL );
386
387 // Name field
388 wxStaticText* nameLabel = new wxStaticText( &dlg, wxID_ANY, _( "Variant name:" ) );
389 mainSizer->Add( nameLabel, 0, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 10 );
390
391 mainSizer->AddSpacer( 3 );
392
393 wxTextCtrl* nameCtrl = new wxTextCtrl( &dlg, wxID_ANY );
394 mainSizer->Add( nameCtrl, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 10 );
395
396 // Description field
397 wxStaticText* descLabel = new wxStaticText( &dlg, wxID_ANY, _( "Description (optional):" ) );
398 mainSizer->Add( descLabel, 0, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 10 );
399
400 mainSizer->AddSpacer( 3 );
401
402 wxTextCtrl* descCtrl = new wxTextCtrl( &dlg, wxID_ANY, wxEmptyString, wxDefaultPosition,
403 wxSize( 300, 60 ), wxTE_MULTILINE );
404 mainSizer->Add( descCtrl, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 10 );
405
406 // Buttons
407 wxStdDialogButtonSizer* btnSizer = new wxStdDialogButtonSizer();
408 btnSizer->AddButton( new wxButton( &dlg, wxID_OK ) );
409 btnSizer->AddButton( new wxButton( &dlg, wxID_CANCEL ) );
410 btnSizer->Realize();
411 mainSizer->Add( btnSizer, 0, wxALL | wxALIGN_RIGHT, 5 );
412
413 dlg.SetSizer( mainSizer );
414 dlg.Fit();
415 dlg.Centre();
416 nameLabel->SetFocus();
417
418 if( dlg.ShowModal() == wxID_CANCEL )
419 return false;
420
421 wxString variantName = nameCtrl->GetValue().Trim().Trim( false );
422 wxString variantDesc = descCtrl->GetValue().Trim().Trim( false );
423
424 // Empty strings, reserved names, and duplicate variant names are not allowed.
425 if( variantName.IsEmpty() )
426 {
427 GetInfoBar()->ShowMessageFor( _( "Variant name cannot be empty." ), 10000, wxICON_ERROR );
428 return false;
429 }
430
431 // Check for reserved name (case-insensitive)
432 if( variantName.CmpNoCase( GetDefaultVariantName() ) == 0 )
433 {
434 GetInfoBar()->ShowMessageFor( wxString::Format( _( "'%s' is a reserved variant name." ),
436 10000, wxICON_ERROR );
437 return false;
438 }
439
440 // Check for duplicate variant names (case-insensitive)
441 for( const wxString& existingName : Schematic().GetVariantNames() )
442 {
443 if( existingName.CmpNoCase( variantName ) == 0 )
444 {
445 GetInfoBar()->ShowMessageFor( wxString::Format( _( "Variant '%s' already exists." ),
446 existingName ),
447 10000, wxICON_ERROR );
448 return false;
449 }
450 }
451
452 // Add variant to the schematic
453 Schematic().AddVariant( variantName );
454
455 if( !variantDesc.IsEmpty() )
456 Schematic().SetVariantDescription( variantName, variantDesc );
457
458 // Update the variant selector and select the new variant
459 UpdateVariantSelectionCtrl( Schematic().GetVariantNamesForUI() );
460 SetCurrentVariant( variantName );
461 OnModify();
462 return true;
463}
464
465
466void SCH_EDIT_FRAME::SetCurrentVariant( const wxString& aVariantName )
467{
469 return;
470
471 wxString name = aVariantName.IsEmpty() ? GetDefaultVariantName() : aVariantName;
472
473 int newSelection = m_currentVariantCtrl->FindString( name );
474
475 if( newSelection == wxNOT_FOUND )
476 return;
477
478 int currentSelection = m_currentVariantCtrl->GetSelection();
479
480 wxString selectedString;
481
482 if( currentSelection != wxNOT_FOUND )
483 selectedString = m_currentVariantCtrl->GetString( currentSelection );
484
485 if( selectedString != name )
486 {
487 m_currentVariantCtrl->SetSelection( newSelection );
488 Schematic().SetCurrentVariant( aVariantName );
489
491 HardRedraw();
492 }
493}
const char * name
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static TOOL_ACTION gridProperties
Definition actions.h:196
static TOOL_ACTION toggleGrid
Definition actions.h:194
static TOOL_ACTION paste
Definition actions.h:76
static TOOL_ACTION zoomRedraw
Definition actions.h:128
static TOOL_ACTION millimetersUnits
Definition actions.h:202
static TOOL_ACTION cursorSmallCrosshairs
Definition actions.h:148
static TOOL_ACTION zoomOutCenter
Definition actions.h:132
static TOOL_ACTION selectSetLasso
Definition actions.h:217
static TOOL_ACTION selectSetRect
Set lasso selection mode.
Definition actions.h:216
static TOOL_ACTION group
Definition actions.h:235
static TOOL_ACTION showSymbolEditor
Definition actions.h:256
static TOOL_ACTION showSymbolBrowser
Definition actions.h:255
static TOOL_ACTION findAndReplace
Definition actions.h:114
static TOOL_ACTION milsUnits
Definition actions.h:201
static TOOL_ACTION ungroup
Definition actions.h:236
static TOOL_ACTION toggleBoundingBoxes
Definition actions.h:153
static TOOL_ACTION plot
Definition actions.h:61
static TOOL_ACTION open
Definition actions.h:53
static TOOL_ACTION pageSettings
Definition actions.h:59
static TOOL_ACTION undo
Definition actions.h:71
static TOOL_ACTION inchesUnits
Definition actions.h:200
static TOOL_ACTION save
Definition actions.h:54
static TOOL_ACTION zoomFitScreen
Definition actions.h:138
static TOOL_ACTION redo
Definition actions.h:72
static TOOL_ACTION deleteTool
Definition actions.h:82
static TOOL_ACTION zoomTool
Definition actions.h:142
static TOOL_ACTION cursor45Crosshairs
Definition actions.h:150
static TOOL_ACTION showFootprintEditor
Definition actions.h:258
static TOOL_ACTION print
Definition actions.h:60
static TOOL_ACTION showProperties
Definition actions.h:262
static TOOL_ACTION doNew
Definition actions.h:50
static TOOL_ACTION zoomFitObjects
Definition actions.h:139
static TOOL_ACTION zoomInCenter
Definition actions.h:131
static TOOL_ACTION toggleGridOverrides
Definition actions.h:195
static TOOL_ACTION cursorFullCrosshairs
Definition actions.h:149
static TOOL_ACTION find
Definition actions.h:113
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.
std::vector< const PLUGIN_ACTION * > GetActionsForScope(PLUGIN_ACTION_SCOPE aScope)
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:96
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:562
virtual API_PLUGIN_MANAGER & GetPluginManager() const
Definition pgm_base.h:140
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:75
static TOOL_ACTION placeSheetPin
Definition sch_actions.h:81
static TOOL_ACTION assignFootprints
static TOOL_ACTION mirrorV
static TOOL_ACTION placeGlobalLabel
Definition sch_actions.h:76
static TOOL_ACTION editSymbolFields
static TOOL_ACTION drawEllipseArc
Definition sch_actions.h:94
static TOOL_ACTION drawTextBox
Definition sch_actions.h:89
static TOOL_ACTION toggleAnnotateAuto
static TOOL_ACTION syncAllSheetsPins
Definition sch_actions.h:87
static TOOL_ACTION drawArc
Definition sch_actions.h:95
static TOOL_ACTION drawSheet
Definition sch_actions.h:78
static TOOL_ACTION navigateBack
static TOOL_ACTION schematicSetup
static TOOL_ACTION highlightNetTool
static TOOL_ACTION drawRectangle
Definition sch_actions.h:91
static TOOL_ACTION drawLines
Definition sch_actions.h:97
static TOOL_ACTION placeHierLabel
Definition sch_actions.h:77
static TOOL_ACTION drawEllipse
Definition sch_actions.h:93
static TOOL_ACTION placeLabel
Definition sch_actions.h:74
static TOOL_ACTION drawCircle
Definition sch_actions.h:92
static TOOL_ACTION placeBusWireEntry
Definition sch_actions.h:73
static TOOL_ACTION drawBezier
Definition sch_actions.h:96
static TOOL_ACTION drawWire
Definition sch_actions.h:68
static TOOL_ACTION lineMode45
static TOOL_ACTION rotateCW
static TOOL_ACTION generateBOM
static TOOL_ACTION showHierarchy
static TOOL_ACTION placeJunction
Definition sch_actions.h:72
static TOOL_ACTION drawRuleArea
static TOOL_ACTION placeSymbol
Definition sch_actions.h:62
static TOOL_ACTION placeImage
Definition sch_actions.h:98
static TOOL_ACTION navigateForward
static TOOL_ACTION mirrorH
static TOOL_ACTION showSimulator
static TOOL_ACTION drawBus
Definition sch_actions.h:69
static TOOL_ACTION runERC
Inspection and Editing.
static TOOL_ACTION drawTable
Definition sch_actions.h:90
static TOOL_ACTION lineMode90
static TOOL_ACTION placeSchematicText
Definition sch_actions.h:88
static TOOL_ACTION lineModeFree
static TOOL_ACTION annotate
static TOOL_ACTION placeNoConnect
Definition sch_actions.h:71
static TOOL_ACTION toggleHiddenPins
static TOOL_ACTION placePower
Definition sch_actions.h:64
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.
void configureToolbars() override
void HardRedraw() override
Rebuild the GAL and redraw the screen.
PLUGIN_ACTION_SCOPE PluginActionScope() const override
SCHEMATIC & Schematic() const
bool ShowAddVariantDialog(wxWindow *aParent=nullptr)
Show a dialog to create a new variant with name and description.
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:104
EDA_ITEM * Front() const
Definition selection.h:176
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:30
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.