KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_wizard_frame.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) 2012-2015 Miguel Angel Ajo Pelayo <[email protected]>
5 * Copyright (C) 2012-2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
6 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
7 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
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 <kiface_base.h>
28#include <pcb_draw_panel_gal.h>
29#include <pcb_edit_frame.h>
31#include <widgets/msgpanel.h>
32#include <bitmaps.h>
33#include <grid_tricks.h>
34#include <board.h>
37#include <pcbnew_id.h>
38#include <wx/listbox.h>
39#include <wx/statline.h>
40#include <wx/tokenzr.h>
41#include <wx/numformatter.h>
42#include <wx/wupdlock.h>
43#include <pgm_base.h>
46#include <tool/tool_manager.h>
48#include <tool/action_toolbar.h>
49#include <tool/common_tools.h>
51#include <tools/pcb_control.h>
52#include <tools/pcb_actions.h>
57
58
60
61 // Window events
64
65 // Toolbar events
68
69 // listbox events
72 FOOTPRINT_WIZARD_FRAME::ParametersUpdated )
73END_EVENT_TABLE()
74
75
76// Note: our FOOTPRINT_WIZARD_FRAME is always modal.
77
78FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent,
79 FRAME_T aFrameType ) :
80 PCB_BASE_EDIT_FRAME( aKiway, aParent, aFrameType, _( "Footprint Wizard" ),
81 wxDefaultPosition, wxDefaultSize,
82 aParent ? KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT
83 : KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP,
85 m_wizardListShown( false )
86{
87 wxASSERT( aFrameType == FRAME_FOOTPRINT_WIZARD );
88
89 // This frame is always show modal:
90 SetModal( true );
91
92 // Give an icon
93 wxIcon icon;
94 icon.CopyFromBitmap( KiBitmap( BITMAPS::module_wizard ) );
95 SetIcon( icon );
96
97 m_wizardName.Empty();
98
99 // Create the GAL canvas.
100 // Must be created before calling LoadSettings() that needs a valid GAL canvas
101 PCB_DRAW_PANEL_GAL* gal_drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ),
102 m_frameSize,
103 GetGalDisplayOptions(),
105 SetCanvas( gal_drawPanel );
106
107 SetBoard( new BOARD() );
108
109 // Ensure all layers and items are visible:
111 SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
112 GetScreen()->m_Center = true; // Center coordinate origins on screen.
113
114 LoadSettings( config() );
115
116 SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
117
118 // Set some display options here, because the FOOTPRINT_WIZARD_FRAME
119 // does not have a config menu to do that:
120
121 // the footprint wizard frame has no config menu. so use some settings
122 // from the caller, or force some options:
123 PCB_BASE_FRAME* caller = dynamic_cast<PCB_BASE_FRAME*>( aParent );
124
125 if( caller )
126 SetUserUnits( caller->GetUserUnits() );
127
128 // In viewer, the default net clearance is not known (it depends on the actual board).
129 // So we do not show the default clearance, by setting it to 0
130 // The footprint or pad specific clearance will be shown
131 GetBoard()->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->SetClearance( 0 );
132
133 // Create the manager and dispatcher & route draw panel events to the dispatcher
134 m_toolManager = new TOOL_MANAGER;
135 m_toolManager->SetEnvironment( GetBoard(), gal_drawPanel->GetView(),
136 gal_drawPanel->GetViewControls(), config(), this );
137 m_actions = new PCB_ACTIONS();
138 m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
139 gal_drawPanel->SetEventDispatcher( m_toolDispatcher );
140
141 m_toolManager->RegisterTool( new PCB_CONTROL );
142 m_toolManager->RegisterTool( new PCB_SELECTION_TOOL ); // for std context menus (zoom & grid)
143 m_toolManager->RegisterTool( new SCRIPTING_TOOL );
144 m_toolManager->RegisterTool( new COMMON_TOOLS );
145 m_toolManager->RegisterTool( new FOOTPRINT_WIZARD_TOOLS );
146 m_toolManager->InitTools();
147
148 // Run the control tool, it is supposed to be always active
149 m_toolManager->InvokeTool( "common.InteractiveSelection" );
150
151 // Create the toolbars
152 m_toolbarSettings = GetToolbarSettings<FOOTPRINT_WIZARD_TOOLBAR_SETTINGS>( "fpwizard-toolbars" );
153 configureToolbars();
154 RecreateToolbars();
155
156 // Create the parameters panel
157 m_parametersPanel = new wxPanel( this, wxID_ANY );
158
159 m_pageList = new wxListBox( m_parametersPanel, ID_FOOTPRINT_WIZARD_PAGE_LIST,
160 wxDefaultPosition, wxDefaultSize, 0, nullptr,
161 wxLB_HSCROLL | wxNO_BORDER );
162
163 auto divider = new wxStaticLine( m_parametersPanel, wxID_ANY,
164 wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
165
166 m_parameterGrid = new WX_GRID( m_parametersPanel, ID_FOOTPRINT_WIZARD_PARAMETER_LIST );
167 initParameterGrid();
168 m_parameterGrid->PushEventHandler( new GRID_TRICKS( m_parameterGrid ) );
169
170 ReCreatePageList();
171
172 wxBoxSizer* parametersSizer = new wxBoxSizer( wxHORIZONTAL );
173 parametersSizer->Add( m_pageList, 0, wxEXPAND, 5 );
174 parametersSizer->Add( divider, 0, wxEXPAND, 5 );
175 parametersSizer->Add( m_parameterGrid, 1, wxEXPAND, 5 );
176 m_parametersPanel->SetSizer( parametersSizer );
177 m_parametersPanel->Layout();
178
179 // Create the build message box
180 m_buildMessageBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
181 wxDefaultPosition, wxDefaultSize,
182 wxTE_MULTILINE | wxTE_READONLY | wxNO_BORDER );
183
184 DisplayWizardInfos();
185
186 m_auimgr.SetManagedWindow( this );
187
188 m_auimgr.AddPane( m_tbTopMain, EDA_PANE().HToolbar().Name( "TopMainToolbar" ).Top().Layer(6) );
189 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6)
190 .BestSize( -1, m_msgFrameHeight ) );
191
192 m_auimgr.AddPane( m_parametersPanel, EDA_PANE().Palette().Name( "Params" ).Left().Position(0)
193 .Caption( _( "Parameters" ) ).MinSize( 360, 180 ) );
194 m_auimgr.AddPane( m_buildMessageBox, EDA_PANE().Palette().Name( "Output" ).Left().Position(1)
195 .CaptionVisible( false ).MinSize( 360, -1 ) );
196
197 m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() );
198
199 auto& galOpts = GetGalDisplayOptions();
200 galOpts.m_fullscreenCursor = true;
201 galOpts.m_forceDisplayCursor = true;
202 galOpts.m_axesEnabled = true;
203
204 ActivateGalCanvas();
205 updateView();
206
207 SetActiveLayer( F_Cu );
208 GetToolManager()->PostAction( ACTIONS::zoomFitScreen );
209
210 // Do not Run a dialog here: on some Window Managers, it creates issues.
211 // Reason: the FOOTPRINT_WIZARD_FRAME is run as modal;
212 // It means the call to FOOTPRINT_WIZARD_FRAME::ShowModal will change the
213 // Event Loop Manager, and stop the one created by the dialog.
214 // It does not happen on all W.M., perhaps due to the way the order events are called
215 // See the call in onActivate instead
216}
217
218
220{
221 // Delete the GRID_TRICKS.
222 m_parameterGrid->PopEventHandler( true );
223
225 // Be sure any event cannot be fired after frame deletion:
226 GetCanvas()->SetEvtHandlerEnabled( false );
227
228 // Be sure a active tool (if exists) is deactivated:
229 if( m_toolManager )
231
232 EDA_3D_VIEWER_FRAME* draw3DFrame = Get3DViewerFrame();
233
234 if( draw3DFrame )
235 draw3DFrame->Destroy();
236
237 // Now this frame can be deleted
238}
239
240
242{
243 SaveSettings( config() );
244
245 if( IsModal() )
246 {
247 // Only dismiss a modal frame once, so that the return values set by
248 // the prior DismissModal() are not bashed for ShowModal().
249 if( !IsDismissed() )
250 DismissModal( false );
251 }
252}
253
254
256{
257 DismissModal( true );
258 Close();
259}
260
261
262void FOOTPRINT_WIZARD_FRAME::OnGridSize( wxSizeEvent& aSizeEvent )
263{
264 // Resize the parameter columns
266
267 aSizeEvent.Skip();
268}
269
270
271void FOOTPRINT_WIZARD_FRAME::OnSize( wxSizeEvent& SizeEv )
272{
273 if( m_auimgr.GetManagedWindow() )
274 m_auimgr.Update();
275
276 SizeEv.Skip();
277}
278
279
281{
283 return ::GetColorSettings( cfg ? cfg->m_ColorTheme : DEFAULT_THEME );
284}
285
286
288{
294}
295
296
298{
299 BOARD_ITEM* footprint = GetBoard()->GetFirstFootprint();
300
301 if( footprint )
302 {
303 std::vector<MSG_PANEL_ITEM> items;
304
305 footprint->GetMsgPanelInfo( this, items );
306 SetMsgPanel( items );
307 }
308 else
309 {
311 }
312}
313
314
316{
318
319 // Prepare the grid where parameters are displayed
320
321 m_parameterGrid->CreateGrid( 0, 3 );
322
323 m_parameterGrid->SetColLabelValue( WIZ_COL_NAME, _( "Parameter" ) );
324 m_parameterGrid->SetColLabelValue( WIZ_COL_VALUE, _( "Value" ) );
325 m_parameterGrid->SetColLabelValue( WIZ_COL_UNITS, _( "Units" ) );
326
328 m_parameterGrid->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE );
329 m_parameterGrid->AutoSizeColumns();
330
331 m_parameterGrid->AutoSizeRows();
332 m_parameterGrid->SetRowLabelSize( 0 );
333
334 m_parameterGrid->DisableDragGridSize();
335 m_parameterGrid->DisableDragColSize();
336
337 m_parameterGrid->Connect( wxEVT_SIZE,
338 wxSizeEventHandler( FOOTPRINT_WIZARD_FRAME::OnGridSize ),
339 nullptr, this );
340}
341
342
344{
345 if( m_pageList == nullptr )
346 return;
347
348 FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
349
350 if( !footprintWizard )
351 return;
352
353 m_pageList->Clear();
354 int max_page = footprintWizard->GetNumParameterPages();
355
356 for( int i = 0; i < max_page; i++ )
357 {
358 wxString name = footprintWizard->GetParameterPageName( i );
359 m_pageList->Append( name );
360 }
361
362 m_pageList->SetSelection( 0, true );
363
367 GetCanvas()->Refresh();
368}
369
370
372{
373 if( m_parameterGrid == nullptr )
374 return;
375
376 FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
377
378 if( footprintWizard == nullptr )
379 return;
380
381 wxWindowUpdateLocker updateLock( m_parameterGrid );
382
383 m_parameterGrid->ClearGrid();
384 m_parameterGridPage = m_pageList->GetSelection();
385
386 if( m_parameterGridPage < 0 ) // Should not happen
387 return;
388
389 // Get the list of names, values, types, hints and designators
390 wxArrayString designatorsList = footprintWizard->GetParameterDesignators( m_parameterGridPage );
391 wxArrayString namesList = footprintWizard->GetParameterNames( m_parameterGridPage );
392 wxArrayString valuesList = footprintWizard->GetParameterValues( m_parameterGridPage );
393 wxArrayString typesList = footprintWizard->GetParameterTypes( m_parameterGridPage );
394 wxArrayString hintsList = footprintWizard->GetParameterHints( m_parameterGridPage );
395
396 // Dimension the wxGrid
398 m_parameterGrid->AppendRows( namesList.size() );
399
400 wxString designator, name, value, units, hint;
401
402 for( unsigned int i = 0; i < namesList.size(); i++ )
403 {
404 designator = designatorsList[i];
405 name = namesList[i];
406 value = valuesList[i];
407 units = typesList[i];
408 hint = hintsList[i];
409
410 m_parameterGrid->SetRowLabelValue( i, designator );
411
412 // Set the 'Name'
413 m_parameterGrid->SetCellValue( i, WIZ_COL_NAME, name );
414 m_parameterGrid->SetReadOnly( i, WIZ_COL_NAME );
415
416 // Boolean parameters are displayed using a checkbox
417 if( units == WIZARD_PARAM_UNITS_BOOL )
418 {
419 // Set to ReadOnly as we delegate interactivity to GRID_TRICKS
420 m_parameterGrid->SetReadOnly( i, WIZ_COL_VALUE );
421 m_parameterGrid->SetCellRenderer( i, WIZ_COL_VALUE, new wxGridCellBoolRenderer );
422 }
423 // Parameters that can be selected from a list of multiple options
424 else if( units.Contains( wxT( "," ) ) ) // Indicates list of available options
425 {
426 wxStringTokenizer tokenizer( units, wxT( "," ) );
427 wxArrayString options;
428
429 while( tokenizer.HasMoreTokens() )
430 options.Add( tokenizer.GetNextToken() );
431
432 m_parameterGrid->SetCellEditor( i, WIZ_COL_VALUE, new wxGridCellChoiceEditor( options ) );
433
434 units = wxT( "" );
435 }
436 else if( units == WIZARD_PARAM_UNITS_INTEGER ) // Integer parameters
437 {
438 m_parameterGrid->SetCellEditor( i, WIZ_COL_VALUE, new wxGridCellNumberEditor );
439 }
440 else if( ( units == WIZARD_PARAM_UNITS_MM ) ||
441 ( units == WIZARD_PARAM_UNITS_MILS ) ||
442 ( units == WIZARD_PARAM_UNITS_FLOAT ) ||
443 ( units == WIZARD_PARAM_UNITS_RADIANS ) ||
444 ( units == WIZARD_PARAM_UNITS_DEGREES ) ||
445 ( units == WIZARD_PARAM_UNITS_PERCENT ) )
446 {
447 // Non-integer numerical parameters
448 m_parameterGrid->SetCellEditor( i, WIZ_COL_VALUE, new wxGridCellFloatEditor );
449
450 // Convert separators to the locale-specific character
451 value.Replace( ",", wxNumberFormatter::GetDecimalSeparator() );
452 value.Replace( ".", wxNumberFormatter::GetDecimalSeparator() );
453 }
454
455 // Set the 'Units'
456 m_parameterGrid->SetCellValue( i, WIZ_COL_UNITS, units );
457 m_parameterGrid->SetReadOnly( i, WIZ_COL_UNITS );
458
459 // Set the 'Value'
460 m_parameterGrid->SetCellValue( i, WIZ_COL_VALUE, value );
461 }
462
464}
465
467{
468 // Parameter grid is not yet configured
469 if( ( m_parameterGrid == nullptr ) || ( m_parameterGrid->GetNumberCols() == 0 ) )
470 return;
471
472 // first auto-size the columns to ensure enough space around text
473 m_parameterGrid->AutoSizeColumns();
474
475 // Auto-size the value column
476 int width = m_parameterGrid->GetClientSize().GetWidth() -
477 m_parameterGrid->GetRowLabelSize() -
478 m_parameterGrid->GetColSize( WIZ_COL_NAME ) -
479 m_parameterGrid->GetColSize( WIZ_COL_UNITS );
480
481 if( width > m_parameterGrid->GetColMinimalAcceptableWidth() )
482 {
483 m_parameterGrid->SetColSize( WIZ_COL_VALUE, width );
484 }
485}
486
487
488void FOOTPRINT_WIZARD_FRAME::ClickOnPageList( wxCommandEvent& event )
489{
490 if( m_pageList->GetSelection() >= 0 )
491 {
493 GetCanvas()->Refresh();
495 }
496}
497
498
500{
501 PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
502 wxCHECK( cfg, /*void*/ );
503
505
507}
508
509
511{
512 PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
513 wxCHECK( cfg, /*void*/ );
514
516
517 cfg->m_FootprintViewer.perspective = m_auimgr.SavePerspective().ToStdString();
518}
519
520
522{
523 auto cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
524 wxASSERT( cfg );
525
526 return cfg ? &cfg->m_FootprintWizard : nullptr;
527}
528
529
530void FOOTPRINT_WIZARD_FRAME::OnActivate( wxActivateEvent& event )
531{
532 // Ensure we do not have old selection:
533 if( !event.GetActive() )
534 return;
535
536 if( !m_wizardListShown )
537 {
538 m_wizardListShown = true;
539 wxPostEvent( this, wxCommandEvent( wxEVT_TOOL, ID_FOOTPRINT_WIZARD_SELECT_WIZARD ) );
540 }
541#if 0
542 // Currently, we do not have a way to see if a Python wizard has changed,
543 // therefore the lists of parameters and option has to be rebuilt
544 // This code could be enabled when this way exists
545 bool footprintWizardsChanged = false;
546
547 if( footprintWizardsChanged )
548 {
549 // If we are here, the library list has changed, rebuild it
552 }
553#endif
554}
555
556
557void FOOTPRINT_WIZARD_FRAME::Update3DView( bool aMarkDirty, bool aRefresh, const wxString* aTitle )
558{
559 wxString frm3Dtitle;
560 frm3Dtitle.Printf( _( "ModView: 3D Viewer [%s]" ), m_wizardName );
561 PCB_BASE_FRAME::Update3DView( aMarkDirty, aRefresh, &frm3Dtitle );
562}
563
564
566{
567 return GetBoard()->GetFirstFootprint();
568}
569
570
572{
573 // Reload the Python plugins
574 // Because the board editor has also a plugin python menu,
575 // call the PCB_EDIT_FRAME RunAction() if the board editor is running
576 // Otherwise run the current RunAction().
577 PCB_EDIT_FRAME* pcbframe = static_cast<PCB_EDIT_FRAME*>( Kiway().Player( FRAME_PCB_EDITOR, false ) );
578
579 if( pcbframe )
581 else
583}
const char * name
Definition: DXF_plotter.cpp:62
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
@ module_wizard
static TOOL_ACTION pluginsReload
Definition: actions.h:287
static TOOL_ACTION zoomFitScreen
Definition: actions.h:141
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:108
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:235
std::shared_ptr< NET_SETTINGS > m_NetSettings
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:317
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:487
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
Definition: board.cpp:943
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:1011
Color settings are a bit different than most of the settings objects in that there can be more than o...
Handles action that are shared between different applications.
Definition: common_tools.h:38
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
wxAuiManager m_auimgr
virtual void ClearMsgPanel()
Clear all messages from the message panel.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual void ReCreateHToolbar()
static constexpr GAL_TYPE GAL_FALLBACK
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: eda_item.h:219
Specialization of the wxAuiPaneInfo class for KiCad panels.
BOARD_ITEM_CONTAINER * GetModel() const override
void PythonPluginsReload()
Reload the Python plugins if they are newer than the already loaded, and load new plugins if any.
void initParameterGrid()
Prepare the grid where parameters are displayed.
void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
int m_parameterGridPage
the page currently displayed by m_parameterGrid it is most of time the m_pageList selection,...
wxListBox * m_pageList
The list of pages.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void ReCreateParameterList()
Create the list of parameters for the current page.
void DisplayWizardInfos()
Show all the details about the current wizard.
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
wxString m_wizardName
name of the current wizard
void SelectCurrentWizard(wxCommandEvent &aDummy)
bool m_wizardListShown
A show-once flag for the wizard list.
void updateView()
Rebuild the GAL view (reint tool manager, colors and drawings) must be run after any footprint change...
void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr) override
Update the 3D view, if the viewer is opened by this frame.
void ClickOnPageList(wxCommandEvent &event)
WX_GRID * m_parameterGrid
The list of parameters.
FOOTPRINT_WIZARD * GetMyWizard()
Reloads the wizard by name.
void ResizeParamColumns()
Expand the 'Value' column to fill available.
void UpdateMsgPanel() override
Redraw the message panel.
void ReCreatePageList()
Create or recreate the list of parameter pages for the current wizard.
wxString m_auiPerspective
Encoded string describing the AUI layout.
void ExportSelectedFootprint(wxCommandEvent &aEvent)
Will let the caller exit from the wait loop, and get the built footprint.
void OnGridSize(wxSizeEvent &aSizeEvent)
WINDOW_SETTINGS * GetWindowSettings(APP_SETTINGS_BASE *aCfg) override
Return a pointer to the window settings for this frame.
void OnActivate(wxActivateEvent &event)
Called when the frame frame is activate to reload the libraries and component lists that can be chang...
Tool useful for viewing footprints.
The parent class from where any footprint wizard class must derive.
virtual wxArrayString GetParameterHints(int aPage)=0
virtual wxArrayString GetParameterNames(int aPage)=0
virtual wxArrayString GetParameterValues(int aPage)=0
virtual wxString GetParameterPageName(int aPage)=0
virtual wxArrayString GetParameterTypes(int aPage)=0
virtual int GetNumParameterPages()=0
virtual wxArrayString GetParameterDesignators(int aPage)=0
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
bool IsDismissed()
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
bool IsModal() const override
Return true if the frame is shown in our modal mode and false if the frame is shown as an usual frame...
Definition: kiway_player.h:154
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:286
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:395
WINDOW_SETTINGS m_FootprintViewer
Gather all the actions that are shared by tools.
Definition: pcb_actions.h:51
Common, abstract interface for edit frames.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
BOARD * GetBoard() const
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
EDA_3D_VIEWER_FRAME * Get3DViewerFrame()
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
Handle actions that are shared between different frames in PcbNew.
Definition: pcb_control.h:47
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
The main frame for Pcbnew.
The selection tool: currently supports:
Tool relating to pads and pad settings.
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:171
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
@ MODEL_RELOAD
Model changes (the sheet for a schematic)
Definition: tool_base.h:80
Master controller class:
Definition: tool_manager.h:62
void DeactivateTool()
Deactivate the currently active tool.
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
Definition: tool_manager.h:150
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Reset all tools (i.e.
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Set the work environment (model, view, view controls and the parent window).
EDA_UNITS GetUserUnits() const
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
Definition: wx_grid.cpp:252
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
Definition: wx_grid.h:203
#define _(s)
Declaration of the eda_3d_viewer class.
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define FOOTPRINT_WIZARD_FRAME_NAME
const wxString WIZARD_PARAM_UNITS_PERCENT
const wxString WIZARD_PARAM_UNITS_RADIANS
const wxString WIZARD_PARAM_UNITS_MM
const wxString WIZARD_PARAM_UNITS_INTEGER
const wxString WIZARD_PARAM_UNITS_BOOL
const wxString WIZARD_PARAM_UNITS_FLOAT
const wxString WIZARD_PARAM_UNITS_MILS
const wxString WIZARD_PARAM_UNITS_DEGREES
EVT_GRID_CMD_CELL_CHANGED(ID_FOOTPRINT_WIZARD_PARAMETER_LIST, FOOTPRINT_WIZARD_FRAME::ParametersUpdated) FOOTPRINT_WIZARD_FRAME
@ WIZ_COL_VALUE
@ WIZ_COL_NAME
@ WIZ_COL_UNITS
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:33
@ FRAME_PCB_EDITOR
Definition: frame_type.h:42
@ FRAME_FOOTPRINT_WIZARD
Definition: frame_type.h:46
@ F_Cu
Definition: layer_ids.h:64
Message panel definition file.
@ ID_FOOTPRINT_WIZARD_DONE
Definition: pcbnew_id.h:86
@ ID_FOOTPRINT_WIZARD_SELECT_WIZARD
Definition: pcbnew_id.h:89
@ ID_FOOTPRINT_WIZARD_PARAMETER_LIST
Definition: pcbnew_id.h:88
@ ID_FOOTPRINT_WIZARD_PAGE_LIST
Definition: pcbnew_id.h:87
BOARD * GetBoard()
see class PGM_BASE
#define DEFAULT_THEME
KIWAY Kiway(KFCTL_STANDALONE)
Store the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:90
wxString perspective
Definition: app_settings.h:93