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, see <https://www.gnu.org/licenses/>.
20 */
21
25
26#ifndef FOOTPRINT_WIZARD_FRAME_H_
27#define FOOTPRINT_WIZARD_FRAME_H_
28
29#include <memory>
30#include <wx/gdicmn.h>
31#include <footprint_wizard.h>
32#include <pcb_base_edit_frame.h>
33#include <nlohmann/json_fwd.hpp>
34
35class wxSashLayoutWindow;
36class wxSashEvent;
39
41{
42public:
43 FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* parent, FRAME_T aFrameType );
44
46
48 BOARD_ITEM_CONTAINER* GetModel() const override;
49
51
52 COLOR_SETTINGS* GetColorSettings( bool aForceRefresh = false ) const override;
53
54 void SelectCurrentWizard( wxCommandEvent& aDummy ); // Open the wizard selector dialog
55
56 void DefaultParameters(); // Reset the initial (default) values of the wizard prms
57
61 void ExportSelectedFootprint( wxCommandEvent& aEvent );
62
65
67
68private:
69 void OnSize( wxSizeEvent& event ) override;
70
76 void UpdateMsgPanel() override;
77
82 void updateView();
83
87 void OnSashDrag( wxSashEvent& event );
88
93
101
105 void RegenerateFootprint();
106
111
115 void DisplayWizardInfos();
116
117 void doCloseWindow() override;
118
119 void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
120 void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
121
123
128 void OnActivate( wxActivateEvent& event );
129
130
132 void Update3DView( bool aMarkDirty, bool aRefresh, const wxString* aTitle = nullptr ) override;
133
134 DECLARE_EVENT_TABLE()
135
136protected:
138 wxString m_wizardStatus;
139
140private:
142 wxTextCtrl* m_buildMessageBox;
143
146
148
150};
151
152
153
154#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...
BOARD_ITEM_CONTAINER * GetModel() const override
FOOTPRINT_WIZARD_MANAGER * Manager() const
void OnSashDrag(wxSashEvent &event)
Resize the child windows when dragging a sash window border.
std::unique_ptr< FOOTPRINT_WIZARD_MANAGER > m_wizardManager
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.
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.
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
FOOTPRINT_WIZARD * m_currentWizard
FOOTPRINT_WIZARD * GetMyWizard()
Reloads the wizard by name.
FOOTPRINT_WIZARD_FRAME(KIWAY *aKiway, wxWindow *parent, FRAME_T aFrameType)
void UpdateMsgPanel() override
Redraw the message panel.
std::unique_ptr< nlohmann::json > m_viewerAuiState
void RegenerateFootprint()
Regenerate the current footprint.
void SelectFootprintWizard()
Prepare the grid where parameters are displayed.
wxString m_auiPerspective
Encoded string describing the AUI layout.
FOOTPRINT_WIZARD_PROPERTIES_PANEL * m_parametersPanel
Panel for the parameter grid.
void ExportSelectedFootprint(wxCommandEvent &aEvent)
Will let the caller exit from the wait loop, and get the built footprint.
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 footprint wizard manager interfaces with API_PLUGINs that can generate footprints.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:311
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)
STL class.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition frame_type.h:29
nlohmann::json json
Definition gerbview.cpp:49
STL namespace.
Store the common settings that are saved and loaded for each window / frame.