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 SetIncludeInBom( bool aInclude ) { m_excludeFromBomCheckBox->SetValue( !aInclude ); }
81  bool GetIncludeInBom() const { return !m_excludeFromBomCheckBox->GetValue(); }
82 
83  void SetIncludeOnBoard( bool aInclude ) { m_excludeFromBoardCheckBox->SetValue( !aInclude ); }
84  bool GetIncludeOnBoard() const { return !m_excludeFromBoardCheckBox->GetValue(); }
85 
86  void SetPinTextPosition( int position )
87  {
88  m_pinTextPosition.SetValue( position );
89  }
90  int GetPinTextPosition( void ) { return m_pinTextPosition.GetValue(); }
91 
92  void SetShowPinNumber( bool show )
93  {
94  m_checkShowPinNumber->SetValue( show );
95  }
96  bool GetShowPinNumber( void ) { return m_checkShowPinNumber->GetValue(); }
97 
98  void SetShowPinName( bool show )
99  {
100  m_checkShowPinName->SetValue( show );
101  }
102  bool GetShowPinName( void ) { return m_checkShowPinName->GetValue(); }
103 
104  void SetPinNameInside( bool show )
105  {
106  m_checkShowPinNameInside->SetValue( show );
107  }
108  bool GetPinNameInside( void ) { return m_checkShowPinNameInside->GetValue(); }
109 
110 protected:
111  virtual void OnParentSymbolSelect( wxCommandEvent& aEvent ) override;
112  virtual void onPowerCheckBox( wxCommandEvent& aEvent ) override;
113 
114 private:
115  void syncControls( bool aIsDerivedPart );
116 
118 };
119 
120 #endif // __dialog_lib_new_component__
void SetReference(const wxString &reference)
virtual void onPowerCheckBox(wxCommandEvent &aEvent) override
void SetName(const wxString &name) 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 SetIncludeOnBoard(bool aInclude)
void SetPinTextPosition(int position)
wxString GetName(void) const override
void syncControls(bool aIsDerivedPart)
void SetIncludeInBom(bool aInclude)
const char * name
Definition: DXF_plotter.cpp:59
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.
virtual void OnParentSymbolSelect(wxCommandEvent &aEvent) override
void SetAlternateBodyStyle(bool enable)