From e3842514e7c87723446d93c291fef9f38bb6bd9f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 19 Oct 2022 11:32:16 +0100 Subject: [PATCH] Move courtyard collision setting to preferences. Also cleans up PCBNew/FPEditor edit options panel to be more in sync with each other. --- common/layer_id.cpp | 2 +- pcbnew/dialogs/panel_edit_options.cpp | 10 +- pcbnew/dialogs/panel_edit_options_base.cpp | 86 ++- pcbnew/dialogs/panel_edit_options_base.fbp | 681 +++++++++++---------- pcbnew/dialogs/panel_edit_options_base.h | 17 +- pcbnew/pcbnew_settings.cpp | 4 + pcbnew/pcbnew_settings.h | 2 + pcbnew/router/router_tool.cpp | 3 +- pcbnew/tools/edit_tool_move_fct.cpp | 19 +- pcbnew/widgets/appearance_controls.cpp | 43 +- 10 files changed, 450 insertions(+), 417 deletions(-) diff --git a/common/layer_id.cpp b/common/layer_id.cpp index 90459383f7..3b21389880 100644 --- a/common/layer_id.cpp +++ b/common/layer_id.cpp @@ -183,7 +183,7 @@ wxString LayerName( int aLayer ) case LAYER_PCB_BACKGROUND: return _( "Background" ); case LAYER_SELECT_OVERLAY: return _( "Selection highlight" ); case LAYER_LOCKED_ITEM_SHADOW: return _( "Locked item shadow" ); - case LAYER_CONFLICTS_SHADOW: return _( "Conflicting items shadow" ); + case LAYER_CONFLICTS_SHADOW: return _( "Courtyard collision shadow" ); default: wxCHECK_MSG( false, wxEmptyString, wxString::Format( "Unknown layer ID %d", aLayer ) ); diff --git a/pcbnew/dialogs/panel_edit_options.cpp b/pcbnew/dialogs/panel_edit_options.cpp index 328622c7c9..c3e573e969 100644 --- a/pcbnew/dialogs/panel_edit_options.cpp +++ b/pcbnew/dialogs/panel_edit_options.cpp @@ -67,7 +67,8 @@ void PANEL_EDIT_OPTIONS::loadPCBSettings( PCBNEW_SETTINGS* aCfg ) m_magneticTrackChoice->SetSelection( static_cast( aCfg->m_MagneticItems.tracks ) ); m_magneticGraphicsChoice->SetSelection( !aCfg->m_MagneticItems.graphics ); m_flipLeftRight->SetValue( aCfg->m_FlipLeftRight ); - m_cbPcbGraphic45Mode->SetValue( aCfg->m_Use45DegreeLimit ); + m_cbConstrainHV45Mode->SetValue( aCfg->m_Use45DegreeLimit ); + m_cbCourtyardCollisions->SetValue( aCfg->m_ShowCourtyardCollisions ); /* Set display options */ m_OptDisplayCurvedRatsnestLines->SetValue( aCfg->m_Display.m_DisplayRatsnestLinesCurved ); @@ -99,7 +100,7 @@ void PANEL_EDIT_OPTIONS::loadFPSettings( FOOTPRINT_EDITOR_SETTINGS* aCfg ) m_rotationAngle.SetAngleValue( aCfg->m_RotationAngle ); m_magneticPads->SetValue( aCfg->m_MagneticItems.pads == MAGNETIC_OPTIONS::CAPTURE_ALWAYS ); m_magneticGraphics->SetValue( aCfg->m_MagneticItems.graphics ); - m_cbFpGraphic45Mode->SetValue( aCfg->m_Use45Limit ); + m_cbConstrainHV45Mode->SetValue( aCfg->m_Use45Limit ); } @@ -138,7 +139,7 @@ bool PANEL_EDIT_OPTIONS::TransferDataFromWindow() : MAGNETIC_OPTIONS::NO_EFFECT; cfg->m_MagneticItems.graphics = m_magneticGraphics->GetValue(); - cfg->m_Use45Limit = m_cbFpGraphic45Mode->GetValue(); + cfg->m_Use45Limit = m_cbConstrainHV45Mode->GetValue(); } else { @@ -172,7 +173,8 @@ bool PANEL_EDIT_OPTIONS::TransferDataFromWindow() cfg->m_CtrlClickHighlight = m_rbCtrlClickAction->GetSelection(); #endif - cfg->m_Use45DegreeLimit = m_cbPcbGraphic45Mode->GetValue(); + cfg->m_Use45DegreeLimit = m_cbConstrainHV45Mode->GetValue(); + cfg->m_ShowCourtyardCollisions = m_cbCourtyardCollisions->GetValue(); } return true; diff --git a/pcbnew/dialogs/panel_edit_options_base.cpp b/pcbnew/dialogs/panel_edit_options_base.cpp index de9e819171..4f789687da 100644 --- a/pcbnew/dialogs/panel_edit_options_base.cpp +++ b/pcbnew/dialogs/panel_edit_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -23,58 +23,49 @@ PANEL_EDIT_OPTIONS_BASE::PANEL_EDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID i wxStaticBoxSizer* bOptionsSizer; bOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing Options") ), wxVERTICAL ); - wxBoxSizer* bSizeFPEdit; - bSizeFPEdit = new wxBoxSizer( wxVERTICAL ); - - m_magneticPads = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Magnetic pads"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizeFPEdit->Add( m_magneticPads, 0, wxBOTTOM, 3 ); - - m_magneticGraphics = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Magnetic graphics"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizeFPEdit->Add( m_magneticGraphics, 0, wxBOTTOM, 5 ); - - - bOptionsSizer->Add( bSizeFPEdit, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - wxBoxSizer* bSizerBoardEdit; bSizerBoardEdit = new wxBoxSizer( wxVERTICAL ); m_flipLeftRight = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Flip board items L/R (default is T/B)"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerBoardEdit->Add( m_flipLeftRight, 0, wxBOTTOM, 5 ); + bSizerBoardEdit->Add( m_flipLeftRight, 0, wxBOTTOM|wxLEFT, 5 ); + + m_allowFreePads = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Allow free pads"), wxDefaultPosition, wxDefaultSize, 0 ); + m_allowFreePads->SetToolTip( _("If checked, pads can be moved with respect to the rest of the footprint.") ); + + bSizerBoardEdit->Add( m_allowFreePads, 0, wxBOTTOM|wxLEFT, 5 ); + + m_staticline3 = new wxStaticLine( bOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerBoardEdit->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 4 ); - bOptionsSizer->Add( bSizerBoardEdit, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bOptionsSizer->Add( bSizerBoardEdit, 0, wxEXPAND, 5 ); wxBoxSizer* bSizerUniversal; bSizerUniversal = new wxBoxSizer( wxVERTICAL ); + m_cbConstrainHV45Mode = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Constrain actions to H, V, 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerUniversal->Add( m_cbConstrainHV45Mode, 0, wxTOP|wxBOTTOM, 5 ); + wxBoxSizer* bSizerRotationStep; bSizerRotationStep = new wxBoxSizer( wxHORIZONTAL ); m_rotationAngleLabel = new wxStaticText( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Step for &rotate commands:"), wxDefaultPosition, wxDefaultSize, 0 ); m_rotationAngleLabel->Wrap( -1 ); - bSizerRotationStep->Add( m_rotationAngleLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + bSizerRotationStep->Add( m_rotationAngleLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); m_rotationAngleCtrl = new wxTextCtrl( bOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_rotationAngleCtrl->SetToolTip( _("Set increment (in degrees) for context menu and hotkey rotation.") ); m_rotationAngleCtrl->SetMinSize( wxSize( 60,-1 ) ); - bSizerRotationStep->Add( m_rotationAngleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizerRotationStep->Add( m_rotationAngleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_rotationAngleUnits = new wxStaticText( bOptionsSizer->GetStaticBox(), wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); m_rotationAngleUnits->Wrap( -1 ); - bSizerRotationStep->Add( m_rotationAngleUnits, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + bSizerRotationStep->Add( m_rotationAngleUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); bSizerUniversal->Add( bSizerRotationStep, 0, wxEXPAND, 5 ); - m_allowFreePads = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Allow free pads"), wxDefaultPosition, wxDefaultSize, 0 ); - m_allowFreePads->SetToolTip( _("If checked, pads can be moved with respect to the rest of the footprint.") ); - - bSizerUniversal->Add( m_allowFreePads, 0, wxBOTTOM|wxRIGHT, 5 ); - - m_escClearsNetHighlight = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _(" clears net highlighting"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerUniversal->Add( m_escClearsNetHighlight, 0, wxBOTTOM|wxRIGHT, 5 ); - bOptionsSizer->Add( bSizerUniversal, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); @@ -244,14 +235,18 @@ PANEL_EDIT_OPTIONS_BASE::PANEL_EDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID i wxBoxSizer* bSizer10; bSizer10 = new wxBoxSizer( wxVERTICAL ); - wxStaticBoxSizer* sbSizerFpGraphics; - sbSizerFpGraphics = new wxStaticBoxSizer( new wxStaticBox( fpPage, wxID_ANY, _("Graphics Editing") ), wxVERTICAL ); + wxStaticBoxSizer* sbFPMagnets; + sbFPMagnets = new wxStaticBoxSizer( new wxStaticBox( fpPage, wxID_ANY, _("Magnetic Points") ), wxVERTICAL ); - m_cbFpGraphic45Mode = new wxCheckBox( sbSizerFpGraphics->GetStaticBox(), wxID_ANY, _("Constrain to H, V, 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerFpGraphics->Add( m_cbFpGraphic45Mode, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_magneticPads = new wxCheckBox( sbFPMagnets->GetStaticBox(), wxID_ANY, _("Magnetic pads"), wxDefaultPosition, wxDefaultSize, 0 ); + m_magneticPads->SetValue(true); + sbFPMagnets->Add( m_magneticPads, 0, wxBOTTOM|wxLEFT, 5 ); + + m_magneticGraphics = new wxCheckBox( sbFPMagnets->GetStaticBox(), wxID_ANY, _("Magnetic graphics"), wxDefaultPosition, wxDefaultSize, 0 ); + sbFPMagnets->Add( m_magneticGraphics, 0, wxBOTTOM|wxLEFT, 5 ); - bSizer10->Add( sbSizerFpGraphics, 1, wxEXPAND, 5 ); + bSizer10->Add( sbFPMagnets, 1, wxEXPAND, 5 ); fpPage->SetSizer( bSizer10 ); @@ -364,32 +359,31 @@ PANEL_EDIT_OPTIONS_BASE::PANEL_EDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID i pcbOptionsSizer->Add( sbSizer41, 0, wxEXPAND|wxTOP, 5 ); - wxStaticBoxSizer* sbSizerPcbGraphics; - sbSizerPcbGraphics = new wxStaticBoxSizer( new wxStaticBox( pcbPage, wxID_ANY, _("Graphics Editing") ), wxVERTICAL ); + wxStaticBoxSizer* sbSizerMisc; + sbSizerMisc = new wxStaticBoxSizer( new wxStaticBox( pcbPage, wxID_ANY, _("Miscellaneous") ), wxVERTICAL ); - m_cbPcbGraphic45Mode = new wxCheckBox( sbSizerPcbGraphics->GetStaticBox(), wxID_ANY, _("Limit actions to 45 degrees from start"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerPcbGraphics->Add( m_cbPcbGraphic45Mode, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_escClearsNetHighlight = new wxCheckBox( sbSizerMisc->GetStaticBox(), wxID_ANY, _(" clears net highlighting"), wxDefaultPosition, wxDefaultSize, 0 ); + m_escClearsNetHighlight->SetValue(true); + sbSizerMisc->Add( m_escClearsNetHighlight, 0, wxBOTTOM|wxLEFT, 5 ); - - pcbOptionsSizer->Add( sbSizerPcbGraphics, 0, wxEXPAND|wxTOP, 5 ); - - wxStaticBoxSizer* sbSizer4; - sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( pcbPage, wxID_ANY, _("Miscellaneous") ), wxVERTICAL ); - - m_showPageLimits = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 0 ); + m_showPageLimits = new wxCheckBox( sbSizerMisc->GetStaticBox(), wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 0 ); m_showPageLimits->SetValue(true); m_showPageLimits->SetToolTip( _("Draw an outline to show the sheet size.") ); - sbSizer4->Add( m_showPageLimits, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + sbSizerMisc->Add( m_showPageLimits, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_autoRefillZones = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Auto-refill zones"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbCourtyardCollisions = new wxCheckBox( sbSizerMisc->GetStaticBox(), wxID_ANY, _("Show courtyard collisions when moving/dragging"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbCourtyardCollisions->SetValue(true); + sbSizerMisc->Add( m_cbCourtyardCollisions, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_autoRefillZones = new wxCheckBox( sbSizerMisc->GetStaticBox(), wxID_ANY, _("Auto-refill zones"), wxDefaultPosition, wxDefaultSize, 0 ); m_autoRefillZones->SetValue(true); m_autoRefillZones->SetToolTip( _("If checked, zones will be re-filled after editing the properties of the zone using the Zone Properties dialog") ); - sbSizer4->Add( m_autoRefillZones, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + sbSizerMisc->Add( m_autoRefillZones, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - pcbOptionsSizer->Add( sbSizer4, 1, wxEXPAND|wxTOP, 5 ); + pcbOptionsSizer->Add( sbSizerMisc, 1, wxEXPAND|wxTOP, 5 ); pcbPage->SetSizer( pcbOptionsSizer ); diff --git a/pcbnew/dialogs/panel_edit_options_base.fbp b/pcbnew/dialogs/panel_edit_options_base.fbp index efd7f3636c..a80c6729e9 100644 --- a/pcbnew/dialogs/panel_edit_options_base.fbp +++ b/pcbnew/dialogs/panel_edit_options_base.fbp @@ -89,146 +89,7 @@ none 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - - bSizeFPEdit - wxVERTICAL - none - - 3 - wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Magnetic pads - - 0 - - - 0 - - 1 - m_magneticPads - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Magnetic graphics - - 0 - - - 0 - - 1 - m_magneticGraphics - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT + wxEXPAND 0 @@ -237,7 +98,7 @@ none 5 - wxBOTTOM + wxBOTTOM|wxLEFT 0 1 @@ -299,29 +160,215 @@ + + 5 + wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Allow free pads + + 0 + + + 0 + + 1 + m_allowFreePads + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + If checked, pads can be moved with respect to the rest of the footprint. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 4 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline3 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + 5 wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizerUniversal wxVERTICAL none - + + 5 + wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Constrain actions to H, V, 45 degrees + + 0 + + + 0 + + 1 + m_cbConstrainHV45Mode + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + 5 wxEXPAND 0 - + bSizerRotationStep wxHORIZONTAL none 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT 0 1 @@ -382,7 +429,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -446,7 +493,7 @@ 5 - wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT 0 1 @@ -507,134 +554,6 @@ - - 5 - wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Allow free pads - - 0 - - - 0 - - 1 - m_allowFreePads - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - If checked, pads can be moved with respect to the rest of the footprint. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - <ESC> clears net highlighting - - 0 - - - 0 - - 1 - m_escClearsNetHighlight - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - @@ -643,7 +562,7 @@ 5 wxEXPAND|wxALL 1 - + wxID_ANY Left Click Mouse Commands @@ -651,11 +570,11 @@ wxVERTICAL 1 protected - + 5 wxALL 0 - + 1 1 1 @@ -712,11 +631,11 @@ -1 - + 5 wxEXPAND|wxTOP|wxBOTTOM 0 - + 1 1 1 @@ -770,7 +689,7 @@ - + 5 wxEXPAND 1 @@ -1335,11 +1254,11 @@ -1 - + 5 wxALL 0 - + 1 1 1 @@ -1409,7 +1328,7 @@ 5 wxEXPAND|wxALL 1 - + wxID_ANY Left Click Mouse Commands @@ -1417,11 +1336,11 @@ wxVERTICAL 1 protected - + 5 wxALL 0 - + 1 1 1 @@ -1478,11 +1397,11 @@ -1 - + 5 wxEXPAND|wxTOP|wxBOTTOM 0 - + 1 1 1 @@ -1536,11 +1455,11 @@ - + 5 wxEXPAND 1 - + 2 wxBOTH @@ -2101,11 +2020,11 @@ -1 - + 5 wxALL 0 - + 1 1 1 @@ -2353,7 +2272,7 @@ a page 0 - + 1 1 1 @@ -2404,28 +2323,92 @@ wxTAB_TRAVERSAL - + bSizer10 wxVERTICAL none - + 5 wxEXPAND 1 - + wxID_ANY - Graphics Editing + Magnetic Points - sbSizerFpGraphics + sbFPMagnets wxVERTICAL 1 none - + 5 - wxBOTTOM|wxRIGHT|wxLEFT + wxBOTTOM|wxLEFT 0 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Magnetic pads + + 0 + + + 0 + + 1 + m_magneticPads + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxBOTTOM|wxLEFT + 0 + 1 1 1 @@ -2454,7 +2437,7 @@ 0 0 wxID_ANY - Constrain to H, V, 45 degrees + Magnetic graphics 0 @@ -2462,7 +2445,7 @@ 0 1 - m_cbFpGraphic45Mode + m_magneticGraphics 1 @@ -3379,18 +3362,18 @@ 5 wxEXPAND|wxTOP - 0 + 1 wxID_ANY - Graphics Editing + Miscellaneous - sbSizerPcbGraphics + sbSizerMisc wxVERTICAL 1 none 5 - wxBOTTOM|wxRIGHT|wxLEFT + wxBOTTOM|wxLEFT 0 1 @@ -3406,7 +3389,7 @@ 1 0 - 0 + 1 1 1 @@ -3421,7 +3404,7 @@ 0 0 wxID_ANY - Limit actions to 45 degrees from start + <ESC> clears net highlighting 0 @@ -3429,7 +3412,7 @@ 0 1 - m_cbPcbGraphic45Mode + m_escClearsNetHighlight 1 @@ -3452,20 +3435,6 @@ - - - - 5 - wxEXPAND|wxTOP - 1 - - wxID_ANY - Miscellaneous - - sbSizer4 - wxVERTICAL - 1 - none 5 wxBOTTOM|wxRIGHT|wxLEFT @@ -3530,6 +3499,70 @@ + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show courtyard collisions when moving/dragging + + 0 + + + 0 + + 1 + m_cbCourtyardCollisions + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + 5 wxBOTTOM|wxRIGHT|wxLEFT diff --git a/pcbnew/dialogs/panel_edit_options_base.h b/pcbnew/dialogs/panel_edit_options_base.h index 55eb1faa65..ab74f703f7 100644 --- a/pcbnew/dialogs/panel_edit_options_base.h +++ b/pcbnew/dialogs/panel_edit_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -17,11 +17,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -38,14 +38,13 @@ class PANEL_EDIT_OPTIONS_BASE : public RESETTABLE_PANEL private: protected: - wxCheckBox* m_magneticPads; - wxCheckBox* m_magneticGraphics; wxCheckBox* m_flipLeftRight; + wxCheckBox* m_allowFreePads; + wxStaticLine* m_staticline3; + wxCheckBox* m_cbConstrainHV45Mode; wxStaticText* m_rotationAngleLabel; wxTextCtrl* m_rotationAngleCtrl; wxStaticText* m_rotationAngleUnits; - wxCheckBox* m_allowFreePads; - wxCheckBox* m_escClearsNetHighlight; wxStaticBoxSizer* m_mouseCmdsWinLin; wxStaticText* m_staticText181; wxRadioBox* m_rbCtrlClickAction; @@ -53,7 +52,8 @@ class PANEL_EDIT_OPTIONS_BASE : public RESETTABLE_PANEL wxStaticText* m_staticText1811; wxRadioBox* m_rbCtrlClickActionMac; wxSimplebook* m_optionsBook; - wxCheckBox* m_cbFpGraphic45Mode; + wxCheckBox* m_magneticPads; + wxCheckBox* m_magneticGraphics; wxStaticText* m_staticText2; wxChoice* m_magneticPadChoice; wxStaticText* m_staticText21; @@ -66,8 +66,9 @@ class PANEL_EDIT_OPTIONS_BASE : public RESETTABLE_PANEL wxRadioButton* m_rbTrackDragMove; wxRadioButton* m_rbTrackDrag45; wxRadioButton* m_rbTrackDragFree; - wxCheckBox* m_cbPcbGraphic45Mode; + wxCheckBox* m_escClearsNetHighlight; wxCheckBox* m_showPageLimits; + wxCheckBox* m_cbCourtyardCollisions; wxCheckBox* m_autoRefillZones; public: diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 2a41a5f2f3..0b2f9f4da1 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -74,6 +74,7 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_PolarCoords( false ), m_RotationAngle( ANGLE_90 ), m_ShowPageLimits( true ), + m_ShowCourtyardCollisions( true ), m_AutoRefillZones( false ), m_AllowFreePads( false ), m_PnsSettings( nullptr ), @@ -119,6 +120,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "editing.esc_clears_net_highlight", &m_ESCClearsNetHighlight, true ) ); + m_params.emplace_back( new PARAM( "editing.show_courtyard_collisions", + &m_ShowCourtyardCollisions, true ) ); + m_params.emplace_back( new PARAM( "editing.magnetic_graphics", &m_MagneticItems.graphics, true ) ); diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index 641baf34cc..8d7707926b 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -372,6 +372,8 @@ public: bool m_ShowPageLimits; + bool m_ShowCourtyardCollisions; + ///<@todo Implement real auto zone filling (not just after zone properties are edited) bool m_AutoRefillZones; // Fill zones after editing the zone using the Zone Properties dialog diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 977d39f831..0942ce3a1a 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -2000,8 +2000,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) PNS::ITEM_SET itemsToDrag; FOOTPRINT* footprint = nullptr; - // Courtyard conflicts will be tested only if the LAYER_CONFLICTS_SHADOW gal layer is visible - bool showCourtyardConflicts = frame()->GetBoard()->IsElementVisible( LAYER_CONFLICTS_SHADOW ); + bool showCourtyardConflicts = frame()->GetPcbNewSettings()->m_ShowCourtyardCollisions; std::shared_ptr drcEngine = m_toolMgr->GetTool()->GetDRCEngine(); DRC_INTERACTIVE_COURTYARD_CLEARANCE courtyardClearanceDRC( drcEngine ); diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index f8a2ef5122..624ab5da1b 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -318,6 +318,7 @@ VECTOR2I EDIT_TOOL::getSafeMovement( const VECTOR2I& aMovement, const BOX2I& aSo int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference ) { PCB_BASE_EDIT_FRAME* editFrame = getEditFrame(); + PCBNEW_SETTINGS* cfg = editFrame->GetPcbNewSettings(); BOARD* board = editFrame->GetBoard(); KIGFX::VIEW_CONTROLS* controls = getViewControls(); VECTOR2I originalCursorPos = controls->GetCursorPosition(); @@ -332,7 +333,7 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference ) }, // Prompt user regarding locked items if in board editor and in free-pad-mode (if // we're not in free-pad mode we delay this until the second RequestSelection()). - editFrame->GetPcbNewSettings()->m_AllowFreePads && !m_isFootprintEditor ); + !m_isFootprintEditor && cfg->m_AllowFreePads ); if( m_dragging || selection.Empty() ) return 0; @@ -344,7 +345,7 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference ) // Now filter out pads if not in free pads mode. We cannot do this in the first // RequestSelection() as we need the item_layers when a pad is the selection front. - if( !m_isFootprintEditor && !editFrame->GetPcbNewSettings()->m_AllowFreePads ) + if( !m_isFootprintEditor && !cfg->m_AllowFreePads ) { selection = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) @@ -425,10 +426,8 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference ) bool hv45Mode = false; bool eatFirstMouseUp = true; bool hasRedrawn3D = false; - bool allowRedraw3D = editFrame->GetPcbNewSettings()->m_Display.m_Live3DRefresh; - // Courtyard conflicts will be tested only if the LAYER_CONFLICTS_SHADOW gal layer is visible - bool showCourtyardConflicts = !m_isFootprintEditor - && board->IsElementVisible( LAYER_CONFLICTS_SHADOW ); + bool allowRedraw3D = cfg->m_Display.m_Live3DRefresh; + bool showCourtyardConflicts = !m_isFootprintEditor && cfg->m_ShowCourtyardCollisions; // Used to test courtyard overlaps std::unique_ptr drc_on_move = nullptr; @@ -552,10 +551,10 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference ) else if( !m_dragging && !evt->IsAction( &ACTIONS::refreshPreview ) ) { // Prepare to start dragging - if( !( evt->IsAction( &PCB_ACTIONS::move ) - || evt->IsAction( &PCB_ACTIONS::moveWithReference ) - || evt->IsAction( &PCB_ACTIONS::moveIndividually ) ) - && ( editFrame->GetPcbNewSettings()->m_TrackDragAction != TRACK_DRAG_ACTION::MOVE ) ) + if( !evt->IsAction( &PCB_ACTIONS::move ) + && !evt->IsAction( &PCB_ACTIONS::moveWithReference ) + && !evt->IsAction( &PCB_ACTIONS::moveIndividually ) + && cfg->m_TrackDragAction != TRACK_DRAG_ACTION::MOVE ) { if( invokeInlineRouter( PNS::DM_ANY ) ) break; diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index 696e2accbf..c48919f15c 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -338,31 +338,30 @@ const APPEARANCE_CONTROLS::APPEARANCE_SETTING APPEARANCE_CONTROLS::s_objectSetti #define RR APPEARANCE_CONTROLS::APPEARANCE_SETTING // Render Row abbreviation to reduce source width - // text id tooltip opacity slider - RR( _HKI( "Tracks" ), LAYER_TRACKS, _HKI( "Show tracks" ), true ), - RR( _HKI( "Vias" ), LAYER_VIAS, _HKI( "Show all vias" ), true ), - RR( _HKI( "Pads" ), LAYER_PADS, _HKI( "Show all pads" ), true ), - RR( _HKI( "Zones" ), LAYER_ZONES, _HKI( "Show copper zones" ), true ), - RR( _HKI( "Images" ), LAYER_DRAW_BITMAPS, _HKI( "Show user images" ), true ), + // text id tooltip opacity slider + RR( _HKI( "Tracks" ), LAYER_TRACKS, _HKI( "Show tracks" ), true ), + RR( _HKI( "Vias" ), LAYER_VIAS, _HKI( "Show all vias" ), true ), + RR( _HKI( "Pads" ), LAYER_PADS, _HKI( "Show all pads" ), true ), + RR( _HKI( "Zones" ), LAYER_ZONES, _HKI( "Show copper zones" ), true ), + RR( _HKI( "Images" ), LAYER_DRAW_BITMAPS, _HKI( "Show user images" ), true ), RR(), - RR( _HKI( "Footprints Front" ), LAYER_MOD_FR, _HKI( "Show footprints that are on board's front" ) ), - RR( _HKI( "Footprints Back" ), LAYER_MOD_BK, _HKI( "Show footprints that are on board's back" ) ), - RR( _HKI( "Through-hole Pads" ),LAYER_PADS_TH, _HKI( "Show through-hole pads" ) ), - RR( _HKI( "Values" ), LAYER_MOD_VALUES, _HKI( "Show footprint values" ) ), - RR( _HKI( "References" ), LAYER_MOD_REFERENCES, _HKI( "Show footprint references" ) ), - RR( _HKI( "Footprint Text" ), LAYER_MOD_TEXT, _HKI( "Show all footprint text" ) ), - RR( _HKI( "Hidden Text" ), LAYER_MOD_TEXT_INVISIBLE, _HKI( "Show footprint text marked as invisible" ) ), + RR( _HKI( "Footprints Front" ), LAYER_MOD_FR, _HKI( "Show footprints that are on board's front" ) ), + RR( _HKI( "Footprints Back" ), LAYER_MOD_BK, _HKI( "Show footprints that are on board's back" ) ), + RR( _HKI( "Through-hole Pads" ), LAYER_PADS_TH, _HKI( "Show through-hole pads" ) ), + RR( _HKI( "Values" ), LAYER_MOD_VALUES, _HKI( "Show footprint values" ) ), + RR( _HKI( "References" ), LAYER_MOD_REFERENCES, _HKI( "Show footprint references" ) ), + RR( _HKI( "Footprint Text" ), LAYER_MOD_TEXT, _HKI( "Show all footprint text" ) ), + RR( _HKI( "Hidden Text" ), LAYER_MOD_TEXT_INVISIBLE, _HKI( "Show footprint text marked as invisible" ) ), RR(), RR(), - RR( _HKI( "Ratsnest" ), LAYER_RATSNEST, _HKI( "Show unconnected nets as a ratsnest") ), - RR( _HKI( "DRC Warnings" ), LAYER_DRC_WARNING, _HKI( "DRC violations with a Warning severity" ) ), - RR( _HKI( "DRC Errors" ), LAYER_DRC_ERROR, _HKI( "DRC violations with an Error severity" ) ), - RR( _HKI( "DRC Exclusions" ), LAYER_DRC_EXCLUSION, _HKI( "DRC violations which have been individually excluded" ) ), - RR( _HKI( "Anchors" ), LAYER_ANCHOR, _HKI( "Show footprint and text origins as a cross" ) ), - RR( _HKI( "Shadow on Locked Items" ), LAYER_LOCKED_ITEM_SHADOW, _HKI( "Show a shadow marker on locked items" ) ), - RR( _HKI( "Shadow on Conflicts" ), LAYER_CONFLICTS_SHADOW, _HKI( "Show a shadow on overlapping courtyards while moving footprints" ) ), - RR( _HKI( "Drawing Sheet" ), LAYER_DRAWINGSHEET, _HKI( "Show drawing sheet borders and title block" ) ), - RR( _HKI( "Grid" ), LAYER_GRID, _HKI( "Show the (x,y) grid dots" ) ) + RR( _HKI( "Ratsnest" ), LAYER_RATSNEST, _HKI( "Show unconnected nets as a ratsnest") ), + RR( _HKI( "DRC Warnings" ), LAYER_DRC_WARNING, _HKI( "DRC violations with a Warning severity" ) ), + RR( _HKI( "DRC Errors" ), LAYER_DRC_ERROR, _HKI( "DRC violations with an Error severity" ) ), + RR( _HKI( "DRC Exclusions" ), LAYER_DRC_EXCLUSION, _HKI( "DRC violations which have been individually excluded" ) ), + RR( _HKI( "Anchors" ), LAYER_ANCHOR, _HKI( "Show footprint and text origins as a cross" ) ), + RR( _HKI( "Locked Item Shadow" ), LAYER_LOCKED_ITEM_SHADOW, _HKI( "Show a shadow marker on locked items" ) ), + RR( _HKI( "Drawing Sheet" ), LAYER_DRAWINGSHEET, _HKI( "Show drawing sheet borders and title block" ) ), + RR( _HKI( "Grid" ), LAYER_GRID, _HKI( "Show the (x,y) grid dots" ) ) }; /// These GAL layers are shown in the Objects tab in the footprint editor