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.

65 lines
2.2 KiB

  1. /*
  2. * This program source code file is part of KICAD, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2020 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 _PANEL_TEXT_VARIABLES_H_
  24. #define _PANEL_TEXT_VARIABLES_H_
  25. #include <../common/dialogs/panel_text_variables_base.h>
  26. #include <wx/valtext.h>
  27. class PROJECT;
  28. class PANEL_TEXT_VARIABLES: public PANEL_TEXT_VARIABLES_BASE
  29. {
  30. public:
  31. PANEL_TEXT_VARIABLES( wxWindow* aParent, PROJECT* aProject );
  32. ~PANEL_TEXT_VARIABLES() override;
  33. bool TransferDataToWindow() override;
  34. bool TransferDataFromWindow() override;
  35. protected:
  36. // Various button callbacks
  37. void OnGridCellChange( wxGridEvent& event ) override;
  38. void OnGridSize( wxSizeEvent& event ) override;
  39. void OnUpdateUI( wxUpdateUIEvent& event ) override;
  40. void OnGridCellChanging( wxGridEvent& event );
  41. void OnAddTextVar( wxCommandEvent& event ) override;
  42. void OnRemoveTextVar( wxCommandEvent& event ) override;
  43. void AppendTextVar( const wxString& aName, const wxString& aValue );
  44. private:
  45. PROJECT* m_project;
  46. wxString m_errorMsg;
  47. int m_errorRow;
  48. int m_errorCol;
  49. wxTextValidator m_nameValidator;
  50. bool m_gridWidthsDirty;
  51. };
  52. #endif // _PANEL_TEXT_VARIABLES_H_