KiCad PCB EDA Suite
dialog_lib_new_component.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) 2009 Wayne Stambaugh <stambaughw@gmail.com>
5  * Copyright (C) 2015-2019 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_new_component__
26 #define __dialog_lib_new_component__
27 
33 #include <widgets/unit_binder.h>
34 
36 
37 class EDA_DRAW_FRAME;
38 class wxArrayString;
39 
42 {
43 public:
46  const wxArrayString* aRootSymbolNames = nullptr );
47 
48  void SetName( const wxString& name ) override { m_textName->SetValue( name ); }
49  wxString GetName( void ) const override { return m_textName->GetValue(); }
50 
51  wxString GetParentSymbolName() const { return m_comboInheritanceSelect->GetValue(); }
52 
53  void SetReference( const wxString& reference )
54  {
55  m_textReference->SetValue( reference );
56  }
57  wxString GetReference( void ) { return m_textReference->GetValue(); }
58 
59  void SetPartCount( int count ) { m_spinPartCount->SetValue( count ); }
60  int GetUnitCount( void ) { return m_spinPartCount->GetValue(); }
61 
62  void SetAlternateBodyStyle( bool enable )
63  {
64  m_checkHasConversion->SetValue( enable );
65  }
66  bool GetAlternateBodyStyle( void )
67  {
68  return m_checkHasConversion->GetValue();
69  }
70 
71  void SetPowerSymbol( bool enable )
72  {
73  m_checkIsPowerSymbol->SetValue( enable );
74  }
75  bool GetPowerSymbol( void ) { return m_checkIsPowerSymbol->GetValue(); }
76 
77  void SetLockItems( bool enable ) { m_checkLockItems->SetValue( enable ); }
78  bool GetLockItems( void ) { return m_checkLockItems->GetValue(); }
79 
80  void SetPinTextPosition( int position )
81  {
82  m_pinTextPosition.SetValue( position );
83  }
84  int GetPinTextPosition( void ) { return m_pinTextPosition.GetValue(); }
85 
86  void SetShowPinNumber( bool show )
87  {
88  m_checkShowPinNumber->SetValue( show );
89  }
90  bool GetShowPinNumber( void ) { return m_checkShowPinNumber->GetValue(); }
91 
92  void SetShowPinName( bool show )
93  {
94  m_checkShowPinName->SetValue( show );
95  }
96  bool GetShowPinName( void ) { return m_checkShowPinName->GetValue(); }
97 
98  void SetPinNameInside( bool show )
99  {
100  m_checkShowPinNameInside->SetValue( show );
101  }
102  bool GetPinNameInside( void ) { return m_checkShowPinNameInside->GetValue(); }
103 
104 protected:
105  virtual void OnParentSymbolSelect( wxCommandEvent& event ) override;
106 
107 private:
108  void syncControls( bool aIsDerivedPart );
109 
111 };
112 
113 #endif // __dialog_lib_new_component__
void SetReference(const wxString &reference)
void SetName(const wxString &name) override
virtual void OnParentSymbolSelect(wxCommandEvent &event) override
The base class for create windows for drawing purpose.
DIALOG_LIB_NEW_COMPONENT(EDA_DRAW_FRAME *parent, const wxArrayString *aRootSymbolNames=nullptr)
Constructor.
Class DIALOG_LIB_NEW_COMPONENT_BASE.
void SetPinTextPosition(int position)
wxString GetName(void) const override
void syncControls(bool aIsDerivedPart)
const char * name
Definition: DXF_plotter.cpp:60
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
Implementing DIALOG_LIB_NEW_COMPONENT.
void SetAlternateBodyStyle(bool enable)