KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_wizard_frame.h
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 Miguel Angel Ajo Pelayo, [email protected]
5 * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
29
30#ifndef FOOTPRINT_WIZARD_FRAME_H_
31#define FOOTPRINT_WIZARD_FRAME_H_
32
33#include <wx/gdicmn.h>
34#include <footprint_wizard.h>
35#include <pcb_base_edit_frame.h>
36#include <nlohmann/json_fwd.hpp>
37
38class wxSashLayoutWindow;
39class wxSashEvent;
40class wxListBox;
41class WX_GRID;
42class wxGridEvent;
44
45
52
54{
55public:
56 FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* parent, FRAME_T aFrameType );
57
59
61 BOARD_ITEM_CONTAINER* GetModel() const override;
62
64
70
71 COLOR_SETTINGS* GetColorSettings( bool aForceRefresh = false ) const override;
72
73 void SelectCurrentWizard( wxCommandEvent& aDummy ); // Open the wizard selector dialog
74
75 void DefaultParameters(); // Reset the initial (default) values of the wizard prms
76 void SelectWizardPreviousPage(); // Select the previous parameter page for wizards having
77 // more than one parameter page
78 void SelectWizardNextPage(); // Select the next parameter page for wizards having
79 // more than one parameter page
80
84 void ExportSelectedFootprint( wxCommandEvent& aEvent );
85
86private:
87
88 void OnSize( wxSizeEvent& event ) override;
89 void OnGridSize( wxSizeEvent& aSizeEvent );
90
96 void UpdateMsgPanel() override;
97
102 void updateView();
103
107 void OnSashDrag( wxSashEvent& event );
108
114 void ReCreatePageList();
115
120
124 void ResizeParamColumns();
125
129 void initParameterGrid();
130
135
139 void RegenerateFootprint();
140
144 void DisplayBuildMessage( wxString& aMessage );
145
150
154 void DisplayWizardInfos();
155
156 void doCloseWindow() override;
157 void ClickOnPageList( wxCommandEvent& event );
158
159 void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
160 void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
161
163
168 void OnActivate( wxActivateEvent& event );
169
173 void ParametersUpdated( wxGridEvent& event );
174
176 void Update3DView( bool aMarkDirty, bool aRefresh, const wxString* aTitle = nullptr ) override;
177
178 DECLARE_EVENT_TABLE()
179
180protected:
181 wxString m_wizardName;
183 wxString m_wizardStatus;
184
185private:
187 wxListBox* m_pageList;
192 wxTextCtrl* m_buildMessageBox;
193
196
198};
199
200
201
202#endif // FOOTPRINT_WIZARD_FRM_H_
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void ParametersUpdated(wxGridEvent &event)
Update the footprint python parameters values from the values in grid.
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 OnSashDrag(wxSashEvent &event)
Resize the child windows when dragging a sash window border.
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.
wxString m_wizardStatus
current wizard status
void ClickOnPageList(wxCommandEvent &event)
WX_GRID * m_parameterGrid
The list of parameters.
void DisplayBuildMessage(wxString &aMessage)
Display the message generated by the python build footprint script.
FOOTPRINT_WIZARD * GetMyWizard()
Reloads the wizard by name.
FOOTPRINT_WIZARD_FRAME(KIWAY *aKiway, wxWindow *parent, FRAME_T aFrameType)
void ResizeParamColumns()
Expand the 'Value' column to fill available.
wxString m_wizardDescription
description of the wizard
void UpdateMsgPanel() override
Redraw the message panel.
wxPanel * m_parametersPanel
Panel for the page list and parameter grid.
void ReCreatePageList()
Create or recreate the list of parameter pages for the current wizard.
void RegenerateFootprint()
Regenerate the current footprint.
void SelectFootprintWizard()
Show the list of footprint wizards available into the system.
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...
The parent class from where any footprint wizard class must derive.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:286
PCB_BASE_EDIT_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
Class FOOTPRINT_WIZARD and FOOTPRINT_WIZARDS.
WizardParameterColumnNames
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition frame_type.h:33
nlohmann::json json
Definition gerbview.cpp:50
Store the common settings that are saved and loaded for each window / frame.