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.

84 lines
2.8 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, you may find one here:
  18. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  19. * or you may search the http://www.gnu.org website for the version 2 license,
  20. * or you may write to the Free Software Foundation, Inc.,
  21. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  22. */
  23. #ifndef _DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_H_
  24. #define _DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_H_
  25. #include <dialog_edit_component_in_schematic_base.h>
  26. #include <fields_grid_table.h>
  27. class SCH_EDIT_FRAME;
  28. class LIB_PART;
  29. /**
  30. * Dialog used to edit #SCH_COMPONENT objects in a schematic.
  31. *
  32. * This is derived from DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE which is maintained by
  33. * wxFormBuilder.
  34. */
  35. class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC : public DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE
  36. {
  37. public:
  38. DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( SCH_EDIT_FRAME* aParent, SCH_COMPONENT* aComponent );
  39. ~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC() override;
  40. SCH_EDIT_FRAME* GetParent();
  41. private:
  42. SCH_COMPONENT* m_cmp;
  43. LIB_PART* m_part;
  44. int m_width;
  45. int m_delayedFocusRow;
  46. int m_delayedFocusColumn;
  47. wxString m_shownColumns;
  48. FIELDS_GRID_TABLE<SCH_FIELD>* m_fields;
  49. bool TransferDataToWindow() override;
  50. bool TransferDataFromWindow() override;
  51. bool Validate() override;
  52. // event handlers
  53. void UpdateFieldsFromLibrary( wxCommandEvent& event ) override;
  54. void OnAddField( wxCommandEvent& event ) override;
  55. void OnDeleteField( wxCommandEvent& event ) override;
  56. void OnMoveUp( wxCommandEvent& event ) override;
  57. void OnMoveDown( wxCommandEvent& event ) override;
  58. void OnBrowseLibrary( wxCommandEvent& event ) override;
  59. void OnEditSpiceModel( wxCommandEvent& event ) override;
  60. void OnSizeGrid( wxSizeEvent& event ) override;
  61. void OnGridCellChanging( wxGridEvent& event );
  62. void OnUpdateUI( wxUpdateUIEvent& event ) override;
  63. void OnCancelButtonClick( wxCommandEvent& event ) override;
  64. void OnInitDlg( wxInitDialogEvent& event ) override;
  65. void AdjustGridColumns( int aWidth );
  66. };
  67. #endif // _DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_H_