diff --git a/common/widgets/widget_save_restore.cpp b/common/widgets/widget_save_restore.cpp index 3c5b08d088..2bbcfecadc 100644 --- a/common/widgets/widget_save_restore.cpp +++ b/common/widgets/widget_save_restore.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2019 KiCad Developers, see AUTHORS.TXT for contributors. + * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.TXT for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -38,6 +39,12 @@ void WIDGET_SAVE_RESTORE::Add( wxRadioBox& ctrl, long& dest ) } +void WIDGET_SAVE_RESTORE::Add( wxRadioButton& ctrl, bool& dest ) +{ + m_ctrls.emplace_back( WIDGET_CTRL_TYPE_T::RADIOBUTTON, ctrl, dest ); +} + + void WIDGET_SAVE_RESTORE::Add( wxCheckBox& ctrl, bool& dest ) { m_ctrls.emplace_back( WIDGET_CTRL_TYPE_T::CHECKBOX, ctrl, dest ); @@ -90,6 +97,10 @@ void WIDGET_SAVE_RESTORE::ReadConfigFromControls() *ctrl.m_dest.m_bool = ctrl.m_control.m_checkbox->GetValue(); break; + case WIDGET_CTRL_TYPE_T::RADIOBUTTON: + *ctrl.m_dest.m_bool = ctrl.m_control.m_radiobutton->GetValue(); + break; + case WIDGET_CTRL_TYPE_T::TEXT: *ctrl.m_dest.m_str = ctrl.m_control.m_textctrl->GetValue(); break; @@ -137,6 +148,10 @@ void WIDGET_SAVE_RESTORE::RestoreConfigToControls() ctrl.m_control.m_checkbox->SetValue( *ctrl.m_dest.m_bool ); break; + case WIDGET_CTRL_TYPE_T::RADIOBUTTON: + ctrl.m_control.m_radiobutton->SetValue( *ctrl.m_dest.m_bool ); + break; + case WIDGET_CTRL_TYPE_T::TEXT: ctrl.m_control.m_textctrl->SetValue( *ctrl.m_dest.m_str ); break; diff --git a/include/array_options.h b/include/array_options.h index fb758df0ec..f902e46ebd 100644 --- a/include/array_options.h +++ b/include/array_options.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -92,6 +92,20 @@ public: m_shouldNumber = aShouldNumber; } + /*! + * @return are the footprints in this array reannotated to be unique (true), or do they + * keep the original annotation (false)? + */ + bool ShouldReannotateFootprints() const + { + return m_reannotateFootprints; + } + + void SetSShouldReannotateFootprints( bool aShouldReannotate ) + { + m_reannotateFootprints = aShouldReannotate; + } + /*! * @return is the numbering is enabled and should start at a point * specified in these options or is it implicit according to the calling @@ -114,6 +128,9 @@ protected: /// True if this array numbers the new items bool m_shouldNumber; + /// True if this array will rename any footprints to be unique + bool m_reannotateFootprints; + /// True if this array's number starts from the preset point /// False if the array numbering starts from some externally provided point bool m_numberingStartIsSpecified; diff --git a/include/widgets/widget_save_restore.h b/include/widgets/widget_save_restore.h index 3adee45d1c..2ce5d68e3c 100644 --- a/include/widgets/widget_save_restore.h +++ b/include/widgets/widget_save_restore.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2019 KiCad Developers, see AUTHORS.TXT for contributors. + * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.TXT for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,6 +30,7 @@ class wxCheckBox; class wxChoice; class wxNotebook; class wxRadioBox; +class wxRadioButton; class wxString; class wxTextCtrl; @@ -48,6 +49,11 @@ public: */ void Add( wxRadioBox& ctrl, long& dest ); + /** + * Bind a radio button to a binary choice + */ + void Add( wxRadioButton& ctrl, bool& dest ); + /** * Bind a check box to a binary choice */ @@ -111,6 +117,7 @@ private: TEXT_DOUBLE, UNIT_BINDER, CHECKBOX, + RADIOBUTTON, RADIOBOX, CHOICE, TAB @@ -122,6 +129,11 @@ private: { } + CONTROL( wxRadioButton* aCtrl ) : + m_radiobutton( aCtrl ) + { + } + CONTROL( wxChoice* aCtrl ) : m_choice( aCtrl ) { @@ -147,12 +159,13 @@ private: { } - wxCheckBox* m_checkbox; - wxChoice* m_choice; - wxNotebook* m_notebook; - wxRadioBox* m_radiobox; - wxTextCtrl* m_textctrl; - UNIT_BINDER* m_unit_binder; + wxCheckBox* m_checkbox; + wxChoice* m_choice; + wxNotebook* m_notebook; + wxRadioBox* m_radiobox; + wxRadioButton* m_radiobutton; + wxTextCtrl* m_textctrl; + UNIT_BINDER* m_unit_binder; }; union DATA { diff --git a/pcbnew/array_creator.cpp b/pcbnew/array_creator.cpp index 556ebc014f..914b9a6696 100644 --- a/pcbnew/array_creator.cpp +++ b/pcbnew/array_creator.cpp @@ -29,6 +29,9 @@ #include #include #include +#include +#include +#include /** * Transform a #BOARD_ITEM from the given #ARRAY_OPTIONS and an index into the array. @@ -70,19 +73,23 @@ void ARRAY_CREATOR::Invoke() ARRAY_PAD_NUMBER_PROVIDER pad_number_provider( fp, *array_opts ); - for ( int i = 0; i < m_selection.Size(); ++i ) + std::vector all_added_items; + + // The first item in list is the original item. We do not modify it + for( int ptN = 0; ptN < array_opts->GetArraySize(); ptN++ ) { - BOARD_ITEM* item = static_cast( m_selection[ i ] ); + PCB_SELECTION items_for_this_block; - if( item->Type() == PCB_PAD_T && !m_isFootprintEditor ) + for ( int i = 0; i < m_selection.Size(); ++i ) { - // If it is not the footprint editor, then duplicate the parent footprint instead - item = static_cast( item )->GetParent(); - } + BOARD_ITEM* item = static_cast( m_selection[ i ] ); + + if( item->Type() == PCB_PAD_T && !m_isFootprintEditor ) + { + // If it is not the footprint editor, then duplicate the parent footprint instead + item = static_cast( item )->GetParent(); + } - // The first item in list is the original item. We do not modify it - for( int ptN = 0; ptN < array_opts->GetArraySize(); ptN++ ) - { BOARD_ITEM* this_item = nullptr; if( ptN == 0 ) @@ -127,18 +134,13 @@ void ARRAY_CREATOR::Invoke() break; } - // PCB items keep the same numbering - - // @TODO: renumber footprints if asked. This needs UI to enable. - // something like this, but needs a "block offset" to prevent - // multiple selections overlapping. - // if( this_item->Type() == PCB_FOOTPRINT_T ) - // static_cast( *new_item ).IncrementReference( ptN ); - // @TODO: we should merge zones. This is a bit tricky, because // the undo command needs saving old area, if it is merged. } + // Add new items to selection (footprints in the selection will be reannotated) + items_for_this_block.Add( this_item ); + if( this_item ) { // Because aItem is/can be created from a selected item, and inherits from @@ -192,7 +194,19 @@ void ARRAY_CREATOR::Invoke() } } } + + if( !m_isFootprintEditor && array_opts->ShouldReannotateFootprints() ) + { + m_toolMgr->GetTool()->ReannotateDuplicates( items_for_this_block, + all_added_items ); + } + + for( EDA_ITEM* item : items_for_this_block ) + all_added_items.push_back( item ); } + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &all_added_items ); + commit.Push( _( "Create an array" ) ); } diff --git a/pcbnew/array_creator.h b/pcbnew/array_creator.h index 8464750987..fd6a3892ea 100644 --- a/pcbnew/array_creator.h +++ b/pcbnew/array_creator.h @@ -32,6 +32,8 @@ #include #include +class TOOL_MANAGER; + /*! * Class that performs array creation by producing a dialog to gather parameters and then * creating and laying out the items. @@ -40,10 +42,11 @@ class ARRAY_CREATOR { public: ARRAY_CREATOR( PCB_BASE_FRAME& aParent, bool aIsFootprintEditor, - const PCB_SELECTION& aSelection ) : + const PCB_SELECTION& aSelection, TOOL_MANAGER* aToolManager ) : m_parent( aParent ), m_isFootprintEditor( aIsFootprintEditor ), - m_selection( aSelection ) + m_selection( aSelection ), + m_toolMgr( aToolManager ) {} virtual ~ARRAY_CREATOR() {} @@ -56,7 +59,8 @@ public: private: PCB_BASE_FRAME& m_parent; bool m_isFootprintEditor; - const PCB_SELECTION& m_selection; + const PCB_SELECTION m_selection; + TOOL_MANAGER* m_toolMgr; }; #endif /* ARRAY_CREATOR_H_ */ diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 072efb6151..64feb665d1 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -70,7 +70,9 @@ struct CREATE_ARRAY_DIALOG_ENTRIES m_CircNumberingOffset( "1" ), m_CircNumberingStep( 1 ), m_CircRotatationStep( false ), - m_ArrayTypeTab( 0 ) // start on grid view + m_ArrayTypeTab( 0 ), // start on grid view + m_FootprintKeepAnnotations( false ), + m_FootprintReannotate( true ) // Assign unique by default { } @@ -106,6 +108,8 @@ struct CREATE_ARRAY_DIALOG_ENTRIES long m_CircNumberingStep; bool m_CircRotatationStep; long m_ArrayTypeTab; + bool m_FootprintKeepAnnotations; + bool m_FootprintReannotate; }; // Persistent options settings @@ -145,11 +149,11 @@ static const std::vector numberingTypeData { DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, std::unique_ptr& aSettings, - bool enableNumbering, const wxPoint& aOrigPos ) : + bool aIsFootprintEditor, const wxPoint& aOrigPos ) : DIALOG_CREATE_ARRAY_BASE( aParent ), m_settings( aSettings ), m_originalItemPosition( aOrigPos ), - m_numberingEnabled( enableNumbering ), + m_isFootprintEditor( aIsFootprintEditor ), m_hSpacing( aParent, m_labelDx, m_entryDx, m_unitLabelDx ), m_vSpacing( aParent, m_labelDy, m_entryDy, m_unitLabelDy ), m_hOffset( aParent, m_labelOffsetX, m_entryOffsetX, m_unitLabelOffsetX ), @@ -224,6 +228,9 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, m_cfg_persister.Add( *m_gridTypeNotebook, s_arrayOptions.m_ArrayTypeTab ); + m_cfg_persister.Add( *m_radioBtnKeepRefs, s_arrayOptions.m_FootprintKeepAnnotations ); + m_cfg_persister.Add( *m_radioBtnUniqueRefs, s_arrayOptions.m_FootprintReannotate ); + m_cfg_persister.RestoreConfigToControls(); // Run the callbacks once to process the dialog contents @@ -342,9 +349,9 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow() newGrid->m_horizontalThenVertical = m_radioBoxGridNumberingAxis->GetSelection() == 0; newGrid->m_reverseNumberingAlternate = m_checkBoxGridReverseNumbering->GetValue(); - newGrid->SetShouldNumber( m_numberingEnabled ); + newGrid->SetShouldNumber( m_isFootprintEditor ); - if ( m_numberingEnabled ) + if( m_isFootprintEditor ) { newGrid->SetNumberingStartIsSpecified( m_rbGridStartNumberingOpt->GetSelection() == 1 ); @@ -393,9 +400,9 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow() ok = ok && validateLongEntry(*m_entryCircCount, newCirc->m_nPts, _("point count"), errors); newCirc->m_rotateItems = m_entryRotateItemsCb->GetValue(); - newCirc->SetShouldNumber( m_numberingEnabled ); + newCirc->SetShouldNumber( m_isFootprintEditor ); - if ( m_numberingEnabled ) + if( m_isFootprintEditor ) { newCirc->SetNumberingStartIsSpecified( m_rbCircStartNumberingOpt->GetSelection() == 1 ); @@ -424,6 +431,8 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow() // assign pointer and ownership here m_settings = std::move( newSettings ); + m_settings->SetSShouldReannotateFootprints( m_radioBtnUniqueRefs->GetValue() ); + // persist the control state for next time m_cfg_persister.ReadConfigFromControls(); @@ -446,8 +455,13 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow() void DIALOG_CREATE_ARRAY::setControlEnablement() { - if ( m_numberingEnabled ) + if( m_isFootprintEditor ) { + m_footprintReannotatePanel->Show( false ); + + m_gridPadNumberingPanel->Show( true ); + m_circularPadNumberingPanel->Show( true ); + // If we set the start number, we can set the other options, // otherwise it's a hardcoded linear array const bool use_set_start_grid = m_rbGridStartNumberingOpt->GetSelection() == 1; @@ -488,9 +502,15 @@ void DIALOG_CREATE_ARRAY::setControlEnablement() m_entryGridPriNumberingOffset->Enable( false ); m_entryGridSecNumberingOffset->Enable( false ); + m_gridPadNumberingPanel->Show( false ); + // circular m_rbCircStartNumberingOpt->Enable( false ); m_entryCircNumberingStart->Enable( false ); + + m_circularPadNumberingPanel->Show( false ); + + m_footprintReannotatePanel->Show( true ); } } diff --git a/pcbnew/dialogs/dialog_create_array.h b/pcbnew/dialogs/dialog_create_array.h index adfc9bdd9a..198be10f2f 100644 --- a/pcbnew/dialogs/dialog_create_array.h +++ b/pcbnew/dialogs/dialog_create_array.h @@ -71,8 +71,8 @@ private: */ const wxPoint m_originalItemPosition; - // some uses of arrays might not allow component renumbering - bool m_numberingEnabled; + // Decide whether to display pad numbering options or not + bool m_isFootprintEditor; UNIT_BINDER m_hSpacing, m_vSpacing; UNIT_BINDER m_hOffset, m_vOffset; diff --git a/pcbnew/dialogs/dialog_create_array_base.cpp b/pcbnew/dialogs/dialog_create_array_base.cpp index 7490312b03..98e9b65eab 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 3.9.0 Jun 18 2020) +// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -18,6 +18,9 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer7; + bSizer7 = new wxBoxSizer( wxHORIZONTAL ); + m_gridTypeNotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_gridPanel = new wxPanel( m_gridTypeNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer2; @@ -105,46 +108,49 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID bSizer2->Add( 0, 0, 0, wxALL|wxEXPAND, 10 ); + m_gridPadNumberingPanel = new wxPanel( m_gridPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_gridPadNumberingPanel->Hide(); + 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, _("Numbering Direction"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPadNumberingPanel, 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_checkBoxGridReverseNumbering = new wxCheckBox( m_gridPadNumberingPanel, 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 = new wxRadioBox( m_gridPadNumberingPanel, 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 = new wxRadioBox( m_gridPadNumberingPanel, 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 = new wxStaticText( m_gridPadNumberingPanel, 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 = new wxChoice( m_gridPadNumberingPanel, 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 = new wxStaticText( m_gridPadNumberingPanel, 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 = new wxChoice( m_gridPadNumberingPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSecAxisNumberingChoices, 0 ); m_choiceSecAxisNumbering->SetSelection( 0 ); m_choiceSecAxisNumbering->Enable( false ); @@ -156,30 +162,30 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID fgSizer1->SetFlexibleDirection( wxBOTH ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_labelGridNumberingOffset = new wxStaticText( m_gridPanel, wxID_ANY, _("Pad numbering start:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelGridNumberingOffset = new wxStaticText( m_gridPadNumberingPanel, wxID_ANY, _("Pad numbering start:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelGridNumberingOffset->Wrap( -1 ); fgSizer1->Add( m_labelGridNumberingOffset, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - m_entryGridPriNumberingOffset = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + m_entryGridPriNumberingOffset = new wxTextCtrl( m_gridPadNumberingPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryGridPriNumberingOffset->SetMinSize( wxSize( 72,-1 ) ); fgSizer1->Add( m_entryGridPriNumberingOffset, 0, wxALL, 5 ); - m_entryGridSecNumberingOffset = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + m_entryGridSecNumberingOffset = new wxTextCtrl( m_gridPadNumberingPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryGridSecNumberingOffset->SetMinSize( wxSize( 72,-1 ) ); fgSizer1->Add( m_entryGridSecNumberingOffset, 0, wxALL, 5 ); - m_labelGridNumberingStep = new wxStaticText( m_gridPanel, wxID_ANY, _("Pad numbering skip:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelGridNumberingStep = new wxStaticText( m_gridPadNumberingPanel, wxID_ANY, _("Pad numbering skip:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelGridNumberingStep->Wrap( -1 ); fgSizer1->Add( m_labelGridNumberingStep, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - m_entryGridPriNumberingStep = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + m_entryGridPriNumberingStep = new wxTextCtrl( m_gridPadNumberingPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryGridPriNumberingStep->SetMinSize( wxSize( 72,-1 ) ); fgSizer1->Add( m_entryGridPriNumberingStep, 0, wxALL, 5 ); - m_entryGridSecNumberingStep = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + m_entryGridSecNumberingStep = new wxTextCtrl( m_gridPadNumberingPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryGridSecNumberingStep->SetMinSize( wxSize( 72,-1 ) ); fgSizer1->Add( m_entryGridSecNumberingStep, 0, wxALL, 5 ); @@ -188,13 +194,16 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_gridPadNumberingSizer->Add( fgSizer1, 1, wxEXPAND, 5 ); - bSizer2->Add( m_gridPadNumberingSizer, 0, wxALL|wxEXPAND, 5 ); + m_gridPadNumberingPanel->SetSizer( m_gridPadNumberingSizer ); + m_gridPadNumberingPanel->Layout(); + m_gridPadNumberingSizer->Fit( m_gridPadNumberingPanel ); + bSizer2->Add( m_gridPadNumberingPanel, 1, wxEXPAND | wxALL, 5 ); m_gridPanel->SetSizer( bSizer2 ); m_gridPanel->Layout(); bSizer2->Fit( m_gridPanel ); - m_gridTypeNotebook->AddPage( m_gridPanel, _("Grid Array"), false ); + m_gridTypeNotebook->AddPage( m_gridPanel, _("Grid Array"), true ); m_circularPanel = new wxPanel( m_gridTypeNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer4; bSizer4 = new wxBoxSizer( wxHORIZONTAL ); @@ -276,7 +285,10 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID bSizer4->Add( 0, 0, 0, wxALL|wxEXPAND, 10 ); - m_circPadNumberingSizer = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Numbering Options") ), wxVERTICAL ); + m_circularPadNumberingPanel = new wxPanel( m_circularPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_circularPadNumberingPanel->Hide(); + + m_circPadNumberingSizer = new wxStaticBoxSizer( new wxStaticBox( m_circularPadNumberingPanel, wxID_ANY, _("Numbering Options") ), wxVERTICAL ); wxString m_rbCircStartNumberingOptChoices[] = { _("Use first free number"), _("From start value") }; int m_rbCircStartNumberingOptNChoices = sizeof( m_rbCircStartNumberingOptChoices ) / sizeof( wxString ); @@ -317,15 +329,46 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_circPadNumberingSizer->Add( fgSizer2, 1, wxEXPAND, 5 ); - bSizer4->Add( m_circPadNumberingSizer, 0, wxEXPAND|wxALL, 5 ); + m_circularPadNumberingPanel->SetSizer( m_circPadNumberingSizer ); + m_circularPadNumberingPanel->Layout(); + m_circPadNumberingSizer->Fit( m_circularPadNumberingPanel ); + bSizer4->Add( m_circularPadNumberingPanel, 1, wxEXPAND | wxALL, 5 ); m_circularPanel->SetSizer( bSizer4 ); m_circularPanel->Layout(); bSizer4->Fit( m_circularPanel ); - m_gridTypeNotebook->AddPage( m_circularPanel, _("Circular Array"), true ); + m_gridTypeNotebook->AddPage( m_circularPanel, _("Circular Array"), false ); - bMainSizer->Add( m_gridTypeNotebook, 1, wxEXPAND | wxALL, 5 ); + bSizer7->Add( m_gridTypeNotebook, 1, wxEXPAND | wxALL, 5 ); + + m_footprintReannotatePanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer8; + bSizer8 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizerFootprintAnnotation; + sbSizerFootprintAnnotation = new wxStaticBoxSizer( new wxStaticBox( m_footprintReannotatePanel, wxID_ANY, _("Footprint Annotation") ), wxVERTICAL ); + + m_radioBtnKeepRefs = new wxRadioButton( sbSizerFootprintAnnotation->GetStaticBox(), wxID_ANY, _("Keep existing reference designators"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerFootprintAnnotation->Add( m_radioBtnKeepRefs, 0, wxALL, 5 ); + + m_radioBtnUniqueRefs = new wxRadioButton( sbSizerFootprintAnnotation->GetStaticBox(), wxID_ANY, _("Assign unique reference designators"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnUniqueRefs->SetValue( true ); + m_radioBtnUniqueRefs->SetToolTip( _("This can conflict with reference designators in the schematic that have not yet been synchronized with the board.") ); + + sbSizerFootprintAnnotation->Add( m_radioBtnUniqueRefs, 0, wxALL, 5 ); + + + bSizer8->Add( sbSizerFootprintAnnotation, 0, wxEXPAND, 5 ); + + + m_footprintReannotatePanel->SetSizer( bSizer8 ); + m_footprintReannotatePanel->Layout(); + bSizer8->Fit( m_footprintReannotatePanel ); + bSizer7->Add( m_footprintReannotatePanel, 0, wxEXPAND | wxALL, 5 ); + + + bMainSizer->Add( bSizer7, 1, wxEXPAND, 5 ); m_stdButtons = new wxStdDialogButtonSizer(); m_stdButtonsOK = new wxButton( this, wxID_OK ); diff --git a/pcbnew/dialogs/dialog_create_array_base.fbp b/pcbnew/dialogs/dialog_create_array_base.fbp index e8dc8efe66..f0e1bef054 100644 --- a/pcbnew/dialogs/dialog_create_array_base.fbp +++ b/pcbnew/dialogs/dialog_create_array_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -52,6 +52,7 @@ DIALOG_SHIM; dialog_shim.h Create Array + 0 @@ -63,66 +64,18 @@ none 5 - wxEXPAND | wxALL + wxEXPAND 1 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 + - 1 - m_gridTypeNotebook - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - - Load From File; - Grid Array - 0 - + bSizer7 + wxHORIZONTAL + none + + 5 + wxEXPAND | wxALL + 1 + 1 1 1 @@ -133,6 +86,7 @@ + 1 0 @@ -157,7 +111,7 @@ 0 1 - m_gridPanel + m_gridTypeNotebook 1 @@ -167,1836 +121,95 @@ Resizable 1 + 0 - wxTAB_TRAVERSAL - - - bSizer2 - wxHORIZONTAL - none - - 5 - wxEXPAND|wxTOP|wxRIGHT - 1 - - - wxBOTH - - - 0 - - gbSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - - 5 - 1 - 0 - wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Horizontal count: - 0 - - 0 - - - 0 - - 1 - m_labelNx - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryNx - 1 - - - protected - 1 - - Resizable - 1 - - - TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 5 - - - - OnParameterChanged - - - - 5 - 1 - 0 - wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Vertical count: - 0 - - 0 - - - 0 - - 1 - m_labelNy - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryNy - 1 - - - protected - 1 - - Resizable - 1 - - - TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 5 - - - - OnParameterChanged - - - - 5 - 1 - 0 - wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Horizontal spacing: - 0 - - 0 - - - 0 - - 1 - m_labelDx - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryDx - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 5 - - - - OnParameterChanged - - - - 5 - 1 - 2 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_unitLabelDx - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 0 - wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Vertical spacing: - 0 - - 0 - - - 0 - - 1 - m_labelDy - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryDy - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 5 - - - - OnParameterChanged - - - - 5 - 1 - 2 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_unitLabelDy - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 0 - wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL - 4 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Horizontal offset: - 0 - - 0 - - - 0 - - 1 - m_labelOffsetX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 4 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 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 - 1 - 2 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT - 4 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_unitLabelOffsetX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 0 - wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL - 5 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Vertical offset: - 0 - - 0 - - - 0 - - 1 - m_labelOffsetY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 5 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 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 - 1 - 2 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT - 5 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_unitLabelOffsetY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 0 - wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL - 6 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Stagger: - 0 - - 0 - - - 0 - - 1 - m_labelStagger - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 6 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryStagger - 1 - - - protected - 1 - - Resizable - 1 - - - TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 1 - - - - OnParameterChanged - - - - 5 - 2 - 0 - wxALL|wxEXPAND - 7 - 2 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Rows" "Columns" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Stagger Type - 1 - - 0 - - - 0 - - 1 - m_radioBoxGridStaggerType - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 10 - wxALL|wxEXPAND - 0 - - 0 - protected - 0 - - - - 5 - wxALL|wxEXPAND - 0 + + + Load From File; + Grid Array + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_gridPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL - m_gridPadNumberingSizer - wxVERTICAL - protected - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Horizontal, then vertical" "Vertical, then horizontal" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Numbering Direction - 1 - - 0 - - - 0 - - 1 - m_radioBoxGridNumberingAxis - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Reverse numbering on alternate rows/columns - - 0 - - - 0 - - 1 - m_checkBoxGridReverseNumbering - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Use first free number" "From start value" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Initial Pad Number - 1 - - 0 - - - 0 - - 1 - m_rbGridStartNumberingOpt - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnParameterChanged - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Continuous (1, 2, 3...)" "Coordinate (A1, A2, ... B1, ...)" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Pad Numbering Scheme - 1 - - 0 - - - 0 - - 1 - m_radioBoxGridNumberingScheme - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnParameterChanged - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Primary axis numbering: - 0 - - 0 - - - 0 - - 1 - m_labelPriAxisNumbering - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choicePriAxisNumbering - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - - 1 - - 0 - 0 - wxID_ANY - Secondary axis numbering: - 0 - - 0 - - - 0 - - 1 - m_labelSecAxisNumbering - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 0 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceSecAxisNumbering - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - + bSizer2 + wxHORIZONTAL + none 5 - wxEXPAND + wxEXPAND|wxTOP|wxRIGHT 1 - - 3 + + wxBOTH - 0 + 0 - fgSizer1 + gbSizer1 wxFLEX_GROWMODE_SPECIFIED none - 2 0 - + 5 - wxALIGN_CENTER_VERTICAL|wxALL - 1 + 1 + 0 + wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL + 0 + 1 1 1 @@ -2025,7 +238,7 @@ 0 0 wxID_ANY - Pad numbering start: + Horizontal count: 0 0 @@ -2034,7 +247,7 @@ 0 1 - m_labelGridNumberingOffset + m_labelNx 1 @@ -2054,10 +267,13 @@ -1 - + 5 + 1 + 1 wxALL - 0 + 0 + 1 1 1 @@ -2092,9 +308,78 @@ 0 0 - 72,-1 + 1 - m_entryGridPriNumberingOffset + m_entryNx + 1 + + + protected + 1 + + Resizable + 1 + + + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 5 + + + + OnParameterChanged + + + + 5 + 1 + 0 + wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Vertical count: + 0 + + 0 + + + 0 + + 1 + m_labelNy 1 @@ -2108,20 +393,19 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - - 1 + -1 - + 5 + 1 + 1 wxALL - 0 + 1 + 1 1 1 @@ -2156,9 +440,9 @@ 0 0 - 72,-1 + 1 - m_entryGridSecNumberingOffset + m_entryNy 1 @@ -2169,24 +453,28 @@ 1 - + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h 0 wxFILTER_NONE wxDefaultValidator - 1 + 5 + OnParameterChanged - + 5 - wxALIGN_CENTER_VERTICAL|wxALL - 1 - + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 2 + 1 + 1 1 1 @@ -2214,7 +502,7 @@ 0 0 wxID_ANY - Pad numbering skip: + Horizontal spacing: 0 0 @@ -2223,7 +511,7 @@ 0 1 - m_labelGridNumberingStep + m_labelDx 1 @@ -2243,11 +531,14 @@ -1 - + 5 + 1 + 1 wxALL - 0 - + 2 + 1 + 1 1 1 @@ -2281,9 +572,78 @@ 0 0 - 72,-1 + 1 - m_entryGridPriNumberingStep + m_entryDx + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 5 + + + + OnParameterChanged + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_unitLabelDx 1 @@ -2297,6 +657,721 @@ 0 + + + + -1 + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Vertical spacing: + 0 + + 0 + + + 0 + + 1 + m_labelDy + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_entryDy + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 5 + + + + OnParameterChanged + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_unitLabelDy + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Horizontal offset: + 0 + + 0 + + + 0 + + 1 + m_labelOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 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 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_unitLabelOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Vertical offset: + 0 + + 0 + + + 0 + + 1 + m_labelOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 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 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_unitLabelOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 6 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Stagger: + 0 + + 0 + + + 0 + + 1 + m_labelStagger + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 6 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_entryStagger + 1 + + + protected + 1 + + Resizable + 1 + + + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h + 0 + wxFILTER_NONE wxDefaultValidator @@ -2305,13 +1380,1213 @@ + OnParameterChanged + + + + 5 + 2 + 0 + wxALL|wxEXPAND + 7 + 2 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Rows" "Columns" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Stagger Type + 1 + + 0 + + + 0 + + 1 + m_radioBoxGridStaggerType + 1 + + + protected + 1 + + Resizable + 1 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + - + + + + 10 + wxALL|wxEXPAND + 0 + + 0 + protected + 0 + + + + 5 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 1 + wxID_ANY + + 0 + + + 0 + + 1 + m_gridPadNumberingPanel + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + m_gridPadNumberingSizer + wxVERTICAL + protected + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Horizontal, then vertical" "Vertical, then horizontal" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Numbering Direction + 1 + + 0 + + + 0 + + 1 + m_radioBoxGridNumberingAxis + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Reverse numbering on alternate rows/columns + + 0 + + + 0 + + 1 + m_checkBoxGridReverseNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Use first free number" "From start value" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Initial Pad Number + 1 + + 0 + + + 0 + + 1 + m_rbGridStartNumberingOpt + 1 + + + protected + 1 + + Resizable + 1 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnParameterChanged + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Continuous (1, 2, 3...)" "Coordinate (A1, A2, ... B1, ...)" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pad Numbering Scheme + 1 + + 0 + + + 0 + + 1 + m_radioBoxGridNumberingScheme + 1 + + + protected + 1 + + Resizable + 1 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnParameterChanged + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Primary axis numbering: + 0 + + 0 + + + 0 + + 1 + m_labelPriAxisNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choicePriAxisNumbering + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + + 1 + + 0 + 0 + wxID_ANY + Secondary axis numbering: + 0 + + 0 + + + 0 + + 1 + m_labelSecAxisNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceSecAxisNumbering + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 1 + + 3 + wxBOTH + 0 + + 0 + + fgSizer1 + wxFLEX_GROWMODE_SPECIFIED + none + 2 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pad numbering start: + 0 + + 0 + + + 0 + + 1 + m_labelGridNumberingOffset + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + 72,-1 + 1 + m_entryGridPriNumberingOffset + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + 72,-1 + 1 + m_entryGridSecNumberingOffset + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pad numbering skip: + 0 + + 0 + + + 0 + + 1 + m_labelGridNumberingStep + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + 72,-1 + 1 + m_entryGridPriNumberingStep + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + 72,-1 + 1 + m_entryGridSecNumberingStep + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + Circular Array + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_circularPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + bSizer4 + wxHORIZONTAL + none + + 5 + wxALL|wxEXPAND + 1 + + + wxBOTH + + + 0 + + gbSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Horizontal center: + 0 + + 0 + + + 0 + + 1 + m_labelCentreX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 wxALL - 0 - + 0 + 1 + 1 1 1 @@ -2345,9 +2620,78 @@ 0 0 - 72,-1 + 1 - m_entryGridSecNumberingStep + m_entryCentreX + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + OnParameterChanged + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_unitLabelCentreX 1 @@ -2361,14 +2705,1393 @@ 0 + + + + -1 + + + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Vertical center: + 0 + + 0 + + + 0 + + 1 + m_labelCentreY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_entryCentreY + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + wxFILTER_NONE wxDefaultValidator - 1 + 0 + OnParameterChanged + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_unitLabelCentreY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Radius: + 0 + + 0 + + + 0 + + 1 + m_labelCircRadius + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 0 + + 0 + + + 0 + + 1 + m_valueCircRadius + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 2 + wxTOP|wxBOTTOM|wxRIGHT + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_unitLabelCircRadius + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Angle: + 0 + + 0 + + + 0 + + 1 + m_labelCircAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_entryCircAngle + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Positive angles represent an anti-clockwise rotation. An angle of 0 will produce a full circle divided evenly into "Count" portions. + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + OnParameterChanged + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + deg + 0 + + 0 + + + 0 + + 1 + m_unitLabelCircAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Count: + 0 + + 0 + + + 0 + + 1 + m_labelCircCount + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_entryCircCount + 1 + + + protected + 1 + + Resizable + 1 + + + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h + 0 + How many items in the array. + + wxFILTER_NONE + wxDefaultValidator + + 4 + + + + OnParameterChanged + + + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Rotate: + 0 + + 0 + + + 0 + + 1 + m_labelCircRotate + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_entryRotateItemsCb + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Rotate the item as well as move it - multi-selections will be rotated together + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 10 + wxALL|wxEXPAND + 0 + + 0 + protected + 0 + + + + 5 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 1 + wxID_ANY + + 0 + + + 0 + + 1 + m_circularPadNumberingPanel + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + wxID_ANY + Numbering Options + + m_circPadNumberingSizer + wxVERTICAL + 1 + protected + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Use first free number" "From start value" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Initial Pad Number: + 1 + + 0 + + + 0 + + 1 + m_rbCircStartNumberingOpt + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnParameterChanged + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pad Numbering: + 0 + + 0 + + + 0 + + 1 + m_labelCircNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceCircNumbering + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 1 + + 2 + wxBOTH + 0 + + 0 + + fgSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pad numbering start: + 0 + + 0 + + + 0 + + 1 + m_labelCircNumStart + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_entryCircNumberingStart + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pad numbering skip: + 0 + + 0 + + + 0 + + 1 + m_labelCircNumStep + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_entryCircNumberingStep + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + @@ -2378,10 +4101,10 @@ - - - Circular Array - 1 + + 5 + wxEXPAND | wxALL + 0 1 1 @@ -2417,7 +4140,7 @@ 0 1 - m_circularPanel + m_footprintReannotatePanel 1 @@ -2427,7 +4150,7 @@ Resizable 1 - + ; ; forward_declare 0 @@ -2435,1096 +4158,26 @@ wxTAB_TRAVERSAL - bSizer4 - wxHORIZONTAL + bSizer8 + wxVERTICAL none 5 - wxALL|wxEXPAND - 1 - - - wxBOTH - - - 0 - - gbSizer2 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - - 5 - 1 - 0 - wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Horizontal center: - 0 - - 0 - - - 0 - - 1 - m_labelCentreX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryCentreX - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - OnParameterChanged - - - - 5 - 1 - 2 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_unitLabelCentreX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 0 - wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Vertical center: - 0 - - 0 - - - 0 - - 1 - m_labelCentreY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryCentreY - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - OnParameterChanged - - - - 5 - 1 - 2 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_unitLabelCentreY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Radius: - 0 - - 0 - - - 0 - - 1 - m_labelCircRadius - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 0 - - 0 - - - 0 - - 1 - m_valueCircRadius - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 2 - wxTOP|wxBOTTOM|wxRIGHT - 2 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_unitLabelCircRadius - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - 5 - 1 - 0 - wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Angle: - 0 - - 0 - - - 0 - - 1 - m_labelCircAngle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryCircAngle - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Positive angles represent an anti-clockwise rotation. An angle of 0 will produce a full circle divided evenly into "Count" portions. - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - OnParameterChanged - - - - 5 - 1 - 2 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - deg - 0 - - 0 - - - 0 - - 1 - m_unitLabelCircAngle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 0 - wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT - 4 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Count: - 0 - - 0 - - - 0 - - 1 - m_labelCircCount - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 4 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryCircCount - 1 - - - protected - 1 - - Resizable - 1 - - - TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h - 0 - How many items in the array. - - wxFILTER_NONE - wxDefaultValidator - - 4 - - - - OnParameterChanged - - - - 5 - 1 - 0 - wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT - 5 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Rotate: - 0 - - 0 - - - 0 - - 1 - m_labelCircRotate - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxALL - 5 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_entryRotateItemsCb - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Rotate the item as well as move it - multi-selections will be rotated together - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 10 - wxALL|wxEXPAND - 0 - - 0 - protected - 0 - - - - 5 - wxEXPAND|wxALL + wxEXPAND 0 wxID_ANY - Numbering Options + Footprint Annotation - m_circPadNumberingSizer + sbSizerFootprintAnnotation wxVERTICAL 1 - protected - + none + 5 - wxALL|wxEXPAND + wxALL 0 - + 1 1 1 @@ -3538,7 +4191,6 @@ 1 0 - "Use first free number" "From start value" 1 1 @@ -3553,8 +4205,7 @@ 0 0 wxID_ANY - Initial Pad Number: - 1 + Keep existing reference designators 0 @@ -3562,7 +4213,7 @@ 0 1 - m_rbCircStartNumberingOpt + m_radioBtnKeepRefs 1 @@ -3570,28 +4221,27 @@ 1 Resizable - 0 1 - wxRA_SPECIFY_COLS - + + ; ; forward_declare 0 wxFILTER_NONE wxDefaultValidator + 0 - OnParameterChanged 5 wxALL 0 - + 1 1 1 @@ -3619,8 +4269,7 @@ 0 0 wxID_ANY - Pad Numbering: - 0 + Assign unique reference designators 0 @@ -3628,7 +4277,7 @@ 0 1 - m_labelCircNumbering + m_radioBtnUniqueRefs 1 @@ -3641,345 +4290,17 @@ ; ; forward_declare 0 - - - - - -1 - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceCircNumbering - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - + This can conflict with reference designators in the schematic that have not yet been synchronized with the board. wxFILTER_NONE wxDefaultValidator + 1 - - 5 - wxEXPAND - 1 - - 2 - wxBOTH - 0 - - 0 - - fgSizer2 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Pad numbering start: - 0 - - 0 - - - 0 - - 1 - m_labelCircNumStart - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryCircNumberingStart - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 1 - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Pad numbering skip: - 0 - - 0 - - - 0 - - 1 - m_labelCircNumStep - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_entryCircNumberingStep - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 1 - - - - - - - diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h index 208a73f95c..3ce473f866 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 3.9.0 Jun 18 2020) +// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -31,6 +31,7 @@ class TEXT_CTRL_EVAL; #include #include #include +#include #include #include @@ -67,6 +68,7 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM wxStaticText* m_labelStagger; TEXT_CTRL_EVAL* m_entryStagger; wxRadioBox* m_radioBoxGridStaggerType; + wxPanel* m_gridPadNumberingPanel; wxBoxSizer* m_gridPadNumberingSizer; wxRadioBox* m_radioBoxGridNumberingAxis; wxCheckBox* m_checkBoxGridReverseNumbering; @@ -99,6 +101,7 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM TEXT_CTRL_EVAL* m_entryCircCount; wxStaticText* m_labelCircRotate; wxCheckBox* m_entryRotateItemsCb; + wxPanel* m_circularPadNumberingPanel; wxStaticBoxSizer* m_circPadNumberingSizer; wxRadioBox* m_rbCircStartNumberingOpt; wxStaticText* m_labelCircNumbering; @@ -107,11 +110,14 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM wxTextCtrl* m_entryCircNumberingStart; wxStaticText* m_labelCircNumStep; wxTextCtrl* m_entryCircNumberingStep; + wxPanel* m_footprintReannotatePanel; + wxRadioButton* m_radioBtnKeepRefs; + wxRadioButton* m_radioBtnUniqueRefs; wxStdDialogButtonSizer* m_stdButtons; wxButton* m_stdButtonsOK; wxButton* m_stdButtonsCancel; - // Virtual event handlers, overide them in your derived class + // Virtual event handlers, override them in your derived class virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } virtual void OnParameterChanged( wxCommandEvent& event ) { event.Skip(); } @@ -119,6 +125,7 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM 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(); }; diff --git a/pcbnew/tools/board_reannotate_tool.cpp b/pcbnew/tools/board_reannotate_tool.cpp index f6d760c995..9441140c37 100644 --- a/pcbnew/tools/board_reannotate_tool.cpp +++ b/pcbnew/tools/board_reannotate_tool.cpp @@ -68,17 +68,32 @@ int BOARD_REANNOTATE_TOOL::ReannotateDuplicatesInSelection() if( selection.Empty() ) return 0; - // 1. Build list of designators on the board + return ReannotateDuplicates( selection, std::vector() ); +} + +int BOARD_REANNOTATE_TOOL::ReannotateDuplicates( const PCB_SELECTION& aSelectionToReannotate, + const std::vector& aAdditionalFootprints ) +{ + if( aSelectionToReannotate.Empty() ) + return 0; + + // 1. Build list of designators on the board & the additional footprints FOOTPRINTS fpOnBoard = m_frame->GetBoard()->Footprints(); std::multimap usedDesignatorsMap; + for( EDA_ITEM* item : aAdditionalFootprints ) + { + if( item->Type() == PCB_FOOTPRINT_T ) + fpOnBoard.push_back( static_cast( item ) ); + } + for( FOOTPRINT* fp : fpOnBoard ) usedDesignatorsMap.insert( { fp->GetReference(), fp->m_Uuid } ); // 2. Get a sorted list of footprints from the selection FOOTPRINTS fpInSelection; - for( EDA_ITEM* item : selection ) + for( EDA_ITEM* item : aSelectionToReannotate ) { if( item->Type() == PCB_FOOTPRINT_T ) fpInSelection.push_back( static_cast( item ) ); @@ -90,7 +105,20 @@ int BOARD_REANNOTATE_TOOL::ReannotateDuplicatesInSelection() int ii = StrNumCmp( aA->GetReference(), aB->GetReference(), true ); if( ii == 0 ) - ii = aA->m_Uuid < aB->m_Uuid; // ensure a deterministic sort + { + // Sort by position: x, then y + if( aA->GetPosition().y == aB->GetPosition().y ) + { + if( aA->GetPosition().x == aB->GetPosition().x ) + return aA->m_Uuid < aB->m_Uuid; // ensure a deterministic sort + else + return aA->GetPosition().x < aB->GetPosition().x; + } + else + { + return aA->GetPosition().y > aB->GetPosition().y; + } + } return ii < 0; } ); diff --git a/pcbnew/tools/board_reannotate_tool.h b/pcbnew/tools/board_reannotate_tool.h index 0c71fc1be0..2d7af1e3a8 100644 --- a/pcbnew/tools/board_reannotate_tool.h +++ b/pcbnew/tools/board_reannotate_tool.h @@ -40,8 +40,12 @@ public: bool Init() override; void Reset( RESET_REASON aReason ) override; int ShowReannotateDialog( const TOOL_EVENT& aEvent ); + int ReannotateDuplicatesInSelection(); + int ReannotateDuplicates( const PCB_SELECTION& aSelectionToReannotate, + const std::vector& aAdditionalFootprints ); + private: void setTransitions() override; //> Bind handlers to corresponding TOOL_ACTIONs diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 539f74f7f0..75636ad832 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -2276,7 +2276,7 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent ) // we have a selection to work on now, so start the tool process PCB_BASE_FRAME* editFrame = getEditFrame(); - ARRAY_CREATOR array_creator( *editFrame, m_isFootprintEditor, selection ); + ARRAY_CREATOR array_creator( *editFrame, m_isFootprintEditor, selection, m_toolMgr ); array_creator.Invoke(); return 0;