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.

86 lines
3.1 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2017 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. #include <dialog_block_options.h>
  24. #include <wxPcbStruct.h>
  25. DIALOG_BLOCK_OPTIONS::DIALOG_BLOCK_OPTIONS( PCB_BASE_FRAME* aParent,
  26. OPTIONS& aOptions, bool aShowLegacyOptions,
  27. const wxString& aTitle ) :
  28. DIALOG_BLOCK_OPTIONS_BASE( aParent, -1, aTitle ),
  29. m_options( aOptions )
  30. {
  31. if( !aShowLegacyOptions )
  32. {
  33. m_DrawBlockItems->Hide();
  34. }
  35. m_Include_Modules->SetValue( m_options.includeModules );
  36. m_IncludeLockedModules->SetValue( m_options.includeLockedModules );
  37. if( m_Include_Modules->GetValue() )
  38. m_IncludeLockedModules->Enable();
  39. else
  40. m_IncludeLockedModules->Disable();
  41. m_Include_Tracks->SetValue( m_options.includeTracks );
  42. m_Include_Zones->SetValue( m_options.includeZones );
  43. m_Include_Draw_Items->SetValue( m_options.includeItemsOnTechLayers );
  44. m_Include_Edges_Items->SetValue( m_options.includeBoardOutlineLayer );
  45. m_Include_PcbTextes->SetValue( m_options.includePcbTexts );
  46. m_DrawBlockItems->SetValue( m_options.drawItems );
  47. m_checkBoxIncludeInvisible->SetValue( m_options.includeItemsOnInvisibleLayers );
  48. m_sdbSizer1OK->SetDefault();
  49. SetFocus();
  50. GetSizer()->SetSizeHints( this );
  51. Centre();
  52. }
  53. void DIALOG_BLOCK_OPTIONS::checkBoxClicked( wxCommandEvent& aEvent )
  54. {
  55. if( m_Include_Modules->GetValue() )
  56. m_IncludeLockedModules->Enable();
  57. else
  58. m_IncludeLockedModules->Disable();
  59. }
  60. void DIALOG_BLOCK_OPTIONS::ExecuteCommand( wxCommandEvent& event )
  61. {
  62. m_options.includeModules = m_Include_Modules->GetValue();
  63. m_options.includeLockedModules = m_IncludeLockedModules->GetValue();
  64. m_options.includeTracks = m_Include_Tracks->GetValue();
  65. m_options.includeZones = m_Include_Zones->GetValue();
  66. m_options.includeItemsOnTechLayers = m_Include_Draw_Items->GetValue();
  67. m_options.includeBoardOutlineLayer = m_Include_Edges_Items->GetValue();
  68. m_options.includePcbTexts = m_Include_PcbTextes->GetValue();
  69. m_options.drawItems = m_DrawBlockItems->GetValue();
  70. m_options.includeItemsOnInvisibleLayers = m_checkBoxIncludeInvisible->GetValue();
  71. EndModal( wxID_OK );
  72. }