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-2018 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 wxGrid;
39 class wxGridEvent;
41 
42 
44 {
48 };
49 
54 {
55 private:
56  wxPanel* m_parametersPanel;
57  wxListBox* m_pageList;
58  wxGrid* m_parameterGrid;
60  wxTextCtrl* m_buildMessageBox;
63 
64  wxString m_auiPerspective;
65 
66 protected:
67  wxString m_wizardName;
69  wxString m_wizardStatus;
70 
71 public:
72 
73  FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* parent, FRAME_T aFrameType );
74 
76 
78 
84  void PythonPluginsReload();
85 
86 private:
87 
88  void OnSize( wxSizeEvent& event ) override;
89  void OnGridSize( wxSizeEvent& aSizeEvent );
90 
96  void UpdateMsgPanel() override;
97 
102  void updateView();
103 
109  void ExportSelectedFootprint( wxCommandEvent& aEvent );
110 
116  void OnSashDrag( wxSashEvent& event );
117 
123  void ReCreatePageList();
124 
129  void ReCreateParameterList();
130 
134  void ResizeParamColumns();
135 
140  void initParameterGrid();
141 
146  void SelectFootprintWizard();
147 
152  void ReloadFootprint();
153 
158  void DisplayBuildMessage( wxString& aMessage );
159 
165 
166 
167  void Process_Special_Functions( wxCommandEvent& event );
168 
173  void DisplayWizardInfos();
174 
175 
176  void RedrawActiveWindow( wxDC* DC, bool EraseBg ) override;
177  void OnCloseWindow( wxCloseEvent& Event ) override;
178  void ReCreateHToolbar() override;
179  void ReCreateVToolbar() override;
180  void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) override;
181  void ClickOnPageList( wxCommandEvent& event );
182  void OnSetRelativeOffset( wxCommandEvent& event );
183 
184  bool GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 ) override;
185 
187  EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const override;
188 
197  bool OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem = NULL ) override;
198 
199  void LoadSettings( wxConfigBase* aCfg ) override;
200  void SaveSettings( wxConfigBase* aCfg ) override;
201 
207  virtual void OnActivate( wxActivateEvent& event ) override;
208 
209  void SelectCurrentWizard( wxCommandEvent& event );
210 
211  void DefaultParameters( wxCommandEvent& event );
212 
217  void ParametersUpdated( wxGridEvent& event );
218 
219  bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) override;
220 
225  void Show3D_Frame( wxCommandEvent& event ) override;
226 
234  void Update3D_Frame( bool aForceReloadFootprint = true );
235 
236  /*
237  * Virtual functions, not used here, but needed by PCB_BASE_FRAME
238  * (virtual pure functions )
239  */
240  void OnLeftDClick( wxDC*, const wxPoint& ) override {}
241  void SaveCopyInUndoList( BOARD_ITEM*, UNDO_REDO_T, const wxPoint& ) override {}
242  void SaveCopyInUndoList( const PICKED_ITEMS_LIST&, UNDO_REDO_T, const wxPoint& ) override {}
243 
244 
245  DECLARE_EVENT_TABLE()
246 };
247 
248 
249 
250 #endif // FOOTPRINT_WIZARD_FRM_H_
Class FOOTPRINT_WIZARD_FRAME.
bool OnHotKey(wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
Function OnHotKey handle hot key events.
wxString m_wizardName
name of the current wizard
void DisplayWizardInfos()
Function DisplayWizardInfos Shows all the details about the current wizard.
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
wxString m_auiPerspective
Encoded string describing the AUI layout.
WizardParameterColumnNames
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
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 RedrawActiveWindow(wxDC *DC, bool EraseBg) override
Function RedrawActiveWindow Display the current selected component.
UNDO_REDO_T
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
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...
void ReloadFootprint()
Function ReloadFootprint Reloads the current footprint.
void SaveCopyInUndoList(const PICKED_ITEMS_LIST &, UNDO_REDO_T, const wxPoint &) override
Function SaveCopyInUndoList (virtual pure, overloaded).
void Update3D_Frame(bool aForceReloadFootprint=true)
Function Update3D_Frame must be called after a footprint selection Updates the 3D view and 3D frame t...
void initParameterGrid()
Function initParameterGrid Prepare the grid where parameters are displayed.
void ClickOnPageList(wxCommandEvent &event)
void ReCreateParameterList()
Function ReCreateParameterList Creates the list of parameters for the current page.
wxString m_wizardStatus
current wizard status
virtual void OnActivate(wxActivateEvent &event) override
Function OnActivate is called when the frame frame is activate to reload the libraries and component ...
wxGrid * m_parameterGrid
The list of parameters.
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 ParametersUpdated(wxGridEvent &event)
Function ParametersUpdated Update the footprint python parameters values from the values in grid...
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...
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:258
uint32_t EDA_KEY
Definition: common.h:73
Class 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 OnRightClick(const wxPoint &MousePos, wxMenu *PopMenu) override
void PythonPluginsReload()
Reload the Python plugins if they are newer than the already loaded, and load new plugins if any Do n...
void Show3D_Frame(wxCommandEvent &event) override
Function Show3D_Frame (virtual) displays 3D view of the footprint (module) being edited.
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)
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:59
bool GeneralControl(wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0) override
Perform application specific control using aDC at aPosition in logical units.
void SelectFootprintWizard()
Function SelectFootprintWizard Shows the list of footprint wizards available into the system...
void OnSetRelativeOffset(wxCommandEvent &event)
void OnLeftDClick(wxDC *, const wxPoint &) override
void OnGridSize(wxSizeEvent &aSizeEvent)
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
void SelectCurrentWizard(wxCommandEvent &event)
void Process_Special_Functions(wxCommandEvent &event)
void OnCloseWindow(wxCloseEvent &Event) override
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 &#39;Value&#39; column to fill available.
EDA_HOTKEY * GetHotKeyDescription(int aCommand) const override
>
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
void SaveCopyInUndoList(BOARD_ITEM *, UNDO_REDO_T, const wxPoint &) override
Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands.
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
Class FOOTPRINT_WIZARD This is the parent class from where any footprint wizard class must derive...
wxString m_wizardDescription
description of the wizard