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.

55 lines
1.9 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2022 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 LEGACYFILEDLG_SAVE_PROJ_H_
  20. #define LEGACYFILEDLG_SAVE_PROJ_H_
  21. #include <wx/checkbox.h>
  22. #include <wx/panel.h>
  23. #include <wx/sizer.h>
  24. ///< Helper widget to select whether a new project should be created for a file when saving
  25. class LEGACYFILEDLG_SAVE_PROJECT : public wxPanel
  26. {
  27. public:
  28. LEGACYFILEDLG_SAVE_PROJECT( wxWindow* aParent ) : wxPanel( aParent )
  29. {
  30. m_cbCreateProject =
  31. new wxCheckBox( this, wxID_ANY, _( "Create a new project for this board" ) );
  32. m_cbCreateProject->SetValue( true );
  33. m_cbCreateProject->SetToolTip( _( "Creating a project will enable features such as "
  34. "design rules, net classes, and layer presets" ) );
  35. wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL );
  36. sizer->Add( m_cbCreateProject, 0, wxALL, 8 );
  37. SetSizerAndFit( sizer );
  38. }
  39. bool GetValue() const { return m_cbCreateProject->GetValue(); }
  40. static wxWindow* Create( wxWindow* aParent )
  41. {
  42. return new LEGACYFILEDLG_SAVE_PROJECT( aParent );
  43. }
  44. protected:
  45. wxCheckBox* m_cbCreateProject;
  46. };
  47. #endif