KiCad PCB EDA Suite
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, miguelangel@nbee.es
5  * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
6  * Copyright (C) 2004-2020 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 
30 #ifndef FOOTPRINT_WIZARD_FRAME_H_
31 #define FOOTPRINT_WIZARD_FRAME_H_
32 
33 
34 #include <wx/gdicmn.h>
35 #include <footprint_wizard.h>
36 class wxSashLayoutWindow;
37 class wxListBox;
38 class WX_GRID;
39 class wxGridEvent;
41 
42 
44 {
48 };
49 
54 {
55 private:
56  wxPanel* m_parametersPanel;
57  wxListBox* m_pageList;
60  wxTextCtrl* m_buildMessageBox;
63 
64  wxString m_auiPerspective;
65 
67 
68 protected:
69  wxString m_wizardName;
71  wxString m_wizardStatus;
72 
73 public:
74 
75  FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* parent, FRAME_T aFrameType );
76 
78 
80  BOARD_ITEM_CONTAINER* GetModel() const override;
81 
83 
89  void PythonPluginsReload();
90 
91  COLOR_SETTINGS* GetColorSettings() override;
92 
93 private:
94 
95  void OnSize( wxSizeEvent& event ) override;
96  void OnGridSize( wxSizeEvent& aSizeEvent );
97 
103  void UpdateMsgPanel() override;
104 
109  void updateView();
110 
116  void ExportSelectedFootprint( wxCommandEvent& aEvent );
117 
123  void OnSashDrag( wxSashEvent& event );
124 
130  void ReCreatePageList();
131 
136  void ReCreateParameterList();
137 
141  void ResizeParamColumns();
142 
147  void initParameterGrid();
148 
153  void SelectFootprintWizard();
154 
159  void ReloadFootprint();
160 
165  void DisplayBuildMessage( wxString& aMessage );
166 
172 
173 
174  void Process_Special_Functions( wxCommandEvent& event );
175 
180  void DisplayWizardInfos();
181 
182 
183  void doCloseWindow() override;
184  void ReCreateHToolbar() override;
185  void ReCreateVToolbar() override;
186  void ClickOnPageList( wxCommandEvent& event );
187 
188  void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
189  void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
190 
192 
198  void OnActivate( wxActivateEvent& event );
199 
200  void SelectCurrentWizard( wxCommandEvent& event );
201 
202  void DefaultParameters( wxCommandEvent& event );
203 
208  void ParametersUpdated( wxGridEvent& event );
209 
217  void Update3DView( bool aForceReload, const wxString* aTitle ) override;
218 
219  /*
220  * Virtual functions, not used here, but needed by PCB_BASE_FRAME
221  * (virtual pure functions )
222  */
223  void SaveCopyInUndoList( EDA_ITEM*, UNDO_REDO, const wxPoint& ) override {}
224  void SaveCopyInUndoList( const PICKED_ITEMS_LIST&, UNDO_REDO, const wxPoint& ) override {}
225 
226 
227  DECLARE_EVENT_TABLE()
228 };
229 
230 
231 
232 #endif // FOOTPRINT_WIZARD_FRM_H_
void Update3DView(bool aForceReload, const wxString *aTitle) override
Function Update3D_Frame must be called after a footprint selection Updates the 3D view and 3D frame t...
FOOTPRINT_WIZARD_FRAME.
wxString m_wizardName
name of the current wizard
void DisplayWizardInfos()
Function DisplayWizardInfos Shows all the details about the current wizard.
void SaveCopyInUndoList(const PICKED_ITEMS_LIST &, UNDO_REDO, const wxPoint &) override
Function SaveCopyInUndoList (virtual pure, overloaded).
wxString m_auiPerspective
Encoded string describing the AUI layout.
WizardParameterColumnNames
wxListBox * m_pageList
The list of pages.
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
void ExportSelectedFootprint(wxCommandEvent &aEvent)
Function ExportSelectedFootprint(); will let the caller exit from the wait loop, and get the built fo...
int m_parameterGridPage
the page currently displayed by m_parameterGrid it is most of time the m_pageList selection,...
WX_GRID * m_parameterGrid
The list of parameters.
void ReloadFootprint()
Function ReloadFootprint Reloads the current footprint.
void initParameterGrid()
Function initParameterGrid Prepare the grid where parameters are displayed.
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
void ClickOnPageList(wxCommandEvent &event)
BOARD_ITEM_CONTAINER * GetModel() const override
void ReCreateParameterList()
Function ReCreateParameterList Creates the list of parameters for the current page.
COLOR_SETTINGS * GetColorSettings() override
Helper to retrieve the current color settings.
wxString m_wizardStatus
current wizard status
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:81
wxPanel * m_parametersPanel
Panel for the page list and parameter grid.
void ReCreatePageList()
Function ReCreatePageList Creates or recreates the list of parameter pages for the current wizard.
void OnActivate(wxActivateEvent &event)
Function OnActivate is called when the frame frame is activate to reload the libraries and component ...
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:99
void ParametersUpdated(wxGridEvent &event)
Function ParametersUpdated Update the footprint python parameters values from the values in grid.
void SaveCopyInUndoList(EDA_ITEM *, UNDO_REDO, const wxPoint &) override
Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands.
FOOTPRINT_WIZARD_FRAME(KIWAY *aKiway, wxWindow *parent, FRAME_T aFrameType)
void DisplayBuildMessage(wxString &aMessage)
Function DisplayBuildMessages Display the message generated by the python build footprint script.
KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the s...
Definition: kiway.h:273
PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
FOOTPRINT_WIZARD * GetMyWizard()
Function GetMyWizard Reloads the wizard by name.
bool m_wizardListShown
A show-once flag for the wizard list.
void PythonPluginsReload()
Reload the Python plugins if they are newer than the already loaded, and load new plugins if any Do n...
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Saves common frame parameters to a configuration data file.
void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
void OnSashDrag(wxSashEvent &event)
Function OnSashDrag resizes the child windows when dragging a sash window border.
void DefaultParameters(wxCommandEvent &event)
void SelectFootprintWizard()
Function SelectFootprintWizard Shows the list of footprint wizards available into the system.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void OnGridSize(wxSizeEvent &aSizeEvent)
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SelectCurrentWizard(wxCommandEvent &event)
void Process_Special_Functions(wxCommandEvent &event)
Abstract interface for BOARD_ITEMs capable of storing other items inside.
Class FOOTPRINT_WIZARD and FOOTPRINT_WIZARDS.
void updateView()
rebuild the GAL view (reint tool manager, colors and drawings) must be run after any footprint change...
void UpdateMsgPanel() override
redraws the message panel.
void ResizeParamColumns()
Expand the 'Value' column to fill available.
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
FOOTPRINT_WIZARD This is the parent class from where any footprint wizard class must derive.
WINDOW_SETTINGS * GetWindowSettings(APP_SETTINGS_BASE *aCfg) override
Returns a pointer to the window settings for this frame.
wxString m_wizardDescription
description of the wizard