diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index aadc1ff823..7ef42e11f0 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -181,6 +181,8 @@ set( PCBNEW_DIALOGS dialogs/panel_rule_area_properties_placement_base.cpp dialogs/panel_setup_constraints.cpp dialogs/panel_setup_constraints_base.cpp + dialogs/panel_setup_dimensions.cpp + dialogs/panel_setup_dimensions_base.cpp dialogs/panel_setup_formatting.cpp dialogs/panel_setup_formatting_base.cpp dialogs/panel_setup_mask_and_paste.cpp diff --git a/pcbnew/dialogs/panel_fp_editor_defaults.cpp b/pcbnew/dialogs/panel_fp_editor_defaults.cpp index e30bb6221b..d3c93c9a7a 100644 --- a/pcbnew/dialogs/panel_fp_editor_defaults.cpp +++ b/pcbnew/dialogs/panel_fp_editor_defaults.cpp @@ -21,6 +21,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "panel_fp_editor_defaults.h" + #include #include #include @@ -28,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -172,11 +174,21 @@ enum }; -PANEL_FP_EDITOR_DEFAULTS::PANEL_FP_EDITOR_DEFAULTS( wxWindow* aParent, - UNITS_PROVIDER* aUnitsProvider ) : - PANEL_FP_EDITOR_DEFAULTS_BASE( aParent ) +static BOARD_DESIGN_SETTINGS& GetPgmDesignSettings() +{ + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); + return mgr.GetAppSettings( "fpedit" )->m_DesignSettings; +} + + +PANEL_FP_EDITOR_DEFAULTS::PANEL_FP_EDITOR_DEFAULTS( wxWindow* aParent, + UNITS_PROVIDER* aUnitsProvider ) : + PANEL_FP_EDITOR_DEFAULTS_BASE( aParent ), + m_unitProvider( aUnitsProvider ), + m_designSettings( GetPgmDesignSettings() ), + m_dimensionsPanel( + std::make_unique( this, *m_unitProvider, m_designSettings ) ) { - m_unitProvider = aUnitsProvider; m_fieldPropsGrid->SetDefaultRowSize( m_fieldPropsGrid->GetDefaultRowSize() + 4 ); m_fieldPropsGrid->SetTable( new TEXT_ITEMS_GRID_TABLE( true ), true ); @@ -225,6 +237,8 @@ PANEL_FP_EDITOR_DEFAULTS::PANEL_FP_EDITOR_DEFAULTS( wxWindow* aParent, m_graphicsGrid->DeleteRows( m_graphicsGrid->GetNumberRows() - 1, 1 ); m_graphicsGrid->PushEventHandler( new GRID_TRICKS( m_graphicsGrid ) ); + + GetSizer()->Add( m_dimensionsPanel.get(), 0, wxEXPAND | wxALL, 5 ); } @@ -311,6 +325,8 @@ void PANEL_FP_EDITOR_DEFAULTS::loadFPSettings( FOOTPRINT_EDITOR_SETTINGS* aCfg ) m_graphicsGrid->SetRowLabelSize( m_graphicsGrid->GetVisibleWidth( -1, true, true, true ) ); + m_dimensionsPanel->LoadFromSettings( aCfg->m_DesignSettings ); + Layout(); } @@ -354,8 +370,7 @@ bool PANEL_FP_EDITOR_DEFAULTS::TransferDataFromWindow() if( !m_textItemsGrid->CommitPendingChanges() || !m_graphicsGrid->CommitPendingChanges() ) return false; - SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); - BOARD_DESIGN_SETTINGS& cfg = mgr.GetAppSettings( "fpedit" )->m_DesignSettings; + BOARD_DESIGN_SETTINGS& cfg = m_designSettings; // A minimal value for sizes and thickness: const int minWidth = pcbIUScale.mmToIU( MINIMUM_LINE_WIDTH_MM ); @@ -469,6 +484,8 @@ bool PANEL_FP_EDITOR_DEFAULTS::TransferDataFromWindow() cfg.m_DefaultFPTextItems.emplace_back( text, visible, layer ); } + m_dimensionsPanel->TransferDataFromWindow(); + if( errorsMsg.IsEmpty() ) return true; diff --git a/pcbnew/dialogs/panel_fp_editor_defaults.h b/pcbnew/dialogs/panel_fp_editor_defaults.h index 642be147d5..25da49a589 100644 --- a/pcbnew/dialogs/panel_fp_editor_defaults.h +++ b/pcbnew/dialogs/panel_fp_editor_defaults.h @@ -17,13 +17,17 @@ * with this program. If not, see . */ -#ifndef PANEL_FP_EDITOR_DEFAULTS_H -#define PANEL_FP_EDITOR_DEFAULTS_H +#pragma once + +#include #include +class BOARD_DESIGN_SETTINGS; class PAGED_DIALOG; class FOOTPRINT_EDITOR_SETTINGS; +class PANEL_SETUP_DIMENSIONS; +class UNITS_PROVIDER; class PANEL_FP_EDITOR_DEFAULTS : public PANEL_FP_EDITOR_DEFAULTS_BASE @@ -46,12 +50,8 @@ private: void loadFPSettings( FOOTPRINT_EDITOR_SETTINGS* aCfg ); private: - bool m_firstShow = true; - UNITS_PROVIDER* m_unitProvider; + bool m_firstShow = true; + UNITS_PROVIDER* m_unitProvider; + BOARD_DESIGN_SETTINGS& m_designSettings; + std::unique_ptr m_dimensionsPanel; }; - - - - -#endif // PANEL_FP_EDITOR_DEFAULTS_H - diff --git a/pcbnew/dialogs/panel_fp_editor_defaults_base.cpp b/pcbnew/dialogs/panel_fp_editor_defaults_base.cpp index 820d727193..8393e74e21 100644 --- a/pcbnew/dialogs/panel_fp_editor_defaults_base.cpp +++ b/pcbnew/dialogs/panel_fp_editor_defaults_base.cpp @@ -202,6 +202,7 @@ PANEL_FP_EDITOR_DEFAULTS_BASE::PANEL_FP_EDITOR_DEFAULTS_BASE( wxWindow* parent, bSizerMain->Add( bSizerMargins, 1, wxEXPAND, 5 ); + this->SetSizer( bSizerMain ); this->Layout(); bSizerMain->Fit( this ); diff --git a/pcbnew/dialogs/panel_setup_dimensions.cpp b/pcbnew/dialogs/panel_setup_dimensions.cpp new file mode 100644 index 0000000000..6785f1856a --- /dev/null +++ b/pcbnew/dialogs/panel_setup_dimensions.cpp @@ -0,0 +1,106 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018-2023 KiCad Developers, see change_log.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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "panel_setup_dimensions.h" + +#include +#include + + +PANEL_SETUP_DIMENSIONS::PANEL_SETUP_DIMENSIONS( wxWindow* aParentWindow, UNITS_PROVIDER& aUnitsProvider, + BOARD_DESIGN_SETTINGS& aBrdSettings ) : + PANEL_SETUP_DIMENSIONS_BASE( aParentWindow ), + m_parentWindow( aParentWindow ), + m_unitsProvider( aUnitsProvider ), + m_brdSettings( &aBrdSettings ), + m_arrowLength( &m_unitsProvider, aParentWindow, m_lblArrowLength, m_dimensionArrowLength, m_arrowLengthUnits ), + m_extensionOffset( &m_unitsProvider, aParentWindow, m_lblExtensionOffset, m_dimensionExtensionOffset, + m_dimensionExtensionOffsetUnits ) +{ + m_parentWindow->Bind( EDA_EVT_UNITS_CHANGED, &PANEL_SETUP_DIMENSIONS::onUnitsChanged, this ); +} + + +PANEL_SETUP_DIMENSIONS::~PANEL_SETUP_DIMENSIONS() +{ + m_parentWindow->Unbind( EDA_EVT_UNITS_CHANGED, &PANEL_SETUP_DIMENSIONS::onUnitsChanged, this ); +} + + +void PANEL_SETUP_DIMENSIONS::onUnitsChanged( wxCommandEvent& aEvent ) +{ + BOARD_DESIGN_SETTINGS tempBDS( nullptr, "dummy" ); + BOARD_DESIGN_SETTINGS* saveBDS = m_brdSettings; + + m_brdSettings = &tempBDS; // No, address of stack var does not escape function + + TransferDataFromWindow(); + TransferDataToWindow(); + + m_brdSettings = saveBDS; + + aEvent.Skip(); +} + + +bool PANEL_SETUP_DIMENSIONS::TransferDataToWindow() +{ + LoadFromSettings( *m_brdSettings ); + return true; +} + + +void PANEL_SETUP_DIMENSIONS::LoadFromSettings( const BOARD_DESIGN_SETTINGS& aBrdSettings ) +{ + m_dimensionUnits->SetSelection( static_cast( aBrdSettings.m_DimensionUnitsMode ) ); + m_dimensionUnitsFormat->SetSelection( static_cast( aBrdSettings.m_DimensionUnitsFormat ) ); + m_dimensionPrecision->SetSelection( static_cast( aBrdSettings.m_DimensionPrecision ) ); + m_dimensionSuppressZeroes->SetValue( aBrdSettings.m_DimensionSuppressZeroes ); + + int position = static_cast( aBrdSettings.m_DimensionTextPosition ); + m_dimensionTextPositionMode->SetSelection( position ); + + m_dimensionTextKeepAligned->SetValue( aBrdSettings.m_DimensionKeepTextAligned ); + m_arrowLength.SetValue( aBrdSettings.m_DimensionArrowLength ); + + m_extensionOffset.SetValue( aBrdSettings.m_DimensionExtensionOffset ); +} + + +bool PANEL_SETUP_DIMENSIONS::TransferDataFromWindow() +{ + int mode = m_dimensionUnits->GetSelection(); + m_brdSettings->m_DimensionUnitsMode = static_cast( mode ); + int format = m_dimensionUnitsFormat->GetSelection(); + m_brdSettings->m_DimensionUnitsFormat = static_cast( format ); + int precision = m_dimensionPrecision->GetSelection(); + m_brdSettings->m_DimensionPrecision = static_cast( precision ); + m_brdSettings->m_DimensionSuppressZeroes = m_dimensionSuppressZeroes->GetValue(); + int position = m_dimensionTextPositionMode->GetSelection(); + m_brdSettings->m_DimensionTextPosition = static_cast( position ); + m_brdSettings->m_DimensionKeepTextAligned = m_dimensionTextKeepAligned->GetValue(); + m_brdSettings->m_DimensionArrowLength = m_arrowLength.GetValue(); + m_brdSettings->m_DimensionExtensionOffset = m_extensionOffset.GetValue(); + + return true; +} diff --git a/pcbnew/dialogs/panel_setup_dimensions.h b/pcbnew/dialogs/panel_setup_dimensions.h new file mode 100644 index 0000000000..1a3de2345a --- /dev/null +++ b/pcbnew/dialogs/panel_setup_dimensions.h @@ -0,0 +1,57 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2024 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#pragma once + +#include +#include +#include + +#include + +class BOARD_DESIGN_SETTINGS; + + +class PANEL_SETUP_DIMENSIONS : public PANEL_SETUP_DIMENSIONS_BASE +{ +public: + PANEL_SETUP_DIMENSIONS( wxWindow* aParentWindow, UNITS_PROVIDER& aUnitsProvider, + BOARD_DESIGN_SETTINGS& aBrdSettings ); + ~PANEL_SETUP_DIMENSIONS( ) override; + + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; + + void LoadFromSettings( const BOARD_DESIGN_SETTINGS& aBrdSettings ); + +private: + void onUnitsChanged( wxCommandEvent& aEvent ); + +private: + wxWindow* m_parentWindow; + UNITS_PROVIDER& m_unitsProvider; + BOARD_DESIGN_SETTINGS* m_brdSettings; + UNIT_BINDER m_arrowLength; + UNIT_BINDER m_extensionOffset; +}; diff --git a/pcbnew/dialogs/panel_setup_dimensions_base.cpp b/pcbnew/dialogs/panel_setup_dimensions_base.cpp new file mode 100644 index 0000000000..ee848efd58 --- /dev/null +++ b/pcbnew/dialogs/panel_setup_dimensions_base.cpp @@ -0,0 +1,121 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_setup_dimensions_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_SETUP_DIMENSIONS_BASE::PANEL_SETUP_DIMENSIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) +{ + wxBoxSizer* mainSizer; + mainSizer = new wxBoxSizer( wxVERTICAL ); + + m_staticTextDefPropDim = new wxStaticText( this, wxID_ANY, _("Default properties for new dimension objects:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDefPropDim->Wrap( -1 ); + mainSizer->Add( m_staticTextDefPropDim, 0, wxTOP|wxRIGHT|wxLEFT, 8 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + mainSizer->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 8 ); + + wxGridBagSizer* gbSizer1; + gbSizer1 = new wxGridBagSizer( 0, 5 ); + gbSizer1->SetFlexibleDirection( wxVERTICAL ); + gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE ); + + m_lblDimensionUnits = new wxStaticText( this, wxID_ANY, _("Units:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lblDimensionUnits->Wrap( -1 ); + gbSizer1->Add( m_lblDimensionUnits, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + wxString m_dimensionUnitsChoices[] = { _("Inches"), _("Mils"), _("Millimeters"), _("Automatic") }; + int m_dimensionUnitsNChoices = sizeof( m_dimensionUnitsChoices ) / sizeof( wxString ); + m_dimensionUnits = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dimensionUnitsNChoices, m_dimensionUnitsChoices, 0 ); + m_dimensionUnits->SetSelection( 0 ); + m_dimensionUnits->SetToolTip( _("Default units for dimensions (\"automatic\" to follow the chosen UI units)") ); + + gbSizer1->Add( m_dimensionUnits, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + + gbSizer1->Add( 0, 0, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + m_lblTextPositionMode = new wxStaticText( this, wxID_ANY, _("Text position:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lblTextPositionMode->Wrap( -1 ); + gbSizer1->Add( m_lblTextPositionMode, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 4 ); + + wxString m_dimensionTextPositionModeChoices[] = { _("Outside"), _("Inline") }; + int m_dimensionTextPositionModeNChoices = sizeof( m_dimensionTextPositionModeChoices ) / sizeof( wxString ); + m_dimensionTextPositionMode = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dimensionTextPositionModeNChoices, m_dimensionTextPositionModeChoices, 0 ); + m_dimensionTextPositionMode->SetSelection( 0 ); + m_dimensionTextPositionMode->SetToolTip( _("Where to position the dimension text relative to the dimension line") ); + + gbSizer1->Add( m_dimensionTextPositionMode, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + m_lblDimensionUnitsFormat = new wxStaticText( this, wxID_ANY, _("Units format:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lblDimensionUnitsFormat->Wrap( -1 ); + gbSizer1->Add( m_lblDimensionUnitsFormat, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + wxString m_dimensionUnitsFormatChoices[] = { _("1234"), _("1234 mm"), _("1234 (mm)") }; + int m_dimensionUnitsFormatNChoices = sizeof( m_dimensionUnitsFormatChoices ) / sizeof( wxString ); + m_dimensionUnitsFormat = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dimensionUnitsFormatNChoices, m_dimensionUnitsFormatChoices, 0 ); + m_dimensionUnitsFormat->SetSelection( 1 ); + gbSizer1->Add( m_dimensionUnitsFormat, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + m_dimensionTextKeepAligned = new wxCheckBox( this, wxID_ANY, _("Keep text aligned"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dimensionTextKeepAligned->SetToolTip( _("When checked, dimension text will be kept aligned with dimension lines") ); + + gbSizer1->Add( m_dimensionTextKeepAligned, wxGBPosition( 1, 3 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT, 5 ); + + m_lblDimensionPrecision = new wxStaticText( this, wxID_ANY, _("Precision:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lblDimensionPrecision->Wrap( -1 ); + gbSizer1->Add( m_lblDimensionPrecision, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + wxString m_dimensionPrecisionChoices[] = { _("0"), _("0.0"), _("0.00"), _("0.000"), _("0.0000"), _("0.00000") }; + int m_dimensionPrecisionNChoices = sizeof( m_dimensionPrecisionChoices ) / sizeof( wxString ); + m_dimensionPrecision = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dimensionPrecisionNChoices, m_dimensionPrecisionChoices, 0 ); + m_dimensionPrecision->SetSelection( 4 ); + m_dimensionPrecision->SetToolTip( _("How many digits of precision to show") ); + + gbSizer1->Add( m_dimensionPrecision, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + m_lblArrowLength = new wxStaticText( this, wxID_ANY, _("Arrow length:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lblArrowLength->Wrap( -1 ); + gbSizer1->Add( m_lblArrowLength, wxGBPosition( 2, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + + m_dimensionArrowLength = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_dimensionArrowLength, wxGBPosition( 2, 4 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + m_arrowLengthUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); + m_arrowLengthUnits->Wrap( -1 ); + gbSizer1->Add( m_arrowLengthUnits, wxGBPosition( 2, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + m_dimensionSuppressZeroes = new wxCheckBox( this, wxID_ANY, _("Suppress trailing zeroes"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dimensionSuppressZeroes->SetToolTip( _("When checked, \"1.2300\" will be rendered as \"1.23\" even if precision is set to show more digits") ); + + gbSizer1->Add( m_dimensionSuppressZeroes, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + m_lblExtensionOffset = new wxStaticText( this, wxID_ANY, _("Extension line offset:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lblExtensionOffset->Wrap( -1 ); + gbSizer1->Add( m_lblExtensionOffset, wxGBPosition( 3, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + + m_dimensionExtensionOffset = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_dimensionExtensionOffset, wxGBPosition( 3, 4 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + m_dimensionExtensionOffsetUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dimensionExtensionOffsetUnits->Wrap( -1 ); + gbSizer1->Add( m_dimensionExtensionOffsetUnits, wxGBPosition( 3, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + + mainSizer->Add( gbSizer1, 1, wxEXPAND|wxTOP, 5 ); + + + this->SetSizer( mainSizer ); + this->Layout(); + mainSizer->Fit( this ); +} + +PANEL_SETUP_DIMENSIONS_BASE::~PANEL_SETUP_DIMENSIONS_BASE() +{ +} diff --git a/pcbnew/dialogs/panel_setup_dimensions_base.fbp b/pcbnew/dialogs/panel_setup_dimensions_base.fbp new file mode 100644 index 0000000000..b9c2bce243 --- /dev/null +++ b/pcbnew/dialogs/panel_setup_dimensions_base.fbp @@ -0,0 +1,1281 @@ + + + + + C++ + + 1 + connect + none + + + 0 + 1 + res + UTF-8 + panel_setup_dimensions_base + 1000 + 1 + 1 + UI + panel_setup_dimensions_base + . + 0 + source_name + 1 + 0 + source_name + + + 1 + 1 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 0 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_SETUP_DIMENSIONS_BASE + + -1,-1 + ; forward_declare + + 0 + + + wxTAB_TRAVERSAL + + + mainSizer + wxVERTICAL + none + + 8 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Default properties for new dimension objects: + 0 + + 0 + + + 0 + + 1 + m_staticTextDefPropDim + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + 8 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND|wxTOP + 1 + + + wxVERTICAL + + + 5 + + gbSizer1 + wxFLEX_GROWMODE_NONE + none + 0 + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Units: + 0 + + 0 + + + 0 + + 1 + m_lblDimensionUnits + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + "Inches" "Mils" "Millimeters" "Automatic" + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_dimensionUnits + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + Default units for dimensions ("automatic" to follow the chosen UI units) + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 1 + 2 + wxEXPAND|wxALIGN_CENTER_VERTICAL + 0 + 1 + + 0 + protected + 0 + + + + 4 + 1 + 3 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Text position: + 0 + + 0 + + + 0 + + 1 + m_lblTextPositionMode + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 4 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + "Outside" "Inline" + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_dimensionTextPositionMode + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + Where to position the dimension text relative to the dimension line + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 1 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Units format: + 0 + + 0 + + + 0 + + 1 + m_lblDimensionUnitsFormat + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM + 1 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + "1234" "1234 mm" "1234 (mm)" + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_dimensionUnitsFormat + 1 + + + protected + 1 + + Resizable + 1 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 2 + 3 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT + 1 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Keep text aligned + + 0 + + + 0 + + 1 + m_dimensionTextKeepAligned + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + When checked, dimension text will be kept aligned with dimension lines + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 2 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Precision: + 0 + + 0 + + + 0 + + 1 + m_lblDimensionPrecision + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM + 2 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + "0" "0.0" "0.00" "0.000" "0.0000" "0.00000" + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_dimensionPrecision + 1 + + + protected + 1 + + Resizable + 4 + 1 + + + ; ; forward_declare + 0 + How many digits of precision to show + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 1 + 3 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + 2 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Arrow length: + 0 + + 0 + + + 0 + + 1 + m_lblArrowLength + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 4 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM + 2 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_dimensionArrowLength + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + 1 + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 2 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + 0 + + 0 + + + 0 + + 1 + m_arrowLengthUnits + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 2 + 0 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 3 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Suppress trailing zeroes + + 0 + + + 0 + + 1 + m_dimensionSuppressZeroes + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + When checked, "1.2300" will be rendered as "1.23" even if precision is set to show more digits + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 1 + 3 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + 3 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Extension line offset: + 0 + + 0 + + + 0 + + 1 + m_lblExtensionOffset + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 4 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM + 3 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_dimensionExtensionOffset + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + 1 + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 3 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + 0 + + 0 + + + 0 + + 1 + m_dimensionExtensionOffsetUnits + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + + + + + diff --git a/pcbnew/dialogs/panel_setup_dimensions_base.h b/pcbnew/dialogs/panel_setup_dimensions_base.h new file mode 100644 index 0000000000..490d677785 --- /dev/null +++ b/pcbnew/dialogs/panel_setup_dimensions_base.h @@ -0,0 +1,63 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_SETUP_DIMENSIONS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_SETUP_DIMENSIONS_BASE : public wxPanel +{ + private: + + protected: + wxStaticText* m_staticTextDefPropDim; + wxStaticLine* m_staticline1; + wxStaticText* m_lblDimensionUnits; + wxChoice* m_dimensionUnits; + wxStaticText* m_lblTextPositionMode; + wxChoice* m_dimensionTextPositionMode; + wxStaticText* m_lblDimensionUnitsFormat; + wxChoice* m_dimensionUnitsFormat; + wxCheckBox* m_dimensionTextKeepAligned; + wxStaticText* m_lblDimensionPrecision; + wxChoice* m_dimensionPrecision; + wxStaticText* m_lblArrowLength; + wxTextCtrl* m_dimensionArrowLength; + wxStaticText* m_arrowLengthUnits; + wxCheckBox* m_dimensionSuppressZeroes; + wxStaticText* m_lblExtensionOffset; + wxTextCtrl* m_dimensionExtensionOffset; + wxStaticText* m_dimensionExtensionOffsetUnits; + + public: + + PANEL_SETUP_DIMENSIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + + ~PANEL_SETUP_DIMENSIONS_BASE(); + +}; + diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp index 1e491ae68a..120121ce6b 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp @@ -21,11 +21,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include "panel_setup_text_and_graphics.h" + #include +#include +#include #include #include -#include + #include @@ -53,16 +56,14 @@ enum }; -PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS( wxWindow* aParentWindow, +PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ) : PANEL_SETUP_TEXT_AND_GRAPHICS_BASE( aParentWindow ), - m_arrowLength( aFrame, m_lblArrowLength, m_dimensionArrowLength, m_arrowLengthUnits ), - m_extensionOffset( aFrame, m_lblExtensionOffset, m_dimensionExtensionOffset, - m_dimensionExtensionOffsetUnits ) + m_Frame( aFrame ), + m_BrdSettings( &m_Frame->GetBoard()->GetDesignSettings() ), + m_dimensionsPanel( + std::make_unique( this, *aFrame, *m_BrdSettings ) ) { - m_Frame = aFrame; - m_BrdSettings = &m_Frame->GetBoard()->GetDesignSettings(); - m_grid->SetUnitsProvider( m_Frame ); m_grid->SetAutoEvalCols( { COL_LINE_THICKNESS, COL_TEXT_WIDTH, @@ -95,6 +96,8 @@ PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS( wxWindow* aParentW m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) ); + GetSizer()->Add( m_dimensionsPanel.get(), 0, wxEXPAND | wxALL, 5 ); + m_Frame->Bind( EDA_EVT_UNITS_CHANGED, &PANEL_SETUP_TEXT_AND_GRAPHICS::onUnitsChanged, this ); } @@ -178,17 +181,7 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow() Layout(); - m_dimensionUnits->SetSelection( static_cast( m_BrdSettings->m_DimensionUnitsMode ) ); - m_dimensionUnitsFormat->SetSelection( static_cast( m_BrdSettings->m_DimensionUnitsFormat ) ); - m_dimensionPrecision->SetSelection( static_cast( m_BrdSettings->m_DimensionPrecision ) ); - m_dimensionSuppressZeroes->SetValue( m_BrdSettings->m_DimensionSuppressZeroes ); - - int position = static_cast( m_BrdSettings->m_DimensionTextPosition ); - m_dimensionTextPositionMode->SetSelection( position ); - - m_dimensionTextKeepAligned->SetValue( m_BrdSettings->m_DimensionKeepTextAligned ); - m_arrowLength.SetValue( m_BrdSettings->m_DimensionArrowLength ); - m_extensionOffset.SetValue( m_BrdSettings->m_DimensionExtensionOffset ); + m_dimensionsPanel->TransferDataToWindow(); return true; } @@ -289,21 +282,7 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow() wxGridCellBoolEditor::IsTrueValue( m_grid->GetCellValue( i, COL_TEXT_UPRIGHT ) ); } - // These are all stored in project file, not board, so no need for OnModify() - - int mode = m_dimensionUnits->GetSelection(); - m_BrdSettings->m_DimensionUnitsMode = static_cast( mode ); - int format = m_dimensionUnitsFormat->GetSelection(); - m_BrdSettings->m_DimensionUnitsFormat = static_cast( format ); - int precision = m_dimensionPrecision->GetSelection(); - m_BrdSettings->m_DimensionPrecision = static_cast( precision ); - m_BrdSettings->m_DimensionSuppressZeroes = m_dimensionSuppressZeroes->GetValue(); - int position = m_dimensionTextPositionMode->GetSelection(); - m_BrdSettings->m_DimensionTextPosition = static_cast( position ); - m_BrdSettings->m_DimensionKeepTextAligned = m_dimensionTextKeepAligned->GetValue(); - m_BrdSettings->m_DimensionArrowLength = m_arrowLength.GetValue(); - m_BrdSettings->m_DimensionExtensionOffset = m_extensionOffset.GetValue(); - + m_dimensionsPanel->TransferDataFromWindow(); if( errorsMsg.IsEmpty() ) return true; diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.h b/pcbnew/dialogs/panel_setup_text_and_graphics.h index f9baf25965..a98208faca 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.h +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2018-2024 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 @@ -21,9 +21,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma once -#ifndef PANEL_SETUP_TEXT_AND_GRAPHICS_H -#define PANEL_SETUP_TEXT_AND_GRAPHICS_H +#include #include #include @@ -31,9 +31,9 @@ #include -class PCB_EDIT_FRAME; class BOARD_DESIGN_SETTINGS; - +class PANEL_SETUP_DIMENSIONS; +class PCB_EDIT_FRAME; class PANEL_SETUP_TEXT_AND_GRAPHICS : public PANEL_SETUP_TEXT_AND_GRAPHICS_BASE { @@ -52,8 +52,6 @@ private: private: PCB_EDIT_FRAME* m_Frame; BOARD_DESIGN_SETTINGS* m_BrdSettings; - UNIT_BINDER m_arrowLength; - UNIT_BINDER m_extensionOffset; -}; -#endif //PANEL_SETUP_TEXT_AND_GRAPHICS_H + std::unique_ptr m_dimensionsPanel; +}; diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp index e1223eba2a..dbb1e9db48 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -75,102 +75,6 @@ PANEL_SETUP_TEXT_AND_GRAPHICS_BASE::PANEL_SETUP_TEXT_AND_GRAPHICS_BASE( wxWindow m_gridSizer->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - m_staticTextDefPropDim = new wxStaticText( this, wxID_ANY, _("Default properties for new dimension objects:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDefPropDim->Wrap( -1 ); - m_gridSizer->Add( m_staticTextDefPropDim, 0, wxTOP|wxRIGHT|wxLEFT, 8 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_gridSizer->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 8 ); - - wxGridBagSizer* gbSizer1; - gbSizer1 = new wxGridBagSizer( 0, 5 ); - gbSizer1->SetFlexibleDirection( wxVERTICAL ); - gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE ); - - m_lblDimensionUnits = new wxStaticText( this, wxID_ANY, _("Units:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_lblDimensionUnits->Wrap( -1 ); - gbSizer1->Add( m_lblDimensionUnits, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - - wxString m_dimensionUnitsChoices[] = { _("Inches"), _("Mils"), _("Millimeters"), _("Automatic") }; - int m_dimensionUnitsNChoices = sizeof( m_dimensionUnitsChoices ) / sizeof( wxString ); - m_dimensionUnits = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dimensionUnitsNChoices, m_dimensionUnitsChoices, 0 ); - m_dimensionUnits->SetSelection( 0 ); - m_dimensionUnits->SetToolTip( _("Default units for dimensions (\"automatic\" to follow the chosen UI units)") ); - - gbSizer1->Add( m_dimensionUnits, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - - gbSizer1->Add( 0, 0, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - m_lblTextPositionMode = new wxStaticText( this, wxID_ANY, _("Text position:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_lblTextPositionMode->Wrap( -1 ); - gbSizer1->Add( m_lblTextPositionMode, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 4 ); - - wxString m_dimensionTextPositionModeChoices[] = { _("Outside"), _("Inline") }; - int m_dimensionTextPositionModeNChoices = sizeof( m_dimensionTextPositionModeChoices ) / sizeof( wxString ); - m_dimensionTextPositionMode = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dimensionTextPositionModeNChoices, m_dimensionTextPositionModeChoices, 0 ); - m_dimensionTextPositionMode->SetSelection( 0 ); - m_dimensionTextPositionMode->SetToolTip( _("Where to position the dimension text relative to the dimension line") ); - - gbSizer1->Add( m_dimensionTextPositionMode, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - m_lblDimensionUnitsFormat = new wxStaticText( this, wxID_ANY, _("Units format:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_lblDimensionUnitsFormat->Wrap( -1 ); - gbSizer1->Add( m_lblDimensionUnitsFormat, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - - wxString m_dimensionUnitsFormatChoices[] = { _("1234"), _("1234 mm"), _("1234 (mm)") }; - int m_dimensionUnitsFormatNChoices = sizeof( m_dimensionUnitsFormatChoices ) / sizeof( wxString ); - m_dimensionUnitsFormat = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dimensionUnitsFormatNChoices, m_dimensionUnitsFormatChoices, 0 ); - m_dimensionUnitsFormat->SetSelection( 1 ); - gbSizer1->Add( m_dimensionUnitsFormat, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - m_dimensionTextKeepAligned = new wxCheckBox( this, wxID_ANY, _("Keep text aligned"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dimensionTextKeepAligned->SetToolTip( _("When checked, dimension text will be kept aligned with dimension lines") ); - - gbSizer1->Add( m_dimensionTextKeepAligned, wxGBPosition( 1, 3 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT, 5 ); - - m_lblDimensionPrecision = new wxStaticText( this, wxID_ANY, _("Precision:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_lblDimensionPrecision->Wrap( -1 ); - gbSizer1->Add( m_lblDimensionPrecision, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - - wxString m_dimensionPrecisionChoices[] = { _("0"), _("0.0"), _("0.00"), _("0.000"), _("0.0000"), _("0.00000") }; - int m_dimensionPrecisionNChoices = sizeof( m_dimensionPrecisionChoices ) / sizeof( wxString ); - m_dimensionPrecision = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dimensionPrecisionNChoices, m_dimensionPrecisionChoices, 0 ); - m_dimensionPrecision->SetSelection( 4 ); - m_dimensionPrecision->SetToolTip( _("How many digits of precision to show") ); - - gbSizer1->Add( m_dimensionPrecision, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - m_lblArrowLength = new wxStaticText( this, wxID_ANY, _("Arrow length:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_lblArrowLength->Wrap( -1 ); - gbSizer1->Add( m_lblArrowLength, wxGBPosition( 2, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - - m_dimensionArrowLength = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_dimensionArrowLength, wxGBPosition( 2, 4 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - m_arrowLengthUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); - m_arrowLengthUnits->Wrap( -1 ); - gbSizer1->Add( m_arrowLengthUnits, wxGBPosition( 2, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - - m_dimensionSuppressZeroes = new wxCheckBox( this, wxID_ANY, _("Suppress trailing zeroes"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dimensionSuppressZeroes->SetToolTip( _("When checked, \"1.2300\" will be rendered as \"1.23\" even if precision is set to show more digits") ); - - gbSizer1->Add( m_dimensionSuppressZeroes, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - - m_lblExtensionOffset = new wxStaticText( this, wxID_ANY, _("Extension line offset:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_lblExtensionOffset->Wrap( -1 ); - gbSizer1->Add( m_lblExtensionOffset, wxGBPosition( 3, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - - m_dimensionExtensionOffset = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_dimensionExtensionOffset, wxGBPosition( 3, 4 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - m_dimensionExtensionOffsetUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dimensionExtensionOffsetUnits->Wrap( -1 ); - gbSizer1->Add( m_dimensionExtensionOffsetUnits, wxGBPosition( 3, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - - - m_gridSizer->Add( gbSizer1, 1, wxEXPAND|wxTOP, 5 ); - mainSizer->Add( m_gridSizer, 0, wxLEFT, 5 ); diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp b/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp index 0ec26c2e4d..ebb1e33004 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp @@ -1,1498 +1,307 @@ - + - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - panel_setup_text_and_graphics_base - 1000 - none - - - 1 - panel_setup_text_and_graphics_base - - . - - 1 - 1 - 1 - 1 - UI - 0 - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - 1 - 1 - impl_virtual - - - 0 - wxID_ANY - + + + C++ + + 1 + connect + none + + + 0 + 1 + res + UTF-8 + panel_setup_text_and_graphics_base + 1000 + 1 + 1 + UI + panel_setup_text_and_graphics_base + . + 0 + source_name + 1 + 0 + source_name + + + 1 + 1 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 0 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_SETUP_TEXT_AND_GRAPHICS_BASE + + -1,-1 + ; forward_declare + + 0 + + + wxTAB_TRAVERSAL + + + mainSizer + wxVERTICAL + none + + 5 + wxLEFT + 0 + - PANEL_SETUP_TEXT_AND_GRAPHICS_BASE - - -1,-1 - ; forward_declare - - 0 - - - wxTAB_TRAVERSAL - + m_gridSizer + wxVERTICAL + protected + + 8 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Default properties for new graphics and text: + 0 + + 0 + + + 0 - mainSizer - wxVERTICAL - none - - 5 - wxLEFT - 0 - - - m_gridSizer - wxVERTICAL - protected - - 8 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Default properties for new graphics and text: - 0 - - 0 - - - 0 - - 1 - m_staticTextDefProp - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline11 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxEXPAND - 0 - - 3 - protected - 0 - - - - 15 - wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - 0 - - - - 1 - - - wxALIGN_LEFT - - wxALIGN_CENTER - 0 - 1 - wxALIGN_CENTER - wxGRID_AUTOSIZE - "Line Thickness" "Text Width" "Text Height" "Text Thickness" "Italic" "Keep Upright" - wxALIGN_CENTER - 6 - 140,140,140,140,80,120 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - 0 - 0 - 1 - 1 - - 1 - - - 1 - 0 - 0 - wxID_ANY - - - - 0 - 0 - - 0 - - - 0 - -1,-1 - 1 - m_grid - 1 - - - protected - 1 - - Resizable - wxALIGN_LEFT - 132 - "Silk Layers" "Copper Layers" "Edge Cuts" "Courtyards" "Fab Layers" "Other Layers" - wxALIGN_CENTER - - 6 - 1 - - WX_GRID; widgets/wx_grid.h; forward_declare - 0 - - - - wxTAB_TRAVERSAL - - - - 5 - wxEXPAND|wxTOP|wxBOTTOM - 0 - - 0 - protected - 0 - - - - 8 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Default properties for new dimension objects: - 0 - - 0 - - - 0 - - 1 - m_staticTextDefPropDim - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - 8 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxEXPAND|wxTOP - 1 - - - wxVERTICAL - - - 5 - - gbSizer1 - wxFLEX_GROWMODE_NONE - none - 0 - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Units: - 0 - - 0 - - - 0 - - 1 - m_lblDimensionUnits - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Inches" "Mils" "Millimeters" "Automatic" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_dimensionUnits - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - Default units for dimensions ("automatic" to follow the chosen UI units) - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 1 - 2 - wxEXPAND|wxALIGN_CENTER_VERTICAL - 0 - 1 - - 0 - protected - 0 - - - - 4 - 1 - 3 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text position: - 0 - - 0 - - - 0 - - 1 - m_lblTextPositionMode - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 1 - 4 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Outside" "Inline" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_dimensionTextPositionMode - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - Where to position the dimension text relative to the dimension line - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Units format: - 0 - - 0 - - - 0 - - 1 - m_lblDimensionUnitsFormat - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "1234" "1234 mm" "1234 (mm)" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_dimensionUnitsFormat - 1 - - - protected - 1 - - Resizable - 1 - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 2 - 3 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Keep text aligned - - 0 - - - 0 - - 1 - m_dimensionTextKeepAligned - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - When checked, dimension text will be kept aligned with dimension lines - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Precision: - 0 - - 0 - - - 0 - - 1 - m_lblDimensionPrecision - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "0" "0.0" "0.00" "0.000" "0.0000" "0.00000" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_dimensionPrecision - 1 - - - protected - 1 - - Resizable - 4 - 1 - - - ; ; forward_declare - 0 - How many digits of precision to show - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 1 - 3 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Arrow length: - 0 - - 0 - - - 0 - - 1 - m_lblArrowLength - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 1 - 4 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_dimensionArrowLength - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - 1 - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - 0 - - 0 - - - 0 - - 1 - m_arrowLengthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 2 - 0 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Suppress trailing zeroes - - 0 - - - 0 - - 1 - m_dimensionSuppressZeroes - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - When checked, "1.2300" will be rendered as "1.23" even if precision is set to show more digits - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 1 - 3 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Extension line offset: - 0 - - 0 - - - 0 - - 1 - m_lblExtensionOffset - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 1 - 4 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_dimensionExtensionOffset - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - 1 - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - 0 - - 0 - - - 0 - - 1 - m_dimensionExtensionOffsetUnits - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - - - + 1 + m_staticTextDefProp + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline11 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND + 0 + + 3 + protected + 0 + + + + 15 + wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + 0 + + + + 1 + + + wxALIGN_LEFT + + wxALIGN_CENTER + 0 + 1 + wxALIGN_CENTER + wxGRID_AUTOSIZE + "Line Thickness" "Text Width" "Text Height" "Text Thickness" "Italic" "Keep Upright" + wxALIGN_CENTER + 6 + 140,140,140,140,80,120 + + 1 + 0 + Dock + 0 + Left + 0 + 0 + 1 + 0 + 0 + 1 + 1 + + 1 + + + 1 + 0 + 0 + wxID_ANY + + + + 0 + 0 + + 0 + + + 0 + -1,-1 + 1 + m_grid + 1 + + + protected + 1 + + Resizable + wxALIGN_LEFT + 132 + "Silk Layers" "Copper Layers" "Edge Cuts" "Courtyards" "Fab Layers" "Other Layers" + wxALIGN_CENTER + + 6 + 1 + + WX_GRID; widgets/wx_grid.h; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 0 + protected + 0 + + + + + diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics_base.h b/pcbnew/dialogs/panel_setup_text_and_graphics_base.h index 798a53cb89..0a056f5efe 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics_base.h +++ b/pcbnew/dialogs/panel_setup_text_and_graphics_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -20,10 +20,6 @@ class WX_GRID; #include #include #include -#include -#include -#include -#include #include #include @@ -41,24 +37,6 @@ class PANEL_SETUP_TEXT_AND_GRAPHICS_BASE : public wxPanel wxStaticText* m_staticTextDefProp; wxStaticLine* m_staticline11; WX_GRID* m_grid; - wxStaticText* m_staticTextDefPropDim; - wxStaticLine* m_staticline1; - wxStaticText* m_lblDimensionUnits; - wxChoice* m_dimensionUnits; - wxStaticText* m_lblTextPositionMode; - wxChoice* m_dimensionTextPositionMode; - wxStaticText* m_lblDimensionUnitsFormat; - wxChoice* m_dimensionUnitsFormat; - wxCheckBox* m_dimensionTextKeepAligned; - wxStaticText* m_lblDimensionPrecision; - wxChoice* m_dimensionPrecision; - wxStaticText* m_lblArrowLength; - wxTextCtrl* m_dimensionArrowLength; - wxStaticText* m_arrowLengthUnits; - wxCheckBox* m_dimensionSuppressZeroes; - wxStaticText* m_lblExtensionOffset; - wxTextCtrl* m_dimensionExtensionOffset; - wxStaticText* m_dimensionExtensionOffsetUnits; public: diff --git a/pcbnew/footprint_editor_settings.cpp b/pcbnew/footprint_editor_settings.cpp index 806d28bc20..48d6fd9662 100644 --- a/pcbnew/footprint_editor_settings.cpp +++ b/pcbnew/footprint_editor_settings.cpp @@ -277,6 +277,42 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() : m_params.emplace_back( new PARAM( "design_settings.others_text_italic", &m_DesignSettings.m_TextItalic[ LAYER_CLASS_OTHERS ], false ) ); + + // --------------------------------------------------------------------------------------------- + // Dimension settings + + m_params.emplace_back( new PARAM_ENUM( "design_settings.dimensions.units", + &m_DesignSettings.m_DimensionUnitsMode, DIM_UNITS_MODE::AUTOMATIC, DIM_UNITS_MODE::INCHES, + DIM_UNITS_MODE::AUTOMATIC ) ); + + m_params.emplace_back( new PARAM_ENUM( "design_settings.dimensions.precision", + &m_DesignSettings.m_DimensionPrecision, DIM_PRECISION::X_XXXX, DIM_PRECISION::X, DIM_PRECISION::V_VVVVV ) ); + + m_params.emplace_back( new PARAM_ENUM( "design_settings.dimensions.units_format", + &m_DesignSettings.m_DimensionUnitsFormat, DIM_UNITS_FORMAT::NO_SUFFIX, DIM_UNITS_FORMAT::NO_SUFFIX, + DIM_UNITS_FORMAT::PAREN_SUFFIX ) ); + + m_params.emplace_back( new PARAM( "design_settings.dimensions.suppress_zeroes", + &m_DesignSettings.m_DimensionSuppressZeroes, true ) ); + + // NOTE: excluding DIM_TEXT_POSITION::MANUAL from the valid range here + m_params.emplace_back( new PARAM_ENUM( "design_settings.dimensions.text_position", + &m_DesignSettings.m_DimensionTextPosition, DIM_TEXT_POSITION::OUTSIDE, DIM_TEXT_POSITION::OUTSIDE, + DIM_TEXT_POSITION::INLINE ) ); + + m_params.emplace_back( new PARAM( "design_settings.dimensions.keep_text_aligned", + &m_DesignSettings.m_DimensionKeepTextAligned, true ) ); + + m_params.emplace_back( new PARAM( "design_settings.dimensions.arrow_length", + &m_DesignSettings.m_DimensionArrowLength, + pcbIUScale.MilsToIU( DEFAULT_DIMENSION_ARROW_LENGTH ) ) ); + + m_params.emplace_back( new PARAM( "design_settings.dimensions.extension_offset", + &m_DesignSettings.m_DimensionExtensionOffset, + pcbIUScale.mmToIU( DEFAULT_DIMENSION_EXTENSION_OFFSET ) ) ); + + // --------------------------------------------------------------------------------------------- + m_params.emplace_back( new PARAM_LAMBDA( "editing.selection_filter", [&]() -> nlohmann::json {