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-2021 KiCad Developers, see AUTHORS.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 
28 #include <widgets/unit_binder.h>
29 
31 
32 class EDA_DRAW_FRAME;
33 class wxArrayString;
34 
36 {
37 public:
39  const wxArrayString* aRootSymbolNames = nullptr );
40 
41  void SetName( const wxString& name ) override { m_textName->SetValue( name ); }
42  wxString GetName( void ) const override { return m_textName->GetValue(); }
43 
44  wxString GetParentSymbolName() const { return m_comboInheritanceSelect->GetValue(); }
45 
46  void SetReference( const wxString& reference )
47  {
48  m_textReference->SetValue( reference );
49  }
50  wxString GetReference( void ) { return m_textReference->GetValue(); }
51 
52  void SetPartCount( int count ) { m_spinPartCount->SetValue( count ); }
53  int GetUnitCount( void ) { return m_spinPartCount->GetValue(); }
54 
55  void SetAlternateBodyStyle( bool enable )
56  {
57  m_checkHasConversion->SetValue( enable );
58  }
59  bool GetAlternateBodyStyle( void )
60  {
61  return m_checkHasConversion->GetValue();
62  }
63 
64  void SetPowerSymbol( bool enable )
65  {
66  m_checkIsPowerSymbol->SetValue( enable );
67  }
68  bool GetPowerSymbol( void ) { return m_checkIsPowerSymbol->GetValue(); }
69 
70  void SetLockItems( bool enable ) { m_checkLockItems->SetValue( enable ); }
71  bool GetLockItems( void ) { return m_checkLockItems->GetValue(); }
72 
73  void SetIncludeInBom( bool aInclude ) { m_excludeFromBomCheckBox->SetValue( !aInclude ); }
74  bool GetIncludeInBom() const { return !m_excludeFromBomCheckBox->GetValue(); }
75 
76  void SetIncludeOnBoard( bool aInclude ) { m_excludeFromBoardCheckBox->SetValue( !aInclude ); }
77  bool GetIncludeOnBoard() const { return !m_excludeFromBoardCheckBox->GetValue(); }
78 
79  void SetPinTextPosition( int position )
80  {
81  m_pinTextPosition.SetValue( position );
82  }
83  int GetPinTextPosition( void ) { return m_pinTextPosition.GetValue(); }
84 
85  void SetShowPinNumber( bool show )
86  {
87  m_checkShowPinNumber->SetValue( show );
88  }
89  bool GetShowPinNumber( void ) { return m_checkShowPinNumber->GetValue(); }
90 
91  void SetShowPinName( bool show )
92  {
93  m_checkShowPinName->SetValue( show );
94  }
95  bool GetShowPinName( void ) { return m_checkShowPinName->GetValue(); }
96 
97  void SetPinNameInside( bool show )
98  {
99  m_checkShowPinNameInside->SetValue( show );
100  }
101  bool GetPinNameInside( void ) { return m_checkShowPinNameInside->GetValue(); }
102 
103 protected:
104  virtual void OnParentSymbolSelect( wxCommandEvent& aEvent ) override;
105  virtual void onPowerCheckBox( wxCommandEvent& aEvent ) override;
106 
107 private:
108  void syncControls( bool aIsDerivedPart );
109 
111 };
112 
113 #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)
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)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void OnParentSymbolSelect(wxCommandEvent &aEvent) override
void SetAlternateBodyStyle(bool enable)