KiCad PCB EDA Suite
dialog_pad_properties.h
Go to the documentation of this file.
1 
6 /*
7  * This program source code file is part of KiCad, a free EDA CAD application.
8  *
9  * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
10  * Copyright (C) 2013 Dick Hollenbeck, dick@softplc.com
11  * Copyright (C) 2008-2013 Wayne Stambaugh <stambaughw@verizon.net>
12  * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, you may find one here:
26  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
27  * or you may search the http://www.gnu.org website for the version 2 license,
28  * or you may write to the Free Software Foundation, Inc.,
29  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
30  */
31 
32 #ifndef _DIALOG_PAD_PROPERTIES_H_
33 #define _DIALOG_PAD_PROPERTIES_H_
34 
35 #include <class_drawpanel.h>
36 #include <pcbnew.h>
37 #include <wxBasePcbFrame.h>
38 #include <base_units.h>
39 #include <wx/valnum.h>
40 
41 #include <class_board.h>
42 #include <class_module.h>
43 
44 #include <origin_viewitem.h>
45 
47 #include <pcb_draw_panel_gal.h>
48 
49 
50 
56 {
57 public:
58  DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aPad );
59  void OnInitDialog( wxInitDialogEvent& event ) override;
61  {
62  delete m_dummyPad;
63  delete m_axisOrigin;
64  }
65 
66 private:
69  D_PAD* m_currentPad; // pad currently being edited
70  D_PAD* m_dummyPad; // a working copy used to show changes
71  D_PAD* m_padMaster; // The pad used to create new pads in board or
72  // footprint editor
73  BOARD* m_board; // the main board: this is the board handled by
74  // the PCB editor, if running or the dummy
75  // board used by the footprint editor
76  // (could happen when the Footprint editor will be run
77  // alone, outside the board editor
78  bool m_isFlipped; // true if the parent footprint (therefore pads) is flipped (mirrored)
79  // in this case, some Y coordinates values must be negated
81  bool m_canEditNetName; // true only if the caller is the board editor
82 
83  wxFloatingPointValidator<double> m_OrientValidator;
84  double m_OrientValue;
85 
86 private:
87  void initValues();
88  bool padValuesOK();
89  void redraw();
91 
97  void setPadLayersList( LSET layer_mask );
98 
100  bool transferDataToPad( D_PAD* aPad );
101 
102  // event handlers:
103  void OnResize( wxSizeEvent& event );
104 
105  void OnPadShapeSelection( wxCommandEvent& event ) override;
106  void OnDrillShapeSelected( wxCommandEvent& event ) override;
107 
108  void PadOrientEvent( wxCommandEvent& event ) override;
109  void PadTypeSelected( wxCommandEvent& event ) override;
110 
111  void OnSetLayers( wxCommandEvent& event ) override;
112  void OnPaintShowPanel( wxPaintEvent& event ) override;
113 
114  // Called when corner setup value is changed for rounded rect pads
115  void onCornerSizePercentChange( wxCommandEvent& event ) override;
116 
119  void OnValuesChanged( wxCommandEvent& event ) override;
120 
123  bool TransferDataFromWindow() override;
124  bool TransferDataToWindow() override;
125 };
126 
127 #endif // #ifndef _DIALOG_PAD_PROPERTIES_H_
void OnInitDialog(wxInitDialogEvent &event) override
void OnValuesChanged(wxCommandEvent &event) override
Called when a dimension has changed.
DIALOG_PAD_PROPERTIES(PCB_BASE_FRAME *aParent, D_PAD *aPad)
Implementation of conversion functions that require both schematic and board internal units...
bool transferDataToPad(D_PAD *aPad)
Copy values from dialog field to aPad's members.
Class BOARD to handle a board.
void setPadLayersList(LSET layer_mask)
Function setPadLayersList updates the CheckBox states in pad layers list,.
wxFloatingPointValidator< double > m_OrientValidator
bool TransferDataToWindow() override
void onCornerSizePercentChange(wxCommandEvent &event) override
class DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, created by wxFormBuilder ...
KIGFX::ORIGIN_VIEWITEM * m_axisOrigin
Class LSET is a set of LAYER_IDs.
Classes used in Pcbnew, CvPcb and GerbView.
void OnSetLayers(wxCommandEvent &event) override
void OnPaintShowPanel(wxPaintEvent &event) override
Class DIALOG_PAD_PROPERTIES_BASE.
void OnResize(wxSizeEvent &event)
void OnPadShapeSelection(wxCommandEvent &event) override
void PadTypeSelected(wxCommandEvent &event) override
void OnDrillShapeSelected(wxCommandEvent &event) override
bool TransferDataFromWindow() override
Updates the different parameters for the component being edited.
void PadOrientEvent(wxCommandEvent &event) override
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
bool padValuesOK()
test if all values are acceptable for the pad
Module description (excepted pads)
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...