diff --git a/pcbnew/dialogs/panel_edit_options.cpp b/pcbnew/dialogs/panel_edit_options.cpp index 536b194252..5949e53881 100644 --- a/pcbnew/dialogs/panel_edit_options.cpp +++ b/pcbnew/dialogs/panel_edit_options.cpp @@ -37,7 +37,7 @@ PANEL_EDIT_OPTIONS::PANEL_EDIT_OPTIONS( PCB_BASE_EDIT_FRAME* aFrame, PAGED_DIALO m_magneticPads->Show( dynamic_cast( m_frame ) != nullptr ); m_magneticGraphics->Show( dynamic_cast( m_frame ) != nullptr ); m_flipLeftRight->Show( dynamic_cast( m_frame ) != nullptr ); - m_addUnlockedPads->Show( dynamic_cast( m_frame ) != nullptr ); + m_autoLockPads->Show( dynamic_cast( m_frame ) != nullptr ); #ifdef __WXOSX_MAC__ m_mouseCmdsOSX->Show( true ); @@ -72,7 +72,7 @@ bool PANEL_EDIT_OPTIONS::TransferDataToWindow() m_magneticTrackChoice->SetSelection( static_cast( general_opts.m_MagneticItems.tracks ) ); m_magneticGraphicsChoice->SetSelection( !general_opts.m_MagneticItems.graphics ); m_flipLeftRight->SetValue( general_opts.m_FlipLeftRight ); - m_addUnlockedPads->SetValue( general_opts.m_AddUnlockedPads ); + m_autoLockPads->SetValue( !general_opts.m_AddUnlockedPads ); m_Show_Page_Limits->SetValue( m_frame->ShowPageLimits() ); @@ -117,7 +117,7 @@ bool PANEL_EDIT_OPTIONS::TransferDataFromWindow() m_frame->Settings().m_FlipLeftRight = m_flipLeftRight->GetValue(); m_frame->SetShowPageLimits( m_Show_Page_Limits->GetValue() ); - m_frame->Settings().m_AddUnlockedPads = m_addUnlockedPads->GetValue(); + m_frame->Settings().m_AddUnlockedPads = !m_autoLockPads->GetValue(); if( m_rbTrackDragMove->GetValue() ) pcbnewSettings.m_TrackDragAction = TRACK_DRAG_ACTION::MOVE; diff --git a/pcbnew/dialogs/panel_edit_options_base.cpp b/pcbnew/dialogs/panel_edit_options_base.cpp index 1e37c0e4b8..44a945d8c5 100644 --- a/pcbnew/dialogs/panel_edit_options_base.cpp +++ b/pcbnew/dialogs/panel_edit_options_base.cpp @@ -23,33 +23,39 @@ 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 ); - bOptionsSizer->Add( m_magneticPads, 0, wxRIGHT|wxLEFT, 5 ); - - - bOptionsSizer->Add( 0, 3, 0, wxEXPAND, 5 ); + bSizeFPEdit->Add( m_magneticPads, 0, wxBOTTOM, 3 ); m_magneticGraphics = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Magnetic graphics"), wxDefaultPosition, wxDefaultSize, 0 ); - bOptionsSizer->Add( m_magneticGraphics, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizeFPEdit->Add( m_magneticGraphics, 0, wxBOTTOM, 15 ); - bOptionsSizer->Add( 0, 6, 0, wxEXPAND, 5 ); + bOptionsSizer->Add( bSizeFPEdit, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizerBoardEdit; + bSizerBoardEdit = new wxBoxSizer( wxVERTICAL ); + + m_autoLockPads = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Lock pads of newly added footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + m_autoLockPads->SetToolTip( _("If checked, when a footprint is added to the board, the pads will be freely moveable.") ); + + bSizerBoardEdit->Add( m_autoLockPads, 0, wxBOTTOM, 15 ); + + 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, 15 ); + + + bOptionsSizer->Add( bSizerBoardEdit, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizerUniversal; + bSizerUniversal = new wxBoxSizer( wxVERTICAL ); m_segments45OnlyCtrl = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to H, V and 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); m_segments45OnlyCtrl->SetToolTip( _("When drawing graphic lines force to horizontal, vertical, or 45 degrees.") ); - bOptionsSizer->Add( m_segments45OnlyCtrl, 0, wxALL, 5 ); - - - bOptionsSizer->Add( 0, 6, 0, wxEXPAND, 5 ); - - m_flipLeftRight = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Flip board items L/R (default is T/B)"), wxDefaultPosition, wxDefaultSize, 0 ); - bOptionsSizer->Add( m_flipLeftRight, 0, wxALL, 5 ); - - m_addLockedPads = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Add footprints with pads unlocked"), wxDefaultPosition, wxDefaultSize, 0 ); - m_addLockedPads->SetToolTip( _("If checked, when a footprint is added to the board, the pads will be freely moveable.") ); - - bOptionsSizer->Add( m_addLockedPads, 0, wxALL, 5 ); + bSizerUniversal->Add( m_segments45OnlyCtrl, 0, wxBOTTOM, 3 ); wxFlexGridSizer* fgSizer12; fgSizer12 = new wxFlexGridSizer( 0, 2, 0, 0 ); @@ -59,7 +65,7 @@ PANEL_EDIT_OPTIONS_BASE::PANEL_EDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID i m_staticTextRotationAngle = new wxStaticText( bOptionsSizer->GetStaticBox(), wxID_ANY, _("&Rotation angle:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextRotationAngle->Wrap( -1 ); - fgSizer12->Add( m_staticTextRotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + fgSizer12->Add( m_staticTextRotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); m_rotationAngle = new wxTextCtrl( bOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_rotationAngle->SetToolTip( _("Set increment (in degrees) for context menu and hotkey rotation.") ); @@ -67,7 +73,10 @@ PANEL_EDIT_OPTIONS_BASE::PANEL_EDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID i fgSizer12->Add( m_rotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); - bOptionsSizer->Add( fgSizer12, 0, wxEXPAND|wxTOP, 5 ); + bSizerUniversal->Add( fgSizer12, 0, wxEXPAND, 5 ); + + + bOptionsSizer->Add( bSizerUniversal, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); bMiddleLeftSizer->Add( bOptionsSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); diff --git a/pcbnew/dialogs/panel_edit_options_base.fbp b/pcbnew/dialogs/panel_edit_options_base.fbp index 7c8e072ec8..1428001c51 100644 --- a/pcbnew/dialogs/panel_edit_options_base.fbp +++ b/pcbnew/dialogs/panel_edit_options_base.fbp @@ -86,375 +86,18 @@ none 5 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Magnetic pads - - 0 - - - 0 + wxEXPAND|wxRIGHT|wxLEFT + 1 + - 1 - m_magneticPads - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND - 0 - - 3 - protected - 0 - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 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 - 0 - - 6 - protected - 0 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_SEGMENTS45 - L&imit graphic lines to H, V and 45 degrees - - 0 - - - 0 - - 1 - m_segments45OnlyCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - When drawing graphic lines force to horizontal, vertical, or 45 degrees. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND - 0 - - 6 - protected - 0 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Flip board items L/R (default is T/B) - - 0 - - - 0 - - 1 - m_flipLeftRight - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Add footprints with pads unlocked - - 0 - - - 0 - - 1 - m_addLockedPads - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - If checked, when a footprint is added to the board, the pads will be freely moveable. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND|wxTOP - 0 - - 2 - wxBOTH - 1 - - 0 - - fgSizer12 - wxFLEX_GROWMODE_SPECIFIED + bSizeFPEdit + wxVERTICAL none - 0 - 0 - 5 - wxALIGN_CENTER_VERTICAL|wxALL + 3 + wxBOTTOM 0 - + 1 1 1 @@ -468,6 +111,7 @@ 1 0 + 0 1 1 @@ -482,8 +126,7 @@ 0 0 wxID_ANY - &Rotation angle: - 0 + Magnetic pads 0 @@ -491,7 +134,7 @@ 0 1 - m_staticTextRotationAngle + m_magneticPads 1 @@ -502,79 +145,439 @@ 1 - + ; ; forward_declare 0 - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_rotationAngle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Set increment (in degrees) for context menu and hotkey rotation. wxFILTER_NONE wxDefaultValidator - + + 15 + 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 + 0 + + + bSizerBoardEdit + wxVERTICAL + none + + 15 + wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Lock pads of newly added footprints + + 0 + + + 0 + + 1 + m_autoLockPads + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + If checked, when a footprint is added to the board, the pads will be freely moveable. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 15 + wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Flip board items L/R (default is T/B) + + 0 + + + 0 + + 1 + m_flipLeftRight + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + + bSizerUniversal + wxVERTICAL + none + + 3 + wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_SEGMENTS45 + L&imit graphic lines to H, V and 45 degrees + + 0 + + + 0 + + 1 + m_segments45OnlyCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + When drawing graphic lines force to horizontal, vertical, or 45 degrees. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 0 + + 2 + wxBOTH + 1 + + 0 + + fgSizer12 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Rotation angle: + 0 + + 0 + + + 0 + + 1 + m_staticTextRotationAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_rotationAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Set increment (in degrees) for context menu and hotkey rotation. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + diff --git a/pcbnew/dialogs/panel_edit_options_base.h b/pcbnew/dialogs/panel_edit_options_base.h index ad598b9c92..881d6cefdb 100644 --- a/pcbnew/dialogs/panel_edit_options_base.h +++ b/pcbnew/dialogs/panel_edit_options_base.h @@ -16,9 +16,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -43,9 +43,9 @@ class PANEL_EDIT_OPTIONS_BASE : public wxPanel wxCheckBox* m_magneticPads; wxCheckBox* m_magneticGraphics; - wxCheckBox* m_segments45OnlyCtrl; + wxCheckBox* m_autoLockPads; wxCheckBox* m_flipLeftRight; - wxCheckBox* m_addLockedPads; + wxCheckBox* m_segments45OnlyCtrl; wxStaticText* m_staticTextRotationAngle; wxTextCtrl* m_rotationAngle; wxStaticBoxSizer* m_mouseCmdsWinLin;