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.

118 lines
4.2 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2010-2015 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
  5. * Copyright (C) 1992-2022 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. #ifndef DIALOG_FOOTPRINT_PROPERTIES_H
  25. #define DIALOG_FOOTPRINT_PROPERTIES_H
  26. #include <dialog_footprint_properties_base.h>
  27. #include <wx/valnum.h>
  28. #include <pcb_fields_grid_table.h>
  29. #include <footprint.h>
  30. #include <widgets/unit_binder.h>
  31. class PCB_EDIT_FRAME;
  32. class PANEL_FP_PROPERTIES_3D_MODEL;
  33. class PANEL_EMBEDDED_FILES;
  34. class DIALOG_FOOTPRINT_PROPERTIES: public DIALOG_FOOTPRINT_PROPERTIES_BASE
  35. {
  36. public:
  37. // The dialog can be closed for several reasons.
  38. enum FP_PROPS_RETVALUE
  39. {
  40. FP_PROPS_CANCEL,
  41. FP_PROPS_UPDATE_FP,
  42. FP_PROPS_CHANGE_FP,
  43. FP_PROPS_OK,
  44. FP_PROPS_EDIT_BOARD_FP,
  45. FP_PROPS_EDIT_LIBRARY_FP
  46. };
  47. DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParent, FOOTPRINT* aFootprint );
  48. ~DIALOG_FOOTPRINT_PROPERTIES() override;
  49. bool Validate() override;
  50. bool TransferDataToWindow() override;
  51. bool TransferDataFromWindow() override;
  52. ///< @return the value depending on the way the dialog was closed.
  53. enum FP_PROPS_RETVALUE GetReturnValue() { return m_returnValue; }
  54. private:
  55. // virtual event functions
  56. void EditFootprint( wxCommandEvent& ) override;
  57. void EditLibraryFootprint( wxCommandEvent& ) override;
  58. void UpdateFootprint( wxCommandEvent& ) override;
  59. void ChangeFootprint( wxCommandEvent& ) override;
  60. void OnGridSize( wxSizeEvent& aEvent ) override;
  61. void OnAddField( wxCommandEvent& ) override;
  62. void OnDeleteField( wxCommandEvent& ) override;
  63. void OnUpdateUI( wxUpdateUIEvent& ) override;
  64. void OnPageChanging( wxNotebookEvent& event ) override;
  65. void OnCombobox( wxCommandEvent& event ) override;
  66. void OnText( wxCommandEvent& event ) override;
  67. void OnChoice( wxCommandEvent& event ) override;
  68. void OnCheckBox( wxCommandEvent& event ) override;
  69. void adjustGridColumns();
  70. private:
  71. PCB_EDIT_FRAME* m_frame;
  72. FOOTPRINT* m_footprint;
  73. static int m_page; // remember the last open page during session
  74. PCB_FIELDS_GRID_TABLE* m_fields;
  75. UNIT_BINDER m_posX;
  76. UNIT_BINDER m_posY;
  77. UNIT_BINDER m_orientation;
  78. UNIT_BINDER m_netClearance;
  79. UNIT_BINDER m_solderMask;
  80. UNIT_BINDER m_solderPaste;
  81. UNIT_BINDER m_solderPasteRatio;
  82. wxString m_delayedErrorMessage;
  83. wxGrid* m_delayedFocusGrid;
  84. int m_delayedFocusRow;
  85. int m_delayedFocusColumn;
  86. bool m_initialFocus;
  87. enum FP_PROPS_RETVALUE m_returnValue; // the option that closed the dialog
  88. PANEL_FP_PROPERTIES_3D_MODEL* m_3dPanel;
  89. bool m_initialized;
  90. wxSize m_gridSize;
  91. wxSize m_lastRequestedSize;
  92. PANEL_EMBEDDED_FILES* m_embeddedFiles;
  93. };
  94. #endif // DIALOG_FOOTPRINT_PROPERTIES_H