From 155620cc9afb04b53f4e365ea8c34665998b3482 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 29 May 2022 21:28:10 +0100 Subject: [PATCH] Move H/V/45 mode from zone properties to toolbar. Fixes https://gitlab.com/kicad/code/kicad/issues/8587 --- bitmaps_png/CMakeLists.txt | 1 + bitmaps_png/png/hv45mode_24.png | Bin 0 -> 200 bytes bitmaps_png/sources/light/hv45mode.svg | 84 +++++++++++ include/bitmaps/bitmap_info.h | 1 + include/bitmaps/bitmaps_list.h | 3 +- pcbnew/board_design_settings.cpp | 3 - pcbnew/dialogs/dialog_copper_zones.cpp | 4 +- pcbnew/dialogs/dialog_copper_zones_base.cpp | 29 ++-- pcbnew/dialogs/dialog_copper_zones_base.fbp | 99 ++----------- pcbnew/dialogs/dialog_copper_zones_base.h | 8 +- .../dialog_non_copper_zones_properties.cpp | 4 +- ...ialog_non_copper_zones_properties_base.cpp | 12 +- ...ialog_non_copper_zones_properties_base.fbp | 82 +---------- .../dialog_non_copper_zones_properties_base.h | 8 +- .../dialogs/dialog_rule_area_properties.cpp | 3 - .../dialog_rule_area_properties_base.cpp | 11 +- .../dialog_rule_area_properties_base.fbp | 73 +-------- .../dialog_rule_area_properties_base.h | 1 - pcbnew/footprint_edit_frame.cpp | 7 + pcbnew/pcb_edit_frame.cpp | 139 +++++++++--------- pcbnew/plugins/kicad/pcb_parser.cpp | 4 +- pcbnew/plugins/legacy/legacy_plugin.cpp | 5 +- pcbnew/toolbars_footprint_editor.cpp | 3 + pcbnew/toolbars_pcb_editor.cpp | 3 + pcbnew/tools/drawing_tool.cpp | 10 +- pcbnew/tools/pcb_actions.cpp | 2 +- pcbnew/tools/zone_create_helper.cpp | 5 +- pcbnew/zone.cpp | 2 - pcbnew/zone.h | 5 - pcbnew/zone_settings.cpp | 9 +- pcbnew/zone_settings.h | 3 +- 31 files changed, 237 insertions(+), 386 deletions(-) create mode 100644 bitmaps_png/png/hv45mode_24.png create mode 100644 bitmaps_png/sources/light/hv45mode.svg diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index 68f04469cf..92a6a92a93 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -299,6 +299,7 @@ set( BMAPS_MID hotkeys hole_to_hole_clearance hole_to_copper_clearance + hv45mode icon_cvpcb_24 icon_footprint_browser icon_gerbview_24 diff --git a/bitmaps_png/png/hv45mode_24.png b/bitmaps_png/png/hv45mode_24.png new file mode 100644 index 0000000000000000000000000000000000000000..7adb2f0536f1c3c74be618da5a02cf196170774a GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+ieoq(25R21Cr<~<&P~dT!dvN~_ z_Ri!CpM7$3oXS&}Z7uw47ff8y=&!f!`u7F7T#?hnHf*@h()v%mXQ|Jm%ZCC^a~<{J z;+tNoq2Z{d6OeN$z?S8MxnhTXD@UF9q8-9#Cax`$I`~)m&da@QAH6NQGp9!Nt}Z*w zQMY=^1OGPRJttXMZ!q^S_Z7Yrcjvl)L%*y|;5G+-(?4HbP0l+XkK0iR5i literal 0 HcmV?d00001 diff --git a/bitmaps_png/sources/light/hv45mode.svg b/bitmaps_png/sources/light/hv45mode.svg new file mode 100644 index 0000000000..e8e53d5a15 --- /dev/null +++ b/bitmaps_png/sources/light/hv45mode.svg @@ -0,0 +1,84 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/include/bitmaps/bitmap_info.h b/include/bitmaps/bitmap_info.h index cdd0a660c4..9632042986 100644 --- a/include/bitmaps/bitmap_info.h +++ b/include/bitmaps/bitmap_info.h @@ -335,6 +335,7 @@ const std::vector g_BitmapInfo = { { BITMAPS::hotkeys, wxT( "hotkeys_24.png" ), 24, wxT( "light" ) }, { BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_24.png" ), 24, wxT( "light" ) }, { BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_24.png" ), 24, wxT( "light" ) }, + { BITMAPS::hv45mode, wxT( "hv45mode_24.png" ), 24, wxT( "light" ) }, { BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_24.png" ), 24, wxT( "light" ) }, { BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_24.png" ), 24, wxT( "light" ) }, { BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) }, diff --git a/include/bitmaps/bitmaps_list.h b/include/bitmaps/bitmaps_list.h index 0658b66074..8e4d4419a4 100644 --- a/include/bitmaps/bitmaps_list.h +++ b/include/bitmaps/bitmaps_list.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2007-2017 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.TXT for contributors. + * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.TXT for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -229,6 +229,7 @@ enum class BITMAPS : unsigned int hole_to_copper_clearance, hole_to_hole_clearance, hotkeys, + hv45mode, icon_3d, icon_bitmap2component, icon_bitmap2component_16, diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 7ea08417b1..f78fa5beb8 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -703,9 +703,6 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: &m_DimensionExtensionOffset, Millimeter2iu( DEFAULT_DIMENSION_EXTENSION_OFFSET ) ) ); - m_params.emplace_back( new PARAM( "defaults.zones.45_degree_only", - &m_defaultZoneSettings.m_Zone_45_Only, false ) ); - m_params.emplace_back( new PARAM_SCALED( "defaults.zones.min_clearance", &m_defaultZoneSettings.m_ZoneClearance, Mils2iu( ZONE_CLEARANCE_MIL ), Millimeter2iu( 0.0 ), Millimeter2iu( 25.0 ), MM_PER_IU ) ); diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index 1568acdc6c..1634fc5ae7 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -238,7 +238,6 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* bool DIALOG_COPPER_ZONE::TransferDataToWindow() { - m_constrainOutline->SetValue( m_settings.m_Zone_45_Only ); m_cbLocked->SetValue( m_settings.m_Locked ); m_cornerSmoothingChoice->SetSelection( m_settings.GetCornerSmoothingType() ); m_cornerRadius.SetValue( m_settings.GetCornerRadius() ); @@ -542,7 +541,6 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aUseExportableSetupOnly ) m_settings.m_ZonePriority = m_PriorityLevelCtrl->GetValue(); - m_settings.m_Zone_45_Only = m_constrainOutline->GetValue(); m_settings.m_Locked = m_cbLocked->GetValue(); m_settings.m_ThermalReliefGap = m_antipadClearance.GetValue(); diff --git a/pcbnew/dialogs/dialog_copper_zones_base.cpp b/pcbnew/dialogs/dialog_copper_zones_base.cpp index c0eaeb881a..5fa0ec4d5a 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.cpp +++ b/pcbnew/dialogs/dialog_copper_zones_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -124,56 +124,53 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i gbSizer1->SetFlexibleDirection( wxBOTH ); gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_constrainOutline = new wxCheckBox( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Constrain outline to H, V and 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_constrainOutline, wxGBPosition( 0, 0 ), wxGBSpan( 1, 3 ), wxRIGHT, 5 ); - m_cbLocked = new wxCheckBox( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Locked"), wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_cbLocked, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT, 5 ); + gbSizer1->Add( m_cbLocked, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT, 5 ); m_staticTextStyle = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Outline display:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextStyle->Wrap( -1 ); - gbSizer1->Add( m_staticTextStyle, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + gbSizer1->Add( m_staticTextStyle, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); wxString m_OutlineDisplayCtrlChoices[] = { _("Line"), _("Hatched"), _("Fully hatched") }; int m_OutlineDisplayCtrlNChoices = sizeof( m_OutlineDisplayCtrlChoices ) / sizeof( wxString ); m_OutlineDisplayCtrl = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_OUTLINEAPPEARANCECTRL, wxDefaultPosition, wxDefaultSize, m_OutlineDisplayCtrlNChoices, m_OutlineDisplayCtrlChoices, 0 ); m_OutlineDisplayCtrl->SetSelection( 0 ); - gbSizer1->Add( m_OutlineDisplayCtrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer1->Add( m_OutlineDisplayCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_stBorderHatchPitchText = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Outline hatch pitch:"), wxDefaultPosition, wxDefaultSize, 0 ); m_stBorderHatchPitchText->Wrap( -1 ); - gbSizer1->Add( m_stBorderHatchPitchText, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + gbSizer1->Add( m_stBorderHatchPitchText, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_outlineHatchPitchCtrl = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), ID_M_CORNERSMOOTHINGCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_outlineHatchPitchCtrl, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + gbSizer1->Add( m_outlineHatchPitchCtrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_outlineHatchUnits = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_outlineHatchUnits->Wrap( -1 ); - gbSizer1->Add( m_outlineHatchUnits, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer1->Add( m_outlineHatchUnits, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_staticline4 = new wxStaticLine( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - gbSizer1->Add( m_staticline4, wxGBPosition( 4, 0 ), wxGBSpan( 1, 3 ), wxEXPAND | wxALL, 5 ); + gbSizer1->Add( m_staticline4, wxGBPosition( 3, 0 ), wxGBSpan( 1, 3 ), wxEXPAND | wxALL, 5 ); m_staticTextSmoothing = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Corner smoothing:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextSmoothing->Wrap( -1 ); - gbSizer1->Add( m_staticTextSmoothing, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + gbSizer1->Add( m_staticTextSmoothing, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); wxString m_cornerSmoothingChoiceChoices[] = { _("None"), _("Chamfer"), _("Fillet") }; int m_cornerSmoothingChoiceNChoices = sizeof( m_cornerSmoothingChoiceChoices ) / sizeof( wxString ); m_cornerSmoothingChoice = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_CORNER_SMOOTHING, wxDefaultPosition, wxDefaultSize, m_cornerSmoothingChoiceNChoices, m_cornerSmoothingChoiceChoices, 0 ); m_cornerSmoothingChoice->SetSelection( 1 ); - gbSizer1->Add( m_cornerSmoothingChoice, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + gbSizer1->Add( m_cornerSmoothingChoice, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_cornerRadiusLabel = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Chamfer distance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_cornerRadiusLabel->Wrap( -1 ); - gbSizer1->Add( m_cornerRadiusLabel, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + gbSizer1->Add( m_cornerRadiusLabel, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_cornerRadiusCtrl = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), ID_M_CORNERSMOOTHINGCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_cornerRadiusCtrl, wxGBPosition( 6, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + gbSizer1->Add( m_cornerRadiusCtrl, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_cornerRadiusUnits = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_cornerRadiusUnits->Wrap( -1 ); - gbSizer1->Add( m_cornerRadiusUnits, wxGBPosition( 6, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer1->Add( m_cornerRadiusUnits, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); gbSizer1->AddGrowableCol( 0 ); diff --git a/pcbnew/dialogs/dialog_copper_zones_base.fbp b/pcbnew/dialogs/dialog_copper_zones_base.fbp index a168217fb0..6155564150 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.fbp +++ b/pcbnew/dialogs/dialog_copper_zones_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,7 +14,6 @@ dialog_copper_zones_base 1000 none - 1 dialog_copper_zones_base @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -52,7 +50,6 @@ DIALOG_SHIM; dialog_shim.h Copper Zone Properties - 0 @@ -807,7 +804,7 @@ wxEXPAND|wxBOTTOM|wxRIGHT 1 - + -1,-1 wxBOTH 0 @@ -817,79 +814,12 @@ wxFLEX_GROWMODE_SPECIFIED none 5 - - 5 - 3 - 0 - wxRIGHT - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Constrain outline to H, V and 45 degrees - - 0 - - - 0 - - 1 - m_constrainOutline - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - 5 1 0 wxBOTTOM|wxRIGHT - 1 + 0 1 1 @@ -956,7 +886,7 @@ 1 0 wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 2 + 1 1 1 @@ -1020,7 +950,7 @@ 1 1 wxEXPAND|wxALIGN_CENTER_VERTICAL - 2 + 1 1 1 @@ -1087,7 +1017,7 @@ 1 0 wxALIGN_CENTER_VERTICAL|wxLEFT - 3 + 2 1 1 @@ -1151,7 +1081,7 @@ 1 1 wxALIGN_CENTER_VERTICAL|wxEXPAND - 3 + 2 1 1 @@ -1218,7 +1148,7 @@ 1 2 wxALIGN_CENTER_VERTICAL - 3 + 2 1 1 @@ -1282,7 +1212,7 @@ 3 0 wxEXPAND | wxALL - 4 + 3 1 1 @@ -1343,7 +1273,7 @@ 1 0 wxALIGN_CENTER_VERTICAL|wxLEFT - 5 + 4 1 1 @@ -1407,7 +1337,7 @@ 1 1 wxALIGN_CENTER_VERTICAL|wxEXPAND - 5 + 4 1 1 @@ -1474,7 +1404,7 @@ 1 0 wxALIGN_CENTER_VERTICAL|wxLEFT - 6 + 5 1 1 @@ -1538,7 +1468,7 @@ 1 1 wxALIGN_CENTER_VERTICAL|wxEXPAND - 6 + 5 1 1 @@ -1605,7 +1535,7 @@ 1 2 wxALIGN_CENTER_VERTICAL - 6 + 5 1 1 @@ -4104,7 +4034,6 @@ - 0 diff --git a/pcbnew/dialogs/dialog_copper_zones_base.h b/pcbnew/dialogs/dialog_copper_zones_base.h index 77b1215a5b..3428ffc298 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.h +++ b/pcbnew/dialogs/dialog_copper_zones_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -28,10 +28,10 @@ #include #include #include -#include #include #include #include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -70,7 +70,6 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM wxTextCtrl* m_tcZoneName; wxStaticText* m_staticTextPriorityLevel; wxSpinCtrl* m_PriorityLevelCtrl; - wxCheckBox* m_constrainOutline; wxCheckBox* m_cbLocked; wxStaticText* m_staticTextStyle; wxChoice* m_OutlineDisplayCtrl; @@ -124,7 +123,7 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; - // Virtual event handlers, override them in your derived class + // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnLayerSelection( wxDataViewEvent& event ) { event.Skip(); } @@ -140,7 +139,6 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM public: DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id = ID_DIALOG_COPPER_ZONE_BASE, const wxString& title = _("Copper Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_COPPER_ZONE_BASE(); }; diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp b/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp index bdabe367d2..f82eb6dddc 100644 --- a/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp +++ b/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -117,7 +117,6 @@ bool DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow() m_cornerRadius.SetValue( m_settings.GetCornerRadius() ); m_minWidth.SetValue( m_settings.m_ZoneMinThickness ); - m_ConstrainOpt->SetValue( m_settings.m_Zone_45_Only ); m_cbLocked->SetValue( m_settings.m_Locked ); switch( m_settings.m_ZoneBorderDisplayStyle ) @@ -247,7 +246,6 @@ bool DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataFromWindow() auto cfg = m_parent->GetPcbNewSettings(); cfg->m_Zones.hatching_style = static_cast( m_settings.m_ZoneBorderDisplayStyle ); - m_settings.m_Zone_45_Only = m_ConstrainOpt->GetValue(); m_settings.m_Locked = m_cbLocked->GetValue(); // Get the layer selection for this zone diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp index 4454ffea1e..52604178ed 100644 --- a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp +++ b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -47,12 +47,10 @@ DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE::DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE( gbSizer1 = new wxGridBagSizer( 0, 0 ); gbSizer1->SetFlexibleDirection( wxBOTH ); gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_ConstrainOpt = new wxCheckBox( sbShape->GetStaticBox(), wxID_ANY, _("Constrain outline to H, V and 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_ConstrainOpt, wxGBPosition( 0, 0 ), wxGBSpan( 1, 3 ), wxALL, 5 ); + gbSizer1->SetEmptyCellSize( wxSize( -1,6 ) ); m_cbLocked = new wxCheckBox( sbShape->GetStaticBox(), wxID_ANY, _("Locked"), wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_cbLocked, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + gbSizer1->Add( m_cbLocked, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); m_staticTextStyle = new wxStaticText( sbShape->GetStaticBox(), wxID_ANY, _("Outline style:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextStyle->Wrap( -1 ); @@ -113,7 +111,7 @@ DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE::DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE( sbShape->Add( gbSizer1, 0, wxEXPAND, 5 ); - bSizerMiddle->Add( sbShape, 0, wxEXPAND, 5 ); + bSizerMiddle->Add( sbShape, 0, wxEXPAND|wxBOTTOM, 5 ); wxStaticBoxSizer* sbFill; sbFill = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fill") ), wxVERTICAL ); @@ -196,7 +194,7 @@ DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE::DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE( sbFill->Add( fgSizer1, 0, wxEXPAND, 5 ); - bSizerMiddle->Add( sbFill, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 ); + bSizerMiddle->Add( sbFill, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); m_UpperSizer->Add( bSizerMiddle, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 ); diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp index ddbd4aa4f2..c5c1d16cec 100644 --- a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp +++ b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,7 +14,6 @@ dialog_non_copper_zones_properties_base 1000 none - 1 dialog_non_copper_zones_properties_base @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -50,9 +48,8 @@ -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Non Copper Zones Properties + Non Copper Zone Properties - 0 wxFULL_REPAINT_ON_RESIZE|wxBORDER_SUNKEN @@ -192,7 +189,7 @@ none 5 - wxEXPAND + wxEXPAND|wxBOTTOM 0 wxID_ANY @@ -207,7 +204,7 @@ wxEXPAND 0 - + -1,6 wxBOTH 1 @@ -219,78 +216,11 @@ 0 5 - 3 + 1 0 wxALL 0 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Constrain outline to H, V and 45 degrees - - 0 - - - 0 - - 1 - m_ConstrainOpt - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 1 - 0 - wxBOTTOM|wxRIGHT|wxLEFT - 1 - 1 1 1 @@ -1203,7 +1133,7 @@ - 10 + 5 wxEXPAND|wxTOP|wxBOTTOM 0 diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h index 09bd3c352c..aaf42514b1 100644 --- a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h +++ b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -41,7 +41,6 @@ class DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE : public DIALOG_SHIM protected: wxStaticText* m_staticTextLayerSelection; wxDataViewListCtrl* m_layers; - wxCheckBox* m_ConstrainOpt; wxCheckBox* m_cbLocked; wxStaticText* m_staticTextStyle; wxChoice* m_OutlineDisplayCtrl; @@ -76,7 +75,7 @@ class DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE : public DIALOG_SHIM wxButton* m_sdbSizerButtonsOK; wxButton* m_sdbSizerButtonsCancel; - // Virtual event handlers, override them in your derived class + // Virtual event handlers, overide them in your derived class virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnLayerSelection( wxDataViewEvent& event ) { event.Skip(); } virtual void OnStyleSelection( wxCommandEvent& event ) { event.Skip(); } @@ -84,8 +83,7 @@ class DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE : public DIALOG_SHIM public: - DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxBORDER_SUNKEN ); - + DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxBORDER_SUNKEN ); ~DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE(); }; diff --git a/pcbnew/dialogs/dialog_rule_area_properties.cpp b/pcbnew/dialogs/dialog_rule_area_properties.cpp index 31dcfeb751..aaf2024466 100644 --- a/pcbnew/dialogs/dialog_rule_area_properties.cpp +++ b/pcbnew/dialogs/dialog_rule_area_properties.cpp @@ -101,8 +101,6 @@ bool DIALOG_RULE_AREA_PROPERTIES::TransferDataToWindow() m_cbLocked->SetValue( m_zonesettings.m_Locked ); - m_cbConstrainCtrl->SetValue( m_zonesettings.m_Zone_45_Only ); - m_tcName->SetValue( m_zonesettings.m_Name ); switch( m_zonesettings.m_ZoneBorderDisplayStyle ) @@ -185,7 +183,6 @@ bool DIALOG_RULE_AREA_PROPERTIES::TransferDataFromWindow() auto cfg = m_parent->GetPcbNewSettings(); cfg->m_Zones.hatching_style = static_cast( m_zonesettings.m_ZoneBorderDisplayStyle ); - m_zonesettings.m_Zone_45_Only = m_cbConstrainCtrl->GetValue(); m_zonesettings.m_Locked = m_cbLocked->GetValue(); m_zonesettings.m_ZonePriority = 0; // for a keepout, this param is not used. diff --git a/pcbnew/dialogs/dialog_rule_area_properties_base.cpp b/pcbnew/dialogs/dialog_rule_area_properties_base.cpp index 3cf0715768..d4d9eefdc1 100644 --- a/pcbnew/dialogs/dialog_rule_area_properties_base.cpp +++ b/pcbnew/dialogs/dialog_rule_area_properties_base.cpp @@ -93,7 +93,7 @@ DIALOG_RULE_AREA_PROPERTIES_BASE::DIALOG_RULE_AREA_PROPERTIES_BASE( wxWindow* pa m_cbFootprintsCtrl = new wxCheckBox( this, wxID_ANY, _("Keep out footprints"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbFootprintsCtrl->SetToolTip( _("Raise a DRC error if a footprint courtyard overlaps this area") ); - fgSizer2->Add( m_cbFootprintsCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + fgSizer2->Add( m_cbFootprintsCtrl, 0, wxRIGHT|wxLEFT, 5 ); bSizerRight->Add( fgSizer2, 0, wxEXPAND, 5 ); @@ -102,10 +102,10 @@ DIALOG_RULE_AREA_PROPERTIES_BASE::DIALOG_RULE_AREA_PROPERTIES_BASE( wxWindow* pa bSizerRight->Add( 0, 3, 0, wxEXPAND, 5 ); - bSizerRight->Add( 0, 0, 0, wxEXPAND|wxTOP, 5 ); + bSizerRight->Add( 0, 0, 0, wxEXPAND, 5 ); - bSizerRight->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + bSizerRight->Add( 0, 0, 0, wxEXPAND|wxBOTTOM, 5 ); wxGridBagSizer* gbSizer1; gbSizer1 = new wxGridBagSizer( 3, 3 ); @@ -113,11 +113,6 @@ DIALOG_RULE_AREA_PROPERTIES_BASE::DIALOG_RULE_AREA_PROPERTIES_BASE( wxWindow* pa gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); gbSizer1->SetEmptyCellSize( wxSize( -1,2 ) ); - m_cbConstrainCtrl = new wxCheckBox( this, wxID_ANY, _("Constrain outline to H, V and 45 deg"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbConstrainCtrl->SetToolTip( _("Draw the area using horizontal, vertical and 45 degree lines only") ); - - gbSizer1->Add( m_cbConstrainCtrl, wxGBPosition( 0, 0 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_VERTICAL, 5 ); - m_staticTextStyle = new wxStaticText( this, wxID_ANY, _("Outline display:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextStyle->Wrap( -1 ); gbSizer1->Add( m_staticTextStyle, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); diff --git a/pcbnew/dialogs/dialog_rule_area_properties_base.fbp b/pcbnew/dialogs/dialog_rule_area_properties_base.fbp index 8b14c64af1..f19f9787a1 100644 --- a/pcbnew/dialogs/dialog_rule_area_properties_base.fbp +++ b/pcbnew/dialogs/dialog_rule_area_properties_base.fbp @@ -733,7 +733,7 @@ 5 - wxBOTTOM|wxRIGHT|wxLEFT + wxRIGHT|wxLEFT 0 1 @@ -809,7 +809,7 @@ 5 - wxEXPAND|wxTOP + wxEXPAND 0 0 @@ -819,7 +819,7 @@ 5 - wxEXPAND|wxTOP|wxBOTTOM + wxEXPAND|wxBOTTOM 0 0 @@ -842,73 +842,6 @@ wxFLEX_GROWMODE_SPECIFIED none 3 - - 5 - 3 - 0 - wxALIGN_CENTER_VERTICAL - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Constrain outline to H, V and 45 deg - - 0 - - - 0 - - 1 - m_cbConstrainCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - Draw the area using horizontal, vertical and 45 degree lines only - - wxFILTER_NONE - wxDefaultValidator - - - - - - 5 1 diff --git a/pcbnew/dialogs/dialog_rule_area_properties_base.h b/pcbnew/dialogs/dialog_rule_area_properties_base.h index 4a8181d90a..81be6908b0 100644 --- a/pcbnew/dialogs/dialog_rule_area_properties_base.h +++ b/pcbnew/dialogs/dialog_rule_area_properties_base.h @@ -49,7 +49,6 @@ class DIALOG_RULE_AREA_PROPERTIES_BASE : public DIALOG_SHIM wxCheckBox* m_cbPadsCtrl; wxCheckBox* m_cbCopperPourCtrl; wxCheckBox* m_cbFootprintsCtrl; - wxCheckBox* m_cbConstrainCtrl; wxStaticText* m_staticTextStyle; wxChoice* m_OutlineDisplayCtrl; wxStaticText* m_stBorderHatchPitchText; diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 0236d6a651..601e5561ca 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -1107,6 +1107,12 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) ); mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) ); + auto constrainedDrawingModeCond = + [this]( const SELECTION& ) + { + return GetSettings()->m_Use45Limit; + }; + auto highContrastCond = [this]( const SELECTION& ) { @@ -1131,6 +1137,7 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions() return m_auimgr.GetPane( "LayersManager" ).IsShown(); }; + mgr->SetConditions( PCB_ACTIONS::toggleHV45Mode, CHECK( constrainedDrawingModeCond ) ); mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) ); mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) ); mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) ); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index d27c5f268b..bfaf0483d6 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -658,59 +658,66 @@ void PCB_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) ); - auto enableBoardSetupCondition = - [this] ( const SELECTION& ) - { - if( DRC_TOOL* tool = m_toolManager->GetTool() ) - return !tool->IsDRCDialogShown(); + auto constrainedDrawingModeCond = + [this]( const SELECTION& ) + { + return GetPcbNewSettings()->m_Use45DegreeLimit; + }; - return true; - }; + auto enableBoardSetupCondition = + [this] ( const SELECTION& ) + { + if( DRC_TOOL* tool = m_toolManager->GetTool() ) + return !tool->IsDRCDialogShown(); + + return true; + }; auto boardFlippedCond = - [this]( const SELECTION& ) - { - return GetCanvas()->GetView()->IsMirroredX(); - }; + [this]( const SELECTION& ) + { + return GetCanvas()->GetView()->IsMirroredX(); + }; auto layerManagerCond = - [this] ( const SELECTION& ) - { - return LayerManagerShown(); - }; + [this] ( const SELECTION& ) + { + return LayerManagerShown(); + }; auto highContrastCond = - [this] ( const SELECTION& ) - { - return GetDisplayOptions().m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL; - }; + [this] ( const SELECTION& ) + { + return GetDisplayOptions().m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL; + }; auto globalRatsnestCond = - [this] (const SELECTION& ) - { - return Settings().m_Display.m_ShowGlobalRatsnest; - }; + [this] (const SELECTION& ) + { + return Settings().m_Display.m_ShowGlobalRatsnest; + }; auto curvedRatsnestCond = - [this] (const SELECTION& ) - { - return Settings().m_Display.m_DisplayRatsnestLinesCurved; - }; + [this] (const SELECTION& ) + { + return Settings().m_Display.m_DisplayRatsnestLinesCurved; + }; auto netHighlightCond = - [this]( const SELECTION& ) - { - KIGFX::RENDER_SETTINGS* settings = GetCanvas()->GetView()->GetPainter()->GetSettings(); - return !settings->GetHighlightNetCodes().empty(); - }; + [this]( const SELECTION& ) + { + KIGFX::RENDER_SETTINGS* settings = GetCanvas()->GetView()->GetPainter()->GetSettings(); + return !settings->GetHighlightNetCodes().empty(); + }; auto enableNetHighlightCond = - [this]( const SELECTION& ) - { - BOARD_INSPECTION_TOOL* tool = m_toolManager->GetTool(); - return tool->IsNetHighlightSet(); - }; + [this]( const SELECTION& ) + { + BOARD_INSPECTION_TOOL* tool = m_toolManager->GetTool(); + return tool->IsNetHighlightSet(); + }; + mgr->SetConditions( PCB_ACTIONS::toggleHV45Mode, CHECK( constrainedDrawingModeCond ) ); mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) ); mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) ); mgr->SetConditions( PCB_ACTIONS::showLayersManager, CHECK( layerManagerCond ) ); @@ -721,44 +728,44 @@ void PCB_EDIT_FRAME::setupUIConditions() mgr->SetConditions( PCB_ACTIONS::boardSetup, ENABLE( enableBoardSetupCondition ) ); auto isHighlightMode = - [this]( const SELECTION& ) - { - ROUTER_TOOL* tool = m_toolManager->GetTool(); - return tool->GetRouterMode() == PNS::RM_MarkObstacles; - }; + [this]( const SELECTION& ) + { + ROUTER_TOOL* tool = m_toolManager->GetTool(); + return tool->GetRouterMode() == PNS::RM_MarkObstacles; + }; auto isShoveMode = - [this]( const SELECTION& ) - { - ROUTER_TOOL* tool = m_toolManager->GetTool(); - return tool->GetRouterMode() == PNS::RM_Shove; - }; + [this]( const SELECTION& ) + { + ROUTER_TOOL* tool = m_toolManager->GetTool(); + return tool->GetRouterMode() == PNS::RM_Shove; + }; auto isWalkaroundMode = - [this]( const SELECTION& ) - { - ROUTER_TOOL* tool = m_toolManager->GetTool(); - return tool->GetRouterMode() == PNS::RM_Walkaround; - }; + [this]( const SELECTION& ) + { + ROUTER_TOOL* tool = m_toolManager->GetTool(); + return tool->GetRouterMode() == PNS::RM_Walkaround; + }; mgr->SetConditions( PCB_ACTIONS::routerHighlightMode, CHECK( isHighlightMode ) ); mgr->SetConditions( PCB_ACTIONS::routerShoveMode, CHECK( isShoveMode ) ); mgr->SetConditions( PCB_ACTIONS::routerWalkaroundMode, CHECK( isWalkaroundMode ) ); auto haveNetCond = - [] ( const SELECTION& aSel ) - { - for( EDA_ITEM* item : aSel ) + [] ( const SELECTION& aSel ) { - if( BOARD_CONNECTED_ITEM* bci = dynamic_cast( item ) ) + for( EDA_ITEM* item : aSel ) { - if( bci->GetNetCode() > 0 ) - return true; + if( BOARD_CONNECTED_ITEM* bci = dynamic_cast( item ) ) + { + if( bci->GetNetCode() > 0 ) + return true; + } } - } - return false; - }; + return false; + }; mgr->SetConditions( PCB_ACTIONS::showNet, ENABLE( haveNetCond ) ); mgr->SetConditions( PCB_ACTIONS::hideNet, ENABLE( haveNetCond ) ); @@ -797,11 +804,11 @@ void PCB_EDIT_FRAME::setupUIConditions() auto isDrcRunning = - [this] ( const SELECTION& ) - { - DRC_TOOL* tool = m_toolManager->GetTool(); - return !tool->IsDRCRunning(); - }; + [this] ( const SELECTION& ) + { + DRC_TOOL* tool = m_toolManager->GetTool(); + return !tool->IsDRCRunning(); + }; #define CURRENT_EDIT_TOOL( action ) mgr->SetConditions( action, ACTION_CONDITIONS().Check( cond.CurrentTool( action ) ).Enable( isDrcRunning ) ) diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index 0283f20753..c7cdd4440b 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -1904,8 +1904,8 @@ void PCB_PARSER::parseSetup() NeedRIGHT(); break; - case T_zone_45_only: - zoneSettings.m_Zone_45_Only = parseBool(); + case T_zone_45_only: // legacy setting + /* zoneSettings.m_Zone_45_Only = */ parseBool(); m_board->m_LegacyDesignSettingsLoaded = true; NeedRIGHT(); break; diff --git a/pcbnew/plugins/legacy/legacy_plugin.cpp b/pcbnew/plugins/legacy/legacy_plugin.cpp index b45b15f630..843543dbfd 100644 --- a/pcbnew/plugins/legacy/legacy_plugin.cpp +++ b/pcbnew/plugins/legacy/legacy_plugin.cpp @@ -919,10 +919,9 @@ void LEGACY_PLUGIN::loadSETUP() BIU tmp = biuParse( line + SZ( "ZoneClearence" ) ); zs.m_ZoneClearance = tmp; } - else if( TESTLINE( "Zone_45_Only" ) ) + else if( TESTLINE( "Zone_45_Only" ) ) // No longer used { - bool tmp = (bool) intParse( line + SZ( "Zone_45_Only" ) ); - zs.m_Zone_45_Only = tmp; + /* bool tmp = (bool) */ intParse( line + SZ( "Zone_45_Only" ) ); } else if( TESTLINE( "DrawSegmWidth" ) ) { diff --git a/pcbnew/toolbars_footprint_editor.cpp b/pcbnew/toolbars_footprint_editor.cpp index 6d0ef7d4d4..f026cdd60b 100644 --- a/pcbnew/toolbars_footprint_editor.cpp +++ b/pcbnew/toolbars_footprint_editor.cpp @@ -220,6 +220,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar() m_optionsToolBar->Add( ACTIONS::millimetersUnits, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->Add( ACTIONS::toggleCursorStyle, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->AddScaledSeparator( this ); + m_optionsToolBar->Add( PCB_ACTIONS::toggleHV45Mode, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->AddScaledSeparator( this ); m_optionsToolBar->Add( PCB_ACTIONS::padDisplayMode, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->Add( PCB_ACTIONS::graphicsOutlines, ACTION_TOOLBAR::TOGGLE ); diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index bf5f2f4adc..a11ba97cbc 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -346,6 +346,9 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar() m_optionsToolBar->Add( ACTIONS::millimetersUnits, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->Add( ACTIONS::toggleCursorStyle, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->AddScaledSeparator( this ); + m_optionsToolBar->Add( PCB_ACTIONS::toggleHV45Mode, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->AddScaledSeparator( this ); m_optionsToolBar->Add( PCB_ACTIONS::showRatsnest, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->Add( PCB_ACTIONS::ratsnestLineMode, ACTION_TOOLBAR::TOGGLE ); diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 3c504cd799..bb1cd96a4e 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -2187,7 +2187,6 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) // the geometry manager which handles the zone geometry, and hands the calculated points // over to the zone creator tool POLYGON_GEOM_MANAGER polyGeomMgr( zoneTool ); - bool constrainAngle = false; bool started = false; PCB_GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() ); STATUS_TEXT_POPUP status( m_frame ); @@ -2238,10 +2237,8 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) m_controls->ForceCursorPosition( true, cursorPos ); - if( ( sourceZone && sourceZone->GetHV45() ) || constrainAngle || Is45Limited() ) - polyGeomMgr.SetLeaderMode( POLYGON_GEOM_MANAGER::LEADER_MODE::DEG45 ); - else - polyGeomMgr.SetLeaderMode( POLYGON_GEOM_MANAGER::LEADER_MODE::DIRECT ); + polyGeomMgr.SetLeaderMode( Is45Limited() ? POLYGON_GEOM_MANAGER::LEADER_MODE::DEG45 + : POLYGON_GEOM_MANAGER::LEADER_MODE::DIRECT ); if( evt->IsCancelInteractive() ) { @@ -2318,9 +2315,6 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) { started = true; - POLYGON_GEOM_MANAGER::LEADER_MODE leaderMode = polyGeomMgr.GetLeaderMode(); - constrainAngle = ( leaderMode == POLYGON_GEOM_MANAGER::LEADER_MODE::DEG45 ); - m_controls->SetAutoPan( true ); m_controls->CaptureCursor( true ); diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index f019cfe4cb..6fff02cb0c 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -697,7 +697,7 @@ TOOL_ACTION PCB_ACTIONS::toggleHV45Mode( "pcbnew.EditorControl.toggle45", MD_SHIFT + ' ', "", _( "Constrain to H, V, 45" ), _( "Limit actions to horizontal, vertical, or 45 degrees from the starting point" ), - BITMAPS::INVALID_BITMAP ); + BITMAPS::hv45mode ); TOOL_ACTION PCB_ACTIONS::lock( "pcbnew.EditorControl.lock", AS_GLOBAL, 0, "", diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index c857c79473..821bc452d9 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -67,7 +67,6 @@ std::unique_ptr ZONE_CREATE_HELPER::createNewZone( bool aKeepout ) zoneInfo.m_Layers.reset().set( m_params.m_layer ); // TODO(JE) multilayer defaults? zoneInfo.m_NetcodeSelection = highlightedNets.empty() ? -1 : *highlightedNets.begin(); zoneInfo.SetIsRuleArea( m_params.m_keepout ); - zoneInfo.m_Zone_45_Only = ( m_params.m_leaderMode == POLYGON_GEOM_MANAGER::LEADER_MODE::DEG45 ); // If we don't have a net from highlighting, maybe we can get one from the selection PCB_SELECTION_TOOL* selectionTool = m_tool.GetManager()->GetTool(); @@ -271,8 +270,8 @@ bool ZONE_CREATE_HELPER::OnFirstPoint( POLYGON_GEOM_MANAGER& aMgr ) m_parentView.SetVisible( &m_previewItem, true ); - aMgr.SetLeaderMode( m_zone->GetHV45() ? POLYGON_GEOM_MANAGER::LEADER_MODE::DEG45 - : POLYGON_GEOM_MANAGER::LEADER_MODE::DIRECT ); + aMgr.SetLeaderMode( m_tool.Is45Limited() ? POLYGON_GEOM_MANAGER::LEADER_MODE::DEG45 + : POLYGON_GEOM_MANAGER::LEADER_MODE::DIRECT ); } } diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index 36f3c6457f..46cca8de32 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -168,8 +168,6 @@ void ZONE::InitDataFromSrcInCopyCtor( const ZONE& aZone ) SetLocalFlags( aZone.GetLocalFlags() ); m_netinfo = aZone.m_netinfo; - - m_hv45 = aZone.m_hv45; m_area = aZone.m_area; } diff --git a/pcbnew/zone.h b/pcbnew/zone.h index cc1a01764c..3dde8f6038 100644 --- a/pcbnew/zone.h +++ b/pcbnew/zone.h @@ -800,9 +800,6 @@ public: const std::vector& GetHatchLines() const { return m_borderHatchLines; } - bool GetHV45() const { return m_hv45; } - void SetHV45( bool aConstrain ) { m_hv45 = aConstrain; } - /** * Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash. * Used in zone filling calculations, to know if m_FilledPolysList is up to date. @@ -931,8 +928,6 @@ protected: /// For each layer, a set of insulated islands that were not removed std::map> m_insulatedIslands; - bool m_hv45; // constrain edges to horiz, vert or 45° - double m_area; // The filled zone area double m_outlinearea; // The outline zone area diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp index af1146e37a..e0499db750 100644 --- a/pcbnew/zone_settings.cpp +++ b/pcbnew/zone_settings.cpp @@ -1,13 +1,9 @@ -/** - * @brief class ZONE_SETTINGS used to handle zones parameters - */ - /* * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -71,7 +67,6 @@ ZONE_SETTINGS::ZONE_SETTINGS() m_padConnection = ZONE_CONNECTION::THERMAL; // How pads are covered by copper in zone - m_Zone_45_Only = false; m_Locked = false; m_cornerSmoothingType = SMOOTHING_NONE; @@ -119,7 +114,6 @@ ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE& aSource ) m_keepoutDoNotAllowTracks = aSource.GetDoNotAllowTracks(); m_keepoutDoNotAllowPads = aSource.GetDoNotAllowPads(); m_keepoutDoNotAllowFootprints = aSource.GetDoNotAllowFootprints(); - m_Zone_45_Only = aSource.GetHV45(); m_Locked = aSource.IsLocked(); m_removeIslands = aSource.GetIslandRemovalMode(); m_minIslandArea = aSource.GetMinIslandArea(); @@ -158,7 +152,6 @@ void ZONE_SETTINGS::ExportSetting( ZONE& aTarget, bool aFullExport ) const aTarget.SetDoNotAllowTracks( GetDoNotAllowTracks() ); aTarget.SetDoNotAllowPads( GetDoNotAllowPads() ); aTarget.SetDoNotAllowFootprints( GetDoNotAllowFootprints() ); - aTarget.SetHV45( m_Zone_45_Only ); aTarget.SetLocked( m_Locked ); aTarget.SetIslandRemovalMode( GetIslandRemovalMode() ); aTarget.SetMinIslandArea( GetMinIslandArea() ); diff --git a/pcbnew/zone_settings.h b/pcbnew/zone_settings.h index 9140a7ba29..4d5c483abb 100644 --- a/pcbnew/zone_settings.h +++ b/pcbnew/zone_settings.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2008-2018 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -105,7 +105,6 @@ public: long m_ThermalReliefGap; // thickness of the gap in thermal reliefs long m_ThermalReliefSpokeWidth; // thickness of the copper bridge in thermal reliefs - bool m_Zone_45_Only; bool m_Locked; /* A zone outline can be a teardrop zone with different rules