Fix some dialog layout issues.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16391
This commit is contained in:
Jeff Young 2024-02-25 22:10:27 +00:00
parent 9066e4b9d0
commit 11774cc9fe
4 changed files with 590 additions and 517 deletions

View File

@ -25,7 +25,6 @@
#include <base_units.h> #include <base_units.h>
#include <widgets/text_ctrl_eval.h> #include <widgets/text_ctrl_eval.h>
#include <board.h>
#include <footprint.h> #include <footprint.h>
#include <pcb_edit_frame.h> #include <pcb_edit_frame.h>
#include <wx/msgdlg.h> #include <wx/msgdlg.h>
@ -50,7 +49,7 @@ struct CREATE_ARRAY_DIALOG_ENTRIES
m_GridOffsetX( 0 ), m_GridOffsetX( 0 ),
m_GridOffsetY( 0 ), m_GridOffsetY( 0 ),
m_GridStagger( 1 ), m_GridStagger( 1 ),
m_GridStaggerType( 0 ), // rows m_GridStaggerRows( true ),
m_GridNumberingAxis( 0 ), // h then v m_GridNumberingAxis( 0 ), // h then v
m_GridNumReverseAlt( false ), m_GridNumReverseAlt( false ),
m_GridNumStartSet( 1 ), // use specified start m_GridNumStartSet( 1 ), // use specified start
@ -84,8 +83,7 @@ struct CREATE_ARRAY_DIALOG_ENTRIES
long m_GridOffsetX; long m_GridOffsetX;
long m_GridOffsetY; long m_GridOffsetY;
long m_GridStagger; long m_GridStagger;
bool m_GridStaggerRows;
long m_GridStaggerType;
long m_GridNumberingAxis; long m_GridNumberingAxis;
bool m_GridNumReverseAlt; bool m_GridNumReverseAlt;
long m_GridNumStartSet; long m_GridNumStartSet;
@ -202,7 +200,7 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent,
m_cfg_persister.Add( m_vOffset, s_arrayOptions.m_GridOffsetY ); m_cfg_persister.Add( m_vOffset, s_arrayOptions.m_GridOffsetY );
m_cfg_persister.Add( *m_entryStagger, s_arrayOptions.m_GridStagger ); m_cfg_persister.Add( *m_entryStagger, s_arrayOptions.m_GridStagger );
m_cfg_persister.Add( *m_radioBoxGridStaggerType, s_arrayOptions.m_GridStaggerType ); m_cfg_persister.Add( *m_staggerRows, s_arrayOptions.m_GridStaggerRows );
m_cfg_persister.Add( *m_radioBoxGridNumberingAxis, s_arrayOptions.m_GridNumberingAxis ); m_cfg_persister.Add( *m_radioBoxGridNumberingAxis, s_arrayOptions.m_GridNumberingAxis );
m_cfg_persister.Add( *m_checkBoxGridReverseNumbering, s_arrayOptions.m_GridNumReverseAlt ); m_cfg_persister.Add( *m_checkBoxGridReverseNumbering, s_arrayOptions.m_GridNumReverseAlt );
@ -387,15 +385,15 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow()
ok &= validateLongEntry(*m_entryNx, newGrid->m_nx, _("horizontal count"), errors); ok &= validateLongEntry(*m_entryNx, newGrid->m_nx, _("horizontal count"), errors);
ok &= validateLongEntry(*m_entryNy, newGrid->m_ny, _("vertical count"), errors); ok &= validateLongEntry(*m_entryNy, newGrid->m_ny, _("vertical count"), errors);
newGrid->m_delta.x = m_hSpacing.GetValue(); newGrid->m_delta.x = m_hSpacing.GetIntValue();
newGrid->m_delta.y = m_vSpacing.GetValue(); newGrid->m_delta.y = m_vSpacing.GetIntValue();
newGrid->m_offset.x = m_hOffset.GetValue(); newGrid->m_offset.x = m_hOffset.GetIntValue();
newGrid->m_offset.y = m_vOffset.GetValue(); newGrid->m_offset.y = m_vOffset.GetIntValue();
ok &= validateLongEntry(*m_entryStagger, newGrid->m_stagger, _("stagger"), errors); ok &= validateLongEntry(*m_entryStagger, newGrid->m_stagger, _("stagger"), errors);
newGrid->m_stagger_rows = m_radioBoxGridStaggerType->GetSelection() == 0; newGrid->m_stagger_rows = m_staggerRows->GetValue();
newGrid->m_horizontalThenVertical = m_radioBoxGridNumberingAxis->GetSelection() == 0; newGrid->m_horizontalThenVertical = m_radioBoxGridNumberingAxis->GetSelection() == 0;
newGrid->m_reverseNumberingAlternate = m_checkBoxGridReverseNumbering->GetValue(); newGrid->m_reverseNumberingAlternate = m_checkBoxGridReverseNumbering->GetValue();
@ -445,8 +443,8 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow()
bool ok = true; bool ok = true;
double angle = EDA_UNIT_UTILS::UI::DoubleValueFromString( m_entryCircAngle->GetValue() ); double angle = EDA_UNIT_UTILS::UI::DoubleValueFromString( m_entryCircAngle->GetValue() );
newCirc->m_centre.x = m_hCentre.GetValue(); newCirc->m_centre.x = m_hCentre.GetIntValue();
newCirc->m_centre.y = m_vCentre.GetValue(); newCirc->m_centre.y = m_vCentre.GetIntValue();
newCirc->m_angle = EDA_ANGLE( angle, DEGREES_T ); newCirc->m_angle = EDA_ANGLE( angle, DEGREES_T );
ok = validateLongEntry(*m_entryCircCount, newCirc->m_nPts, _("point count"), errors); ok = validateLongEntry(*m_entryCircCount, newCirc->m_nPts, _("point count"), errors);
@ -570,7 +568,7 @@ void DIALOG_CREATE_ARRAY::calculateCircularArrayProperties()
{ {
if( m_radioBtnSetByPos->GetValue() ) if( m_radioBtnSetByPos->GetValue() )
{ {
VECTOR2I centre( m_hCentre.GetValue(), m_vCentre.GetValue() ); VECTOR2I centre( m_hCentre.GetIntValue(), m_vCentre.GetIntValue() );
// Find the radius, etc of the circle // Find the radius, etc of the circle
centre -= m_originalItemPosition; centre -= m_originalItemPosition;
@ -587,7 +585,7 @@ void DIALOG_CREATE_ARRAY::calculateCircularArrayProperties()
m_refPosX.SetValue( m_originalItemPosition.x ); m_refPosX.SetValue( m_originalItemPosition.x );
m_refPosY.SetValue( m_originalItemPosition.y ); m_refPosY.SetValue( m_originalItemPosition.y );
double radius = m_circRadius.GetValue(); double radius = m_circRadius.GetIntValue();
EDA_ANGLE angle = m_circCenterAngle.GetAngleValue(); EDA_ANGLE angle = m_circCenterAngle.GetAngleValue();
m_hCentre.SetValue( m_originalItemPosition.x + radius * angle.Cos() ); m_hCentre.SetValue( m_originalItemPosition.x + radius * angle.Cos() );

View File

@ -44,6 +44,8 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
fgSizerGridSize->Add( m_labelNx, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); fgSizerGridSize->Add( m_labelNx, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_entryNx = new TEXT_CTRL_EVAL( sbSizerGridSize->GetStaticBox(), wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryNx = new TEXT_CTRL_EVAL( sbSizerGridSize->GetStaticBox(), wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 );
m_entryNx->SetMinSize( wxSize( 60,-1 ) );
fgSizerGridSize->Add( m_entryNx, 0, wxEXPAND, 5 ); fgSizerGridSize->Add( m_entryNx, 0, wxEXPAND, 5 );
m_labelNy = new wxStaticText( sbSizerGridSize->GetStaticBox(), wxID_ANY, _("Vertical count:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelNy = new wxStaticText( sbSizerGridSize->GetStaticBox(), wxID_ANY, _("Vertical count:"), wxDefaultPosition, wxDefaultSize, 0 );
@ -54,20 +56,22 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
m_entryNy = new TEXT_CTRL_EVAL( sbSizerGridSize->GetStaticBox(), wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryNy = new TEXT_CTRL_EVAL( sbSizerGridSize->GetStaticBox(), wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 );
m_entryNy->SetToolTip( _("Number of rows") ); m_entryNy->SetToolTip( _("Number of rows") );
m_entryNy->SetMinSize( wxSize( 60,-1 ) );
fgSizerGridSize->Add( m_entryNy, 0, wxEXPAND, 5 ); fgSizerGridSize->Add( m_entryNy, 0, wxEXPAND, 5 );
sbSizerGridSize->Add( fgSizerGridSize, 1, wxBOTTOM|wxEXPAND, 5 ); sbSizerGridSize->Add( fgSizerGridSize, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerGridLeft->Add( sbSizerGridSize, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); bSizerGridLeft->Add( sbSizerGridSize, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 10 );
wxStaticBoxSizer* sbSizerItemsSpacing; wxStaticBoxSizer* sbSizerItemsSpacing;
sbSizerItemsSpacing = new wxStaticBoxSizer( new wxStaticBox( m_gridPanel, wxID_ANY, _("Items Spacing") ), wxVERTICAL ); sbSizerItemsSpacing = new wxStaticBoxSizer( new wxStaticBox( m_gridPanel, wxID_ANY, _("Items Spacing") ), wxVERTICAL );
wxFlexGridSizer* fgSizerItemSpacing; wxFlexGridSizer* fgSizerItemSpacing;
fgSizerItemSpacing = new wxFlexGridSizer( 0, 3, 5, 5 ); fgSizerItemSpacing = new wxFlexGridSizer( 0, 3, 5, 5 );
fgSizerItemSpacing->AddGrowableCol( 1 );
fgSizerItemSpacing->SetFlexibleDirection( wxBOTH ); fgSizerItemSpacing->SetFlexibleDirection( wxBOTH );
fgSizerItemSpacing->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizerItemSpacing->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@ -78,7 +82,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
fgSizerItemSpacing->Add( m_labelDx, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); fgSizerItemSpacing->Add( m_labelDx, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_entryDx = new wxTextCtrl( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryDx = new wxTextCtrl( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerItemSpacing->Add( m_entryDx, 0, wxEXPAND, 5 ); fgSizerItemSpacing->Add( m_entryDx, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_unitLabelDx = new wxStaticText( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelDx = new wxStaticText( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_unitLabelDx->Wrap( -1 ); m_unitLabelDx->Wrap( -1 );
@ -91,57 +95,52 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
fgSizerItemSpacing->Add( m_labelDy, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); fgSizerItemSpacing->Add( m_labelDy, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_entryDy = new wxTextCtrl( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryDy = new wxTextCtrl( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerItemSpacing->Add( m_entryDy, 0, 0, 5 ); fgSizerItemSpacing->Add( m_entryDy, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_unitLabelDy = new wxStaticText( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelDy = new wxStaticText( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_unitLabelDy->Wrap( -1 ); m_unitLabelDy->Wrap( -1 );
fgSizerItemSpacing->Add( m_unitLabelDy, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); fgSizerItemSpacing->Add( m_unitLabelDy, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
sbSizerItemsSpacing->Add( fgSizerItemSpacing, 1, wxEXPAND|wxBOTTOM, 5 ); fgSizerItemSpacing->Add( 0, 5, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerGridShape;
sbSizerGridShape = new wxStaticBoxSizer( new wxStaticBox( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("Grid Spacing Modifiers") ), wxVERTICAL );
wxFlexGridSizer* fgSizerModifier; fgSizerItemSpacing->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizerModifier = new wxFlexGridSizer( 0, 3, 5, 5 );
fgSizerModifier->SetFlexibleDirection( wxBOTH );
fgSizerModifier->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_labelOffsetX = new wxStaticText( sbSizerGridShape->GetStaticBox(), wxID_ANY, _("Horizontal offset:"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerItemSpacing->Add( 0, 0, 1, wxEXPAND, 5 );
m_labelOffsetX = new wxStaticText( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("Horizontal offset:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelOffsetX->Wrap( -1 ); m_labelOffsetX->Wrap( -1 );
m_labelOffsetX->SetToolTip( _("Offset added to the next row position.") ); m_labelOffsetX->SetToolTip( _("Offset added to the next row position.") );
fgSizerModifier->Add( m_labelOffsetX, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); fgSizerItemSpacing->Add( m_labelOffsetX, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_entryOffsetX = new wxTextCtrl( sbSizerGridShape->GetStaticBox(), wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryOffsetX = new wxTextCtrl( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerModifier->Add( m_entryOffsetX, 0, wxEXPAND, 5 ); fgSizerItemSpacing->Add( m_entryOffsetX, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_unitLabelOffsetX = new wxStaticText( sbSizerGridShape->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelOffsetX = new wxStaticText( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_unitLabelOffsetX->Wrap( -1 ); m_unitLabelOffsetX->Wrap( -1 );
fgSizerModifier->Add( m_unitLabelOffsetX, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); fgSizerItemSpacing->Add( m_unitLabelOffsetX, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_labelOffsetY = new wxStaticText( sbSizerGridShape->GetStaticBox(), wxID_ANY, _("Vertical offset:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelOffsetY = new wxStaticText( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("Vertical offset:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelOffsetY->Wrap( -1 ); m_labelOffsetY->Wrap( -1 );
m_labelOffsetY->SetToolTip( _("Offset added to the next column position") ); m_labelOffsetY->SetToolTip( _("Offset added to the next column position") );
fgSizerModifier->Add( m_labelOffsetY, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); fgSizerItemSpacing->Add( m_labelOffsetY, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_entryOffsetY = new wxTextCtrl( sbSizerGridShape->GetStaticBox(), wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryOffsetY = new wxTextCtrl( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerModifier->Add( m_entryOffsetY, 0, wxEXPAND, 5 ); fgSizerItemSpacing->Add( m_entryOffsetY, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_unitLabelOffsetY = new wxStaticText( sbSizerGridShape->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelOffsetY = new wxStaticText( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_unitLabelOffsetY->Wrap( -1 ); m_unitLabelOffsetY->Wrap( -1 );
fgSizerModifier->Add( m_unitLabelOffsetY, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); fgSizerItemSpacing->Add( m_unitLabelOffsetY, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
sbSizerGridShape->Add( fgSizerModifier, 1, wxEXPAND, 5 ); sbSizerItemsSpacing->Add( fgSizerItemSpacing, 1, wxEXPAND|wxBOTTOM, 5 );
sbSizerItemsSpacing->Add( sbSizerGridShape, 0, wxALL|wxEXPAND, 5 ); bSizerGridLeft->Add( sbSizerItemsSpacing, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
bSizerGridLeft->Add( sbSizerItemsSpacing, 0, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbSizerStagger; wxStaticBoxSizer* sbSizerStagger;
sbSizerStagger = new wxStaticBoxSizer( new wxStaticBox( m_gridPanel, wxID_ANY, _("Stagger Settings") ), wxVERTICAL ); sbSizerStagger = new wxStaticBoxSizer( new wxStaticBox( m_gridPanel, wxID_ANY, _("Stagger Settings") ), wxVERTICAL );
@ -156,19 +155,20 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
bSizerStaggerset->Add( m_labelStagger, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); bSizerStaggerset->Add( m_labelStagger, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_entryStagger = new TEXT_CTRL_EVAL( sbSizerStagger->GetStaticBox(), wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryStagger = new TEXT_CTRL_EVAL( sbSizerStagger->GetStaticBox(), wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerStaggerset->Add( m_entryStagger, 0, wxALL, 5 ); bSizerStaggerset->Add( m_entryStagger, 0, wxRIGHT|wxLEFT, 5 );
sbSizerStagger->Add( bSizerStaggerset, 1, wxEXPAND, 5 ); sbSizerStagger->Add( bSizerStaggerset, 1, wxEXPAND, 5 );
wxString m_radioBoxGridStaggerTypeChoices[] = { _("Rows"), _("Columns") }; m_staggerRows = new wxRadioButton( sbSizerStagger->GetStaticBox(), wxID_ANY, _("Rows"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
int m_radioBoxGridStaggerTypeNChoices = sizeof( m_radioBoxGridStaggerTypeChoices ) / sizeof( wxString ); sbSizerStagger->Add( m_staggerRows, 0, wxALL, 5 );
m_radioBoxGridStaggerType = new wxRadioBox( sbSizerStagger->GetStaticBox(), wxID_ANY, _("Stagger Type"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridStaggerTypeNChoices, m_radioBoxGridStaggerTypeChoices, 1, wxRA_SPECIFY_COLS );
m_radioBoxGridStaggerType->SetSelection( 0 ); m_staggerCols = new wxRadioButton( sbSizerStagger->GetStaticBox(), wxID_ANY, _("Columns"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerStagger->Add( m_radioBoxGridStaggerType, 0, wxALL, 5 ); m_staggerCols->SetValue( true );
sbSizerStagger->Add( m_staggerCols, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerGridLeft->Add( sbSizerStagger, 0, wxEXPAND|wxALL, 5 ); bSizerGridLeft->Add( sbSizerStagger, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
bSizerGridArray->Add( bSizerGridLeft, 1, wxEXPAND, 5 ); bSizerGridArray->Add( bSizerGridLeft, 1, wxEXPAND, 5 );
@ -287,7 +287,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
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, _("This is the position of the selected item,\nor the position of the group to duplicate"), wxDefaultPosition, wxDefaultSize, 0 );
m_stInfoItems->Wrap( -1 ); m_stInfoItems->Wrap( -1 );
sbSizerInfo->Add( m_stInfoItems, 0, wxALL, 5 ); sbSizerInfo->Add( m_stInfoItems, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgSizer4; wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 0, 3, 5, 5 ); fgSizer4 = new wxFlexGridSizer( 0, 3, 5, 5 );
@ -297,31 +297,31 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
m_stRefPosXTxt = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("Ref point pos X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_stRefPosXTxt = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("Ref point pos X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_stRefPosXTxt->Wrap( -1 ); m_stRefPosXTxt->Wrap( -1 );
fgSizer4->Add( m_stRefPosXTxt, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); fgSizer4->Add( m_stRefPosXTxt, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_tcRefPosX = new wxTextCtrl( sbSizerInfo->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); m_tcRefPosX = new wxTextCtrl( sbSizerInfo->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
fgSizer4->Add( m_tcRefPosX, 0, wxEXPAND, 5 ); fgSizer4->Add( m_tcRefPosX, 0, wxEXPAND, 5 );
m_stRefPosXUnit = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_stRefPosXUnit = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_stRefPosXUnit->Wrap( -1 ); m_stRefPosXUnit->Wrap( -1 );
fgSizer4->Add( m_stRefPosXUnit, 0, wxALIGN_CENTER_VERTICAL, 5 ); fgSizer4->Add( m_stRefPosXUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_stRefPosYTxt = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("Ref point pos Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_stRefPosYTxt = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("Ref point pos Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_stRefPosYTxt->Wrap( -1 ); m_stRefPosYTxt->Wrap( -1 );
fgSizer4->Add( m_stRefPosYTxt, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); fgSizer4->Add( m_stRefPosYTxt, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_tcRefPosY = new wxTextCtrl( sbSizerInfo->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); m_tcRefPosY = new wxTextCtrl( sbSizerInfo->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
fgSizer4->Add( m_tcRefPosY, 0, wxEXPAND, 5 ); fgSizer4->Add( m_tcRefPosY, 0, wxEXPAND, 5 );
m_stRefPosYUnit = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_stRefPosYUnit = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_stRefPosYUnit->Wrap( -1 ); m_stRefPosYUnit->Wrap( -1 );
fgSizer4->Add( m_stRefPosYUnit, 0, wxALIGN_CENTER_VERTICAL, 5 ); fgSizer4->Add( m_stRefPosYUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
sbSizerInfo->Add( fgSizer4, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); sbSizerInfo->Add( fgSizer4, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
bSizerCircLeft->Add( sbSizerInfo, 0, wxALL|wxEXPAND, 5 ); bSizerCircLeft->Add( sbSizerInfo, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
wxStaticBoxSizer* sbSizerCircParams; wxStaticBoxSizer* sbSizerCircParams;
sbSizerCircParams = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Array Settings") ), wxVERTICAL ); sbSizerCircParams = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Array Settings") ), wxVERTICAL );
@ -345,7 +345,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
m_unitLabelCentreX = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCentreX = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_unitLabelCentreX->Wrap( -1 ); m_unitLabelCentreX->Wrap( -1 );
fgSizerArrayPrms->Add( m_unitLabelCentreX, 0, wxALIGN_CENTER_VERTICAL, 5 ); fgSizerArrayPrms->Add( m_unitLabelCentreX, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_labelCentreY = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("Center pos Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCentreY = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("Center pos Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelCentreY->Wrap( -1 ); m_labelCentreY->Wrap( -1 );
@ -356,7 +356,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
m_unitLabelCentreY = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCentreY = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_unitLabelCentreY->Wrap( -1 ); m_unitLabelCentreY->Wrap( -1 );
fgSizerArrayPrms->Add( m_unitLabelCentreY, 0, wxALIGN_CENTER_VERTICAL, 5 ); fgSizerArrayPrms->Add( m_unitLabelCentreY, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
sbSizerCircParams->Add( fgSizerArrayPrms, 0, wxEXPAND|wxLEFT, 25 ); sbSizerCircParams->Add( fgSizerArrayPrms, 0, wxEXPAND|wxLEFT, 25 );
@ -380,11 +380,11 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
m_tcValueCircRadius = new wxTextCtrl( sbSizerCircParams->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_tcValueCircRadius = new wxTextCtrl( sbSizerCircParams->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_tcValueCircRadius->SetToolTip( _("Distance between Ref point and Center pos.") ); m_tcValueCircRadius->SetToolTip( _("Distance between Ref point and Center pos.") );
bSizerRadiusValue->Add( m_tcValueCircRadius, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 3 ); bSizerRadiusValue->Add( m_tcValueCircRadius, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 3 );
m_unitLabelCircRadius = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCircRadius = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_unitLabelCircRadius->Wrap( -1 ); m_unitLabelCircRadius->Wrap( -1 );
bSizerRadiusValue->Add( m_unitLabelCircRadius, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizerRadiusValue->Add( m_unitLabelCircRadius, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
bSizerRadius->Add( bSizerRadiusValue, 0, wxEXPAND, 5 ); bSizerRadius->Add( bSizerRadiusValue, 0, wxEXPAND, 5 );
@ -407,11 +407,11 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
#endif #endif
m_tcValueCircCenterAngle->SetToolTip( _("Angle between Ref point and Center pos.") ); m_tcValueCircCenterAngle->SetToolTip( _("Angle between Ref point and Center pos.") );
bSizerRadiusValue1->Add( m_tcValueCircCenterAngle, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 3 ); bSizerRadiusValue1->Add( m_tcValueCircCenterAngle, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 3 );
m_unitLabelCircCenterAngle = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCircCenterAngle = new wxStaticText( sbSizerCircParams->GetStaticBox(), wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
m_unitLabelCircCenterAngle->Wrap( -1 ); m_unitLabelCircCenterAngle->Wrap( -1 );
bSizerRadiusValue1->Add( m_unitLabelCircCenterAngle, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizerRadiusValue1->Add( m_unitLabelCircCenterAngle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
bSizerRadius->Add( bSizerRadiusValue1, 0, wxEXPAND, 5 ); bSizerRadius->Add( bSizerRadiusValue1, 0, wxEXPAND, 5 );
@ -420,7 +420,10 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
sbSizerCircParams->Add( bSizerRadius, 0, wxEXPAND|wxLEFT, 25 ); sbSizerCircParams->Add( bSizerRadius, 0, wxEXPAND|wxLEFT, 25 );
bSizerCircLeft->Add( sbSizerCircParams, 0, wxEXPAND|wxALL, 5 ); sbSizerCircParams->Add( 0, 5, 0, 0, 5 );
bSizerCircLeft->Add( sbSizerCircParams, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
wxStaticBoxSizer* sbSizerDupPrms; wxStaticBoxSizer* sbSizerDupPrms;
sbSizerDupPrms = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Duplication Settings") ), wxVERTICAL ); sbSizerDupPrms = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Duplication Settings") ), wxVERTICAL );
@ -442,7 +445,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
m_unitLabelCircAngle = new wxStaticText( sbSizerDupPrms->GetStaticBox(), wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCircAngle = new wxStaticText( sbSizerDupPrms->GetStaticBox(), wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
m_unitLabelCircAngle->Wrap( -1 ); m_unitLabelCircAngle->Wrap( -1 );
fgSizerDupPrms->Add( m_unitLabelCircAngle, 0, wxALIGN_CENTER_VERTICAL, 5 ); fgSizerDupPrms->Add( m_unitLabelCircAngle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_labelCircCount = new wxStaticText( sbSizerDupPrms->GetStaticBox(), wxID_ANY, _("Item count:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircCount = new wxStaticText( sbSizerDupPrms->GetStaticBox(), wxID_ANY, _("Item count:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelCircCount->Wrap( -1 ); m_labelCircCount->Wrap( -1 );
@ -464,13 +467,13 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
m_entryRotateItemsCb->SetValue(true); m_entryRotateItemsCb->SetValue(true);
m_entryRotateItemsCb->SetToolTip( _("Rotate the item as well as move it - multi-selections will be rotated together") ); m_entryRotateItemsCb->SetToolTip( _("Rotate the item as well as move it - multi-selections will be rotated together") );
fgSizerDupPrms->Add( m_entryRotateItemsCb, 0, wxALIGN_CENTER_VERTICAL, 5 ); fgSizerDupPrms->Add( m_entryRotateItemsCb, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
sbSizerDupPrms->Add( fgSizerDupPrms, 0, wxBOTTOM|wxEXPAND, 5 ); sbSizerDupPrms->Add( fgSizerDupPrms, 0, wxBOTTOM|wxEXPAND, 5 );
bSizerCircLeft->Add( sbSizerDupPrms, 0, wxEXPAND|wxALL, 5 ); bSizerCircLeft->Add( sbSizerDupPrms, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
bSizer4->Add( bSizerCircLeft, 1, wxEXPAND, 5 ); bSizer4->Add( bSizerCircLeft, 1, wxEXPAND, 5 );
@ -539,7 +542,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
bSizer4->Fit( m_circularPanel ); bSizer4->Fit( m_circularPanel );
m_gridTypeNotebook->AddPage( m_circularPanel, _("Circular Array"), true ); m_gridTypeNotebook->AddPage( m_circularPanel, _("Circular Array"), true );
bSizer7->Add( m_gridTypeNotebook, 1, wxALL|wxEXPAND, 5 ); bSizer7->Add( m_gridTypeNotebook, 1, wxALL|wxEXPAND, 10 );
m_footprintReannotatePanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_footprintReannotatePanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer8; wxBoxSizer* bSizer8;
@ -558,7 +561,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
sbSizerFootprintAnnotation->Add( m_radioBtnUniqueRefs, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); sbSizerFootprintAnnotation->Add( m_radioBtnUniqueRefs, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
bSizer8->Add( sbSizerFootprintAnnotation, 0, wxEXPAND, 5 ); bSizer8->Add( sbSizerFootprintAnnotation, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_footprintReannotatePanel->SetSizer( bSizer8 ); m_footprintReannotatePanel->SetSizer( bSizer8 );

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,7 @@ class TEXT_CTRL_EVAL;
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/radiobut.h>
#include <wx/radiobox.h> #include <wx/radiobox.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/choice.h> #include <wx/choice.h>
@ -29,7 +30,6 @@ class TEXT_CTRL_EVAL;
#include <wx/bitmap.h> #include <wx/bitmap.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/icon.h> #include <wx/icon.h>
#include <wx/radiobut.h>
#include <wx/notebook.h> #include <wx/notebook.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
@ -66,7 +66,8 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM
wxStaticText* m_unitLabelOffsetY; wxStaticText* m_unitLabelOffsetY;
wxStaticText* m_labelStagger; wxStaticText* m_labelStagger;
TEXT_CTRL_EVAL* m_entryStagger; TEXT_CTRL_EVAL* m_entryStagger;
wxRadioBox* m_radioBoxGridStaggerType; wxRadioButton* m_staggerRows;
wxRadioButton* m_staggerCols;
wxPanel* m_gridPadNumberingPanel; wxPanel* m_gridPadNumberingPanel;
wxBoxSizer* m_gridPadNumberingSizer; wxBoxSizer* m_gridPadNumberingSizer;
wxRadioBox* m_radioBoxGridNumberingAxis; wxRadioBox* m_radioBoxGridNumberingAxis;