diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 6ee6c9bb19..f277f5a13a 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -282,7 +282,7 @@ static bool validateLongEntry( const wxTextEntry& entry, } -void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event ) +bool DIALOG_CREATE_ARRAY::TransferDataFromWindow() { ARRAY_OPTIONS* newSettings = NULL; @@ -389,7 +389,7 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event ) m_settings = newSettings; ReadConfigFromControls(); - EndModal( wxID_OK ); + return true; } else { @@ -401,6 +401,7 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event ) errorStr = boost::algorithm::join( errorStrs, "\n" ); wxMessageBox( errorStr ); + return false; } } diff --git a/pcbnew/dialogs/dialog_create_array.h b/pcbnew/dialogs/dialog_create_array.h index 8dce009f1d..aaced2a845 100644 --- a/pcbnew/dialogs/dialog_create_array.h +++ b/pcbnew/dialogs/dialog_create_array.h @@ -345,12 +345,13 @@ private: // Event callbacks void OnParameterChanged( wxCommandEvent& event ) override; - void OnOkClick( wxCommandEvent& event ) override; // Internal callback handlers void setControlEnablement(); void calculateCircularArrayProperties(); + bool TransferDataFromWindow() override; + struct CREATE_ARRAY_DIALOG_ENTRIES { CREATE_ARRAY_DIALOG_ENTRIES() : diff --git a/pcbnew/dialogs/dialog_create_array_base.cpp b/pcbnew/dialogs/dialog_create_array_base.cpp index ae70dd8087..5af4069308 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 Nov 22 2017) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -51,7 +51,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + 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 ); @@ -62,7 +62,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + 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 ); @@ -73,7 +73,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + 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 ); @@ -84,7 +84,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + 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 ); @@ -100,7 +100,10 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID gbSizer1->Add( m_radioBoxGridStaggerType, wxGBPosition( 7, 0 ), wxGBSpan( 2, 2 ), wxALL|wxEXPAND, 5 ); - bSizer2->Add( gbSizer1, 1, wxEXPAND, 5 ); + bSizer2->Add( gbSizer1, 1, wxEXPAND|wxTOP|wxRIGHT, 5 ); + + + bSizer2->Add( 0, 0, 0, wxALL|wxEXPAND, 10 ); m_gridPadNumberingSizer = new wxBoxSizer( wxVERTICAL ); @@ -110,7 +113,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_radioBoxGridNumberingAxis->SetSelection( 0 ); m_gridPadNumberingSizer->Add( m_radioBoxGridNumberingAxis, 0, wxALL|wxEXPAND, 5 ); - m_checkBoxGridReverseNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Reverse pad numbering on alternate rows or columns"), wxDefaultPosition, wxDefaultSize, 0 ); + 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") }; @@ -152,12 +155,16 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_labelGridNumberingOffset = new wxStaticText( m_gridPanel, wxID_ANY, _("Pad numbering start:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelGridNumberingOffset->Wrap( -1 ); - bSizer5->Add( m_labelGridNumberingOffset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + 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 ); @@ -189,7 +196,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + 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 ); @@ -200,7 +207,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + 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 ); @@ -221,7 +228,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + 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 ); @@ -243,7 +250,10 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID gbSizer2->Add( m_entryRotateItemsCb, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - bSizer4->Add( gbSizer2, 0, wxALL|wxEXPAND, 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 ); @@ -267,7 +277,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_circPadNumberingSizer->Add( bSizer7, 0, wxEXPAND, 5 ); - bSizer4->Add( m_circPadNumberingSizer, 1, wxEXPAND|wxALL, 5 ); + bSizer4->Add( m_circPadNumberingSizer, 0, wxEXPAND|wxALL, 5 ); m_circularPanel->SetSizer( bSizer4 ); @@ -307,7 +317,6 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_entryCircAngle->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); m_entryCircCount->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); m_rbCircStartNumberingOpt->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); - m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this ); } DIALOG_CREATE_ARRAY_BASE::~DIALOG_CREATE_ARRAY_BASE() @@ -328,6 +337,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 ); - m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_create_array_base.fbp b/pcbnew/dialogs/dialog_create_array_base.fbp index 36ed398275..c93d4a1676 100644 --- a/pcbnew/dialogs/dialog_create_array_base.fbp +++ b/pcbnew/dialogs/dialog_create_array_base.fbp @@ -260,9 +260,9 @@ none 5 - wxEXPAND + wxEXPAND|wxTOP|wxRIGHT 1 - + wxBOTH @@ -817,7 +817,7 @@ 5 1 2 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 2 1 @@ -1083,7 +1083,7 @@ 5 1 2 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 3 1 @@ -1349,7 +1349,7 @@ 5 1 2 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 4 1 @@ -1615,7 +1615,7 @@ 5 1 2 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 5 1 @@ -1972,11 +1972,21 @@ + + 10 + wxALL|wxEXPAND + 0 + + 0 + protected + 0 + + 5 wxALL|wxEXPAND 0 - + m_gridPadNumberingSizer wxVERTICAL @@ -2104,7 +2114,7 @@ 0 0 wxID_ANY - Reverse pad numbering on alternate rows or columns + Reverse numbering on alternate rows/columns 0 @@ -2159,11 +2169,11 @@ - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -2681,11 +2691,11 @@ - + 5 wxEXPAND 0 - + bSizer5 wxHORIZONTAL @@ -2693,7 +2703,7 @@ 5 wxALIGN_CENTER_VERTICAL|wxALL - 0 + 1 1 1 @@ -2811,7 +2821,7 @@ 0 0 - + 72,-1 1 m_entryGridPriNumberingOffset 1 @@ -2902,7 +2912,7 @@ 0 0 - + 72,-1 1 m_entryGridSecNumberingOffset 1 @@ -3045,10 +3055,10 @@ bSizer4 wxHORIZONTAL none - + 5 wxALL|wxEXPAND - 0 + 1 wxBOTH @@ -3244,7 +3254,7 @@ 5 1 2 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 0 1 @@ -3510,7 +3520,7 @@ 5 1 2 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 1 1 @@ -3948,7 +3958,7 @@ 5 1 2 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 3 1 @@ -4389,11 +4399,21 @@ + + 10 + wxALL|wxEXPAND + 0 + + 0 + protected + 0 + + 5 wxEXPAND|wxALL - 1 - + 0 + wxID_ANY Pad Numbering Options @@ -4402,11 +4422,11 @@ 1 protected - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -4492,11 +4512,11 @@ - + 5 wxEXPAND 0 - + bSizer7 wxHORIZONTAL @@ -4705,7 +4725,7 @@ - OnOkClick + diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h index 9052393b0b..4c5fb2aee2 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 Nov 22 2017) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -107,7 +107,6 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } virtual void OnParameterChanged( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } public: