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. * @author Maciej Suminski <maciej.suminski@cern.ch>
  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_GENCAD_EXPORT_OPTIONS_H__
  25. #define __DIALOG_GENCAD_EXPORT_OPTIONS_H__
  26. #include <dialog_shim.h>
  27. class PCB_EDIT_FRAME;
  28. class wxTextCtrl;
  29. ///> Settings for GenCAD exporter
  30. enum GENCAD_EXPORT_OPT
  31. {
  32. FLIP_BOTTOM_PADS, // flip bottom components padstacks geometry
  33. UNIQUE_PIN_NAMES, // generate unique pin names
  34. INDIVIDUAL_SHAPES, // generate a shape for each component
  35. USE_AUX_ORIGIN, // use auxiliary axis as origin
  36. STORE_ORIGIN_COORDS // saves the origin point coordinates or (0, 0)
  37. };
  38. class DIALOG_GENCAD_EXPORT_OPTIONS : public DIALOG_SHIM
  39. {
  40. public:
  41. DIALOG_GENCAD_EXPORT_OPTIONS( PCB_EDIT_FRAME* aParent );
  42. ~DIALOG_GENCAD_EXPORT_OPTIONS();
  43. ///> Checks whether an option has been selected
  44. bool GetOption( GENCAD_EXPORT_OPT aOption ) const;
  45. ///> Returns all export settings
  46. std::map<GENCAD_EXPORT_OPT, bool> GetAllOptions() const;
  47. ///> Returns the selected file path
  48. wxString GetFileName() const;
  49. protected:
  50. bool TransferDataFromWindow() override;
  51. ///> Creates checkboxes for GenCAD export options
  52. void createOptCheckboxes();
  53. ///> Browse output file event handler
  54. void onBrowse( wxCommandEvent& aEvent );
  55. std::map<GENCAD_EXPORT_OPT, wxCheckBox*> m_options;
  56. // Widgets
  57. wxGridSizer* m_optsSizer;
  58. wxTextCtrl* m_filePath;
  59. };
  60. #endif //__DIALOG_GENCAD_EXPORT_OPTIONS_H__