Add create array tool
This commit is contained in:
parent
4f3672da4d
commit
3c5f3f7049
|
@ -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
|
||||
|
|
|
@ -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 <bitmaps.h>
|
||||
|
||||
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, 0xde, 0xc6, 0xe2, 0x25, 0x2f, 0x99, 0xef, 0xe4,
|
||||
0x77, 0xee, 0x79, 0xe7, 0xfb, 0xee, 0xe0, 0x9c, 0x23, 0xf4, 0x61, 0x8a, 0x75, 0x6b, 0xd2, 0x43,
|
||||
0x2e, 0x79, 0x0f, 0x2e, 0x12, 0xc6, 0x10, 0xde, 0x11, 0xd3, 0x1d, 0xa4, 0x37, 0x5c, 0xc4, 0x30,
|
||||
0xc1, 0x7b, 0x5a, 0x83, 0x41, 0x08, 0x67, 0x11, 0x7e, 0x23, 0x38, 0x84, 0x9b, 0x01, 0x90, 0x13,
|
||||
0x08, 0x35, 0x84, 0x1a, 0x31, 0x87, 0x82, 0x40, 0x58, 0x0e, 0x22, 0xfc, 0x54, 0xc8, 0x0b, 0xdf,
|
||||
0xf8, 0x88, 0x19, 0x45, 0x58, 0x56, 0xd0, 0x58, 0xd0, 0xe8, 0x88, 0x18, 0x46, 0xf8, 0xae, 0x90,
|
||||
0x0f, 0xe4, 0xe9, 0xf0, 0x9c, 0x64, 0x17, 0x42, 0x15, 0xa1, 0x86, 0xe5, 0x36, 0x2e, 0xe0, 0x1b,
|
||||
0x61, 0x19, 0x40, 0xf8, 0xaa, 0x90, 0x4f, 0x44, 0x6c, 0xf4, 0x9c, 0x7c, 0x00, 0xa1, 0xa2, 0x27,
|
||||
0xb9, 0x4f, 0x44, 0xdb, 0x8a, 0xdf, 0x1b, 0x16, 0x95, 0xe9, 0x45, 0xf8, 0xac, 0x90, 0x2f, 0xc4,
|
||||
0x6c, 0xc9, 0x84, 0x14, 0xe9, 0x43, 0x78, 0xa6, 0x90, 0x27, 0xcc, 0xd1, 0xf5, 0x8f, 0xa6, 0xc1,
|
||||
0xb8, 0x3a, 0x11, 0x3e, 0x2a, 0xe4, 0x1b, 0x11, 0x83, 0x9e, 0x6f, 0xd2, 0x8d, 0x50, 0x50, 0x48,
|
||||
0x91, 0x32, 0xbd, 0x0d, 0x75, 0xab, 0x7c, 0xd2, 0x8a, 0xe1, 0x8d, 0x42, 0x7e, 0x10, 0x33, 0x9a,
|
||||
0x09, 0xc9, 0xd3, 0x81, 0x61, 0x5a, 0x21, 0x0b, 0xcc, 0xd0, 0xdf, 0x54, 0xbb, 0x6a, 0xce, 0x25,
|
||||
0x85, 0xfc, 0xc2, 0x70, 0x2a, 0x13, 0xb2, 0x48, 0x0b, 0x86, 0x49, 0x85, 0x54, 0x11, 0x86, 0x32,
|
||||
0xf5, 0xa9, 0x8d, 0xb9, 0xa7, 0x10, 0x87, 0x70, 0x25, 0xc0, 0x5b, 0xd7, 0x75, 0xbb, 0x96, 0x88,
|
||||
0xd8, 0xeb, 0xd5, 0x6b, 0xd1, 0x85, 0x04, 0x62, 0xb8, 0x13, 0x00, 0x39, 0x93, 0x32, 0xe4, 0xb1,
|
||||
0x20, 0xd3, 0x3b, 0xe7, 0x60, 0x86, 0x0d, 0x08, 0x6f, 0x11, 0x66, 0x9b, 0x0a, 0x0b, 0x6c, 0x45,
|
||||
0x38, 0xec, 0x9c, 0x83, 0x79, 0x7a, 0x30, 0x3c, 0xc2, 0x72, 0x3e, 0xc3, 0x53, 0x3b, 0xd2, 0x27,
|
||||
0x4d, 0xcf, 0xbc, 0xbd, 0x99, 0xeb, 0xb1, 0x6c, 0xc2, 0x10, 0xeb, 0xa8, 0x8e, 0xeb, 0xe2, 0xb4,
|
||||
0x7b, 0x9a, 0x7a, 0x8e, 0x65, 0x09, 0x61, 0x5f, 0x58, 0x04, 0x4d, 0xd3, 0x85, 0xe1, 0xb1, 0x8e,
|
||||
0xaa, 0x4c, 0x91, 0x3e, 0x8f, 0x71, 0xeb, 0x4d, 0x19, 0x9e, 0xfe, 0x0d, 0x61, 0x5f, 0x04, 0xb5,
|
||||
0xe9, 0x92, 0xd4, 0x10, 0x2a, 0x14, 0xd8, 0xe6, 0xd1, 0x77, 0x22, 0xe4, 0x93, 0xa6, 0x0a, 0x6c,
|
||||
0xf6, 0x47, 0x90, 0x23, 0x87, 0x70, 0x4b, 0x8b, 0x5e, 0x61, 0xd9, 0xed, 0x6d, 0x4a, 0xb8, 0x9b,
|
||||
0x34, 0x55, 0x5a, 0xd9, 0x54, 0x56, 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
|
|
@ -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 <bitmaps.h>
|
||||
|
||||
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, 0xa9, 0x02, 0x55, 0xa5, 0xf2, 0xd5, 0x1d, 0x75, 0x60, 0x57, 0x22, 0x59, 0x38, 0x43, 0x30,
|
||||
0xa1, 0x6a, 0xd5, 0x6f, 0xf9, 0x7e, 0xd7, 0xd8, 0x68, 0xcf, 0xaa, 0x3a, 0x75, 0x74, 0xc7, 0xe4,
|
||||
0xb0, 0x3a, 0x14, 0xa8, 0x0b, 0xd4, 0xcb, 0x98, 0x58, 0xea, 0x83, 0xd4, 0xc1, 0xd4, 0x86, 0xd4,
|
||||
0x41, 0xda, 0x7e, 0xcb, 0x5f, 0x29, 0x73, 0xd2, 0x12, 0x12, 0x19, 0x92, 0xaf, 0x82, 0xcf, 0x82,
|
||||
0x69, 0x41, 0x4c, 0xa3, 0x46, 0x4d, 0xc9, 0xf7, 0x93, 0xe0, 0x87, 0x20, 0xcb, 0x35, 0x3e, 0xd3,
|
||||
0x67, 0xfb, 0x86, 0x73, 0x9f, 0x9d, 0xea, 0x6e, 0x5d, 0x7e, 0x64, 0x8d, 0x7c, 0xeb, 0xab, 0x02,
|
||||
0x4f, 0x16, 0x1f, 0xda, 0x39, 0x1d, 0xd9, 0xbd, 0xf2, 0x6f, 0xc0, 0x4d, 0xe6, 0x26, 0x9a, 0x30,
|
||||
0x24, 0x31, 0x43, 0xf4, 0x41, 0xb0, 0x20, 0x98, 0x31, 0x7d, 0x1f, 0x65, 0xb7, 0x6f, 0x9c, 0xf1,
|
||||
0x01, 0x3b, 0xd0, 0x58, 0x34, 0x50, 0x18, 0x61, 0xf1, 0xc7, 0x8b, 0x61, 0xfb, 0xd2, 0xc8, 0x85,
|
||||
0x48, 0x59, 0xf4, 0x4a, 0x5b, 0xcb, 0x72, 0x93, 0x26, 0x85, 0x8c, 0xc8, 0xb6, 0x11, 0xe9, 0x9c,
|
||||
0x6c, 0x48, 0x34, 0x6d, 0xf0, 0xcb, 0x7c, 0xa3, 0x82, 0x35, 0xc1, 0x6b, 0xc1, 0x2b, 0xdd, 0xb6,
|
||||
0x55, 0x36, 0x32, 0xfa, 0x2c, 0xdf, 0x78, 0xdf, 0x97, 0x8e, 0x1a, 0x7b, 0xbe, 0x3a, 0x4c, 0xdb,
|
||||
0x6f, 0xfb, 0xab, 0x64, 0xe1, 0x7a, 0xc1, 0x18, 0x64, 0x44, 0x86, 0x8c, 0x4e, 0xce, 0x1c, 0xa2,
|
||||
0x52, 0x93, 0x93, 0x98, 0x89, 0x64, 0xca, 0x15, 0x29, 0x12, 0x2c, 0x99, 0x7f, 0xab, 0x32, 0xf9,
|
||||
0x9a, 0x10, 0x05, 0x33, 0x9b, 0x33, 0xfa, 0xd9, 0xf9, 0x99, 0xfe, 0x82, 0x4e, 0xaf, 0xe5, 0xbd,
|
||||
0xe5, 0x8c, 0x87, 0x8c, 0xc8, 0xf8, 0xa7, 0x73, 0x26, 0x06, 0x71, 0x13, 0x95, 0xbb, 0x88, 0x90,
|
||||
0x2b, 0xea, 0x22, 0x8a, 0x68, 0xd9, 0xb6, 0x88, 0xae, 0x0b, 0x8a, 0x8f, 0x34, 0x67, 0x6a, 0xa2,
|
||||
0xfc, 0xe7, 0xa7, 0xbb, 0xbc, 0xb6, 0xf7, 0xc6, 0x26, 0x91, 0x44, 0x86, 0x8c, 0x9a, 0x48, 0x0c,
|
||||
0x82, 0x1b, 0xb7, 0x88, 0xc4, 0xc2, 0x5a, 0xba, 0x8d, 0xc4, 0xcf, 0x18, 0xb9, 0x06, 0x0c, 0x09,
|
||||
0x32, 0xce, 0x09, 0x26, 0x75, 0xbf, 0xa5, 0x4e, 0xc8, 0xf7, 0xb8, 0xcf, 0xf2, 0x8c, 0x0f, 0xac,
|
||||
0x76, 0x57, 0x57, 0xbd, 0xbb, 0xdb, 0x40, 0x1b, 0x32, 0x41, 0x05, 0x32, 0x92, 0x33, 0x0c, 0xa2,
|
||||
0xa5, 0x13, 0xeb, 0xc7, 0x9b, 0x61, 0xd6, 0xb8, 0x2b, 0x66, 0x72, 0xb2, 0x64, 0x22, 0x99, 0xd3,
|
||||
0x7d, 0xb5, 0x6a, 0x51, 0xbe, 0x6f, 0xd5, 0xba, 0xf2, 0x80, 0x94, 0xba, 0x94, 0xa7, 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, 0x0c, 0xb6, 0xe7, 0x2b, 0xc3, 0x85, 0x62, 0x55, 0x2c,
|
||||
0x8b, 0x75, 0xe9, 0x83, 0x4c, 0x47, 0xe6, 0xb2, 0xf7, 0xc5, 0x91, 0x60, 0x7b, 0x52, 0x7b, 0xcb,
|
||||
0x5a, 0x3b, 0xec, 0xad, 0xef, 0x13, 0x39, 0x5c, 0x1c, 0x32, 0x0e, 0x9b, 0x39, 0x80, 0x15, 0x1c,
|
||||
0x42, 0xda, 0x2c, 0xc4, 0xae, 0x69, 0xeb, 0x7c, 0xc4, 0x1d, 0x58, 0x8f, 0x73, 0x60, 0x2d, 0xef,
|
||||
0x6d, 0xda, 0x49, 0x0f, 0x2c, 0x65, 0x82, 0x72, 0xc1, 0x4e, 0x28, 0x1f, 0x52, 0x46, 0xee, 0x39,
|
||||
0x3b, 0x61, 0x01, 0x76, 0xcb, 0x3f, 0xf2, 0xa0, 0x93, 0x1e, 0x5f, 0x82, 0x2c, 0xef, 0x4d, 0x57,
|
||||
0x09, 0x0a, 0x25, 0x2f, 0x41, 0x52, 0xf8, 0x28, 0x80, 0xfc, 0x2c, 0x8b, 0x96, 0xb4, 0x49, 0x32,
|
||||
0x2d, 0x17, 0x51, 0x05, 0x32, 0xf2, 0x8f, 0x64, 0x1b, 0x67, 0x6d, 0x16, 0xd5, 0xc2, 0xfe, 0xfc,
|
||||
0xf8, 0xa2, 0x6a, 0x5f, 0x1d, 0x2d, 0x69, 0x4f, 0x5c, 0x54, 0xa5, 0x94, 0x13, 0x26, 0xa5, 0x1d,
|
||||
0xe8, 0x43, 0x67, 0x05, 0x6c, 0x22, 0x43, 0x22, 0x72, 0x46, 0x92, 0x91, 0xc5, 0x58, 0x7f, 0xf3,
|
||||
0x9a, 0x08, 0xbd, 0xbf, 0xaf, 0x6b, 0x1d, 0x63, 0xd9, 0xa0, 0xdf, 0xf2, 0x8d, 0x39, 0xeb, 0xec,
|
||||
0xb8, 0x26, 0xcc, 0x4e, 0x2a, 0xb9, 0xac, 0x9c, 0x5b, 0x92, 0xc8, 0x90, 0x00, 0xbd, 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
|
|
@ -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 <bitmaps.h>
|
||||
|
||||
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, 0x3a, 0x00, 0xf1, 0x30,
|
||||
0xff, 0x96, 0xc5, 0x20, 0xda, 0x8b, 0x87, 0xe4, 0x7f, 0xbb, 0xc3, 0xb5, 0x9b, 0xe7, 0x8b, 0x41,
|
||||
0xb4, 0x17, 0x75, 0x53, 0xff, 0xef, 0x9f, 0x66, 0x07, 0xd9, 0x7f, 0xb4, 0x1d, 0x74, 0xf6, 0x54,
|
||||
0xa0, 0x5b, 0x04, 0x89, 0x91, 0x0e, 0x12, 0xa3, 0xcb, 0x20, 0xd1, 0xd3, 0x41, 0xa2, 0xe7, 0x04,
|
||||
0xa1, 0xe1, 0x19, 0x8d, 0x27, 0xa3, 0x61, 0x4f, 0x2a, 0x6f, 0x87, 0xc8, 0x47, 0xf4, 0x6c, 0x8d,
|
||||
0x86, 0xdd, 0xaa, 0xbc, 0x03, 0x24, 0x27, 0xdc, 0x90, 0x86, 0xe4, 0xc4, 0x71, 0x9a, 0x01, 0x4f,
|
||||
0x0a, 0x43, 0x62, 0x60, 0xcc, 0xba, 0xf8, 0xbe, 0xd8, 0x68, 0x93, 0xf2, 0x97, 0xa9, 0xc9, 0xe7,
|
||||
0x96, 0xaf, 0x82, 0x72, 0x35, 0xe7, 0x22, 0xf9, 0x84, 0x6b, 0x13, 0xe9, 0x0f, 0xba, 0x29, 0x8d,
|
||||
0x9b, 0xbc, 0x6f, 0x80, 0xfe, 0x52, 0x93, 0xce, 0x2f, 0x19, 0x02, 0x6c, 0x6a, 0xee, 0x01, 0xb9,
|
||||
0xa9, 0x91, 0x4f, 0xf9, 0x4b, 0xd4, 0x94, 0xe9, 0x89, 0x7f, 0xea, 0xa3, 0x0a, 0x54, 0x81, 0xd2,
|
||||
0x82, 0x45, 0x9d, 0x2f, 0x15, 0x3f, 0x8a, 0x54, 0xbc, 0xa8, 0xdb, 0x21, 0x7e, 0x35, 0xe6, 0xdc,
|
||||
0x0a, 0x2d, 0xd7, 0xa5, 0xd0, 0x31, 0xeb, 0xbc, 0x6a, 0xe0, 0x5a, 0x17, 0xc8, 0x6f, 0x28, 0x7d,
|
||||
0x35, 0x0d, 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
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
width="48"
|
||||
height="48"
|
||||
id="svg18859">
|
||||
<metadata
|
||||
id="metadata18886">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs18861" />
|
||||
<path
|
||||
d="M 4,23 22,3"
|
||||
id="path3376"
|
||||
style="fill:none;stroke:#009b00;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
d="M 26,23 44,3"
|
||||
id="path3378"
|
||||
style="opacity:0.7;fill:none;stroke:#009b00;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
d="M 4,44 22,24"
|
||||
id="path3380"
|
||||
style="opacity:0.7;fill:none;stroke:#009b00;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
d="M 26,44 44,24"
|
||||
id="path3382"
|
||||
style="opacity:0.7;fill:none;stroke:#009b00;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
width="48"
|
||||
height="48"
|
||||
id="svg8431">
|
||||
<metadata
|
||||
id="metadata8454">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs8433" />
|
||||
<path
|
||||
d="m 13,4.03125 c -4.95522,0 -8.96875,4.0135285 -8.96875,8.96875 0,4.955221 4.01353,8.96875 8.96875,8.96875 4.955222,0 8.96875,-4.013529 8.96875,-8.96875 C 21.96875,8.0447785 17.955222,4.03125 13,4.03125 z M 13,9 c 2.209139,0 4,1.790861 4,4 0,2.209139 -1.790861,4 -4,4 -2.209139,0 -4,-1.790861 -4,-4 0,-2.209139 1.790861,-4 4,-4 z"
|
||||
id="path3763"
|
||||
style="fill:#008000;fill-opacity:0.69803922;stroke:#008000;stroke-width:2.05555582;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
d="m 34.996528,4.034722 c -4.95522,0 -8.96875,4.013529 -8.96875,8.96875 0,4.955221 4.01353,8.968749 8.96875,8.968749 4.955223,0 8.968751,-4.013528 8.968751,-8.968749 0,-4.955221 -4.013528,-8.96875 -8.968751,-8.96875 z m 0,4.96875 c 2.209139,0 4.000001,1.790861 4.000001,4 0,2.209139 -1.790862,4 -4.000001,4 -2.209139,0 -4,-1.790861 -4,-4 0,-2.209139 1.790861,-4 4,-4 z"
|
||||
id="path9686"
|
||||
style="opacity:0.7;fill:#a9eba1;fill-opacity:0.69803922;stroke:#008000;stroke-width:2.05555582;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
d="m 13,26.03125 c -4.95522,0 -8.96875,4.013529 -8.96875,8.96875 0,4.955221 4.01353,8.96875 8.96875,8.96875 4.955222,0 8.96875,-4.013529 8.96875,-8.96875 0,-4.955221 -4.013528,-8.96875 -8.96875,-8.96875 z M 13,31 c 2.209139,0 4,1.790861 4,4 0,2.209139 -1.790861,4 -4,4 -2.209139,0 -4,-1.790861 -4,-4 0,-2.209139 1.790861,-4 4,-4 z"
|
||||
id="path3230"
|
||||
style="opacity:0.7;fill:#a9eba1;fill-opacity:0.69803922;stroke:#008000;stroke-width:2.05555582;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
d="m 34.996528,26.034722 c -4.95522,0 -8.96875,4.013529 -8.96875,8.96875 0,4.955221 4.01353,8.968749 8.96875,8.968749 4.955223,0 8.968751,-4.013528 8.968751,-8.968749 0,-4.955221 -4.013528,-8.96875 -8.968751,-8.96875 z m 0,4.96875 c 2.209139,0 4.000001,1.790861 4.000001,4 0,2.209139 -1.790862,4 -4.000001,4 -2.209139,0 -4,-1.790861 -4,-4 0,-2.209139 1.790861,-4 4,-4 z"
|
||||
id="path3232"
|
||||
style="opacity:0.7;fill:#a9eba1;fill-opacity:0.69803922;stroke:#008000;stroke-width:2.05555582;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
width="48"
|
||||
height="48"
|
||||
id="svg18970">
|
||||
<metadata
|
||||
id="metadata18987">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs18972" />
|
||||
<path
|
||||
d="m 1,2 0,6 2,0 2,-3 4,0 0,14.5 -3,2 0,1.5 6,0 6,0 0,-1.5 -3,-2 0,-14.5 4,0 2,3 2,0 0,-6 -11,0 z"
|
||||
id="path19013"
|
||||
style="fill:#00009b;fill-rule:evenodd" />
|
||||
<path
|
||||
d="m 25,2 0,6 2,0 2,-3 4,0 0,14.5 -3,2 0,1.5 6,0 6,0 0,-1.5 -3,-2 0,-14.5 4,0 2,3 2,0 0,-6 -11,0 z"
|
||||
id="path3308"
|
||||
style="opacity:0.7;fill:#00009b;fill-rule:evenodd" />
|
||||
<path
|
||||
d="m 1,25 0,6 2,0 2,-3 4,0 0,14.5 -3,2 0,1.5 6,0 6,0 0,-1.5 -3,-2 0,-14.5 4,0 2,3 2,0 0,-6 -11,0 z"
|
||||
id="path3310"
|
||||
style="opacity:0.7;fill:#00009b;fill-rule:evenodd" />
|
||||
<path
|
||||
d="m 25,25 0,6 2,0 2,-3 4,0 0,14.5 -3,2 0,1.5 6,0 6,0 0,-1.5 -3,-2 0,-14.5 4,0 2,3 2,0 0,-6 -11,0 z"
|
||||
id="path3312"
|
||||
style="opacity:0.7;fill:#00009b;fill-rule:evenodd" />
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <wxPcbStruct.h>
|
||||
#include <base_units.h>
|
||||
|
||||
#include <class_drawpanel.h>
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
|
||||
#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 );
|
||||
}
|
|
@ -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 <dialog_create_array_base.h>
|
||||
|
||||
#include <boost/bimap.hpp>
|
||||
|
||||
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<CONFIG_CTRL_T> 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<CONFIG_CTRL_T>::const_iterator iter = ctrls.begin(), iend = ctrls.end();
|
||||
iter != iend; ++iter )
|
||||
{
|
||||
switch( iter->type )
|
||||
{
|
||||
case CFG_CTRL_CHECKBOX:
|
||||
*(bool*) iter->dest = static_cast<wxCheckBox*>( iter->control )->GetValue();
|
||||
break;
|
||||
|
||||
case CFG_CTRL_TEXT:
|
||||
*(std::string*) iter->dest = static_cast<wxTextCtrl*>( iter->control )->GetValue();
|
||||
break;
|
||||
|
||||
case CFG_CTRL_CHOICE:
|
||||
*(int*) iter->dest = static_cast<wxChoice*>( iter->control )->GetSelection();
|
||||
break;
|
||||
|
||||
case CFG_CTRL_RADIOBOX:
|
||||
*(int*) iter->dest = static_cast<wxRadioBox*>( iter->control )->GetSelection();
|
||||
break;
|
||||
|
||||
case CFG_CTRL_TAB:
|
||||
*(int*) iter->dest = static_cast<wxNotebook*>( 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<CONFIG_CTRL_T>::const_iterator iter = ctrls.begin(), iend = ctrls.end();
|
||||
iter != iend; ++iter )
|
||||
{
|
||||
switch( iter->type )
|
||||
{
|
||||
case CFG_CTRL_CHECKBOX:
|
||||
static_cast<wxCheckBox*>( iter->control )->SetValue( *(bool*) iter->dest );
|
||||
break;
|
||||
|
||||
case CFG_CTRL_TEXT:
|
||||
static_cast<wxTextCtrl*>( iter->control )->SetValue( *(std::string*) iter->dest );
|
||||
break;
|
||||
|
||||
case CFG_CTRL_CHOICE:
|
||||
static_cast<wxChoice*>( iter->control )->SetSelection( *(int*) iter->dest );
|
||||
break;
|
||||
|
||||
case CFG_CTRL_RADIOBOX:
|
||||
static_cast<wxRadioBox*>( iter->control )->SetSelection( *(int*) iter->dest );
|
||||
break;
|
||||
|
||||
case CFG_CTRL_TAB:
|
||||
static_cast<wxNotebook*>( 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__
|
|
@ -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 );
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -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 <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class DIALOG_SHIM;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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__
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
|
||||
#include <dialog_edit_module_for_Modedit.h>
|
||||
#include <dialog_move_exact.h>
|
||||
#include <dialog_create_array.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <menus_helpers.h>
|
||||
#include <footprint_wizard_frame.h>
|
||||
|
@ -667,7 +668,46 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
break;
|
||||
}
|
||||
|
||||
case ID_POPUP_PCB_CREATE_ARRAY:
|
||||
{
|
||||
BOARD_ITEM* item = GetScreen()->GetCurItem();
|
||||
|
||||
if( !item )
|
||||
break;
|
||||
|
||||
MODULE* module = static_cast<MODULE*>( 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<D_PAD*>( new_item )->SetPadName( padName );
|
||||
}
|
||||
}
|
||||
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<MODULE*>( 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 ) );
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <collectors.h>
|
||||
#include <confirm.h>
|
||||
#include <dialogs/dialog_enum_pads.h>
|
||||
#include <dialogs/dialog_create_array.h>
|
||||
|
||||
#include <wxPcbStruct.h>
|
||||
#include <class_board.h>
|
||||
|
@ -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
|
||||
|
@ -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<SELECTION_TOOL>();
|
||||
|
||||
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<PCB_BASE_FRAME>();
|
||||
|
||||
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<BOARD_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<D_PAD*>( 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() );
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue