diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 45d6274c9a..d70da6a11b 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -50,7 +49,7 @@ struct CREATE_ARRAY_DIALOG_ENTRIES m_GridOffsetX( 0 ), m_GridOffsetY( 0 ), m_GridStagger( 1 ), - m_GridStaggerType( 0 ), // rows + m_GridStaggerRows( true ), m_GridNumberingAxis( 0 ), // h then v m_GridNumReverseAlt( false ), m_GridNumStartSet( 1 ), // use specified start @@ -84,8 +83,7 @@ struct CREATE_ARRAY_DIALOG_ENTRIES long m_GridOffsetX; long m_GridOffsetY; long m_GridStagger; - - long m_GridStaggerType; + bool m_GridStaggerRows; long m_GridNumberingAxis; bool m_GridNumReverseAlt; 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_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_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_entryNy, newGrid->m_ny, _("vertical count"), errors); - newGrid->m_delta.x = m_hSpacing.GetValue(); - newGrid->m_delta.y = m_vSpacing.GetValue(); + newGrid->m_delta.x = m_hSpacing.GetIntValue(); + newGrid->m_delta.y = m_vSpacing.GetIntValue(); - newGrid->m_offset.x = m_hOffset.GetValue(); - newGrid->m_offset.y = m_vOffset.GetValue(); + newGrid->m_offset.x = m_hOffset.GetIntValue(); + newGrid->m_offset.y = m_vOffset.GetIntValue(); 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_reverseNumberingAlternate = m_checkBoxGridReverseNumbering->GetValue(); @@ -445,8 +443,8 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow() bool ok = true; double angle = EDA_UNIT_UTILS::UI::DoubleValueFromString( m_entryCircAngle->GetValue() ); - newCirc->m_centre.x = m_hCentre.GetValue(); - newCirc->m_centre.y = m_vCentre.GetValue(); + newCirc->m_centre.x = m_hCentre.GetIntValue(); + newCirc->m_centre.y = m_vCentre.GetIntValue(); newCirc->m_angle = EDA_ANGLE( angle, DEGREES_T ); ok = validateLongEntry(*m_entryCircCount, newCirc->m_nPts, _("point count"), errors); @@ -570,7 +568,7 @@ void DIALOG_CREATE_ARRAY::calculateCircularArrayProperties() { 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 centre -= m_originalItemPosition; @@ -587,7 +585,7 @@ void DIALOG_CREATE_ARRAY::calculateCircularArrayProperties() m_refPosX.SetValue( m_originalItemPosition.x ); m_refPosY.SetValue( m_originalItemPosition.y ); - double radius = m_circRadius.GetValue(); + double radius = m_circRadius.GetIntValue(); EDA_ANGLE angle = m_circCenterAngle.GetAngleValue(); m_hCentre.SetValue( m_originalItemPosition.x + radius * angle.Cos() ); diff --git a/pcbnew/dialogs/dialog_create_array_base.cpp b/pcbnew/dialogs/dialog_create_array_base.cpp index 1257bdb951..9e911213b8 100644 --- a/pcbnew/dialogs/dialog_create_array_base.cpp +++ b/pcbnew/dialogs/dialog_create_array_base.cpp @@ -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 ); 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 ); 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->SetToolTip( _("Number of rows") ); + m_entryNy->SetMinSize( wxSize( 60,-1 ) ); 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; sbSizerItemsSpacing = new wxStaticBoxSizer( new wxStaticBox( m_gridPanel, wxID_ANY, _("Items Spacing") ), wxVERTICAL ); wxFlexGridSizer* fgSizerItemSpacing; fgSizerItemSpacing = new wxFlexGridSizer( 0, 3, 5, 5 ); + fgSizerItemSpacing->AddGrowableCol( 1 ); fgSizerItemSpacing->SetFlexibleDirection( wxBOTH ); 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 ); 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->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 ); 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->Wrap( -1 ); 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; - fgSizerModifier = new wxFlexGridSizer( 0, 3, 5, 5 ); - fgSizerModifier->SetFlexibleDirection( wxBOTH ); - fgSizerModifier->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + fgSizerItemSpacing->Add( 0, 0, 1, wxEXPAND, 5 ); - 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->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 ); - fgSizerModifier->Add( m_entryOffsetX, 0, wxEXPAND, 5 ); + m_entryOffsetX = new wxTextCtrl( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + 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 ); - 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->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 ); - fgSizerModifier->Add( m_entryOffsetY, 0, wxEXPAND, 5 ); + m_entryOffsetY = new wxTextCtrl( sbSizerItemsSpacing->GetStaticBox(), wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + 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 ); - 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|wxALL, 5 ); + bSizerGridLeft->Add( sbSizerItemsSpacing, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 ); wxStaticBoxSizer* sbSizerStagger; 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 ); 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 ); - wxString m_radioBoxGridStaggerTypeChoices[] = { _("Rows"), _("Columns") }; - int m_radioBoxGridStaggerTypeNChoices = sizeof( m_radioBoxGridStaggerTypeChoices ) / sizeof( wxString ); - m_radioBoxGridStaggerType = new wxRadioBox( sbSizerStagger->GetStaticBox(), wxID_ANY, _("Stagger Type"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridStaggerTypeNChoices, m_radioBoxGridStaggerTypeChoices, 1, wxRA_SPECIFY_COLS ); - m_radioBoxGridStaggerType->SetSelection( 0 ); - sbSizerStagger->Add( m_radioBoxGridStaggerType, 0, wxALL, 5 ); + m_staggerRows = new wxRadioButton( sbSizerStagger->GetStaticBox(), wxID_ANY, _("Rows"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + sbSizerStagger->Add( m_staggerRows, 0, wxALL, 5 ); + + m_staggerCols = new wxRadioButton( sbSizerStagger->GetStaticBox(), wxID_ANY, _("Columns"), wxDefaultPosition, wxDefaultSize, 0 ); + 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 ); @@ -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->Wrap( -1 ); - sbSizerInfo->Add( m_stInfoItems, 0, wxALL, 5 ); + sbSizerInfo->Add( m_stInfoItems, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxFlexGridSizer* fgSizer4; 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->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 ); fgSizer4->Add( m_tcRefPosX, 0, wxEXPAND, 5 ); m_stRefPosXUnit = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); 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->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 ); fgSizer4->Add( m_tcRefPosY, 0, wxEXPAND, 5 ); m_stRefPosYUnit = new wxStaticText( sbSizerInfo->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); 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; 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->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->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->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 ); @@ -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->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->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 ); @@ -407,11 +407,11 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID #endif 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->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 ); @@ -420,7 +420,10 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID 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; 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->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->Wrap( -1 ); @@ -464,13 +467,13 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_entryRotateItemsCb->SetValue(true); 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 ); - bSizerCircLeft->Add( sbSizerDupPrms, 0, wxEXPAND|wxALL, 5 ); + bSizerCircLeft->Add( sbSizerDupPrms, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 ); 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 ); 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 ); 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 ); - bSizer8->Add( sbSizerFootprintAnnotation, 0, wxEXPAND, 5 ); + bSizer8->Add( sbSizerFootprintAnnotation, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_footprintReannotatePanel->SetSizer( bSizer8 ); diff --git a/pcbnew/dialogs/dialog_create_array_base.fbp b/pcbnew/dialogs/dialog_create_array_base.fbp index 8c334677fe..dd124d7aa1 100644 --- a/pcbnew/dialogs/dialog_create_array_base.fbp +++ b/pcbnew/dialogs/dialog_create_array_base.fbp @@ -73,7 +73,7 @@ wxHORIZONTAL none - 5 + 10 wxALL|wxEXPAND 1 @@ -201,7 +201,7 @@ wxVERTICAL none - 5 + 10 wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 0 @@ -214,7 +214,7 @@ none 5 - wxBOTTOM|wxEXPAND + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 1 2 @@ -329,7 +329,7 @@ 0 0 - + 60,-1 1 m_entryNx 1 @@ -457,7 +457,7 @@ 0 0 - + 60,-1 1 m_entryNy 1 @@ -489,8 +489,8 @@ - 5 - wxEXPAND|wxALL + 10 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 wxID_ANY @@ -507,7 +507,7 @@ 3 wxBOTH - + 1 5 @@ -580,7 +580,7 @@ 5 - wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 @@ -770,7 +770,7 @@ 5 - + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 @@ -896,416 +896,414 @@ -1 - - - - 5 - wxALL|wxEXPAND - 0 - - wxID_ANY - Grid Spacing Modifiers - - sbSizerGridShape - wxVERTICAL - 1 - none 5 wxEXPAND 1 - - 3 - wxBOTH - - - 5 + + 5 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Horizontal offset: + 0 + + 0 + + + 0 - fgSizerModifier - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 5 - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Horizontal offset: - 0 - - 0 - - - 0 - - 1 - m_labelOffsetX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Offset added to the next row position. - - - - -1 - - - - 5 - wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryOffsetX - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - OnParameterChanged - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_unitLabelOffsetX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Vertical offset: - 0 - - 0 - - - 0 - - 1 - m_labelOffsetY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Offset added to the next column position - - - - -1 - - - - 5 - wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryOffsetY - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - OnParameterChanged - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_unitLabelOffsetY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - + 1 + m_labelOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Offset added to the next row position. + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_entryOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + OnParameterChanged + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_unitLabelOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Vertical offset: + 0 + + 0 + + + 0 + + 1 + m_labelOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Offset added to the next column position + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_entryOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + OnParameterChanged + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_unitLabelOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 @@ -1313,8 +1311,8 @@ - 5 - wxEXPAND|wxALL + 10 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 wxID_ANY @@ -1397,7 +1395,7 @@ 5 - wxALL + wxRIGHT|wxLEFT 0 1 @@ -1467,7 +1465,7 @@ 5 wxALL 0 - + 1 1 1 @@ -1481,7 +1479,6 @@ 1 0 - "Rows" "Columns" 1 1 @@ -1497,8 +1494,7 @@ 0 0 wxID_ANY - Stagger Type - 1 + Rows 0 @@ -1506,7 +1502,7 @@ 0 1 - m_radioBoxGridStaggerType + m_staggerRows 1 @@ -1514,17 +1510,82 @@ 1 Resizable - 0 1 - wxRA_SPECIFY_COLS - + wxRB_GROUP + ; ; forward_declare 0 wxFILTER_NONE wxDefaultValidator + 0 + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Columns + + 0 + + + 0 + + 1 + m_staggerCols + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 @@ -2607,8 +2668,8 @@ wxVERTICAL none - 5 - wxALL|wxEXPAND + 10 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 wxID_ANY @@ -2620,7 +2681,7 @@ none 5 - wxALL + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -2682,7 +2743,7 @@ 5 - wxEXPAND|wxTOP|wxBOTTOM + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT 0 3 @@ -2698,7 +2759,7 @@ 5 5 - wxALIGN_CENTER_VERTICAL|wxLEFT + wxALIGN_CENTER_VERTICAL 0 1 @@ -2825,7 +2886,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -2887,7 +2948,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxLEFT + wxALIGN_CENTER_VERTICAL 0 1 @@ -3014,7 +3075,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -3079,8 +3140,8 @@ - 5 - wxEXPAND|wxALL + 10 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 wxID_ANY @@ -3302,7 +3363,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -3492,7 +3553,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -3712,7 +3773,7 @@ none 3 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT 1 1 @@ -3778,7 +3839,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -3913,7 +3974,7 @@ none 3 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT 1 1 @@ -3979,7 +4040,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -4043,11 +4104,21 @@ + + 5 + + 0 + + 5 + protected + 0 + + - 5 - wxEXPAND|wxALL + 10 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 wxID_ANY @@ -4203,7 +4274,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -4465,7 +4536,7 @@ 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -5157,7 +5228,7 @@ none 5 - wxEXPAND + wxEXPAND|wxRIGHT|wxLEFT 0 wxID_ANY diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h index 59731546fd..04740a78f5 100644 --- a/pcbnew/dialogs/dialog_create_array_base.h +++ b/pcbnew/dialogs/dialog_create_array_base.h @@ -22,6 +22,7 @@ class TEXT_CTRL_EVAL; #include #include #include +#include #include #include #include @@ -29,7 +30,6 @@ class TEXT_CTRL_EVAL; #include #include #include -#include #include #include #include @@ -66,7 +66,8 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM wxStaticText* m_unitLabelOffsetY; wxStaticText* m_labelStagger; TEXT_CTRL_EVAL* m_entryStagger; - wxRadioBox* m_radioBoxGridStaggerType; + wxRadioButton* m_staggerRows; + wxRadioButton* m_staggerCols; wxPanel* m_gridPadNumberingPanel; wxBoxSizer* m_gridPadNumberingSizer; wxRadioBox* m_radioBoxGridNumberingAxis;