diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index ea627d5f82..f2c2939be8 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -151,6 +151,9 @@ set( BMAPS_MID annotate_down_right annotate_right_down annotate + array_line + array_pad + array_text auto_associe auto_delete_track auto_track_width diff --git a/bitmaps_png/cpp_26/array_line.cpp b/bitmaps_png/cpp_26/array_line.cpp new file mode 100644 index 0000000000..0b0911eba6 --- /dev/null +++ b/bitmaps_png/cpp_26/array_line.cpp @@ -0,0 +1,54 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0x51, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xa5, 0x96, 0x4f, 0x6c, 0x4c, + 0x51, 0x14, 0xc6, 0x7f, 0xa3, 0xff, 0xa4, 0xd5, 0x4a, 0x34, 0xb5, 0x20, 0x4d, 0xc5, 0x42, 0x5a, + 0x74, 0xa9, 0x34, 0x44, 0x42, 0x10, 0x82, 0x48, 0x2c, 0x84, 0x88, 0x58, 0x58, 0xd0, 0x8d, 0xda, + 0x48, 0x49, 0xa4, 0xe9, 0x06, 0x8b, 0x62, 0x31, 0xb4, 0xe3, 0xdd, 0x73, 0xdf, 0x8c, 0x69, 0xaa, + 0x99, 0x94, 0x11, 0xed, 0x58, 0xb1, 0x60, 0x67, 0x6d, 0x65, 0x6b, 0x63, 0x67, 0x61, 0x23, 0xb1, + 0x20, 0xd7, 0xe6, 0x78, 0xf3, 0x5a, 0x33, 0xef, 0x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, 0x40, 0x5e, 0xd3, 0xa2, 0x65, 0x2c, 0xfb, 0xb3, 0x37, 0x8a, + 0x1c, 0x96, 0x89, 0xa4, 0xa9, 0x88, 0x61, 0x6f, 0x04, 0x29, 0xe4, 0x5c, 0xb2, 0xbe, 0x96, 0x93, + 0x01, 0x57, 0xc9, 0xd5, 0xa4, 0xa9, 0x88, 0x03, 0xde, 0x64, 0x50, 0x8f, 0x1c, 0x4d, 0x41, 0x2e, + 0x05, 0x5c, 0x72, 0xe9, 0xa6, 0x4e, 0x87, 0x46, 0xd0, 0x88, 0xae, 0x64, 0x0d, 0xc3, 0x78, 0x00, + 0xe4, 0x48, 0x0a, 0x72, 0x39, 0x2c, 0x82, 0x22, 0x06, 0x53, 0x97, 0xd6, 0x24, 0x8b, 0xb4, 0x78, + 0x20, 0x7b, 0x10, 0x5e, 0x2b, 0xe8, 0x46, 0x68, 0x32, 0xf4, 0x23, 0x2c, 0x68, 0xd1, 0x03, 0xef, + 0x4d, 0x1a, 0x31, 0x88, 0xe5, 0xa5, 0xea, 0xa7, 0x7c, 0x4d, 0xd5, 0x41, 0x45, 0x76, 0x22, 0x54, + 0xd2, 0x06, 0xf3, 0x7c, 0xfc, 0x11, 0x84, 0x2a, 0x96, 0x87, 0x94, 0x58, 0x1f, 0x9c, 0x75, 0xce, + 0x39, 0x98, 0x65, 0x3b, 0x73, 0x75, 0x83, 0x05, 0x04, 0xeb, 0x10, 0xf3, 0xf4, 0x04, 0xeb, 0xd7, + 0xf2, 0x87, 0xf0, 0x7f, 0x9e, 0x3f, 0x6d, 0x57, 0x45, 0xa7, 0xea, 0xac, 0xbd, 0xc8, 0x00, 0x00, + 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_line_xpm[1] = {{ png, sizeof( png ), "array_line_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_pad.cpp b/bitmaps_png/cpp_26/array_pad.cpp new file mode 100644 index 0000000000..9afe012a82 --- /dev/null +++ b/bitmaps_png/cpp_26/array_pad.cpp @@ -0,0 +1,77 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x03, 0xbd, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x96, 0xdd, 0x4b, 0x54, + 0x41, 0x18, 0xc6, 0x67, 0x3f, 0xdc, 0x2b, 0x53, 0x28, 0x93, 0xa0, 0x08, 0xef, 0x14, 0x8a, 0x4c, + 0x44, 0x2c, 0x8c, 0x2d, 0xcb, 0x4a, 0xc1, 0x7f, 0xa0, 0x8b, 0xfe, 0x82, 0xa0, 0x8b, 0x8c, 0x22, + 0xf2, 0x63, 0x3d, 0x47, 0x57, 0x4b, 0xca, 0x42, 0xd4, 0xf5, 0xb3, 0x14, 0xf3, 0x83, 0x5c, 0x95, + 0x45, 0x02, 0x15, 0x0c, 0xfb, 0x07, 0x8a, 0x84, 0x10, 0x25, 0x23, 0x24, 0x24, 0xa2, 0x8b, 0x6e, + 0x82, 0xbc, 0xc8, 0xde, 0xdf, 0x38, 0x47, 0x8f, 0xeb, 0x6e, 0x7a, 0x61, 0x5d, 0x3c, 0x9c, 0x61, + 0xce, 0xcc, 0x3c, 0xf3, 0x3e, 0xef, 0x33, 0xef, 0x8c, 0x5a, 0x5f, 0x5f, 0x57, 0xff, 0x03, 0x89, + 0x3b, 0x43, 0xea, 0xa0, 0xa0, 0x54, 0x50, 0xae, 0xc2, 0xea, 0xf0, 0xae, 0x8b, 0x34, 0xaa, 0x74, + 0x65, 0x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0xc5, 0xc3, + 0x41, 0xbd, 0x73, 0xc8, 0x88, 0x0c, 0x19, 0xc9, 0x19, 0x7d, 0xb8, 0x11, 0xeb, 0xef, 0x74, 0x9d, + 0x24, 0xd8, 0x58, 0xf8, 0xa3, 0x49, 0x7c, 0xcc, 0x60, 0x52, 0x93, 0xd4, 0xaa, 0x9f, 0xd2, 0xce, + 0x71, 0x6d, 0xec, 0x98, 0xa7, 0xd6, 0x33, 0x0a, 0x19, 0x91, 0x39, 0xf6, 0xc6, 0x20, 0xb8, 0x11, + 0xeb, 0x73, 0xce, 0x92, 0x1d, 0xd8, 0x2c, 0x2c, 0x6c, 0xa4, 0x5b, 0x35, 0x58, 0xd3, 0x91, 0xb8, + 0x48, 0xdc, 0x64, 0x44, 0x86, 0x74, 0xe4, 0x0c, 0x83, 0x20, 0x1d, 0xd6, 0xe7, 0x9c, 0xed, 0x5e, + 0x82, 0xb0, 0x30, 0xee, 0x22, 0xf1, 0xe4, 0x44, 0xa4, 0x4a, 0x5e, 0xc3, 0x44, 0x4a, 0xc9, 0x19, + 0x06, 0xc1, 0x8d, 0x89, 0x2a, 0x48, 0x72, 0x22, 0x64, 0x64, 0x12, 0x93, 0x59, 0x64, 0xbf, 0x89, + 0x08, 0x97, 0xb0, 0x3d, 0x22, 0x05, 0x32, 0x20, 0x07, 0xb2, 0x20, 0x0f, 0x32, 0xed, 0x45, 0x3a, + 0xe6, 0xfe, 0x55, 0x3a, 0x12, 0x27, 0xfa, 0x8e, 0x14, 0xf4, 0xe5, 0x75, 0xf5, 0xac, 0xb4, 0x86, + 0x9c, 0xe4, 0xf6, 0xaf, 0x76, 0x56, 0x07, 0x87, 0xce, 0x76, 0xc8, 0x02, 0x51, 0x37, 0x99, 0x36, + 0x83, 0xe5, 0x19, 0x0d, 0x0e, 0x17, 0x45, 0x18, 0xe3, 0x8c, 0x67, 0x2e, 0x6b, 0xb0, 0x56, 0x42, + 0x33, 0x60, 0xc5, 0xdc, 0xde, 0x93, 0x3d, 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 0xe9, 0xc3, + 0x49, 0xd8, 0x36, 0xd1, 0xc5, 0xd7, 0xb4, 0x50, 0x5f, 0x77, 0x7e, 0xe8, 0x5c, 0xc7, 0xe5, 0x97, + 0xc5, 0x11, 0xe6, 0x26, 0xbd, 0xf8, 0x8c, 0x5d, 0xd3, 0xb8, 0x7e, 0x19, 0xe0, 0x0c, 0x06, 0x24, + 0x15, 0x07, 0x69, 0xbb, 0xba, 0xce, 0x86, 0x73, 0x95, 0xe7, 0x49, 0x8e, 0xba, 0x56, 0x5a, 0x42, + 0x7b, 0xbe, 0xca, 0x1d, 0x32, 0xfd, 0xb0, 0xe0, 0xb1, 0x21, 0xfa, 0xea, 0x64, 0x4a, 0x5b, 0x3f, + 0x40, 0x5c, 0x67, 0x22, 0xfe, 0x71, 0x22, 0xc5, 0x35, 0x96, 0xde, 0x98, 0xf6, 0x62, 0x4f, 0x8f, + 0x93, 0x6d, 0x9d, 0xe4, 0x8c, 0xa7, 0x13, 0x4f, 0x28, 0x63, 0xcf, 0x7d, 0x7d, 0x6e, 0xfd, 0x4b, + 0xfc, 0x01, 0x33, 0x8a, 0x28, 0x8c, 0xb5, 0xeb, 0xec, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, + 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_pad_xpm[1] = {{ png, sizeof( png ), "array_pad_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_text.cpp b/bitmaps_png/cpp_26/array_text.cpp new file mode 100644 index 0000000000..37aa012460 --- /dev/null +++ b/bitmaps_png/cpp_26/array_text.cpp @@ -0,0 +1,39 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x01, 0x59, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0x96, 0xb1, 0x6a, 0x02, + 0x41, 0x10, 0x86, 0x07, 0x7c, 0x06, 0xad, 0x0c, 0xd8, 0x48, 0xb0, 0x31, 0x36, 0xd6, 0x22, 0x58, + 0x5a, 0xa4, 0xb8, 0x4a, 0xc8, 0x1b, 0x58, 0xa5, 0xca, 0x95, 0xa9, 0x7c, 0x82, 0x20, 0xec, 0xed, + 0xa9, 0x98, 0xce, 0xca, 0x60, 0x93, 0xd6, 0x77, 0xb1, 0xf0, 0x1d, 0x0c, 0x5c, 0x66, 0x6f, 0xe6, + 0xbc, 0xec, 0xe6, 0x76, 0xdd, 0x1c, 0x41, 0x10, 0xee, 0xe0, 0x67, 0x6f, 0x66, 0xff, 0xe1, 0x63, + 0xef, 0x98, 0x61, 0x21, 0x49, 0x12, 0xb8, 0x86, 0xf0, 0x91, 0x53, 0x80, 0xe8, 0xe8, 0x2f, 0xe5, + 0x17, 0x63, 0x7c, 0x7f, 0xf7, 0x97, 0xf2, 0x43, 0xf4, 0x82, 0x42, 0x64, 0x74, 0x40, 0x7d, 0xa2, + 0xf6, 0x1c, 0x67, 0xda, 0x73, 0xfe, 0xc0, 0xb1, 0xf2, 0x07, 0xa8, 0x1d, 0x6a, 0x85, 0xe0, 0x57, + 0x5c, 0x67, 0x1c, 0x67, 0x9a, 0x71, 0x7e, 0xc5, 0x71, 0x90, 0x81, 0xbe, 0x90, 0xda, 0xa7, 0x23, + 0xce, 0x5b, 0x3a, 0x68, 0xde, 0xa2, 0xbc, 0xe8, 0x93, 0x2f, 0x03, 0xc9, 0x0f, 0x80, 0x65, 0x9b, + 0xf6, 0xd6, 0x0d, 0x1d, 0xb4, 0x6e, 0x50, 0x7e, 0xd9, 0x26, 0x1f, 0x81, 0x3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0xec, 0xf1, 0xfb, 0x82, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_text_xpm[1] = {{ png, sizeof( png ), "array_text_xpm" }}; + +//EOF diff --git a/bitmaps_png/sources/array_line.svg b/bitmaps_png/sources/array_line.svg new file mode 100644 index 0000000000..ba726bf427 --- /dev/null +++ b/bitmaps_png/sources/array_line.svg @@ -0,0 +1,44 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/bitmaps_png/sources/array_pad.svg b/bitmaps_png/sources/array_pad.svg new file mode 100644 index 0000000000..8d275518ad --- /dev/null +++ b/bitmaps_png/sources/array_pad.svg @@ -0,0 +1,44 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/bitmaps_png/sources/array_text.svg b/bitmaps_png/sources/array_text.svg new file mode 100644 index 0000000000..1ef82e6056 --- /dev/null +++ b/bitmaps_png/sources/array_text.svg @@ -0,0 +1,44 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/include/bitmaps.h b/include/bitmaps.h index a5364bc684..0bdff3217f 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -102,6 +102,9 @@ EXTERN_BITMAP( anchor_xpm ) EXTERN_BITMAP( annotate_down_right_xpm ) EXTERN_BITMAP( annotate_right_down_xpm ) EXTERN_BITMAP( annotate_xpm ) +EXTERN_BITMAP( array_line_xpm ) +EXTERN_BITMAP( array_pad_xpm ) +EXTERN_BITMAP( array_text_xpm ) EXTERN_BITMAP( auto_associe_xpm ) EXTERN_BITMAP( auto_delete_track_xpm ) EXTERN_BITMAP( auto_track_width_xpm ) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 615d99afa7..8c021667cc 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -46,6 +46,8 @@ set( PCBNEW_DIALOGS dialogs/dialog_cleaning_options.cpp dialogs/dialog_copper_zones.cpp dialogs/dialog_copper_zones_base.cpp + dialogs/dialog_create_array.cpp + dialogs/dialog_create_array_base.cpp dialogs/dialog_design_rules.cpp dialogs/dialog_design_rules_base.cpp dialogs/dialog_dimension_editor_base.cpp diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp new file mode 100644 index 0000000000..32d94957df --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -0,0 +1,482 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2014 John Beard, john.j.beard@gmail.com + * Copyright (C) 1992-2014 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include +#include +#include + +#include "dialog_create_array.h" + + +// initialise statics +DIALOG_CREATE_ARRAY::CREATE_ARRAY_DIALOG_ENTRIES DIALOG_CREATE_ARRAY::m_options; + +// character set +// NOTE: do not change the order of this relative to the ARRAY_NUMBERING_TYPE_T enum +static const wxString charSetDescriptions[] = +{ + "Numerals (0,1,2,...,9,10)", + "Hexadecimal (0,1,...,F,10,...)", + "Alphabet, minus IOSQXZ", + "Alphabet, full 26 characters" +}; + + +DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, ARRAY_OPTIONS** settings ) : + DIALOG_CREATE_ARRAY_BASE( aParent ), + CONFIG_SAVE_RESTORE_WINDOW( m_options.m_optionsSet ), + m_settings( settings ) +{ + m_choicePriAxisNumbering->Set( boost::size( charSetDescriptions ), charSetDescriptions ); + m_choiceSecAxisNumbering->Set( boost::size( charSetDescriptions ), charSetDescriptions ); + + m_choicePriAxisNumbering->SetSelection( 0 ); + m_choiceSecAxisNumbering->SetSelection( 0 ); + m_choiceCircNumberingType->SetSelection( 0 ); + + Add( m_entryNx, m_options.m_gridNx ); + Add( m_entryNy, m_options.m_gridNy ); + Add( m_entryDx, m_options.m_gridDx ); + Add( m_entryDy, m_options.m_gridDy ); + + Add( m_entryOffsetX, m_options.m_gridOffsetX ); + Add( m_entryOffsetY, m_options.m_gridOffsetY ); + Add( m_entryStagger, m_options.m_gridStagger ); + + Add( m_radioBoxGridStaggerType, m_options.m_gridStaggerType ); + + Add( m_radioBoxGridNumberingAxis, m_options.m_gridNumberingAxis ); + Add( m_checkBoxGridReverseNumbering, m_options.m_gridNumberingReverseAlternate ); + + Add( m_entryCentreX, m_options.m_circCentreX ); + Add( m_entryCentreY, m_options.m_circCentreY ); + Add( m_entryCircAngle, m_options.m_circAngle ); + Add( m_entryCircCount, m_options.m_circCount ); + Add( m_entryRotateItemsCb, m_options.m_circRotate ); + + Add( m_gridTypeNotebook, m_options.m_arrayTypeTab ); + + Add( m_radioBoxGridNumberingScheme, m_options.m_grid2dArrayNumbering ); + Add( m_choicePriAxisNumbering, m_options.m_gridPriAxisNumScheme ); + Add( m_choiceSecAxisNumbering, m_options.m_gridSecAxisNumScheme ); + + Add( m_entryGridPriNumberingOffset, m_options.m_gridPriNumberingOffset ); + Add( m_entryGridSecNumberingOffset, m_options.m_gridSecNumberingOffset ); + + + RestoreConfigToControls(); + + // load units into labels + { + const wxString lengthUnit = GetAbbreviatedUnitsLabel( g_UserUnit ); + + m_unitLabelCentreX->SetLabelText( lengthUnit ); + m_unitLabelCentreY->SetLabelText( lengthUnit ); + m_unitLabelDx->SetLabelText( lengthUnit ); + m_unitLabelDy->SetLabelText( lengthUnit ); + m_unitLabelOffsetX->SetLabelText( lengthUnit ); + m_unitLabelOffsetY->SetLabelText( lengthUnit ); + } + + setControlEnablement(); +} + + +void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event ) +{ + const wxObject* evObj = event.GetEventObject(); + + // some controls result in a change of enablement + if( evObj == m_radioBoxGridNumberingScheme + || evObj == m_checkBoxGridRestartNumbering ) + { + setControlEnablement(); + } +} + + +void DIALOG_CREATE_ARRAY::OnCancelClick( wxCommandEvent& event ) +{ + EndModal( CREATE_ARRAY_ABORT ); +} + + +static const std::string& alphabetFromNumberingScheme( + DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type ) +{ + static const std::string alphaNumeric = "0123456789"; + static const std::string alphaHex = "0123456789ABCDEF"; + static const std::string alphaFull = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + static const std::string alphaNoIOSQXZ = "ABCDEFGHJKLNMPRTUVWY"; + static const std::string alphaEmpty = ""; + + switch( type ) + { + case DIALOG_CREATE_ARRAY::NUMBERING_NUMERIC: + return alphaNumeric; + + case DIALOG_CREATE_ARRAY::NUMBERING_HEX: + return alphaHex; + + case DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_NO_IOSQXZ: + return alphaNoIOSQXZ; + + case DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_FULL: + return alphaFull; + + default: + wxASSERT_MSG( false, wxString( "Un-handled numbering scheme: " ) << type ); + } + + return alphaEmpty; +} + + +/** + * @return False for schemes like 0,1...9,10 + * True for schemes like A,B..Z,AA (where the tens column starts with char 0) + */ +static bool schemeNonUnitColsStartAt0( DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type ) +{ + return type == DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_FULL + || type == DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_NO_IOSQXZ; +} + + +static bool getNumberingOffset( const std::string& str, + DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type, + int& offsetToFill ) +{ + const std::string alphabet = alphabetFromNumberingScheme( type ); + + wxASSERT_MSG( !alphabet.empty(), wxString( + "Unable to determine alphabet for numbering scheme: " ) << type ); + + int offset = 0; + const int radix = alphabet.length(); + + for( unsigned i = 0; i < str.length(); i++ ) + { + int chIndex = alphabet.find( str[i], 0 ); + + if( chIndex == wxNOT_FOUND ) + return false; + + const bool start0 = schemeNonUnitColsStartAt0( type ); + + // eg "AA" is actually index 27, not 26 + if( start0 && i < str.length() - 1 ) + chIndex++; + + offset *= radix; + offset += chIndex; + } + + offsetToFill = offset; + return true; +} + + +void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event ) +{ + ARRAY_OPTIONS* newSettings = NULL; + + const wxWindow* page = m_gridTypeNotebook->GetCurrentPage(); + + if( page == m_gridPanel ) + { + ARRAY_GRID_OPTIONS* newGrid = new ARRAY_GRID_OPTIONS(); + bool ok = true; + double x, y; + + // ints + ok = ok && m_entryNx->GetValue().ToLong( &newGrid->m_nx ); + ok = ok && m_entryNy->GetValue().ToLong( &newGrid->m_ny ); + + ok = ok && m_entryDx->GetValue().ToDouble( &x ); + ok = ok && m_entryDy->GetValue().ToDouble( &y ); + + newGrid->m_delta.x = From_User_Unit( g_UserUnit, x ); + newGrid->m_delta.y = From_User_Unit( g_UserUnit, y ); + + ok = ok && m_entryOffsetX->GetValue().ToDouble( &x ); + ok = ok && m_entryOffsetY->GetValue().ToDouble( &y ); + + newGrid->m_offset.x = From_User_Unit( g_UserUnit, x ); + newGrid->m_offset.y = From_User_Unit( g_UserUnit, y ); + + ok = ok && m_entryStagger->GetValue().ToLong( &newGrid->m_stagger ); + + newGrid->m_stagger_rows = m_radioBoxGridStaggerType->GetSelection() == 0; + + newGrid->m_horizontalThenVertical = m_radioBoxGridNumberingAxis->GetSelection() == 0; + newGrid->m_reverseNumberingAlternate = m_checkBoxGridReverseNumbering->GetValue(); + + newGrid->m_2dArrayNumbering = m_radioBoxGridNumberingScheme->GetSelection() != 0; + + // this is only correct if you set the choice up according to the enum size and order + ok = ok && m_choicePriAxisNumbering->GetSelection() < NUMBERING_TYPE_Max + && m_choiceSecAxisNumbering->GetSelection() < NUMBERING_TYPE_Max; + + // mind undefined casts to enums (should not be able to happen) + if( ok ) + { + newGrid->m_priAxisNumType = + (ARRAY_NUMBERING_TYPE_T) m_choicePriAxisNumbering->GetSelection(); + newGrid->m_secAxisNumType = + (ARRAY_NUMBERING_TYPE_T) m_choiceSecAxisNumbering->GetSelection(); + } + + // Work out the offsets for the numbering + ok = ok && getNumberingOffset( + m_entryGridPriNumberingOffset->GetValue().ToStdString(), + newGrid->m_priAxisNumType, newGrid->m_numberingOffsetX ); + + if( newGrid->m_2dArrayNumbering ) + ok = ok && getNumberingOffset( + m_entryGridSecNumberingOffset->GetValue().ToStdString(), + newGrid->m_secAxisNumType, newGrid->m_numberingOffsetY ); + + newGrid->m_shouldRenumber = m_checkBoxGridRestartNumbering->GetValue(); + + // Only use settings if all values are good + if( ok ) + newSettings = newGrid; + } + else if( page == m_circularPanel ) + { + ARRAY_CIRCULAR_OPTIONS* newCirc = new ARRAY_CIRCULAR_OPTIONS(); + bool ok = true; + + double x, y; + ok = ok && m_entryCentreX->GetValue().ToDouble( &x ); + ok = ok &&m_entryCentreY->GetValue().ToDouble( &y ); + + newCirc->m_centre.x = From_User_Unit( g_UserUnit, x ); + newCirc->m_centre.y = From_User_Unit( g_UserUnit, y ); + + ok = ok && m_entryCircAngle->GetValue().ToDouble( &newCirc->m_angle ); + ok = ok && m_entryCircCount->GetValue().ToLong( &newCirc->m_nPts ); + + newCirc->m_rotateItems = m_entryRotateItemsCb->GetValue(); + + newCirc->m_shouldRenumber = m_checkBoxCircRestartNumbering->GetValue(); + + // this is only correct if you set the choice up according to the enum size and order + ok = ok && m_choiceCircNumberingType->GetSelection() < NUMBERING_TYPE_Max; + + // mind undefined casts to enums (should not be able to happen) + if( ok ) + newCirc->m_numberingType = + (ARRAY_NUMBERING_TYPE_T) m_choiceCircNumberingType->GetSelection(); + + // Only use settings if all values are good + if( ok ) + newSettings = newCirc; + } + + // If we got good settings, send them out and finish + if( newSettings ) + { + delete *m_settings; + + // assign pointer and ownership here + *m_settings = newSettings; + + ReadConfigFromControls(); + + EndModal( CREATE_ARRAY_OK ); + } +} + + +void DIALOG_CREATE_ARRAY::setControlEnablement() +{ + const bool renumber = m_checkBoxGridRestartNumbering->GetValue(); + + // 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 ); + + // 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 ); + + // We can only set an offset if we renumber + m_labelGridNumberingOffset->Enable( renumber ); + m_entryGridPriNumberingOffset->Enable( renumber ); + m_entryGridSecNumberingOffset->Enable( renumber && num2d ); + + + // Circular array options + const bool circRenumber = m_checkBoxCircRestartNumbering->GetValue(); + m_choiceCircNumberingType->Enable( circRenumber ); +} + + +// ARRAY OPTION implementation functions -------------------------------------- + +std::string DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::getCoordinateNumber( int n, + ARRAY_NUMBERING_TYPE_T type ) +{ + std::string itemNum; + const std::string& alphabet = alphabetFromNumberingScheme( type ); + + if( !alphabet.empty() ) + { + const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( type ); + + bool firstRound = true; + int radix = alphabet.length(); + + do { + int modN = n % radix; + + if( nonUnitColsStartAt0 && !firstRound ) + modN--; // Start the "tens/hundreds/etc column" at "Ax", not "Bx" + + itemNum.insert( 0, 1, alphabet[modN] ); + + n /= radix; + firstRound = false; + } while( n ); + } + + return itemNum; +} + + +int DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::GetArraySize() const +{ + return m_nx * m_ny; +} + + +wxPoint DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::getGridCoords( int n ) const +{ + const int axisSize = m_horizontalThenVertical ? m_nx : m_ny; + + int x = n % axisSize; + int y = n / axisSize; + + // reverse on this row/col? + if( m_reverseNumberingAlternate && ( y % 2 ) ) + x = axisSize - x - 1; + + wxPoint coords( x, y ); + + return coords; +} + + +void DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::TransformItem( int n, BOARD_ITEM* item, + const wxPoint& rotPoint ) const +{ + wxPoint point; + + wxPoint coords = getGridCoords( n ); + + // swap axes if needed + if( !m_horizontalThenVertical ) + std::swap( coords.x, coords.y ); + + point.x = coords.x * m_delta.x + coords.y * m_offset.x; + point.y = coords.y * m_delta.y + coords.x * m_offset.y; + + if( abs( m_stagger ) > 1 ) + { + const int stagger = abs( m_stagger ); + const bool sr = m_stagger_rows; + const int stagger_idx = ( ( sr ? coords.y : coords.x ) % stagger ); + + wxPoint stagger_delta( ( sr ? m_delta.x : m_offset.x ), + ( sr ? m_offset.y : m_delta.y ) ); + + // Stagger to the left/up if the sign of the stagger is negative + point += stagger_delta * copysign( stagger_idx, m_stagger ) / stagger; + } + + // this is already relative to the first array entry + item->Move( point ); +} + + +std::string DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::GetItemNumber( int n ) const +{ + std::string itemNum; + + if( m_2dArrayNumbering ) + { + wxPoint coords = getGridCoords( n ); + + itemNum += getCoordinateNumber( coords.x + m_numberingOffsetX, m_priAxisNumType ); + itemNum += getCoordinateNumber( coords.y + m_numberingOffsetY, m_secAxisNumType ); + } + else + { + itemNum += getCoordinateNumber( n + m_numberingOffsetX, m_priAxisNumType ); + } + + return itemNum; +} + + +int DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::GetArraySize() const +{ + return m_nPts; +} + + +void DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::TransformItem( int n, BOARD_ITEM* item, + const wxPoint& rotPoint ) const +{ + double angle; + + if( m_angle == 0 ) + // angle is zero, divide evenly into m_nPts + angle = 3600.0 * n / float(m_nPts); + else + // n'th step + angle = m_angle * n * 10.0; + + item->Rotate( m_centre, angle ); + + // take off the rotation (but not the translation) if needed + if( !m_rotateItems ) + item->Rotate( item->GetCenter(), -angle ); +} + + +std::string DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::GetItemNumber( int n ) const +{ + return getCoordinateNumber( n, m_numberingType ); +} diff --git a/pcbnew/dialogs/dialog_create_array.h b/pcbnew/dialogs/dialog_create_array.h new file mode 100644 index 0000000000..0b698d3e47 --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array.h @@ -0,0 +1,346 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2014 John Beard, john.j.beard@gmail.com + * Copyright (C) 1992-2014 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __DIALOG_CREATE_ARRAY__ +#define __DIALOG_CREATE_ARRAY__ + +// Include the wxFormBuider header base: +#include + +#include + +class CONFIG_SAVE_RESTORE_WINDOW +{ +private: + + enum CONFIG_CTRL_TYPE_T + { + CFG_CTRL_TEXT, + CFG_CTRL_CHECKBOX, + CFG_CTRL_RADIOBOX, + CFG_CTRL_CHOICE, + CFG_CTRL_TAB + }; + + struct CONFIG_CTRL_T + { + wxControl* control; + CONFIG_CTRL_TYPE_T type; + void* dest; + }; + + std::vector ctrls; + bool& valid; + +protected: + CONFIG_SAVE_RESTORE_WINDOW( bool& validFlag ) : + valid( validFlag ) + {} + + void Add( wxRadioBox* ctrl, int& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_RADIOBOX, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void Add( wxCheckBox* ctrl, bool& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_CHECKBOX, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void Add( wxTextCtrl* ctrl, std::string& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_TEXT, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void Add( wxChoice* ctrl, int& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_CHOICE, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void Add( wxNotebook* ctrl, int& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_TAB, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void ReadConfigFromControls() + { + for( std::vector::const_iterator iter = ctrls.begin(), iend = ctrls.end(); + iter != iend; ++iter ) + { + switch( iter->type ) + { + case CFG_CTRL_CHECKBOX: + *(bool*) iter->dest = static_cast( iter->control )->GetValue(); + break; + + case CFG_CTRL_TEXT: + *(std::string*) iter->dest = static_cast( iter->control )->GetValue(); + break; + + case CFG_CTRL_CHOICE: + *(int*) iter->dest = static_cast( iter->control )->GetSelection(); + break; + + case CFG_CTRL_RADIOBOX: + *(int*) iter->dest = static_cast( iter->control )->GetSelection(); + break; + + case CFG_CTRL_TAB: + *(int*) iter->dest = static_cast( iter->control )->GetSelection(); + break; + + default: + wxASSERT_MSG( false, wxString( + "Unhandled control type for config store: " ) << iter->type ); + } + } + + valid = true; + } + + void RestoreConfigToControls() + { + if( !valid ) + return; + + for( std::vector::const_iterator iter = ctrls.begin(), iend = ctrls.end(); + iter != iend; ++iter ) + { + switch( iter->type ) + { + case CFG_CTRL_CHECKBOX: + static_cast( iter->control )->SetValue( *(bool*) iter->dest ); + break; + + case CFG_CTRL_TEXT: + static_cast( iter->control )->SetValue( *(std::string*) iter->dest ); + break; + + case CFG_CTRL_CHOICE: + static_cast( iter->control )->SetSelection( *(int*) iter->dest ); + break; + + case CFG_CTRL_RADIOBOX: + static_cast( iter->control )->SetSelection( *(int*) iter->dest ); + break; + + case CFG_CTRL_TAB: + static_cast( iter->control )->SetSelection( *(int*) iter->dest ); + break; + + default: + wxASSERT_MSG( false, wxString( + "Unhandled control type for config restore: " ) << iter->type ); + } + } + } +}; + +class DIALOG_CREATE_ARRAY : public DIALOG_CREATE_ARRAY_BASE, + public CONFIG_SAVE_RESTORE_WINDOW +{ +public: + + enum CREATE_ARRAY_EDIT_T + { + CREATE_ARRAY_ABORT, ///< if not changed or error + CREATE_ARRAY_OK, ///< if successfully changed + }; + + enum ARRAY_TYPE_T + { + ARRAY_GRID, ///< A grid (x*y) array + ARRAY_CIRCULAR, ///< A circular array + }; + + // NOTE: do not change order relative to charSetDescriptions + enum ARRAY_NUMBERING_TYPE_T + { + NUMBERING_NUMERIC = 0, ///< Arabic numerals: 0,1,2,3,4,5,6,7,8,9,10,11... + NUMBERING_HEX, + NUMBERING_ALPHA_NO_IOSQXZ, /*!< Alphabet, excluding IOSQXZ + * + * Per ASME Y14.35M-1997 sec. 5.2 (previously MIL-STD-100 sec. 406.5) + * as these can be confused with numerals and are often not used + * for pin numbering on BGAs, etc + */ + NUMBERING_ALPHA_FULL, ///< Full 26-character alphabet + NUMBERING_TYPE_Max ///< Invalid maximum value, insert above here + }; + + /** + * Persistent dialog options + */ + struct ARRAY_OPTIONS + { + ARRAY_OPTIONS( ARRAY_TYPE_T aType ) : + m_type( aType ), + m_shouldRenumber( false ) + {} + + virtual ~ARRAY_OPTIONS() {}; + + ARRAY_TYPE_T m_type; + bool m_shouldRenumber; + + /*! + * Function GetArrayPositions + * Returns the set of points that represent the array + * in order, if that is important + * + * TODO: Can/should this be done with some sort of iterator? + */ + virtual void TransformItem( int n, BOARD_ITEM* item, + const wxPoint& rotPoint ) const = 0; + virtual int GetArraySize() const = 0; + virtual std::string GetItemNumber( int n ) const = 0; + + bool ShouldRenumberItems() const + { + return m_shouldRenumber; + } + +protected: + static std::string getCoordinateNumber( int n, ARRAY_NUMBERING_TYPE_T type ); + }; + + struct ARRAY_GRID_OPTIONS : public ARRAY_OPTIONS + { + ARRAY_GRID_OPTIONS() : + ARRAY_OPTIONS( ARRAY_GRID ), + m_nx( 0 ), m_ny( 0 ), + m_horizontalThenVertical( true ), + m_reverseNumberingAlternate( false ), + m_stagger( 0 ), + m_stagger_rows( true ), + m_2dArrayNumbering( false ), + m_numberingOffsetX( 0 ), + m_numberingOffsetY( 0 ), + m_priAxisNumType( NUMBERING_NUMERIC ), + m_secAxisNumType( NUMBERING_NUMERIC ) + {} + + long m_nx, m_ny; + bool m_horizontalThenVertical, m_reverseNumberingAlternate; + wxPoint m_delta; + wxPoint m_offset; + long m_stagger; + bool m_stagger_rows; + bool m_2dArrayNumbering; + int m_numberingOffsetX, m_numberingOffsetY; + ARRAY_NUMBERING_TYPE_T m_priAxisNumType, m_secAxisNumType; + + void TransformItem( int n, BOARD_ITEM* item, const wxPoint& rotPoint ) const; // override virtual + int GetArraySize() const; // override virtual + std::string GetItemNumber( int n ) const; // override virtual + +private: + wxPoint getGridCoords( int n ) const; + }; + + struct ARRAY_CIRCULAR_OPTIONS : public ARRAY_OPTIONS + { + ARRAY_CIRCULAR_OPTIONS() : + ARRAY_OPTIONS( ARRAY_CIRCULAR ), + m_nPts( 0 ), + m_angle( 0.0f ), + m_rotateItems( false ), + m_numberingType( NUMBERING_NUMERIC ) + {} + + long m_nPts; + double m_angle; + wxPoint m_centre; + bool m_rotateItems; + ARRAY_NUMBERING_TYPE_T m_numberingType; + + void TransformItem( int n, BOARD_ITEM* item, const wxPoint& rotPoint ) const; // override virtual + int GetArraySize() const; // override virtual + std::string GetItemNumber( int n ) const; // override virtual + }; + + // Constructor and destructor + DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, ARRAY_OPTIONS** settings ); + virtual ~DIALOG_CREATE_ARRAY() {}; + +private: + + // the settings object returned to the caller + // we update the caller's object and never have ownership + ARRAY_OPTIONS** m_settings; + + void OnParameterChanged( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); + void OnOkClick( wxCommandEvent& event ); + + void setControlEnablement(); + + struct CREATE_ARRAY_DIALOG_ENTRIES + { + CREATE_ARRAY_DIALOG_ENTRIES() : + m_optionsSet( false ), + m_gridStaggerType( 0 ), + m_gridNumberingAxis( 0 ), + m_gridNumberingReverseAlternate( false ), + m_grid2dArrayNumbering( 0 ), + m_gridPriAxisNumScheme( 0 ), + m_gridSecAxisNumScheme( 0 ), + m_circRotate( false ), + m_arrayTypeTab( 0 ) + {} + + bool m_optionsSet; + + std::string m_gridNx, m_gridNy, + m_gridDx, m_gridDy, + m_gridOffsetX, m_gridOffsetY, + m_gridStagger; + + int m_gridStaggerType, m_gridNumberingAxis; + bool m_gridNumberingReverseAlternate; + int m_grid2dArrayNumbering; + int m_gridPriAxisNumScheme, m_gridSecAxisNumScheme; + std::string m_gridPriNumberingOffset, m_gridSecNumberingOffset; + + std::string m_circCentreX, m_circCentreY, + m_circAngle, m_circCount; + bool m_circRotate; + + int m_arrayTypeTab; + }; + + static CREATE_ARRAY_DIALOG_ENTRIES m_options; +}; + +#endif // __DIALOG_CREATE_ARRAY__ diff --git a/pcbnew/dialogs/dialog_create_array_base.cpp b/pcbnew/dialogs/dialog_create_array_base.cpp new file mode 100644 index 0000000000..3717b13d03 --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array_base.cpp @@ -0,0 +1,320 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 6 2014) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_create_array_base.h" + +/////////////////////////////////////////////////////////////////////////// + +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, _("x 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 wxTextCtrl( 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, _("y 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 wxTextCtrl( 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, _("x 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelDy = new wxStaticText( m_gridPanel, wxID_ANY, _("y 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelOffsetX = new wxStaticText( m_gridPanel, wxID_ANY, _("x 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelOffsetY = new wxStaticText( m_gridPanel, wxID_ANY, _("y 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 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 wxTextCtrl( 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, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_radioBoxGridStaggerTypeNChoices, m_radioBoxGridStaggerTypeChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridStaggerType->SetSelection( 0 ); + gbSizer1->Add( m_radioBoxGridStaggerType, wxGBPosition( 7, 1 ), wxGBSpan( 1, 2 ), wxALL|wxEXPAND, 5 ); + + m_labelGridStaggerType = new wxStaticText( m_gridPanel, wxID_ANY, _("Stagger type:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelGridStaggerType->Wrap( -1 ); + gbSizer1->Add( m_labelGridStaggerType, wxGBPosition( 7, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + + bSizer2->Add( gbSizer1, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer3; + bSizer3 = 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->SetSelection( 0 ); + bSizer3->Add( m_radioBoxGridNumberingAxis, 0, wxALL|wxEXPAND, 5 ); + + m_checkBoxGridReverseNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Reverse numbering on \nalternate rows/columns"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer3->Add( m_checkBoxGridReverseNumbering, 0, wxALL, 5 ); + + m_checkBoxGridRestartNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Restart numbering"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxGridRestartNumbering->SetValue(true); + bSizer3->Add( m_checkBoxGridRestartNumbering, 0, wxALL, 5 ); + + wxString m_radioBoxGridNumberingSchemeChoices[] = { _("Continuous (1, 2, 3...)"), _("Co-ordinate (A1, A2, ... B1, ...)") }; + int m_radioBoxGridNumberingSchemeNChoices = sizeof( m_radioBoxGridNumberingSchemeChoices ) / sizeof( wxString ); + m_radioBoxGridNumberingScheme = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering scheme:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingSchemeNChoices, m_radioBoxGridNumberingSchemeChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridNumberingScheme->SetSelection( 0 ); + bSizer3->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 ); + bSizer3->Add( m_labelPriAxisNumbering, 0, wxALL, 5 ); + + wxArrayString m_choicePriAxisNumberingChoices; + m_choicePriAxisNumbering = new wxChoice( m_gridPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePriAxisNumberingChoices, 0 ); + m_choicePriAxisNumbering->SetSelection( 0 ); + bSizer3->Add( m_choicePriAxisNumbering, 0, wxALL|wxEXPAND, 5 ); + + m_labelSecAxisNumbering = new wxStaticText( m_gridPanel, wxID_ANY, _("Secondary axis numbering:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelSecAxisNumbering->Wrap( -1 ); + m_labelSecAxisNumbering->Enable( false ); + + bSizer3->Add( m_labelSecAxisNumbering, 0, wxALL, 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 ); + + bSizer3->Add( m_choiceSecAxisNumbering, 0, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer5; + bSizer5 = new wxBoxSizer( wxHORIZONTAL ); + + m_labelGridNumberingOffset = new wxStaticText( m_gridPanel, wxID_ANY, _("Numbering start:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelGridNumberingOffset->Wrap( -1 ); + bSizer5->Add( m_labelGridNumberingOffset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_entryGridPriNumberingOffset = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer5->Add( m_entryGridPriNumberingOffset, 0, wxALL, 5 ); + + m_entryGridSecNumberingOffset = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer5->Add( m_entryGridSecNumberingOffset, 0, wxALL, 5 ); + + + bSizer3->Add( bSizer5, 0, wxEXPAND, 5 ); + + + bSizer2->Add( bSizer3, 1, wxEXPAND, 5 ); + + + m_gridPanel->SetSizer( bSizer2 ); + m_gridPanel->Layout(); + bSizer2->Fit( m_gridPanel ); + m_gridTypeNotebook->AddPage( m_gridPanel, _("Grid"), true ); + 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, _("x Centre:"), 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelCentreY = new wxStaticText( m_circularPanel, wxID_ANY, _("y Centre:"), 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 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelCircAngle = new wxStaticText( m_circularPanel, wxID_ANY, _("Angle:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircAngle->Wrap( -1 ); + gbSizer2->Add( m_labelCircAngle, wxGBPosition( 2, 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( 2, 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( 2, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelCircCount = new wxStaticText( m_circularPanel, wxID_ANY, _("Count:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircCount->Wrap( -1 ); + gbSizer2->Add( m_labelCircCount, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_entryCircCount = new wxTextCtrl( m_circularPanel, wxID_ANY, _("4"), wxDefaultPosition, wxDefaultSize, 0 ); + m_entryCircCount->SetToolTip( _("How many items in the array.") ); + + gbSizer2->Add( m_entryCircCount, wxGBPosition( 3, 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( 4, 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->SetToolTip( _("Rotate the item as well as move it - multi-selections will be rotated together") ); + + gbSizer2->Add( m_entryRotateItemsCb, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + + bSizer4->Add( gbSizer2, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer6; + bSizer6 = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxCircRestartNumbering = new wxCheckBox( m_circularPanel, wxID_ANY, _("Restart numbering"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxCircRestartNumbering->SetValue(true); + bSizer6->Add( m_checkBoxCircRestartNumbering, 0, wxALL, 5 ); + + m_labelCircNumbering = new wxStaticText( m_circularPanel, wxID_ANY, _("Numbering type:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircNumbering->Wrap( -1 ); + bSizer6->Add( m_labelCircNumbering, 0, wxALL, 5 ); + + wxArrayString m_choiceCircNumberingTypeChoices; + m_choiceCircNumberingType = new wxChoice( m_circularPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceCircNumberingTypeChoices, 0 ); + m_choiceCircNumberingType->SetSelection( 0 ); + bSizer6->Add( m_choiceCircNumberingType, 0, wxALL|wxEXPAND, 5 ); + + + bSizer4->Add( bSizer6, 1, wxEXPAND, 5 ); + + + m_circularPanel->SetSizer( bSizer4 ); + m_circularPanel->Layout(); + bSizer4->Fit( m_circularPanel ); + m_gridTypeNotebook->AddPage( m_circularPanel, _("Circular"), 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(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CREATE_ARRAY_BASE::OnClose ) ); + m_entryNx->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryNy->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryDx->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryDy->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryOffsetX->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryOffsetY->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryStagger->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_checkBoxGridRestartNumbering->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_radioBoxGridNumberingScheme->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreX->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreY->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCircAngle->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCircCount->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_stdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnCancelClick ), 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() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CREATE_ARRAY_BASE::OnClose ) ); + m_entryNx->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryNy->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryDx->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryDy->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryOffsetX->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryOffsetY->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryStagger->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_checkBoxGridRestartNumbering->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_radioBoxGridNumberingScheme->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreX->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreY->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCircAngle->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCircCount->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnCancelClick ), 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 new file mode 100644 index 0000000000..0243b6c927 --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array_base.fbp @@ -0,0 +1,4608 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_create_array_base + 1000 + none + 1 + DIALOG_CREATE_ARRAY_BASE + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 1 + impl_virtual + + + + 0 + wxID_DIALOG_CREATE_ARRAY + + -1,-1 + DIALOG_CREATE_ARRAY_BASE + + 576,528 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Create array + + + + + + + + + + + + + + OnClose + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxEXPAND | wxALL + 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 + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer2 + wxHORIZONTAL + none + + 5 + wxEXPAND + 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 + x Count: + + 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 + + 1 + m_entryNx + 1 + + + protected + 1 + + Resizable + 1 + + + + 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 + y Count: + + 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 + + 1 + m_entryNy + 1 + + + protected + 1 + + Resizable + 1 + + + + 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 + x Spacing: + + 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 + + 1 + m_entryDx + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 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 + y Spacing: + + 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 + + 1 + m_entryDy + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 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 + x Offset: + + 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 + + 1 + m_entryOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 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 + y Offset: + + 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 + + 1 + m_entryOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 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 + + 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 + + 1 + m_entryStagger + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 2 + 1 + wxALL|wxEXPAND + 7 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Rows" "Columns" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 1 + + 0 + + + 0 + + 1 + m_radioBoxGridStaggerType + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL + 7 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Stagger type: + + 0 + + + 0 + + 1 + m_labelGridStaggerType + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bSizer3 + wxVERTICAL + none + + 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 + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Restart numbering + + 0 + + + 0 + + 1 + m_checkBoxGridRestartNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnParameterChanged + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Continuous (1, 2, 3...)" "Co-ordinate (A1, A2, ... B1, ...)" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Numbering scheme: + 1 + + 0 + + + 0 + + 1 + m_radioBoxGridNumberingScheme + 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 + Primary axis numbering: + + 0 + + + 0 + + 1 + m_labelPriAxisNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 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 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + + 1 + + 0 + 0 + wxID_ANY + Secondary axis numbering: + + 0 + + + 0 + + 1 + m_labelSecAxisNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 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 + 0 + + + bSizer5 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Numbering start: + + 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 + + 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 + + 1 + m_entryGridSecNumberingOffset + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Circular + 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 + 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 + x Centre: + + 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 + + 1 + m_entryCentreX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 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 + y Centre: + + 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 + + 1 + m_entryCentreY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 0 + + + 0 + + 1 + m_unitLabelCentreY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Angle: + + 0 + + + 0 + + 1 + m_labelCircAngle + 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 + + 1 + m_entryCircAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 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 + wxALL|wxALIGN_CENTER_VERTICAL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + deg + + 0 + + + 0 + + 1 + m_unitLabelCircAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 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 + Count: + + 0 + + + 0 + + 1 + m_labelCircCount + 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 + + 1 + m_entryCircCount + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + How many items in the array. + + wxFILTER_NONE + wxDefaultValidator + + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 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 + Rotate: + + 0 + + + 0 + + 1 + m_labelCircRotate + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 4 + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bSizer6 + wxVERTICAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Restart numbering + + 0 + + + 0 + + 1 + m_checkBoxCircRestartNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Numbering type: + + 0 + + + 0 + + 1 + m_labelCircNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceCircNumberingType + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_stdButtons + protected + + OnCancelClick + + + + OnOkClick + + + + + + + + diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h new file mode 100644 index 0000000000..565e664e7f --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array_base.h @@ -0,0 +1,117 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 6 2014) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_CREATE_ARRAY_BASE_H__ +#define __DIALOG_CREATE_ARRAY_BASE_H__ + +#include +#include +#include +class DIALOG_SHIM; + +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +#define wxID_DIALOG_CREATE_ARRAY 1000 + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_CREATE_ARRAY_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM +{ + private: + + protected: + wxNotebook* m_gridTypeNotebook; + wxPanel* m_gridPanel; + wxStaticText* m_labelNx; + wxTextCtrl* m_entryNx; + wxStaticText* m_labelNy; + wxTextCtrl* m_entryNy; + wxStaticText* m_labelDx; + wxTextCtrl* m_entryDx; + wxStaticText* m_unitLabelDx; + wxStaticText* m_labelDy; + wxTextCtrl* m_entryDy; + wxStaticText* m_unitLabelDy; + wxStaticText* m_labelOffsetX; + wxTextCtrl* m_entryOffsetX; + wxStaticText* m_unitLabelOffsetX; + wxStaticText* m_labelOffsetY; + wxTextCtrl* m_entryOffsetY; + wxStaticText* m_unitLabelOffsetY; + wxStaticText* m_labelStagger; + wxTextCtrl* m_entryStagger; + wxRadioBox* m_radioBoxGridStaggerType; + wxStaticText* m_labelGridStaggerType; + wxRadioBox* m_radioBoxGridNumberingAxis; + wxCheckBox* m_checkBoxGridReverseNumbering; + wxCheckBox* m_checkBoxGridRestartNumbering; + wxRadioBox* m_radioBoxGridNumberingScheme; + wxStaticText* m_labelPriAxisNumbering; + wxChoice* m_choicePriAxisNumbering; + wxStaticText* m_labelSecAxisNumbering; + wxChoice* m_choiceSecAxisNumbering; + wxStaticText* m_labelGridNumberingOffset; + wxTextCtrl* m_entryGridPriNumberingOffset; + wxTextCtrl* m_entryGridSecNumberingOffset; + wxPanel* m_circularPanel; + wxStaticText* m_labelCentreX; + wxTextCtrl* m_entryCentreX; + wxStaticText* m_unitLabelCentreX; + wxStaticText* m_labelCentreY; + wxTextCtrl* m_entryCentreY; + wxStaticText* m_unitLabelCentreY; + wxStaticText* m_labelCircAngle; + wxTextCtrl* m_entryCircAngle; + wxStaticText* m_unitLabelCircAngle; + wxStaticText* m_labelCircCount; + wxTextCtrl* m_entryCircCount; + wxStaticText* m_labelCircRotate; + wxCheckBox* m_entryRotateItemsCb; + wxCheckBox* m_checkBoxCircRestartNumbering; + wxStaticText* m_labelCircNumbering; + wxChoice* m_choiceCircNumberingType; + 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(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( 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( 576,528 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_CREATE_ARRAY_BASE(); + +}; + +#endif //__DIALOG_CREATE_ARRAY_BASE_H__ diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index fc730fae98..f2df8b54f1 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -112,6 +112,7 @@ static EDA_HOTKEY HkMoveItemExact( wxT( "Move Item Exactly" ), HK_MOVE_ITEM_EXAC static EDA_HOTKEY HkDuplicateItem( wxT( "Duplicate Item" ), HK_DUPLICATE_ITEM, 'D' + GR_KB_CTRL ); static EDA_HOTKEY HkDuplicateItemAndIncrement( wxT( "Duplicate Item and Increment" ), HK_DUPLICATE_ITEM_AND_INCREMENT, 'D' + GR_KB_SHIFTCTRL ); +static EDA_HOTKEY HkCreateArray( wxT( "Create Array" ), HK_CREATE_ARRAY, 'N' + GR_KB_CTRL ); static EDA_HOTKEY HkCopyItem( wxT( "Copy Item" ), HK_COPY_ITEM, 'C' ); static EDA_HOTKEY HkDragFootprint( wxT( "Drag Item" ), HK_DRAG_ITEM, 'G' ); static EDA_HOTKEY HkGetAndMoveFootprint( wxT( "Get and Move Footprint" ), HK_GET_AND_MOVE_FOOTPRINT, 'T' ); @@ -305,8 +306,7 @@ EDA_HOTKEY* board_edit_Hotkey_List[] = EDA_HOTKEY* module_edit_Hotkey_List[] = { &HkMoveItem, &HkRotateItem, &HkEditBoardItem, &HkMoveItemExact, &HkDuplicateItem, &HkDuplicateItemAndIncrement, - &HkDelete, - &HkSaveModule, + &HkCreateArray, &HkDelete, &HkSaveModule, NULL }; diff --git a/pcbnew/hotkeys.h b/pcbnew/hotkeys.h index 7f6b5a0a8a..661514a707 100644 --- a/pcbnew/hotkeys.h +++ b/pcbnew/hotkeys.h @@ -63,6 +63,7 @@ enum hotkey_id_commnand { HK_EDIT_ITEM, HK_DUPLICATE_ITEM, HK_DUPLICATE_ITEM_AND_INCREMENT, + HK_CREATE_ARRAY, HK_PLACE_ITEM, HK_SWITCH_TRACK_WIDTH_TO_NEXT, HK_SWITCH_TRACK_WIDTH_TO_PREVIOUS, diff --git a/pcbnew/hotkeys_module_editor.cpp b/pcbnew/hotkeys_module_editor.cpp index bc6a41f8c9..0c4bff73b4 100644 --- a/pcbnew/hotkeys_module_editor.cpp +++ b/pcbnew/hotkeys_module_editor.cpp @@ -172,6 +172,9 @@ bool FOOTPRINT_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPos case HK_DUPLICATE_ITEM_AND_INCREMENT: OnHotkeyDuplicateItem( HK_Descr->m_Idcommand ); break; + + case HK_CREATE_ARRAY: + PostCommandMenuEvent( ID_POPUP_PCB_CREATE_ARRAY ); } return true; diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index eb778dfaa1..8accd287f1 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -667,8 +668,47 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) } m_canvas->MoveCursorToCrossHair(); + break; + } - break; + case ID_POPUP_PCB_CREATE_ARRAY: + { + BOARD_ITEM* item = GetScreen()->GetCurItem(); + + if( !item ) + break; + + MODULE* module = static_cast( item->GetParent() ); + + if( !module ) + break; + + DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL; + + DIALOG_CREATE_ARRAY dialog( this, &array_opts ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_CREATE_ARRAY::CREATE_ARRAY_OK && array_opts != NULL ) + { + SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); + + for( int i = 0; i < array_opts->GetArraySize(); i++) + { + BOARD_ITEM* new_item = module->DuplicateAndAddItem( + item, true ); + + array_opts->TransformItem( i, new_item, new_item->GetCenter() ); + + if( new_item->Type() == PCB_PAD_T && array_opts->ShouldRenumberItems() ) + { + const std::string padName = array_opts->GetItemNumber( i ); + static_cast( new_item )->SetPadName( padName ); + } + } + + m_canvas->Refresh(); + } + break; } case ID_POPUP_PCB_IMPORT_PAD_SETTINGS: diff --git a/pcbnew/modedit_onclick.cpp b/pcbnew/modedit_onclick.cpp index 745f5b0dd0..8c2af77fc5 100644 --- a/pcbnew/modedit_onclick.cpp +++ b/pcbnew/modedit_onclick.cpp @@ -324,6 +324,10 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen msg = AddHotkeyName( _("Move Pad Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT ); AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_pad_xpm ) ); + msg = AddHotkeyName( _("Create Pad Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY ); + AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_pad_xpm ) ); + + if( !flags ) { PopMenu->AppendSeparator(); @@ -347,7 +351,7 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen AddMenuItem( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, KiBitmap( rotate_field_xpm ) ); { - // Do not show option to duplicate value or reference fields + // Do not show option to replicate value or reference fields // (there can only be one of each) const MODULE* module = static_cast( item->GetParent() ); @@ -359,6 +363,11 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM ); AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_text_xpm ) ); + + msg = AddHotkeyName( _("Create Text Array" ), + g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY ); + AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_text_xpm ) ); } } @@ -399,6 +408,9 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen msg = AddHotkeyName( _("Move Edge Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT ); AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_line_xpm ) ); + msg = AddHotkeyName( _("Create Edge Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY ); + AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_line_xpm ) ); + if( ( flags & (IS_NEW | IS_MOVED) ) == IS_MOVED ) AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_EDGE, _( "Place edge" ), KiBitmap( checked_ok_xpm ) ); diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h index f783ae8b12..8fa6d26724 100644 --- a/pcbnew/pcbnew_id.h +++ b/pcbnew/pcbnew_id.h @@ -64,6 +64,7 @@ enum pcbnew_ids ID_POPUP_PCB_DUPLICATE_ITEM, ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT, ID_POPUP_PCB_MOVE_EXACT, + ID_POPUP_PCB_CREATE_ARRAY, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, ID_POPUP_PCB_ROTATE_TEXTMODULE, diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index 1e7eb7b7cc..4c2083f9ae 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -341,6 +341,10 @@ TOOL_ACTION COMMON_ACTIONS::enumeratePads( "pcbnew.ModuleEditor.enumeratePads", AS_GLOBAL, 0, "Enumerate pads", "Enumerate pads", AF_ACTIVATE ); +TOOL_ACTION COMMON_ACTIONS::createArray( "pcbnew.ModuleEditor.createArray", + AS_GLOBAL, MD_CTRL + int('N'), + "Create array", "Create array", AF_ACTIVATE ); + TOOL_ACTION COMMON_ACTIONS::copyItems( "pcbnew.ModuleEditor.copyItems", AS_GLOBAL, MD_CTRL + int( 'C' ), "Copy items", "Copy items", AF_ACTIVATE ); diff --git a/pcbnew/tools/common_actions.h b/pcbnew/tools/common_actions.h index 3c0c85e991..b05e4d3c73 100644 --- a/pcbnew/tools/common_actions.h +++ b/pcbnew/tools/common_actions.h @@ -213,6 +213,9 @@ public: /// Tool for quick pad enumeration static TOOL_ACTION enumeratePads; + /// Tool for creating an array of objects + static TOOL_ACTION createArray; + /// Copying module items to clipboard static TOOL_ACTION copyItems; diff --git a/pcbnew/tools/module_tools.cpp b/pcbnew/tools/module_tools.cpp index e0c3443f00..0bbe0dda3f 100644 --- a/pcbnew/tools/module_tools.cpp +++ b/pcbnew/tools/module_tools.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -75,6 +76,7 @@ bool MODULE_TOOLS::Init() selectionTool->AddMenuItem( COMMON_ACTIONS::enumeratePads ); selectionTool->AddMenuItem( COMMON_ACTIONS::duplicate ); + selectionTool->AddMenuItem( COMMON_ACTIONS::createArray ); setTransitions(); @@ -494,6 +496,7 @@ int MODULE_TOOLS::DuplicateItems( TOOL_EVENT& aEvent ) bool increment = aEvent.IsAction( &COMMON_ACTIONS::duplicateIncrement ); MODULE* module = m_board->m_Modules; + assert( module ); // first, check if we have a selection, or try to get one @@ -554,7 +557,7 @@ int MODULE_TOOLS::DuplicateItems( TOOL_EVENT& aEvent ) } m_frame->DisplayToolMsg( wxString::Format( _( "Duplicated %d item(s)" ), - (int) old_items.size() ) ); + (int) old_items.size() ) ); // pick up the selected item(s) and start moving // this works well for "dropping" copies around @@ -569,6 +572,95 @@ int MODULE_TOOLS::DuplicateItems( TOOL_EVENT& aEvent ) } +int MODULE_TOOLS::CreateArray( TOOL_EVENT& aEvent ) +{ + MODULE* module = m_board->m_Modules; + assert( module ); + + // first, check if we have a selection, or try to get one + SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + + if( selTool->GetSelection().Empty() ) + { + m_toolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true ); + } + + const SELECTION& selection = selTool->GetSelection(); + + // if we don't have a selection by now, this tool can't do anything + if( selection.Empty() || selTool->CheckLock() ) + { + setTransitions(); + return 0; + } + + // we have a selection to work on now, so start the tool process + + m_frame->OnModify(); + m_frame->SaveCopyInUndoList( module, UR_MODEDIT ); + + DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL; + + PCB_BASE_FRAME* baseFrame = getEditFrame(); + + DIALOG_CREATE_ARRAY dialog( baseFrame, &array_opts ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_CREATE_ARRAY::CREATE_ARRAY_OK && array_opts != NULL ) + { + wxPoint rotPoint = selection.GetCenter(); + + for( int i = 0; i < selection.Size(); ++i ) + { + BOARD_ITEM* item = selection.Item( i ); + + if( !item ) + continue; + + // iterate across the array, laying out the item at the + // correct position + // skip the first one - we already have that object + const unsigned nPoints = array_opts->GetArraySize(); + + for( unsigned ptN = 0; ptN < nPoints; ++ptN ) + { + BOARD_ITEM* newItem = NULL; + + if( ptN == 0 ) + { + newItem = item; + } + else + { + newItem = module->DuplicateAndAddItem( item, true ); + + if( newItem ) + { + array_opts->TransformItem( ptN, newItem, rotPoint ); + + m_toolMgr->RunAction( COMMON_ACTIONS::unselectItem, true, newItem ); + m_view->Add( newItem ); + } + } + + // set the number if needed: + if( newItem->Type() == PCB_PAD_T && array_opts->ShouldRenumberItems() ) + { + const std::string padName = array_opts->GetItemNumber( ptN ); + static_cast( newItem )->SetPadName( padName ); + } + } + } + + m_frame->GetGalCanvas()->Refresh(); + } + + setTransitions(); + + return 0; +} + + int MODULE_TOOLS::ModuleTextOutlines( TOOL_EVENT& aEvent ) { KIGFX::PCB_PAINTER* painter = @@ -648,4 +740,5 @@ void MODULE_TOOLS::setTransitions() Go( &MODULE_TOOLS::DuplicateItems, COMMON_ACTIONS::duplicateIncrement.MakeEvent() ); Go( &MODULE_TOOLS::ModuleTextOutlines, COMMON_ACTIONS::moduleTextOutlines.MakeEvent() ); Go( &MODULE_TOOLS::ModuleEdgeOutlines, COMMON_ACTIONS::moduleEdgeOutlines.MakeEvent() ); + Go( &MODULE_TOOLS::CreateArray, COMMON_ACTIONS::createArray.MakeEvent() ); } diff --git a/pcbnew/tools/module_tools.h b/pcbnew/tools/module_tools.h index 3e9ef1043a..a10c41fbff 100644 --- a/pcbnew/tools/module_tools.h +++ b/pcbnew/tools/module_tools.h @@ -80,6 +80,13 @@ public: int DuplicateItems ( TOOL_EVENT& aEvent ); + /** + * Function CreateArray + * + * Creates an array of objects using settings from a dialog + */ + int CreateArray( TOOL_EVENT& aEvent ); + /** * Function ModuleTextOutlines() *