From ffaf99a6008e18fd08e35571f9efce3c999d659d Mon Sep 17 00:00:00 2001 From: John Beard Date: Fri, 25 Jan 2019 16:28:53 +0000 Subject: [PATCH] Pcbnew: Enable some numbering options in pcbnew The numbering axis priority (h then v or v then h), and alternate reversing are not actually numbering parameters, they are part of the geometry of the array (the items are physically in different orders). So enable these options, even when numbering is disabled. Also fix broken logic about when numbering scheme is enabled (it still applies even if the numbering offset is fixed.) --- pcbnew/dialogs/dialog_create_array.cpp | 28 +- pcbnew/dialogs/dialog_create_array_base.cpp | 190 +-- pcbnew/dialogs/dialog_create_array_base.fbp | 1326 +------------------ pcbnew/dialogs/dialog_create_array_base.h | 20 +- 4 files changed, 147 insertions(+), 1417 deletions(-) diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 08dc1745d8..8c5e1d5743 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -318,34 +318,32 @@ void DIALOG_CREATE_ARRAY::setControlEnablement() { if ( m_numberingEnabled ) { - const bool renumber = m_rbGridStartNumberingOpt->GetSelection() == 1; + const bool use_set_start_grid = m_rbGridStartNumberingOpt->GetSelection() == 1; - // If we're not renumbering, we can't set the numbering scheme - // or axis numbering types - m_radioBoxGridNumberingScheme->Enable( renumber ); - m_labelPriAxisNumbering->Enable( renumber ); - m_choicePriAxisNumbering->Enable( renumber ); + m_radioBoxGridNumberingScheme->Enable( true ); + m_labelPriAxisNumbering->Enable( true ); + m_choicePriAxisNumbering->Enable( true ); // Disable the secondary axis numbering option if the // numbering scheme doesn't have two axes const bool num2d = m_radioBoxGridNumberingScheme->GetSelection() != 0; - m_labelSecAxisNumbering->Enable( renumber && num2d ); - m_choiceSecAxisNumbering->Enable( renumber && num2d ); + m_labelSecAxisNumbering->Enable( true && num2d ); + m_choiceSecAxisNumbering->Enable( true && num2d ); - // We can only set an offset if we renumber - m_labelGridNumberingOffset->Enable( renumber ); - m_entryGridPriNumberingOffset->Enable( renumber ); - m_entryGridSecNumberingOffset->Enable( renumber && num2d ); + // We can only set an offset if we're setting the start number + m_labelGridNumberingOffset->Enable( use_set_start_grid ); + m_entryGridPriNumberingOffset->Enable( use_set_start_grid ); + m_entryGridSecNumberingOffset->Enable( use_set_start_grid && num2d ); - m_entryCircNumberingStart->Enable( m_rbCircStartNumberingOpt->GetSelection() == 1 ); + // disable the circular number offset in the same way + const bool use_set_start_circ = m_rbCircStartNumberingOpt->GetSelection() == 1; + m_entryCircNumberingStart->Enable( use_set_start_circ ); } else { // grid m_rbGridStartNumberingOpt->Enable( false ); - m_checkBoxGridReverseNumbering->Enable( false ); - m_radioBoxGridNumberingAxis->Enable( false ); m_radioBoxGridNumberingScheme->Enable( false ); m_choiceSecAxisNumbering->Enable( false ); m_choicePriAxisNumbering->Enable( false ); diff --git a/pcbnew/dialogs/dialog_create_array_base.cpp b/pcbnew/dialogs/dialog_create_array_base.cpp index 1b9df24c8f..42d06370a5 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 Dec 30 2017) +// C++ code generated with wxFormBuilder (version Nov 10 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -14,166 +14,166 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); - + wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - + m_gridTypeNotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_gridPanel = new wxPanel( m_gridTypeNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxHORIZONTAL ); - + wxGridBagSizer* gbSizer1; gbSizer1 = new wxGridBagSizer( 0, 0 ); gbSizer1->SetFlexibleDirection( wxBOTH ); gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - + m_labelNx = new wxStaticText( m_gridPanel, wxID_ANY, _("Horizontal count:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelNx->Wrap( -1 ); gbSizer1->Add( m_labelNx, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_entryNx = new TEXT_CTRL_EVAL( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_entryNx, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_labelNy = new wxStaticText( m_gridPanel, wxID_ANY, _("Vertical count:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelNy->Wrap( -1 ); gbSizer1->Add( m_labelNy, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - + m_entryNy = new TEXT_CTRL_EVAL( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_entryNy, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_labelDx = new wxStaticText( m_gridPanel, wxID_ANY, _("Horizontal spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelDx->Wrap( -1 ); gbSizer1->Add( m_labelDx, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - + m_entryDx = new wxTextCtrl( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_entryDx, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_unitLabelDx = new wxStaticText( m_gridPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelDx->Wrap( -1 ); gbSizer1->Add( m_unitLabelDx, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_labelDy = new wxStaticText( m_gridPanel, wxID_ANY, _("Vertical spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelDy->Wrap( -1 ); gbSizer1->Add( m_labelDy, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - + m_entryDy = new wxTextCtrl( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_entryDy, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_unitLabelDy = new wxStaticText( m_gridPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelDy->Wrap( -1 ); gbSizer1->Add( m_unitLabelDy, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_labelOffsetX = new wxStaticText( m_gridPanel, wxID_ANY, _("Horizontal offset:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelOffsetX->Wrap( -1 ); gbSizer1->Add( m_labelOffsetX, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - + m_entryOffsetX = new wxTextCtrl( m_gridPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_entryOffsetX, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_unitLabelOffsetX = new wxStaticText( m_gridPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelOffsetX->Wrap( -1 ); gbSizer1->Add( m_unitLabelOffsetX, wxGBPosition( 4, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_labelOffsetY = new wxStaticText( m_gridPanel, wxID_ANY, _("Vertical offset:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelOffsetY->Wrap( -1 ); gbSizer1->Add( m_labelOffsetY, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - + m_entryOffsetY = new wxTextCtrl( m_gridPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_entryOffsetY, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_unitLabelOffsetY = new wxStaticText( m_gridPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelOffsetY->Wrap( -1 ); gbSizer1->Add( m_unitLabelOffsetY, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_labelStagger = new wxStaticText( m_gridPanel, wxID_ANY, _("Stagger:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelStagger->Wrap( -1 ); gbSizer1->Add( m_labelStagger, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - + m_entryStagger = new TEXT_CTRL_EVAL( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_entryStagger, wxGBPosition( 6, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + wxString m_radioBoxGridStaggerTypeChoices[] = { _("Rows"), _("Columns") }; int m_radioBoxGridStaggerTypeNChoices = sizeof( m_radioBoxGridStaggerTypeChoices ) / sizeof( wxString ); m_radioBoxGridStaggerType = new wxRadioBox( m_gridPanel, wxID_ANY, _("Stagger Type:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridStaggerTypeNChoices, m_radioBoxGridStaggerTypeChoices, 1, wxRA_SPECIFY_COLS ); m_radioBoxGridStaggerType->SetSelection( 1 ); gbSizer1->Add( m_radioBoxGridStaggerType, wxGBPosition( 7, 0 ), wxGBSpan( 2, 2 ), wxALL|wxEXPAND, 5 ); - - + + bSizer2->Add( gbSizer1, 1, wxEXPAND|wxTOP|wxRIGHT, 5 ); - - + + bSizer2->Add( 0, 0, 0, wxALL|wxEXPAND, 10 ); - + m_gridPadNumberingSizer = new wxBoxSizer( wxVERTICAL ); - + wxString m_radioBoxGridNumberingAxisChoices[] = { _("Horizontal, then vertical"), _("Vertical, then horizontal") }; int m_radioBoxGridNumberingAxisNChoices = sizeof( m_radioBoxGridNumberingAxisChoices ) / sizeof( wxString ); - m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPanel, wxID_ANY, _("Pad Numbering Direction:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering Direction:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS ); m_radioBoxGridNumberingAxis->SetSelection( 0 ); m_gridPadNumberingSizer->Add( m_radioBoxGridNumberingAxis, 0, wxALL|wxEXPAND, 5 ); - + m_checkBoxGridReverseNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Reverse numbering on alternate rows/columns"), wxDefaultPosition, wxDefaultSize, 0 ); m_gridPadNumberingSizer->Add( m_checkBoxGridReverseNumbering, 0, wxALL, 5 ); - + wxString m_rbGridStartNumberingOptChoices[] = { _("Use first free number"), _("From start value") }; int m_rbGridStartNumberingOptNChoices = sizeof( m_rbGridStartNumberingOptChoices ) / sizeof( wxString ); m_rbGridStartNumberingOpt = new wxRadioBox( m_gridPanel, wxID_ANY, _("Initial Pad Number:"), wxDefaultPosition, wxDefaultSize, m_rbGridStartNumberingOptNChoices, m_rbGridStartNumberingOptChoices, 1, wxRA_SPECIFY_COLS ); m_rbGridStartNumberingOpt->SetSelection( 1 ); m_gridPadNumberingSizer->Add( m_rbGridStartNumberingOpt, 0, wxALL|wxEXPAND, 5 ); - + wxString m_radioBoxGridNumberingSchemeChoices[] = { _("Continuous (1, 2, 3...)"), _("Coordinate (A1, A2, ... B1, ...)") }; int m_radioBoxGridNumberingSchemeNChoices = sizeof( m_radioBoxGridNumberingSchemeChoices ) / sizeof( wxString ); m_radioBoxGridNumberingScheme = new wxRadioBox( m_gridPanel, wxID_ANY, _("Pad Numbering Scheme:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingSchemeNChoices, m_radioBoxGridNumberingSchemeChoices, 1, wxRA_SPECIFY_COLS ); m_radioBoxGridNumberingScheme->SetSelection( 1 ); m_gridPadNumberingSizer->Add( m_radioBoxGridNumberingScheme, 0, wxALL|wxEXPAND, 5 ); - + m_labelPriAxisNumbering = new wxStaticText( m_gridPanel, wxID_ANY, _("Primary axis numbering:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelPriAxisNumbering->Wrap( -1 ); m_gridPadNumberingSizer->Add( m_labelPriAxisNumbering, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - + wxArrayString m_choicePriAxisNumberingChoices; m_choicePriAxisNumbering = new wxChoice( m_gridPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePriAxisNumberingChoices, 0 ); m_choicePriAxisNumbering->SetSelection( 0 ); m_gridPadNumberingSizer->Add( m_choicePriAxisNumbering, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - + m_labelSecAxisNumbering = new wxStaticText( m_gridPanel, wxID_ANY, _("Secondary axis numbering:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelSecAxisNumbering->Wrap( -1 ); m_labelSecAxisNumbering->Enable( false ); - + m_gridPadNumberingSizer->Add( m_labelSecAxisNumbering, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - + wxArrayString m_choiceSecAxisNumberingChoices; m_choiceSecAxisNumbering = new wxChoice( m_gridPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSecAxisNumberingChoices, 0 ); m_choiceSecAxisNumbering->SetSelection( 0 ); m_choiceSecAxisNumbering->Enable( false ); - + m_gridPadNumberingSizer->Add( m_choiceSecAxisNumbering, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - + wxBoxSizer* bSizer5; bSizer5 = new wxBoxSizer( wxHORIZONTAL ); - + m_labelGridNumberingOffset = new wxStaticText( m_gridPanel, wxID_ANY, _("Pad numbering start:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelGridNumberingOffset->Wrap( -1 ); bSizer5->Add( m_labelGridNumberingOffset, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - + m_entryGridPriNumberingOffset = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryGridPriNumberingOffset->SetMinSize( wxSize( 72,-1 ) ); - + bSizer5->Add( m_entryGridPriNumberingOffset, 0, wxALL, 5 ); - + m_entryGridSecNumberingOffset = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryGridSecNumberingOffset->SetMinSize( wxSize( 72,-1 ) ); - + bSizer5->Add( m_entryGridSecNumberingOffset, 0, wxALL, 5 ); - - + + m_gridPadNumberingSizer->Add( bSizer5, 0, wxEXPAND, 5 ); - - + + bSizer2->Add( m_gridPadNumberingSizer, 0, wxALL|wxEXPAND, 5 ); - - + + m_gridPanel->SetSizer( bSizer2 ); m_gridPanel->Layout(); bSizer2->Fit( m_gridPanel ); @@ -181,130 +181,130 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_circularPanel = new wxPanel( m_gridTypeNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer4; bSizer4 = new wxBoxSizer( wxHORIZONTAL ); - + wxGridBagSizer* gbSizer2; gbSizer2 = new wxGridBagSizer( 0, 0 ); gbSizer2->SetFlexibleDirection( wxBOTH ); gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - + m_labelCentreX = new wxStaticText( m_circularPanel, wxID_ANY, _("Horizontal center:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCentreX->Wrap( -1 ); gbSizer2->Add( m_labelCentreX, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); - + m_entryCentreX = new wxTextCtrl( m_circularPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer2->Add( m_entryCentreX, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_unitLabelCentreX = new wxStaticText( m_circularPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCentreX->Wrap( -1 ); gbSizer2->Add( m_unitLabelCentreX, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_labelCentreY = new wxStaticText( m_circularPanel, wxID_ANY, _("Vertical center:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCentreY->Wrap( -1 ); gbSizer2->Add( m_labelCentreY, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); - + m_entryCentreY = new wxTextCtrl( m_circularPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer2->Add( m_entryCentreY, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_unitLabelCentreY = new wxStaticText( m_circularPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCentreY->Wrap( -1 ); gbSizer2->Add( m_unitLabelCentreY, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_labelCircRadius = new wxStaticText( m_circularPanel, wxID_ANY, _("Radius:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircRadius->Wrap( -1 ); gbSizer2->Add( m_labelCircRadius, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); - + m_valueCircRadius = new wxStaticText( m_circularPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); m_valueCircRadius->Wrap( -1 ); gbSizer2->Add( m_valueCircRadius, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_unitLabelCircRadius = new wxStaticText( m_circularPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCircRadius->Wrap( -1 ); gbSizer2->Add( m_unitLabelCircRadius, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_labelCircAngle = new wxStaticText( m_circularPanel, wxID_ANY, _("Angle:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircAngle->Wrap( -1 ); gbSizer2->Add( m_labelCircAngle, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); - + m_entryCircAngle = new wxTextCtrl( m_circularPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryCircAngle->SetToolTip( _("Positive angles represent an anti-clockwise rotation. An angle of 0 will produce a full circle divided evenly into \"Count\" portions.") ); - + gbSizer2->Add( m_entryCircAngle, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_unitLabelCircAngle = new wxStaticText( m_circularPanel, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCircAngle->Wrap( -1 ); gbSizer2->Add( m_unitLabelCircAngle, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - + m_labelCircCount = new wxStaticText( m_circularPanel, wxID_ANY, _("Count:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircCount->Wrap( -1 ); gbSizer2->Add( m_labelCircCount, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); - + m_entryCircCount = new TEXT_CTRL_EVAL( m_circularPanel, wxID_ANY, _("4"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryCircCount->SetToolTip( _("How many items in the array.") ); - + gbSizer2->Add( m_entryCircCount, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - + m_labelCircRotate = new wxStaticText( m_circularPanel, wxID_ANY, _("Rotate:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircRotate->Wrap( -1 ); gbSizer2->Add( m_labelCircRotate, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); - + m_entryRotateItemsCb = new wxCheckBox( m_circularPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - 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") ); - + gbSizer2->Add( m_entryRotateItemsCb, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - - + + bSizer4->Add( gbSizer2, 1, wxALL|wxEXPAND, 5 ); - - + + bSizer4->Add( 0, 0, 0, wxALL|wxEXPAND, 10 ); - - m_circPadNumberingSizer = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Pad Numbering Options:") ), wxVERTICAL ); - + + m_circPadNumberingSizer = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Numbering Options:") ), wxVERTICAL ); + wxString m_rbCircStartNumberingOptChoices[] = { _("Use first free number"), _("From start value") }; int m_rbCircStartNumberingOptNChoices = sizeof( m_rbCircStartNumberingOptChoices ) / sizeof( wxString ); m_rbCircStartNumberingOpt = new wxRadioBox( m_circPadNumberingSizer->GetStaticBox(), wxID_ANY, _("Initial Pad Number:"), wxDefaultPosition, wxDefaultSize, m_rbCircStartNumberingOptNChoices, m_rbCircStartNumberingOptChoices, 1, wxRA_SPECIFY_COLS ); m_rbCircStartNumberingOpt->SetSelection( 0 ); m_circPadNumberingSizer->Add( m_rbCircStartNumberingOpt, 0, wxALL|wxEXPAND, 5 ); - + wxBoxSizer* bSizer7; bSizer7 = new wxBoxSizer( wxHORIZONTAL ); - + m_labelCircNumStart = new wxStaticText( m_circPadNumberingSizer->GetStaticBox(), wxID_ANY, _("Pad numbering start value:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircNumStart->Wrap( -1 ); bSizer7->Add( m_labelCircNumStart, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - + m_entryCircNumberingStart = new wxTextCtrl( m_circPadNumberingSizer->GetStaticBox(), wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer7->Add( m_entryCircNumberingStart, 1, wxALL, 5 ); - - + + m_circPadNumberingSizer->Add( bSizer7, 0, wxEXPAND, 5 ); - - + + bSizer4->Add( m_circPadNumberingSizer, 0, wxEXPAND|wxALL, 5 ); - - + + m_circularPanel->SetSizer( bSizer4 ); m_circularPanel->Layout(); bSizer4->Fit( m_circularPanel ); m_gridTypeNotebook->AddPage( m_circularPanel, _("Circular Array"), false ); - + bMainSizer->Add( m_gridTypeNotebook, 1, wxEXPAND | wxALL, 5 ); - + m_stdButtons = new wxStdDialogButtonSizer(); m_stdButtonsOK = new wxButton( this, wxID_OK ); m_stdButtons->AddButton( m_stdButtonsOK ); m_stdButtonsCancel = new wxButton( this, wxID_CANCEL ); m_stdButtons->AddButton( m_stdButtonsCancel ); m_stdButtons->Realize(); - + bMainSizer->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 ); - - + + this->SetSizer( bMainSizer ); this->Layout(); bMainSizer->Fit( this ); - + // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CREATE_ARRAY_BASE::OnClose ) ); m_entryNx->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); @@ -341,5 +341,5 @@ DIALOG_CREATE_ARRAY_BASE::~DIALOG_CREATE_ARRAY_BASE() m_entryCircAngle->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); m_entryCircCount->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); m_rbCircStartNumberingOpt->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); - + } diff --git a/pcbnew/dialogs/dialog_create_array_base.fbp b/pcbnew/dialogs/dialog_create_array_base.fbp index 94879023ba..3a0820ab4b 100644 --- a/pcbnew/dialogs/dialog_create_array_base.fbp +++ b/pcbnew/dialogs/dialog_create_array_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ dialog_create_array_base 1000 none + 1 DIALOG_CREATE_ARRAY_BASE @@ -52,42 +53,7 @@ - - - - - - - - - OnClose - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer @@ -150,31 +116,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - Load From File; Grid Array @@ -230,29 +171,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - bSizer2 @@ -309,6 +227,7 @@ 0 wxID_ANY Horizontal count: + 0 0 @@ -334,29 +253,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -424,33 +320,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -489,6 +359,7 @@ 0 wxID_ANY Vertical count: + 0 0 @@ -514,29 +385,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -604,33 +452,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -669,6 +491,7 @@ 0 wxID_ANY Horizontal spacing: + 0 0 @@ -694,29 +517,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -784,33 +584,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -849,6 +623,7 @@ 0 wxID_ANY mm + 0 0 @@ -874,29 +649,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -935,6 +687,7 @@ 0 wxID_ANY Vertical spacing: + 0 0 @@ -960,29 +713,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1050,33 +780,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -1115,6 +819,7 @@ 0 wxID_ANY mm + 0 0 @@ -1140,29 +845,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1201,6 +883,7 @@ 0 wxID_ANY Horizontal offset: + 0 0 @@ -1226,29 +909,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1316,33 +976,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -1381,6 +1015,7 @@ 0 wxID_ANY mm + 0 0 @@ -1406,29 +1041,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1467,6 +1079,7 @@ 0 wxID_ANY Vertical offset: + 0 0 @@ -1492,29 +1105,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1582,33 +1172,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -1647,6 +1211,7 @@ 0 wxID_ANY mm + 0 0 @@ -1672,29 +1237,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1733,6 +1275,7 @@ 0 wxID_ANY Stagger: + 0 0 @@ -1758,29 +1301,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1848,33 +1368,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -1944,30 +1438,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2024,7 +1494,7 @@ 0 0 wxID_ANY - Pad Numbering Direction: + Numbering Direction: 1 0 @@ -2055,30 +1525,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2143,30 +1589,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2233,30 +1655,7 @@ - - - - - - - - - - - - - - - - - OnParameterChanged - - - - - - @@ -2323,30 +1722,7 @@ - - - - - - - - - - - - - - - - - OnParameterChanged - - - - - - @@ -2382,6 +1758,7 @@ 0 wxID_ANY Primary axis numbering: + 0 0 @@ -2407,29 +1784,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -2494,30 +1848,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2553,6 +1883,7 @@ 0 wxID_ANY Secondary axis numbering: + 0 0 @@ -2578,29 +1909,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -2665,30 +1973,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2733,6 +2017,7 @@ 0 wxID_ANY Pad numbering start: + 0 0 @@ -2758,29 +2043,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -2845,33 +2107,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2936,33 +2171,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3027,29 +2235,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - bSizer4 @@ -3106,6 +2291,7 @@ 0 wxID_ANY Horizontal center: + 0 0 @@ -3131,29 +2317,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -3221,33 +2384,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -3286,6 +2423,7 @@ 0 wxID_ANY mm + 0 0 @@ -3311,29 +2449,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -3372,6 +2487,7 @@ 0 wxID_ANY Vertical center: + 0 0 @@ -3397,29 +2513,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -3487,33 +2580,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -3552,6 +2619,7 @@ 0 wxID_ANY mm + 0 0 @@ -3577,29 +2645,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -3638,6 +2683,7 @@ 0 wxID_ANY Radius: + 0 0 @@ -3663,29 +2709,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -3724,6 +2747,7 @@ 0 wxID_ANY 0 + 0 0 @@ -3749,29 +2773,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -3810,6 +2811,7 @@ 0 wxID_ANY mm + 0 0 @@ -3835,29 +2837,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -3896,6 +2875,7 @@ 0 wxID_ANY Angle: + 0 0 @@ -3921,29 +2901,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -4011,33 +2968,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -4076,6 +3007,7 @@ 0 wxID_ANY deg + 0 0 @@ -4101,29 +3033,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -4162,6 +3071,7 @@ 0 wxID_ANY Count: + 0 0 @@ -4187,29 +3097,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -4277,33 +3164,7 @@ - - - - - - - - - - - - - - - - - - - - - - OnParameterChanged - - - - @@ -4342,6 +3203,7 @@ 0 wxID_ANY Rotate: + 0 0 @@ -4367,29 +3229,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -4457,30 +3296,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -4501,13 +3316,12 @@ 0 wxID_ANY - Pad Numbering Options: + Numbering Options: m_circPadNumberingSizer wxVERTICAL 1 protected - 5 wxALL|wxEXPAND @@ -4572,30 +3386,7 @@ - - - - - - - - - - - - - - - - - OnParameterChanged - - - - - - @@ -4640,6 +3431,7 @@ 0 wxID_ANY Pad numbering start value: + 0 0 @@ -4665,29 +3457,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -4752,33 +3521,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4806,14 +3548,6 @@ m_stdButtons protected - - - - - - - - diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h index 7572edcbd9..7fbd089ffd 100644 --- a/pcbnew/dialogs/dialog_create_array_base.h +++ b/pcbnew/dialogs/dialog_create_array_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Nov 10 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_CREATE_ARRAY_BASE_H__ -#define __DIALOG_CREATE_ARRAY_BASE_H__ +#pragma once #include #include @@ -45,7 +44,7 @@ class TEXT_CTRL_EVAL; class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM { private: - + protected: wxNotebook* m_gridTypeNotebook; wxPanel* m_gridPanel; @@ -104,17 +103,16 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM wxStdDialogButtonSizer* m_stdButtons; wxButton* m_stdButtonsOK; wxButton* m_stdButtonsCancel; - + // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } virtual void OnParameterChanged( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_CREATE_ARRAY, const wxString& title = _("Create Array"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_CREATE_ARRAY, const wxString& title = _("Create Array"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_CREATE_ARRAY_BASE(); - + }; -#endif //__DIALOG_CREATE_ARRAY_BASE_H__