KiCad PCB EDA Suite
dialog_lib_edit_pin.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) 2010 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef __dialog_lib_edit_pin__
26 #define __dialog_lib_edit_pin__
27 
33 #include <wx/bmpcbox.h>
34 #include <pin_shape_combobox.h>
35 #include <pin_type_combobox.h>
36 
38 
41 {
42  LIB_PIN * m_dummyPin; // a working copy used to show changes
43 
44 public:
46  DIALOG_LIB_EDIT_PIN( EDA_DRAW_FRAME* parent, LIB_PIN* aPin );
48 
49  void OnInitDialog( wxInitDialogEvent& event) override;
50 
51  void OnCloseDialog( wxCloseEvent& event ) override;
52  void OnCancelButtonClick( wxCommandEvent& event ) override;
53  void OnOKButtonClick( wxCommandEvent& event ) override;
54  void OnPaintShowPanel( wxPaintEvent& event ) override;
55  void OnPropertiesChange( wxCommandEvent& event ) override;
56 
57  void SetOrientationList( const wxArrayString& list, const BITMAP_DEF* aBitmaps );
58  void SetOrientation( int orientation )
59  {
60  m_choiceOrientation->SetSelection( orientation );
61  }
62  int GetOrientation( void ) { return m_choiceOrientation->GetSelection(); }
63 
65  {
67  }
68 
70  {
72  }
73 
74  void SetStyle( GRAPHIC_PINSHAPE style ) { m_choiceStyle->SetSelection( style ); }
76 
77  void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); }
78  wxString GetPinName( void ) { return m_textPinName->GetValue(); }
79 
80  void SetPinNameTextSize( const wxString& size )
81  {
82  m_textPinNameTextSize->SetValue( size );
83  }
84  wxString GetPinNameTextSize( void )
85  {
86  return m_textPinNameTextSize->GetValue();
87  }
88 
89  void SetPinPositionX( const wxString& aSize )
90  {
91  m_textPinPosX->SetValue( aSize );
92  }
93 
94  void SetPinPositionY( const wxString& aSize )
95  {
96  m_textPinPosY->SetValue( aSize );
97  }
98 
99  wxString GetPinPositionX()
100  {
101  return m_textPinPosX->GetValue();
102  }
103 
104  wxString GetPinPositionY()
105  {
106  return m_textPinPosY->GetValue();
107  }
108 
109  void SetPadName( const wxString& number )
110  {
111  m_textPadName->SetValue( number );
112  }
113  wxString GetPadName( void ) { return m_textPadName->GetValue(); }
114 
115  void SetPadNameTextSize( const wxString& size )
116  {
117  m_textPadNameTextSize->SetValue( size );
118  }
119  wxString GetPadNameTextSize( void )
120  {
121  return m_textPadNameTextSize->GetValue();
122  }
123 
124  void SetLength( const wxString& length )
125  {
126  m_textLength->SetValue( length );
127  }
128  wxString GetLength( void ) { return m_textLength->GetValue(); }
129 
130  void SetAddToAllParts( bool apply )
131  {
132  m_checkApplyToAllParts->SetValue( apply );
133  }
134  bool GetAddToAllParts( void )
135  {
136  return m_checkApplyToAllParts->GetValue();
137  }
138 
139  void SetAddToAllBodyStyles( bool apply )
140  {
141  m_checkApplyToAllConversions->SetValue( apply );
142  }
144  {
145  return m_checkApplyToAllConversions->GetValue();
146  }
147 
148  void SetDlgUnitsLabel( const wxString& units );
149 
150  void SetVisible( bool visible ) { m_checkShow->SetValue( visible ); }
151  bool GetVisible( void ) { return m_checkShow->GetValue(); }
152 };
153 
154 #endif // __dialog_lib_edit_pin__
void SetLength(const wxString &length)
void OnCancelButtonClick(wxCommandEvent &event) override
wxString GetPadNameTextSize(void)
PNG memory record (file in memory).
Definition: bitmap_types.h:38
void SetAddToAllParts(bool apply)
Class DIALOG_LIB_EDIT_PIN_BASE.
void SetStyle(GRAPHIC_PINSHAPE style)
void SetSelection(GRAPHIC_PINSHAPE aShape)
void SetPinPositionY(const wxString &aSize)
void SetPinNameTextSize(const wxString &size)
Implementing DIALOG_LIB_EDIT_PIN_BASE.
void OnOKButtonClick(wxCommandEvent &event) override
Class EDA_DRAW_FRAME is the base class for create windows for drawing purpose.
Definition: draw_frame.h:53
void SetOrientationList(const wxArrayString &list, const BITMAP_DEF *aBitmaps)
void OnCloseDialog(wxCloseEvent &event) override
void SetElectricalType(ELECTRICAL_PINTYPE type)
ELECTRICAL_PINTYPE GetElectricalType(void)
void SetPadNameTextSize(const wxString &size)
void SetOrientation(int orientation)
GRAPHIC_PINSHAPE
Definition: pin_shape.h:35
void SetVisible(bool visible)
ELECTRICAL_PINTYPE GetPinTypeSelection()
void OnPaintShowPanel(wxPaintEvent &event) override
ComboBox widget for pin shape.
void SetAddToAllBodyStyles(bool apply)
void SetPinPositionX(const wxString &aSize)
void SetSelection(ELECTRICAL_PINTYPE aType)
void OnInitDialog(wxInitDialogEvent &event) override
GRAPHIC_PINSHAPE GetStyle(void)
ELECTRICAL_PINTYPE
The component library pin object electrical types used in ERC tests.
Definition: pin_type.h:37
wxString GetPinNameTextSize(void)
wxBitmapComboBox * m_choiceOrientation
const char * name
DIALOG_LIB_EDIT_PIN(EDA_DRAW_FRAME *parent, LIB_PIN *aPin)
Constructor.
void SetDlgUnitsLabel(const wxString &units)
wxString GetPinName(void)
PinTypeComboBox * m_choiceElectricalType
void SetPinName(const wxString &name)
GRAPHIC_PINSHAPE GetPinShapeSelection()
ComboBox widget for pin type.
void SetPadName(const wxString &number)
void OnPropertiesChange(wxCommandEvent &event) override