You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.5 KiB

  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. #ifndef __dialog_lib_edit_pin__
  25. #define __dialog_lib_edit_pin__
  26. /**
  27. * @file
  28. * Subclass of DIALOG_LIB_EDIT_PIN_BASE, which is generated by wxFormBuilder.
  29. */
  30. #include <wx/bmpcbox.h>
  31. #include <dialog_lib_edit_pin_base.h>
  32. /** Implementing DIALOG_LIB_EDIT_PIN_BASE */
  33. class DIALOG_LIB_EDIT_PIN : public DIALOG_LIB_EDIT_PIN_BASE
  34. {
  35. LIB_PIN * m_dummyPin; // a working copy used to show changes
  36. public:
  37. /** Constructor */
  38. DIALOG_LIB_EDIT_PIN( EDA_DRAW_FRAME* parent, LIB_PIN* aPin );
  39. ~DIALOG_LIB_EDIT_PIN();
  40. void OnCloseDialog( wxCloseEvent& event );
  41. void OnCancelButtonClick( wxCommandEvent& event );
  42. void OnOKButtonClick( wxCommandEvent& event );
  43. void OnPaintShowPanel( wxPaintEvent& event );
  44. void OnPropertiesChange( wxCommandEvent& event );
  45. void SetOrientationList( const wxArrayString& list, const BITMAP_DEF* aBitmaps );
  46. void SetOrientation( int orientation )
  47. {
  48. m_choiceOrientation->SetSelection( orientation );
  49. }
  50. int GetOrientation( void ) { return m_choiceOrientation->GetSelection(); }
  51. void SetElectricalTypeList( const wxArrayString& list, const BITMAP_DEF* aBitmaps );
  52. void SetElectricalType( int type )
  53. {
  54. m_choiceElectricalType->SetSelection( type );
  55. }
  56. int GetElectricalType( void )
  57. {
  58. return m_choiceElectricalType->GetSelection();
  59. }
  60. void SetStyleList( const wxArrayString& list, const BITMAP_DEF* aBitmaps );
  61. void SetStyle( int style ) { m_choiceStyle->SetSelection( style ); }
  62. int GetStyle( void ) { return m_choiceStyle->GetSelection(); }
  63. void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); }
  64. wxString GetPinName( void ) { return m_textPinName->GetValue(); }
  65. void SetPinNameTextSize( const wxString& size )
  66. {
  67. m_textPinNameTextSize->SetValue( size );
  68. }
  69. wxString GetPinNameTextSize( void )
  70. {
  71. return m_textPinNameTextSize->GetValue();
  72. }
  73. void SetPinNameTextSizeUnits( const wxString& units )
  74. {
  75. m_staticNameTextSizeUnits->SetLabel( units );
  76. }
  77. void SetPadName( const wxString& number )
  78. {
  79. m_textPadName->SetValue( number );
  80. }
  81. wxString GetPadName( void ) { return m_textPadName->GetValue(); }
  82. void SetPadNameTextSize( const wxString& size )
  83. {
  84. m_textPadNameTextSize->SetValue( size );
  85. }
  86. wxString GetPadNameTextSize( void )
  87. {
  88. return m_textPadNameTextSize->GetValue();
  89. }
  90. void SetPadNameTextSizeUnits( const wxString& units )
  91. {
  92. m_staticNumberTextSizeUnits->SetLabel( units );
  93. }
  94. void SetLength( const wxString& length )
  95. {
  96. m_textLength->SetValue( length );
  97. }
  98. wxString GetLength( void ) { return m_textLength->GetValue(); }
  99. void SetLengthUnits( const wxString& units )
  100. {
  101. m_staticLengthUnits->SetLabel( units );
  102. }
  103. void SetAddToAllParts( bool apply )
  104. {
  105. m_checkApplyToAllParts->SetValue( apply );
  106. }
  107. bool GetAddToAllParts( void )
  108. {
  109. return m_checkApplyToAllParts->GetValue();
  110. }
  111. void SetAddToAllBodyStyles( bool apply )
  112. {
  113. m_checkApplyToAllConversions->SetValue( apply );
  114. }
  115. bool GetAddToAllBodyStyles( void )
  116. {
  117. return m_checkApplyToAllConversions->GetValue();
  118. }
  119. void SetVisible( bool visible ) { m_checkShow->SetValue( visible ); }
  120. bool GetVisible( void ) { return m_checkShow->GetValue(); }
  121. };
  122. #endif // __dialog_lib_edit_pin__