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>
26#include <sch_draw_panel.h>
27#include <sch_edit_frame.h>
29#include <kiface_base.h>
30#include <bitmaps.h>
31#include <eeschema_id.h>
32#include <pgm_base.h>
33#include <tool/action_menu.h>
34#include <tool/tool_manager.h>
36#include <tool/action_toolbar.h>
38#include <widgets/wx_infobar.h>
39#include <tools/sch_actions.h>
46#include <toolbars_sch_editor.h>
47#include <wx/choice.h>
48#include <wx/stattext.h>
49
50
52 _( "Current variant" ),
53 _( "Selects the current schematic variant" ),
54 { FRAME_SCH } );
55
56
57std::optional<TOOLBAR_CONFIGURATION> SCH_EDIT_TOOLBAR_SETTINGS::DefaultToolbarConfig( TOOLBAR_LOC aToolbar )
58{
60
61 // clang-format off
62 switch( aToolbar )
63 {
65 return std::nullopt;
66
68 config.AppendAction( ACTIONS::toggleGrid )
69 .WithContextMenu(
70 []( TOOL_MANAGER* aToolMgr )
71 {
72 SCH_SELECTION_TOOL* selTool = aToolMgr->GetTool<SCH_SELECTION_TOOL>();
73 auto menu = std::make_unique<ACTION_MENU>( false, selTool );
74 menu->Add( ACTIONS::gridProperties );
75 return menu;
76 } )
77 .AppendAction( ACTIONS::toggleGridOverrides )
78 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Units" ) )
79 .AddAction( ACTIONS::inchesUnits )
80 .AddAction( ACTIONS::milsUnits )
81 .AddAction( ACTIONS::millimetersUnits ) )
82 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) )
85 .AddAction( ACTIONS::cursor45Crosshairs ) );
86
87 config.AppendSeparator()
88 .AppendAction( SCH_ACTIONS::toggleHiddenPins );
89
90 config.AppendSeparator()
91 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Line modes" ) )
92 .AddAction( SCH_ACTIONS::lineModeFree )
93 .AddAction( SCH_ACTIONS::lineMode90 )
94 .AddAction( SCH_ACTIONS::lineMode45 ) );
95
96 config.AppendSeparator()
97 .AppendAction( SCH_ACTIONS::toggleAnnotateAuto );
98
99 config.AppendSeparator()
100 .AppendAction( SCH_ACTIONS::showHierarchy )
101 .AppendAction( ACTIONS::showProperties );
102
103 if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
104 config.AppendAction( ACTIONS::toggleBoundingBoxes );
105
106 break;
107
109 config.AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Selection modes" ) )
110 .AddAction( ACTIONS::selectSetRect )
111 .AddAction( ACTIONS::selectSetLasso ) )
112 .AppendAction( SCH_ACTIONS::highlightNetTool );
113
114 config.AppendSeparator()
115 .AppendAction( SCH_ACTIONS::placeSymbol )
116 .AppendAction( SCH_ACTIONS::placePower )
117 .AppendAction( SCH_ACTIONS::drawWire )
118 .AppendAction( SCH_ACTIONS::drawBus )
119 .AppendAction( SCH_ACTIONS::placeBusWireEntry )
120 .AppendAction( SCH_ACTIONS::placeNoConnect )
121 .AppendAction( SCH_ACTIONS::placeJunction )
122 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Labels" ) )
123 .AddAction( SCH_ACTIONS::placeLabel )
124 .AddAction( SCH_ACTIONS::placeClassLabel )
126 .AddAction( SCH_ACTIONS::placeHierLabel ) )
127 .AppendAction( SCH_ACTIONS::drawRuleArea )
128 .AppendAction( SCH_ACTIONS::drawSheet )
129 .AppendAction( SCH_ACTIONS::placeSheetPin )
130 .AppendAction( SCH_ACTIONS::syncAllSheetsPins );
131
132 config.AppendSeparator()
133 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Text objects" ) )
135 .AddAction( SCH_ACTIONS::drawTextBox ) )
136 .AppendAction( SCH_ACTIONS::drawTable )
137 .AppendAction( SCH_ACTIONS::drawRectangle )
138 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Circle" ) )
139 .AddAction( SCH_ACTIONS::drawCircle )
140 .AddAction( SCH_ACTIONS::drawEllipse ) )
141 .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Arc" ) )
142 .AddAction( SCH_ACTIONS::drawArcCenter )
145 .AddAction( SCH_ACTIONS::drawArcTangent )
147 .AddAction( SCH_ACTIONS::drawEllipseArc ) )
148 .AppendAction( SCH_ACTIONS::drawBezier )
149 .AppendAction( SCH_ACTIONS::drawPolygon )
150 .AppendAction( SCH_ACTIONS::drawLines )
151 .AppendAction( SCH_ACTIONS::placeImage )
152 .AppendAction( ACTIONS::deleteTool );
153
154 break;
155
157 if( Kiface().IsSingle() ) // not when under a project mgr
158 {
159 config.AppendAction( ACTIONS::doNew );
160 config.AppendAction( ACTIONS::open );
161 }
162
163 config.AppendAction( ACTIONS::save );
164
165 config.AppendSeparator()
166 .AppendAction( SCH_ACTIONS::schematicSetup );
167
168 config.AppendSeparator()
169 .AppendAction( ACTIONS::pageSettings )
170 .AppendAction( ACTIONS::print )
171 .AppendAction( ACTIONS::plot );
172
173 config.AppendSeparator()
174 .AppendAction( ACTIONS::paste );
175
176 config.AppendSeparator()
177 .AppendAction( ACTIONS::undo )
178 .AppendAction( ACTIONS::redo );
179
180 config.AppendSeparator()
181 .AppendAction( ACTIONS::find )
182 .AppendAction( ACTIONS::findAndReplace );
183
184 config.AppendSeparator()
185 .AppendAction( ACTIONS::zoomRedraw )
186 .AppendAction( ACTIONS::zoomInCenter )
187 .AppendAction( ACTIONS::zoomOutCenter )
188 .AppendAction( ACTIONS::zoomFitScreen )
189 .AppendAction( ACTIONS::zoomFitObjects )
190 .AppendAction( ACTIONS::zoomTool );
191
192 config.AppendSeparator()
193 .AppendAction( SCH_ACTIONS::navigateBack )
194 .AppendAction( SCH_ACTIONS::navigateUp )
195 .AppendAction( SCH_ACTIONS::navigateForward );
196
197 config.AppendSeparator()
198 .AppendAction( SCH_ACTIONS::rotateCCW )
199 .AppendAction( SCH_ACTIONS::rotateCW )
200 .AppendAction( SCH_ACTIONS::mirrorV )
201 .AppendAction( SCH_ACTIONS::mirrorH )
202 .AppendAction( ACTIONS::group )
203 .AppendAction( ACTIONS::ungroup );
204
205 config.AppendSeparator()
206 .AppendAction( ACTIONS::showSymbolEditor )
207 .AppendAction( ACTIONS::showSymbolBrowser )
208 .AppendAction( ACTIONS::showFootprintEditor );
209
210 config.AppendSeparator()
211 .AppendAction( SCH_ACTIONS::annotate )
212 .AppendAction( SCH_ACTIONS::runERC )
213 .AppendAction( SCH_ACTIONS::showSimulator )
214 .AppendAction( SCH_ACTIONS::assignFootprints )
215 .AppendAction( SCH_ACTIONS::editSymbolFields )
216 .AppendAction( SCH_ACTIONS::generateBOM );
217
218 config.AppendSeparator()
219 .AppendAction( SCH_ACTIONS::showPcbNew );
220
222
223 // Insert all the IPC plugins here on the toolbar
224 // TODO (ISM): Move this to individual actions for each script
226
228
229 break;
230 }
231
232 // clang-format on
233 return config;
234}
235
236
238{
240
241 // Variant selection drop down control on main tool bar.
242 auto variantSelectionCtrlFactory =
243 [this]( ACTION_TOOLBAR* aToolbar )
244 {
245 std::optional<wxString> currentVariantName = Schematic().GetCurrentVariant();
246 wxString tmp = currentVariantName ? *currentVariantName : GetDefaultVariantName();
247
248 m_currentVariantCtrl = new wxChoice( aToolbar, ID_TOOLBAR_SCH_SELECT_VARAIANT, wxDefaultPosition,
249 wxDefaultSize, Schematic().GetVariantNamesForUI(), 0,
250 wxDefaultValidator, tmp );
251
252 m_currentVariantCtrl->SetToolTip( _( "Select the current variant to display and edit." ) );
253 aToolbar->Add( m_currentVariantCtrl );
255 };
256
258
259 // IPC/Scripting plugin control
260 // TODO (ISM): Clean this up to make IPC actions just normal tool actions to get rid of this entire
261 // control
262 auto pluginControlFactory =
263 [this]( ACTION_TOOLBAR* aToolbar )
264 {
265
266 bool haveApiPlugins = Pgm().GetCommonSettings()->m_Api.enable_server
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
292{
294 {
295 // Add all variant names, a separator, and "Add New Variant..." at the end
296 wxArrayString contents = Schematic().GetVariantNamesForUI();
297 contents.Add( wxS( "---" ) );
298 contents.Add( _( "Add New Design Variant..." ) );
299
300 m_currentVariantCtrl->Set( contents );
302 }
303
305 m_symbolFieldsTableDialog->ReloadVariants();
306}
307
308
310{
311 // Variant names are case sensitive, but the choice's own string lookup is not. The schematic
312 // falls back to the default for a name it does not have.
313 int selection = m_currentVariantCtrl->FindString( Schematic().GetCurrentVariant(), true );
314 m_currentVariantCtrl->SetSelection( selection == wxNOT_FOUND ? 0 : selection );
315}
316
317
318void SCH_EDIT_FRAME::onVariantSelected( wxCommandEvent& aEvent )
319{
320 if( aEvent.GetId() != ID_TOOLBAR_SCH_SELECT_VARAIANT )
321 return;
322
323 wxCHECK( m_currentVariantCtrl, /* void */ );
324
325 int selection = m_currentVariantCtrl->GetSelection();
326 int count = m_currentVariantCtrl->GetCount();
327
328 if( selection == wxNOT_FOUND || count == 0 )
329 return;
330
331 // "Add New Variant..." is always the last item, separator is second-to-last
332 if( selection == count - 1 )
333 {
334 // Restore previous selection before showing dialog
335 int previousSelection = m_currentVariantCtrl->FindString(
336 Schematic().GetCurrentVariant().IsEmpty() ? GetDefaultVariantName()
337 : Schematic().GetCurrentVariant() );
338
339 if( previousSelection != wxNOT_FOUND )
340 m_currentVariantCtrl->SetSelection( previousSelection );
341
343 return;
344 }
345
346 // Separator line - ignore selection
347 if( selection == count - 2 )
348 {
349 int previousSelection = m_currentVariantCtrl->FindString(
350 Schematic().GetCurrentVariant().IsEmpty() ? GetDefaultVariantName()
351 : Schematic().GetCurrentVariant() );
352
353 if( previousSelection != wxNOT_FOUND )
354 m_currentVariantCtrl->SetSelection( previousSelection );
355
356 return;
357 }
358
359 wxString selectedString = m_currentVariantCtrl->GetString( selection );
360 wxString selectedVariant;
361
362 if( selectedString != GetDefaultVariantName() )
363 selectedVariant = selectedString;
364
365 SetCurrentVariant( selectedVariant );
366
367 // Refresh message panel for current selection
369
370 if( selTool )
371 {
372 SCH_SELECTION& sub_sel = selTool->GetSelection();
373
374 if( sub_sel.GetSize() == 1 )
375 SetMsgPanel( static_cast<EDA_ITEM*>( sub_sel.Front() ) );
376 }
377}
378
379
381{
382 if( !aParent )
383 aParent = this;
384
385 // Create a dialog with both name and description fields
386 wxDialog dlg( aParent, 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 if( !ValidateNewVariantName( variantName, wxEmptyString ) )
429 return false;
430
431 // Add variant to the schematic
432
434
435 Schematic().AddVariant( variantName );
436
437 if( !variantDesc.IsEmpty() )
438 Schematic().SetVariantDescription( variantName, variantDesc );
439
440 PICKED_ITEMS_LIST undoCmd;
441 undoCmd.PushItem( ITEM_PICKER( GetScreen(), undoItem, UNDO_REDO::VARIANTS ) );
442 undoCmd.SetDescription( _( "Add Variant" ) );
443 SaveCopyInUndoList( undoCmd, UNDO_REDO::VARIANTS, false /* append */ );
444
445 // Update the variant selector and select the new variant
447 SetCurrentVariant( variantName );
448 OnModify();
449 return true;
450}
451
452
453void SCH_EDIT_FRAME::SetCurrentVariant( const wxString& aVariantName )
454{
455 Schematic().SetCurrentVariant( aVariantName );
456
459
461 m_symbolFieldsTableDialog->FollowCurrentVariant();
462
464 HardRedraw();
465}
static TOOL_ACTION gridProperties
Definition actions.h:197
static TOOL_ACTION toggleGrid
Definition actions.h:195
static TOOL_ACTION paste
Definition actions.h:77
static TOOL_ACTION zoomRedraw
Definition actions.h:129
static TOOL_ACTION millimetersUnits
Definition actions.h:203
static TOOL_ACTION cursorSmallCrosshairs
Definition actions.h:149
static TOOL_ACTION zoomOutCenter
Definition actions.h:133
static TOOL_ACTION selectSetLasso
Definition actions.h:218
static TOOL_ACTION selectSetRect
Set lasso selection mode.
Definition actions.h:217
static TOOL_ACTION group
Definition actions.h:236
static TOOL_ACTION showSymbolEditor
Definition actions.h:257
static TOOL_ACTION showSymbolBrowser
Definition actions.h:256
static TOOL_ACTION findAndReplace
Definition actions.h:115
static TOOL_ACTION milsUnits
Definition actions.h:202
static TOOL_ACTION ungroup
Definition actions.h:237
static TOOL_ACTION toggleBoundingBoxes
Definition actions.h:154
static TOOL_ACTION plot
Definition actions.h:62
static TOOL_ACTION open
Definition actions.h:53
static TOOL_ACTION pageSettings
Definition actions.h:59
static TOOL_ACTION undo
Definition actions.h:72
static TOOL_ACTION inchesUnits
Definition actions.h:201
static TOOL_ACTION save
Definition actions.h:54
static TOOL_ACTION zoomFitScreen
Definition actions.h:139
static TOOL_ACTION redo
Definition actions.h:73
static TOOL_ACTION deleteTool
Definition actions.h:83
static TOOL_ACTION zoomTool
Definition actions.h:143
static TOOL_ACTION cursor45Crosshairs
Definition actions.h:151
static TOOL_ACTION showFootprintEditor
Definition actions.h:259
static TOOL_ACTION print
Definition actions.h:61
static TOOL_ACTION showProperties
Definition actions.h:263
static TOOL_ACTION doNew
Definition actions.h:50
static TOOL_ACTION zoomFitObjects
Definition actions.h:140
static TOOL_ACTION zoomInCenter
Definition actions.h:132
static TOOL_ACTION toggleGridOverrides
Definition actions.h:196
static TOOL_ACTION cursorFullCrosshairs
Definition actions.h:150
static TOOL_ACTION find
Definition actions.h:114
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()
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:98
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:600
virtual API_PLUGIN_MANAGER & GetPluginManager() const
Definition pgm_base.h:140
A holder to handle information on schematic or board items.
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
void SetDescription(const wxString &aDescription)
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.
wxArrayString GetVariantNamesForUI() const
Return an array of variant names for using in wxWidgets UI controls.
static TOOL_ACTION showPcbNew
static TOOL_ACTION rotateCCW
static TOOL_ACTION placeClassLabel
Definition sch_actions.h:85
static TOOL_ACTION placeSheetPin
Definition sch_actions.h:91
static TOOL_ACTION drawArcCenter
static TOOL_ACTION drawArcStartEndCenter
static TOOL_ACTION assignFootprints
static TOOL_ACTION mirrorV
static TOOL_ACTION placeGlobalLabel
Definition sch_actions.h:86
static TOOL_ACTION editSymbolFields
static TOOL_ACTION drawEllipseArc
static TOOL_ACTION drawTextBox
Definition sch_actions.h:99
static TOOL_ACTION toggleAnnotateAuto
static TOOL_ACTION syncAllSheetsPins
Definition sch_actions.h:97
static TOOL_ACTION drawSheet
Definition sch_actions.h:88
static TOOL_ACTION navigateBack
static TOOL_ACTION schematicSetup
static TOOL_ACTION highlightNetTool
static TOOL_ACTION drawRectangle
static TOOL_ACTION drawLines
static TOOL_ACTION placeHierLabel
Definition sch_actions.h:87
static TOOL_ACTION drawEllipse
static TOOL_ACTION placeLabel
Definition sch_actions.h:84
static TOOL_ACTION drawCircle
static TOOL_ACTION placeBusWireEntry
Definition sch_actions.h:83
static TOOL_ACTION drawArcTangent
static TOOL_ACTION drawBezier
static TOOL_ACTION drawWire
Definition sch_actions.h:78
static TOOL_ACTION lineMode45
static TOOL_ACTION rotateCW
static TOOL_ACTION generateBOM
static TOOL_ACTION showHierarchy
static TOOL_ACTION placeJunction
Definition sch_actions.h:82
static TOOL_ACTION drawRuleArea
static TOOL_ACTION placeSymbol
Definition sch_actions.h:72
static TOOL_ACTION placeImage
static TOOL_ACTION navigateForward
static TOOL_ACTION drawPolygon
static TOOL_ACTION drawArcStartDirEnd
static TOOL_ACTION mirrorH
static TOOL_ACTION showSimulator
static TOOL_ACTION drawBus
Definition sch_actions.h:79
static TOOL_ACTION runERC
Inspection and Editing.
static TOOL_ACTION drawArcStartEndMid
static TOOL_ACTION drawTable
static TOOL_ACTION lineMode90
static TOOL_ACTION placeSchematicText
Definition sch_actions.h:98
static TOOL_ACTION lineModeFree
static TOOL_ACTION annotate
static TOOL_ACTION placeNoConnect
Definition sch_actions.h:81
static TOOL_ACTION toggleHiddenPins
static TOOL_ACTION placePower
Definition sch_actions.h:74
static TOOL_ACTION navigateUp
static ACTION_TOOLBAR_CONTROL currentVariant
bool ValidateNewVariantName(const wxString &aName, const wxString &aExcludeName)
Validate a user-entered variant name for the rename/copy dialogs.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SyncVariantUI()
Refill the toolbar variant control and any open symbol fields table from the schematic.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend)
Create a copy of the current schematic item, and put it in the undo list.
wxChoice * m_currentVariantCtrl
void SetCurrentVariant(const wxString &aVariantName)
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 selectCurrentVariant()
Select the schematic's current variant in the toolbar control, which must exist.
void onVariantSelected(wxCommandEvent &aEvent)
void ClearToolbarControl(int aId) override
DIALOG_SYMBOL_FIELDS_TABLE * m_symbolFieldsTableDialog
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:
T * GetTool()
Return the tool of given type or nullptr if there is no such tool registered.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Definition cvpcb.cpp:178
#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.