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.

75 lines
2.5 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2017 CERN
  5. * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * @author Maciej Suminski <maciej.suminski@cern.ch>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, you may find one here:
  21. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  22. * or you may search the http://www.gnu.org website for the version 2 license,
  23. * or you may write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  25. */
  26. #ifndef __DIALOG_GENCAD_EXPORT_OPTIONS_H__
  27. #define __DIALOG_GENCAD_EXPORT_OPTIONS_H__
  28. #include <dialog_shim.h>
  29. class PCB_EDIT_FRAME;
  30. class wxFilePickerCtrl;
  31. class wxCheckBox;
  32. ///< Settings for GenCAD exporter
  33. enum GENCAD_EXPORT_OPT
  34. {
  35. FLIP_BOTTOM_PADS, // flip bottom components padstacks geometry
  36. UNIQUE_PIN_NAMES, // generate unique pin names
  37. INDIVIDUAL_SHAPES, // generate a shape for each component
  38. USE_AUX_ORIGIN, // use auxiliary axis as origin
  39. STORE_ORIGIN_COORDS // saves the origin point coordinates or (0, 0)
  40. };
  41. class DIALOG_GENCAD_EXPORT_OPTIONS : public DIALOG_SHIM
  42. {
  43. public:
  44. DIALOG_GENCAD_EXPORT_OPTIONS( PCB_EDIT_FRAME* aParent, const wxString& aPath );
  45. ~DIALOG_GENCAD_EXPORT_OPTIONS();
  46. ///< Check whether an option has been selected.
  47. bool GetOption( GENCAD_EXPORT_OPT aOption ) const;
  48. ///< Return all export settings.
  49. std::map<GENCAD_EXPORT_OPT, bool> GetAllOptions() const;
  50. ///< Return the selected file path.
  51. wxString GetFileName() const;
  52. protected:
  53. bool TransferDataFromWindow() override;
  54. ///< Create checkboxes for GenCAD export options.
  55. void createOptCheckboxes();
  56. std::map<GENCAD_EXPORT_OPT, wxCheckBox*> m_options;
  57. // Widgets
  58. wxGridSizer* m_optsSizer;
  59. wxFilePickerCtrl* m_filePicker;
  60. };
  61. #endif //__DIALOG_GENCAD_EXPORT_OPTIONS_H__