From 59142a10d7402804b935d273574366dec71a91ba Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 4 Apr 2024 09:54:47 +0200 Subject: [PATCH] DIALOG_CREATE_ARRAY: better messages and better comments Fixes https://gitlab.com/kicad/code/kicad/-/issues/17642 Fixes https://gitlab.com/kicad/code/kicad/-/issues/17656 --- pcbnew/dialogs/dialog_create_array.cpp | 3 +- pcbnew/dialogs/dialog_create_array_base.cpp | 19 ++-- pcbnew/dialogs/dialog_create_array_base.fbp | 110 ++++++++++---------- pcbnew/dialogs/dialog_create_array_base.h | 2 +- 4 files changed, 68 insertions(+), 66 deletions(-) diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index d70da6a11b..96e8af62b8 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -530,6 +530,7 @@ void DIALOG_CREATE_ARRAY::setControlEnablement() m_labelGridNumberingOffset->Enable( use_set_start_grid ); m_entryGridPriNumberingOffset->Enable( use_set_start_grid ); m_entryGridSecNumberingOffset->Enable( use_set_start_grid && num2d ); + m_entryGridSecNumberingStep->Enable( use_set_start_grid && num2d ); // disable the circular number offset in the same way const bool use_set_start_circ = m_rbCircStartNumberingOpt->GetSelection() == 1; diff --git a/pcbnew/dialogs/dialog_create_array_base.cpp b/pcbnew/dialogs/dialog_create_array_base.cpp index 481f01dc65..d1924ff1a0 100644 --- a/pcbnew/dialogs/dialog_create_array_base.cpp +++ b/pcbnew/dialogs/dialog_create_array_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf02) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -34,6 +34,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID wxFlexGridSizer* fgSizerGridSize; fgSizerGridSize = new wxFlexGridSizer( 0, 2, 5, 5 ); + fgSizerGridSize->AddGrowableCol( 1 ); fgSizerGridSize->SetFlexibleDirection( wxBOTH ); fgSizerGridSize->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); @@ -155,7 +156,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID bSizerStaggerset->Add( m_labelStagger, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_entryStagger = new TEXT_CTRL_EVAL( sbSizerStagger->GetStaticBox(), wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerStaggerset->Add( m_entryStagger, 0, wxRIGHT|wxLEFT, 5 ); + bSizerStaggerset->Add( m_entryStagger, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 ); sbSizerStagger->Add( bSizerStaggerset, 1, wxEXPAND, 5 ); @@ -244,7 +245,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID fgSizer1->Add( m_entryGridSecNumberingOffset, 0, wxALL, 5 ); - m_labelGridNumberingStep = new wxStaticText( m_gridPadNumberingPanel, wxID_ANY, _("Pad numbering skip:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelGridNumberingStep = new wxStaticText( m_gridPadNumberingPanel, wxID_ANY, _("Pad numbering increment:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelGridNumberingStep->Wrap( -1 ); fgSizer1->Add( m_labelGridNumberingStep, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); @@ -259,7 +260,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID fgSizer1->Add( m_entryGridSecNumberingStep, 0, wxALL, 5 ); - m_gridPadNumberingSizer->Add( fgSizer1, 1, wxEXPAND, 5 ); + m_gridPadNumberingSizer->Add( fgSizer1, 0, wxEXPAND, 5 ); bSizer15->Add( m_gridPadNumberingSizer, 1, wxEXPAND|wxLEFT, 10 ); @@ -283,9 +284,9 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID bSizerCircLeft = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbSizerInfo; - sbSizerInfo = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Items to Duplicate") ), wxVERTICAL ); + sbSizerInfo = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Reference Position") ), wxVERTICAL ); - m_stInfoItems = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("This is the position of the selected item,\nor the position of the group to duplicate"), wxDefaultPosition, wxDefaultSize, 0 ); + m_stInfoItems = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("Position of the selected item (or group) to duplicate"), wxDefaultPosition, wxDefaultSize, 0 ); m_stInfoItems->Wrap( -1 ); sbSizerInfo->Add( m_stInfoItems, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -370,7 +371,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID wxBoxSizer* bSizerRadius; bSizerRadius = new wxBoxSizer( wxVERTICAL ); - m_labelCircRadius = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("Radius from center to reference position:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircRadius = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("Radius of circular array:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircRadius->Wrap( -1 ); bSizerRadius->Add( m_labelCircRadius, 0, wxTOP|wxRIGHT, 5 ); @@ -434,7 +435,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID fgSizerDupPrms->SetFlexibleDirection( wxBOTH ); fgSizerDupPrms->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_labelCircAngle = new wxStaticText( sbSizerDupPrms->GetStaticBox(), wxID_ANY, _("Angle:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircAngle = new wxStaticText( sbSizerDupPrms->GetStaticBox(), wxID_ANY, _("Angle between new items:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircAngle->Wrap( -1 ); fgSizerDupPrms->Add( m_labelCircAngle, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); @@ -517,7 +518,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_entryCircNumberingStart = new wxTextCtrl( m_circPadNumberingSizer->GetStaticBox(), wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer2->Add( m_entryCircNumberingStart, 1, wxALL, 5 ); - m_labelCircNumStep = new wxStaticText( m_circPadNumberingSizer->GetStaticBox(), wxID_ANY, _("Pad numbering skip:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircNumStep = new wxStaticText( m_circPadNumberingSizer->GetStaticBox(), wxID_ANY, _("Pad numbering increment:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircNumStep->Wrap( -1 ); fgSizer2->Add( m_labelCircNumStep, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); diff --git a/pcbnew/dialogs/dialog_create_array_base.fbp b/pcbnew/dialogs/dialog_create_array_base.fbp index 4b971ee53e..df24d88e4e 100644 --- a/pcbnew/dialogs/dialog_create_array_base.fbp +++ b/pcbnew/dialogs/dialog_create_array_base.fbp @@ -191,20 +191,20 @@ bSizerGridArray wxHORIZONTAL none - + 5 wxEXPAND 1 - + bSizerGridLeft wxVERTICAL none - + 10 wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 0 - + wxID_ANY Grid Array Size @@ -212,14 +212,14 @@ wxVERTICAL 1 none - + 5 wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 1 - + 2 wxBOTH - + 1 5 @@ -488,11 +488,11 @@ - + 10 wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 - + wxID_ANY Items Spacing @@ -500,7 +500,7 @@ wxVERTICAL 1 none - + 5 wxEXPAND|wxBOTTOM 1 @@ -896,31 +896,31 @@ -1 - + 5 wxEXPAND 1 - + 5 protected 0 - + 5 wxEXPAND 1 - + 0 protected 0 - + 5 wxEXPAND 1 - + 0 protected 0 @@ -1310,11 +1310,11 @@ - + 10 wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 - + wxID_ANY Stagger Settings @@ -1322,16 +1322,16 @@ wxVERTICAL 1 none - + 5 wxEXPAND 1 - + bSizerStaggerset wxHORIZONTAL none - + 5 wxALIGN_CENTER_VERTICAL|wxLEFT 0 @@ -1393,10 +1393,10 @@ -1 - + 5 - wxRIGHT|wxLEFT - 0 + wxRIGHT|wxLEFT|wxEXPAND + 1 1 1 @@ -1461,11 +1461,11 @@ - + 5 wxALL 0 - + 1 1 1 @@ -1526,11 +1526,11 @@ - + 5 wxBOTTOM|wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -1595,11 +1595,11 @@ - + 5 wxEXPAND 1 - + 1 1 1 @@ -1651,16 +1651,16 @@ wxTAB_TRAVERSAL - + bSizer15 wxVERTICAL none - + 10 wxEXPAND|wxLEFT 1 - + m_gridPadNumberingSizer wxVERTICAL @@ -2190,7 +2190,7 @@ 5 wxEXPAND - 1 + 0 3 wxBOTH @@ -2428,7 +2428,7 @@ 0 0 wxID_ANY - Pad numbering skip: + Pad numbering increment: 0 0 @@ -2653,12 +2653,12 @@ wxTAB_TRAVERSAL - + bSizer4 wxHORIZONTAL none - + 5 wxEXPAND 1 @@ -2673,7 +2673,7 @@ 0 wxID_ANY - Items to Duplicate + Reference Position sbSizerInfo wxVERTICAL @@ -2712,7 +2712,7 @@ 0 0 wxID_ANY - This is the position of the selected item, or the position of the group to duplicate + Position of the selected item (or group) to duplicate 0 0 @@ -3733,7 +3733,7 @@ 0 0 wxID_ANY - Radius from center to reference position: + Radius of circular array: 0 0 @@ -4104,11 +4104,11 @@ - + 5 0 - + 5 protected 0 @@ -4177,7 +4177,7 @@ 0 0 wxID_ANY - Angle: + Angle between new items: 0 0 @@ -4605,11 +4605,11 @@ - + 5 wxEXPAND | wxALL 0 - + 1 1 1 @@ -4661,7 +4661,7 @@ wxTAB_TRAVERSAL - + bSizer13 wxHORIZONTAL @@ -4676,11 +4676,11 @@ 10 - + 5 wxEXPAND 1 - + wxID_ANY Numbering Options @@ -4883,11 +4883,11 @@ - + 5 wxEXPAND 0 - + 2 wxBOTH 0 @@ -5059,7 +5059,7 @@ 0 0 wxID_ANY - Pad numbering skip: + Pad numbering increment: 0 0 @@ -5238,11 +5238,11 @@ wxVERTICAL 1 none - + 5 wxALL 0 - + 1 1 1 @@ -5303,11 +5303,11 @@ - + 5 wxBOTTOM|wxLEFT|wxRIGHT 0 - + 1 1 1 diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h index 04740a78f5..222bce60a5 100644 --- a/pcbnew/dialogs/dialog_create_array_base.h +++ b/pcbnew/dialogs/dialog_create_array_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf02) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE!