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.

76 lines
2.4 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors.
  5. *
  6. * This program is free software: you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation, either version 3 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef PANEL_EESCHEMA_DEFUALT_FIELDS_H
  20. #define PANEL_EESCHEMA_DEFUALT_FIELDS_H
  21. #include <template_fieldnames.h>
  22. #include "panel_eeschema_template_fieldnames_base.h"
  23. class SCH_EDIT_FRAME;
  24. class PANEL_EESCHEMA_TEMPLATE_FIELDNAMES : public PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE
  25. {
  26. protected:
  27. SCH_EDIT_FRAME* m_frame;
  28. TEMPLATE_FIELDNAMES m_fields;
  29. int m_checkboxColWidth;
  30. /**
  31. * Function OnAddButtonClick
  32. * Process the wxWidgets @a event produced when the user presses the Add buton for the
  33. * template fieldnames control
  34. *
  35. * @param event The wxWidgets produced event information
  36. *
  37. * Adds a new template fieldname (with default values) to the template fieldnames data
  38. */
  39. void OnAddButtonClick( wxCommandEvent& event ) override;
  40. /**
  41. * Function OnDeleteButtonClick
  42. * Process the wxWidgets @a event produced when the user presses the Delete button for the
  43. * template fieldnames control
  44. *
  45. * @param event The wxWidgets produced event information
  46. *
  47. * Deletes the selected template fieldname from the template fieldnames data
  48. */
  49. void OnDeleteButtonClick( wxCommandEvent& event ) override;
  50. public:
  51. PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow );
  52. ~PANEL_EESCHEMA_TEMPLATE_FIELDNAMES() override;
  53. private:
  54. void AdjustGridColumns( int aWidth );
  55. void OnSizeGrid( wxSizeEvent& event ) override;
  56. bool TransferDataToWindow() override;
  57. bool TransferDataFromWindow() override;
  58. bool TransferDataToGrid();
  59. bool TransferDataFromGrid();
  60. };
  61. #endif //PANEL_EESCHEMA_DEFUALT_FIELDS_H