From 8c6313ac1a9d7495c8d21307795acd1dfc6e29f7 Mon Sep 17 00:00:00 2001 From: John Beard Date: Thu, 12 Feb 2015 03:22:24 +0000 Subject: [PATCH] Extend arrays and duplicate to pcbnew (GAL and legacy), covering modules, text, lines, tracks, dimensions and targets. Text arrays can now use "%s" as a placeholder to be substituted with the array index. Also expand menu options for move exact, arrays and duplicate. Minor fixes for arrays - use proper unit parsing, add numbering start for circular arrays Add circle radius indicator to array dialogue --- bitmaps_png/CMakeLists.txt | 8 + bitmaps_png/cpp_26/array_footprint.cpp | 25 ++ bitmaps_png/cpp_26/array_module.cpp | 25 ++ bitmaps_png/cpp_26/array_target.cpp | 51 +++ bitmaps_png/cpp_26/array_zone.cpp | 51 +++ bitmaps_png/cpp_26/duplicate_footprint.cpp | 43 +++ bitmaps_png/cpp_26/duplicate_module.cpp | 43 +++ bitmaps_png/cpp_26/duplicate_target.cpp | 63 ++++ bitmaps_png/cpp_26/duplicate_zone.cpp | 63 ++++ bitmaps_png/cpp_26/move_target.cpp | 67 ++++ bitmaps_png/cpp_26/move_zone.cpp | 62 ++++ bitmaps_png/sources/array_module.svg | 141 +++++++ bitmaps_png/sources/array_target.svg | 174 +++++++++ bitmaps_png/sources/array_zone.svg | 161 ++++++++ bitmaps_png/sources/duplicate_module.svg | 145 ++++++++ bitmaps_png/sources/duplicate_target.svg | 164 +++++++++ bitmaps_png/sources/duplicate_zone.svg | 161 ++++++++ bitmaps_png/sources/move_target.svg | 227 ++++++++++++ bitmaps_png/sources/move_zone.svg | 169 +++++++++ include/bitmaps.h | 8 + include/class_board_item.h | 3 + include/wxPcbStruct.h | 22 ++ pcbnew/class_board.cpp | 129 +++++++ pcbnew/class_board.h | 10 + pcbnew/class_board_item.cpp | 48 +++ pcbnew/class_module.cpp | 73 ++-- pcbnew/class_module.h | 25 ++ pcbnew/dialogs/dialog_create_array.cpp | 86 +++-- pcbnew/dialogs/dialog_create_array.h | 30 +- pcbnew/dialogs/dialog_create_array_base.cpp | 43 ++- pcbnew/dialogs/dialog_create_array_base.fbp | 389 +++++++++++++++++++- pcbnew/dialogs/dialog_create_array_base.h | 4 + pcbnew/edit.cpp | 209 +++++++++++ pcbnew/hotkeys.cpp | 4 +- pcbnew/hotkeys_board_editor.cpp | 75 ++++ pcbnew/hotkeys_module_editor.cpp | 15 - pcbnew/modedit.cpp | 84 ++--- pcbnew/module_editor_frame.h | 12 +- pcbnew/onrightclick.cpp | 127 ++++++- pcbnew/pcb_base_edit_frame.cpp | 14 + pcbnew/pcb_base_edit_frame.h | 10 + pcbnew/tools/common_actions.cpp | 8 +- pcbnew/tools/edit_tool.cpp | 260 ++++++++++++- pcbnew/tools/edit_tool.h | 10 +- pcbnew/tools/module_tools.cpp | 174 --------- pcbnew/tools/module_tools.h | 3 - pcbnew/tools/pcb_editor_control.cpp | 3 + 47 files changed, 3367 insertions(+), 354 deletions(-) create mode 100644 bitmaps_png/cpp_26/array_footprint.cpp create mode 100644 bitmaps_png/cpp_26/array_module.cpp create mode 100644 bitmaps_png/cpp_26/array_target.cpp create mode 100644 bitmaps_png/cpp_26/array_zone.cpp create mode 100644 bitmaps_png/cpp_26/duplicate_footprint.cpp create mode 100644 bitmaps_png/cpp_26/duplicate_module.cpp create mode 100644 bitmaps_png/cpp_26/duplicate_target.cpp create mode 100644 bitmaps_png/cpp_26/duplicate_zone.cpp create mode 100644 bitmaps_png/cpp_26/move_target.cpp create mode 100644 bitmaps_png/cpp_26/move_zone.cpp create mode 100644 bitmaps_png/sources/array_module.svg create mode 100644 bitmaps_png/sources/array_target.svg create mode 100644 bitmaps_png/sources/array_zone.svg create mode 100644 bitmaps_png/sources/duplicate_module.svg create mode 100644 bitmaps_png/sources/duplicate_target.svg create mode 100644 bitmaps_png/sources/duplicate_zone.svg create mode 100644 bitmaps_png/sources/move_target.svg create mode 100644 bitmaps_png/sources/move_zone.svg diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index f2c2939be8..cbef91207f 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -152,8 +152,11 @@ set( BMAPS_MID annotate_right_down annotate array_line + array_module array_pad array_text + array_target + array_zone auto_associe auto_delete_track auto_track_width @@ -221,8 +224,11 @@ set( BMAPS_MID drc_off drc duplicate_line + duplicate_module duplicate_pad + duplicate_target duplicate_text + duplicate_zone edges_sketch edit_comp_footprint edit_component @@ -369,9 +375,11 @@ set( BMAPS_MID move_polygon move_rectangle move_sheet + move_target move_text move_track_segment move_track + move_zone move mw_add_gap mw_add_line diff --git a/bitmaps_png/cpp_26/array_footprint.cpp b/bitmaps_png/cpp_26/array_footprint.cpp new file mode 100644 index 0000000000..c7b32372e6 --- /dev/null +++ b/bitmaps_png/cpp_26/array_footprint.cpp @@ -0,0 +1,25 @@ + +/* 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, 0x00, 0x79, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xdd, 0x94, 0x41, 0x0a, 0x00, + 0x31, 0x08, 0x03, 0xfd, 0x4a, 0xff, 0x94, 0xff, 0xf6, 0xdc, 0xfd, 0x94, 0x7b, 0xda, 0x43, 0x65, + 0x41, 0xad, 0x90, 0x82, 0x07, 0xc1, 0x8b, 0x0e, 0xc4, 0x18, 0x51, 0x55, 0x61, 0x94, 0xd0, 0x41, + 0x00, 0xd4, 0x2b, 0x3b, 0x0c, 0x60, 0x7a, 0xb5, 0x81, 0xbe, 0x45, 0xb2, 0x86, 0x7a, 0xbd, 0x85, + 0xc8, 0x33, 0xa6, 0xd7, 0xdf, 0x03, 0x65, 0xe4, 0x8b, 0xc8, 0xf6, 0x0b, 0x8a, 0x1c, 0xd4, 0x82, + 0x82, 0x33, 0x97, 0x40, 0x34, 0xe9, 0x7a, 0xb9, 0x8e, 0xf6, 0xb0, 0x6d, 0xb3, 0x2e, 0x2c, 0x43, + 0x25, 0xeb, 0x52, 0x87, 0xad, 0xb8, 0x8e, 0x0b, 0xca, 0x48, 0x71, 0xfa, 0xb0, 0xa9, 0x38, 0xa9, + 0x44, 0x10, 0x0f, 0x44, 0x93, 0xae, 0x97, 0xeb, 0x68, 0x0f, 0xdb, 0x2a, 0xeb, 0x5e, 0x8c, 0x95, + 0x3c, 0x73, 0x5c, 0xe2, 0x55, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_footprint_xpm[1] = {{ png, sizeof( png ), "array_footprint_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_module.cpp b/bitmaps_png/cpp_26/array_module.cpp new file mode 100644 index 0000000000..deb7ef121f --- /dev/null +++ b/bitmaps_png/cpp_26/array_module.cpp @@ -0,0 +1,25 @@ + +/* 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, 0x00, 0x79, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xdd, 0x94, 0x41, 0x0a, 0x00, + 0x31, 0x08, 0x03, 0xfd, 0x4a, 0xff, 0x94, 0xff, 0xf6, 0xdc, 0xfd, 0x94, 0x7b, 0xda, 0x43, 0x65, + 0x41, 0xad, 0x90, 0x82, 0x07, 0xc1, 0x8b, 0x0e, 0xc4, 0x18, 0x51, 0x55, 0x61, 0x94, 0xd0, 0x41, + 0x00, 0xd4, 0x2b, 0x3b, 0x0c, 0x60, 0x7a, 0xb5, 0x81, 0xbe, 0x45, 0xb2, 0x86, 0x7a, 0xbd, 0x85, + 0xc8, 0x33, 0xa6, 0xd7, 0xdf, 0x03, 0x65, 0xe4, 0x8b, 0xc8, 0xf6, 0x0b, 0x8a, 0x1c, 0xd4, 0x82, + 0x82, 0x33, 0x97, 0x40, 0x34, 0xe9, 0x7a, 0xb9, 0x8e, 0xf6, 0xb0, 0x6d, 0xb3, 0x2e, 0x2c, 0x43, + 0x25, 0xeb, 0x52, 0x87, 0xad, 0xb8, 0x8e, 0x0b, 0xca, 0x48, 0x71, 0xfa, 0xb0, 0xa9, 0x38, 0xa9, + 0x44, 0x10, 0x0f, 0x44, 0x93, 0xae, 0x97, 0xeb, 0x68, 0x0f, 0xdb, 0x2a, 0xeb, 0x5e, 0x8c, 0x95, + 0x3c, 0x73, 0x5c, 0xe2, 0x55, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_module_xpm[1] = {{ png, sizeof( png ), "array_module_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_target.cpp b/bitmaps_png/cpp_26/array_target.cpp new file mode 100644 index 0000000000..e5b52092cb --- /dev/null +++ b/bitmaps_png/cpp_26/array_target.cpp @@ -0,0 +1,51 @@ + +/* 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, 0x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da, 0x1b, 0xd0, 0x08, 0x0d, 0xd0, 0x02, 0x4d, 0x5c, 0x10, 0x77, + 0xb4, 0x5b, 0x78, 0xfa, 0x48, 0x87, 0xa1, 0xf8, 0xe0, 0x6a, 0x84, 0x06, 0x68, 0x81, 0x26, 0x2e, + 0x88, 0x3b, 0xda, 0x2d, 0x3c, 0x99, 0x53, 0x41, 0x20, 0xde, 0x0e, 0x4c, 0x1d, 0x53, 0xc5, 0x74, + 0x01, 0x73, 0x41, 0x40, 0x9a, 0xcd, 0xa6, 0x96, 0xd2, 0xfb, 0x7d, 0x77, 0xea, 0x98, 0x2a, 0xa6, + 0x0b, 0x98, 0x0b, 0x02, 0x62, 0x72, 0x94, 0xef, 0x7b, 0x87, 0x03, 0x53, 0x67, 0xff, 0x23, 0x60, + 0x54, 0x46, 0x1b, 0x01, 0xd1, 0x2e, 0x2a, 0xf1, 0xa5, 0xf7, 0x6b, 0xd4, 0x7f, 0x04, 0x8c, 0xca, + 0x68, 0x23, 0x20, 0xda, 0x45, 0x25, 0x7d, 0xc8, 0xf2, 0x58, 0x67, 0x40, 0x33, 0x40, 0xf5, 0x07, + 0xf2, 0x67, 0xb5, 0x22, 0xde, 0x67, 0x72, 0x06, 0xa3, 0x19, 0x20, 0x93, 0xb3, 0x5b, 0x0d, 0xc4, + 0xce, 0x48, 0x67, 0xb8, 0x57, 0xaf, 0xcb, 0x9a, 0x34, 0x09, 0x53, 0xcd, 0x64, 0x90, 0x65, 0x4d, + 0x35, 0xb3, 0x41, 0x96, 0x31, 0xd5, 0x5c, 0x06, 0x59, 0xd8, 0x54, 0xf3, 0x1a, 0x64, 0x19, 0x53, + 0xcd, 0x65, 0x90, 0x45, 0x4d, 0x55, 0xdd, 0x4b, 0x14, 0x31, 0xc8, 0xc2, 0xa6, 0x9a, 0xd7, 0x20, + 0xcb, 0x98, 0x6a, 0x2e, 0x83, 0x2c, 0x6b, 0xaa, 0x99, 0x0d, 0x72, 0x12, 0xa6, 0x9a, 0xc9, 0x20, + 0x27, 0x6d, 0xaa, 0x13, 0xf5, 0xba, 0xff, 0x0c, 0x96, 0xd3, 0x5f, 0x78, 0x1d, 0xd5, 0x5b, 0x00, + 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_target_xpm[1] = {{ png, sizeof( png ), "array_target_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_zone.cpp b/bitmaps_png/cpp_26/array_zone.cpp new file mode 100644 index 0000000000..211aed3385 --- /dev/null +++ b/bitmaps_png/cpp_26/array_zone.cpp @@ -0,0 +1,51 @@ + +/* 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, 0x1a, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xcd, 0x94, 0x3d, 0x88, 0x13, + 0x41, 0x18, 0x86, 0xe7, 0x40, 0xbb, 0x20, 0xe1, 0x1a, 0x13, 0x3b, 0xb1, 0xb3, 0xb0, 0xbf, 0x43, + 0x0e, 0xe5, 0x38, 0xbd, 0xd2, 0x46, 0x10, 0x04, 0x0b, 0x0b, 0x4b, 0xb9, 0xce, 0x9f, 0xc2, 0xcc, + 0x9a, 0x9d, 0x9d, 0x9f, 0x6c, 0x22, 0xc1, 0x22, 0x6a, 0x27, 0x07, 0x5a, 0x18, 0xb2, 0xe4, 0xe4, + 0x20, 0x46, 0x4c, 0x8a, 0x6b, 0x6c, 0xc5, 0xeb, 0x4e, 0x2c, 0x6c, 0x44, 0x39, 0x72, 0x57, 0xa8, + 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0b, 0xcb, 0x3a, 0x2a, + 0x69, 0x77, 0x60, 0x28, 0x84, 0x3b, 0x2f, 0xa4, 0xfb, 0xc8, 0x88, 0x0c, 0x19, 0x9a, 0x39, 0xc9, + 0x15, 0xab, 0x0d, 0x8f, 0xe2, 0x20, 0x32, 0x38, 0xa4, 0x95, 0xa5, 0xd9, 0x2c, 0xae, 0x60, 0x09, + 0xe3, 0x67, 0xc8, 0x54, 0x59, 0x37, 0x3d, 0xa8, 0x1a, 0x02, 0xd2, 0x06, 0xaa, 0x46, 0x80, 0xb4, + 0x81, 0xaa, 0x11, 0x20, 0x6d, 0xa0, 0x6a, 0x04, 0x48, 0x1b, 0xa8, 0x1a, 0x01, 0xd2, 0x06, 0xaa, + 0x46, 0x80, 0xb4, 0x81, 0xaa, 0x11, 0x20, 0x6d, 0xa0, 0x6a, 0x04, 0x48, 0x1b, 0xa8, 0x1a, 0x01, + 0xd2, 0x06, 0xaa, 0x46, 0x80, 0xfc, 0x77, 0xa8, 0x1a, 0x02, 0xf2, 0xbf, 0x86, 0xea, 0x2f, 0x73, + 0x29, 0x07, 0xb2, 0xe7, 0xc3, 0x61, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_zone_xpm[1] = {{ png, sizeof( png ), "array_zone_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_footprint.cpp b/bitmaps_png/cpp_26/duplicate_footprint.cpp new file mode 100644 index 0000000000..e811930db6 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_footprint.cpp @@ -0,0 +1,43 @@ + +/* 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, 0xa4, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x63, 0xf8, 0xff, 0xff, 0x3f, + 0x03, 0x3d, 0x30, 0x0a, 0x27, 0x24, 0x24, 0xe4, 0x3f, 0x0c, 0x13, 0xc3, 0xa7, 0xc8, 0x22, 0x86, + 0x93, 0x8a, 0x28, 0x06, 0xe3, 0xe2, 0x2f, 0x61, 0x60, 0xe0, 0x03, 0x62, 0x4f, 0x20, 0xae, 0x58, + 0xcc, 0xc0, 0x10, 0xbc, 0x9c, 0x81, 0x41, 0x96, 0xa0, 0x45, 0xc8, 0x2e, 0x85, 0x19, 0x84, 0x8f, + 0x9f, 0x65, 0x67, 0xf7, 0x7f, 0x31, 0x23, 0x23, 0xc8, 0x32, 0x30, 0x5e, 0xc3, 0xc2, 0xf2, 0x73, + 0x19, 0x23, 0xe3, 0xb7, 0xa5, 0x0c, 0x0c, 0x76, 0x04, 0x2d, 0x22, 0x25, 0xe8, 0xc2, 0x03, 0x03, + 0xff, 0x2f, 0x62, 0x60, 0xd0, 0xc9, 0xb0, 0xb7, 0xff, 0xbf, 0x8c, 0x89, 0xa9, 0x72, 0x39, 0x23, + 0xe3, 0xe7, 0x63, 0x42, 0x42, 0x20, 0xf6, 0x27, 0xa0, 0xcf, 0x14, 0x08, 0xf9, 0x28, 0x28, 0x3a, + 0x3a, 0x9a, 0x8f, 0x94, 0x70, 0x87, 0x39, 0x00, 0xe8, 0xab, 0xc0, 0x4d, 0xec, 0xec, 0x9f, 0x80, + 0x96, 0xfd, 0x02, 0x5a, 0xd6, 0x45, 0xc8, 0xa2, 0x43, 0x40, 0xbc, 0x81, 0x1c, 0x8b, 0x80, 0xc6, + 0x30, 0x02, 0x83, 0xee, 0xfb, 0x1d, 0x79, 0xf9, 0xff, 0x2b, 0x99, 0x98, 0x9e, 0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x8f, 0x6c, 0xd3, 0xd2, 0xd2, 0xb8, 0x48, 0xcc, 0x02, 0x64, 0x59, 0x34, + 0x31, 0x38, 0x38, 0xb8, 0x85, 0xe6, 0x16, 0x79, 0x7a, 0x7a, 0xb2, 0x03, 0xe9, 0x3d, 0xa4, 0xf8, + 0x8a, 0x5c, 0x1f, 0x4d, 0x02, 0xfa, 0x68, 0x02, 0x3d, 0x82, 0xce, 0x33, 0x34, 0x34, 0x94, 0x99, + 0xe6, 0x16, 0xd1, 0x33, 0xd5, 0xd1, 0x3e, 0x1f, 0x21, 0x5b, 0x88, 0xaf, 0x24, 0xa0, 0xb8, 0x64, + 0xc0, 0xe6, 0x33, 0xb2, 0xcb, 0x3a, 0x5a, 0x62, 0x00, 0x66, 0x05, 0x94, 0x24, 0x1f, 0x97, 0xfe, + 0x47, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_footprint_xpm[1] = {{ png, sizeof( png ), "duplicate_footprint_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_module.cpp b/bitmaps_png/cpp_26/duplicate_module.cpp new file mode 100644 index 0000000000..ecf5bcde44 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_module.cpp @@ -0,0 +1,43 @@ + +/* 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, 0xa4, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x63, 0xf8, 0xff, 0xff, 0x3f, + 0x03, 0x3d, 0x30, 0x0a, 0x27, 0x24, 0x24, 0xe4, 0x3f, 0x0c, 0x13, 0xc3, 0xa7, 0xc8, 0x22, 0x86, + 0x93, 0x8a, 0x28, 0x06, 0xe3, 0xe2, 0x2f, 0x61, 0x60, 0xe0, 0x03, 0x62, 0x4f, 0x20, 0xae, 0x58, + 0xcc, 0xc0, 0x10, 0xbc, 0x9c, 0x81, 0x41, 0x96, 0xa0, 0x45, 0xc8, 0x2e, 0x85, 0x19, 0x84, 0x8f, + 0x9f, 0x65, 0x67, 0xf7, 0x7f, 0x31, 0x23, 0x23, 0xc8, 0x32, 0x30, 0x5e, 0xc3, 0xc2, 0xf2, 0x73, + 0x19, 0x23, 0xe3, 0xb7, 0xa5, 0x0c, 0x0c, 0x76, 0x04, 0x2d, 0x22, 0x25, 0xe8, 0xc2, 0x03, 0x03, + 0xff, 0x2f, 0x62, 0x60, 0xd0, 0xc9, 0xb0, 0xb7, 0xff, 0xbf, 0x8c, 0x89, 0xa9, 0x72, 0x39, 0x23, + 0xe3, 0xe7, 0x63, 0x42, 0x42, 0x20, 0xf6, 0x27, 0xa0, 0xcf, 0x14, 0x08, 0xf9, 0x28, 0x28, 0x3a, + 0x3a, 0x9a, 0x8f, 0x94, 0x70, 0x87, 0x39, 0x00, 0xe8, 0xab, 0xc0, 0x4d, 0xec, 0xec, 0x9f, 0x80, + 0x96, 0xfd, 0x02, 0x5a, 0xd6, 0x45, 0xc8, 0xa2, 0x43, 0x40, 0xbc, 0x81, 0x1c, 0x8b, 0x80, 0xc6, + 0x30, 0x02, 0x83, 0xee, 0xfb, 0x1d, 0x79, 0xf9, 0xff, 0x2b, 0x99, 0x98, 0x9e, 0xe1, 0xb5, 0xc8, + 0xd7, 0xd7, 0x97, 0x0b, 0x48, 0xff, 0x26, 0xc5, 0x57, 0x20, 0x7d, 0xf3, 0x19, 0x18, 0x38, 0x40, + 0xc1, 0xb8, 0x9c, 0x89, 0xe9, 0xe9, 0x5d, 0xa0, 0x45, 0xc0, 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0x5c, 0x1f, 0x4d, 0x02, 0xfa, 0x68, 0x02, 0x3d, 0x82, 0xce, 0x33, 0x34, 0x34, 0x94, 0x99, + 0xe6, 0x16, 0xd1, 0x33, 0xd5, 0xd1, 0x3e, 0x1f, 0x21, 0x5b, 0x88, 0xaf, 0x24, 0xa0, 0xb8, 0x64, + 0xc0, 0xe6, 0x33, 0xb2, 0xcb, 0x3a, 0x5a, 0x62, 0x00, 0x66, 0x05, 0x94, 0x24, 0x1f, 0x97, 0xfe, + 0x47, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_module_xpm[1] = {{ png, sizeof( png ), "duplicate_module_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_target.cpp b/bitmaps_png/cpp_26/duplicate_target.cpp new file mode 100644 index 0000000000..bf4b78ea42 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_target.cpp @@ -0,0 +1,63 @@ + +/* 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, 0xda, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xcd, 0x96, 0xcf, 0x6b, 0x13, + 0x41, 0x14, 0xc7, 0x67, 0x7f, 0x25, 0xdd, 0x4d, 0xb6, 0x69, 0x24, 0xd5, 0x26, 0xa5, 0x49, 0x0f, + 0x1e, 0x5a, 0xd3, 0x58, 0xb0, 0x6c, 0x4c, 0xb0, 0xea, 0x41, 0xf4, 0xe0, 0xc1, 0xbf, 0xa1,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0x1a, 0x7b, 0x19, 0x10, 0x00, 0x9c, 0x20, 0x2a, 0x22, 0x0b, 0x06, 0x65, 0xf8, 0xae, + 0x69, 0x90, 0x5b, 0x50, 0x63, 0x67, 0x0d, 0xc3, 0xb0, 0x00, 0x76, 0xd8, 0x20, 0x3b, 0x60, 0x23, + 0x72, 0xd6, 0x16, 0x08, 0x9b, 0xb5, 0x1b, 0x6d, 0x29, 0xc2, 0x49, 0x71, 0x62, 0xa7, 0x02, 0xdb, + 0x42, 0x3b, 0xa0, 0x58, 0xd7, 0xe4, 0x47, 0x1d, 0x59, 0x07, 0xef, 0x91, 0x03, 0xe4, 0x02, 0x39, + 0x71, 0x82, 0xf0, 0x44, 0xee, 0xfa, 0xc3, 0xbd, 0xa6, 0xaa, 0xb2, 0xab, 0x1d, 0x81, 0x50, 0x4d, + 0xa8, 0x2a, 0x54, 0x17, 0x60, 0x4e, 0x10, 0x20, 0xd4, 0xd8, 0xa6, 0xc7, 0x23, 0x3c, 0x6b, 0xa9, + 0xea, 0xea, 0xc0, 0x86, 0x00, 0x83, 0x32, 0xd8, 0x08, 0x10, 0xec, 0x82, 0x92, 0x0a, 0xa4, 0xb5, + 0x3e, 0x6a, 0xa4, 0xcc, 0xba, 0x19, 0x28, 0x67, 0x00, 0x51, 0x63, 0x67, 0xfd, 0x2a, 0x9b, 0x6c, + 0xfa, 0x66, 0x68, 0x13, 0x6a, 0x76, 0xf4, 0x2f, 0xe8, 0xbf, 0x03, 0x35, 0x13, 0x7f, 0x00, 0x00, + 0x4f, 0xfc, 0x7e, 0x5d, 0x89, 0x9f, 0xa7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_target_xpm[1] = {{ png, sizeof( png ), "duplicate_target_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_zone.cpp b/bitmaps_png/cpp_26/duplicate_zone.cpp new file mode 100644 index 0000000000..a49ffcd039 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_zone.cpp @@ -0,0 +1,63 @@ + +/* 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, 0xde, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x94, 0x5d, 0x48, 0x14, + 0x51, 0x14, 0xc7, 0xcf, 0xce, 0x8c, 0x48, 0xe2, 0x47, 0x42, 0x09, 0xfa, 0xa0, 0x46, 0xbd, 0xd8, + 0x4b, 0xbd, 0x05, 0x51, 0x46, 0x4a, 0x06, 0x3e, 0x54, 0x2f, 0x41, 0x21, 0x14, 0xf4, 0x18, 0x61, + 0x3e, 0x04, 0x69, 0x5f, 0xde, 0xd5, 0x9d, 0x9d, 0x3b, 0xe3, 0x6a, 0x48, 0x91, 0x59, 0x44, 0xe5, + 0xc7, 0x6e, 0x7e, 0xa4, 0x68, 0x45, 0xa5, 0xe8, 0x3e, 0xf8, 0x16, 0xf4, 0x60, 0x49, 0x09, 0x9a, + 0x0f, 0x11, 0x84, 0x21, 0x6a, 0xe2, 0x2a, 0x69, 0xeb, 0xed, 0x3f, 0xeb, 0x20, 0xeb, 0x92, 0xb9, + 0xee, 0x68, 0x0f, 0xff, 0x39, 0x73, 0xef, 0x3d, 0x73, 0x7f, 0x73, 0xce, 0x3d, 0xf7, 0x90, 0x10, + 0x82, 0xfe, 0x87, 0x96, 0x1f, 0x4e, 0xfa, 0x4d, 0x8c, 0x44, 0x54, 0x82, 0x6f, 0xec, 0xa0, 0xe5, + 0x4d, 0x46, 0xb1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0, 0x95, 0xa4, 0xeb, 0x31, 0x47, + 0x84, 0xb5, 0x64, 0xa4, 0x72, 0xc4, 0x65, 0x54, 0xf8, 0xad, 0xf4, 0xae, 0x02, 0x21, 0x85, 0xc9, + 0x88, 0x66, 0x7e, 0x2c, 0x3b, 0x5b, 0xf8, 0x24, 0xe9, 0x27, 0xd2, 0x59, 0x88, 0xb9, 0xdb, 0x8f, + 0x89, 0xb6, 0x6f, 0xe4, 0x8c, 0x5e, 0x99, 0x6b, 0x05, 0x6a, 0x9e, 0x0b, 0x51, 0x05, 0x15, 0xa6, + 0xf4, 0x45, 0x82, 0xcc, 0xb3, 0xf1, 0x39, 0x1c, 0x9f, 0x86, 0x32, 0x32, 0x44, 0x5f, 0x52, 0xd2, + 0x1c, 0x22, 0x5c, 0xc0, 0x19, 0x0e, 0xac, 0x5f, 0x75, 0x2c, 0x54, 0x75, 0x83, 0xd0, 0x2f, 0x6b, + 0x6c, 0xda, 0x41, 0x80, 0x26, 0x2f, 0xf3, 0x4b, 0x3e, 0x44, 0x3e, 0x1c, 0x16, 0x4d, 0x3e, 0x22, + 0x98, 0x6f, 0x93, 0xe5, 0xc5, 0xd1, 0xac, 0x2c, 0x31, 0x95, 0x93, 0x23, 0xba, 0xe3, 0xe3, 0x67, + 0x00, 0x3f, 0x11, 0xed, 0x3d, 0x9a, 0x85, 0xc6, 0xad, 0x72, 0xfe, 0x66, 0x56, 0xde, 0x0d, 0xbd, + 0xd4, 0x00, 0x6c, 0x2e, 0x72, 0x03, 0xc0, 0xf6, 0x22, 0x65, 0x9f, 0x5f, 0x27, 0x24, 0xcc, 0x8e, + 0x64, 0x66, 0x9a, 0xe9, 0x9b, 0x40, 0xb9, 0xcb, 0xff, 0x06, 0xad, 0xad, 0x05, 0x89, 0x49, 0x4f, + 0x34, 0x43, 0xad, 0x63, 0x8c, 0x29, 0x91, 0x9b, 0xd4, 0x13, 0xc5, 0xa1, 0x10, 0x34, 0x40, 0x83, + 0xcd, 0x92, 0xc4,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 0xd5, 0x9a, 0x62, 0x5e, 0x7c, 0x12, 0xef, + 0x57, 0x36, 0xef, 0x1e, 0x31, 0xaa, 0x0b, 0x95, 0xb5, 0x59, 0x65, 0xe5, 0x78, 0xa2, 0xf2, 0x6e, + 0x1a, 0x65, 0x87, 0xb9, 0xee, 0x7a, 0x60, 0xb7, 0x33, 0xf8, 0xff, 0x72, 0x31, 0xc3, 0xd5, 0x84, + 0xb4, 0x15, 0xe2, 0xac, 0x8e, 0xc1, 0xdf, 0xb1, 0xb5, 0x2d, 0xa8, 0x82, 0x2e, 0xda, 0xee, 0x75, + 0xb1, 0xe8, 0x0f, 0xc0, 0x74, 0xed, 0xb7, 0x43, 0x22, 0xa0, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x49, + 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_zone_xpm[1] = {{ png, sizeof( png ), "duplicate_zone_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/move_target.cpp b/bitmaps_png/cpp_26/move_target.cpp new file mode 100644 index 0000000000..7ba8a6e138 --- /dev/null +++ b/bitmaps_png/cpp_26/move_target.cpp @@ -0,0 +1,67 @@ + +/* 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, 0x21, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x94, 0x4b, 0x4c, 0x13, + 0x51, 0x14, 0x86, 0x6f, 0xdb, 0x81, 0x96, 0xb6, 0xd8, 0x97, 0x7d, 0x4c, 0xa7, 0x9d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, 0x8c, 0xca, 0x6c, + 0x36, 0x29, 0x10, 0x78, 0x26, 0x49, 0x12, 0x19, 0x8d, 0x7a, 0xd2, 0x6b, 0xd9, 0x48, 0x66, 0x5d, + 0x34, 0x2e, 0x1f, 0xba, 0x38, 0xe8, 0xbe, 0x59, 0x50, 0xbc, 0x71, 0x4e, 0x4e, 0x1f, 0x31, 0xa4, + 0x96, 0xe6, 0xea, 0xb8, 0xf1, 0x0e, 0x05, 0xb4, 0xdf, 0x66, 0x22, 0xab, 0xd5, 0x4a, 0x2e, 0x97, + 0x93, 0x3c, 0x1e, 0x89, 0x04, 0x0d, 0x4b, 0x21, 0xa1, 0x78, 0xbe, 0x39, 0xee, 0xa9, 0x69, 0x19, + 0x95, 0x92, 0xad, 0xe3, 0xde, 0xcf, 0x91, 0x21, 0xf7, 0xad, 0x42, 0xce, 0x91, 0x16, 0xe7, 0x04, + 0x11, 0x46, 0xba, 0x60, 0xbc, 0xc3, 0x6e, 0xe2, 0xe3, 0x3a, 0x48, 0xe5, 0xe5, 0x06, 0x8c, 0xec, + 0x2b, 0x7f, 0xe6, 0x14, 0x9e, 0x6d, 0xea, 0x97, 0xea, 0x5a, 0x46, 0x3d, 0xc9, 0xce, 0x77, 0x01, + 0xea, 0x5c, 0x08, 0x50, 0xeb, 0x44, 0x6e, 0x58, 0xce, 0x56, 0x71, 0x4e, 0x10, 0x61, 0xa4, 0x0b, + 0xc6, 0x97, 0x96, 0xb0, 0x2f, 0xc6, 0x32, 0x36, 0x94, 0xe9, 0xa4, 0x31, 0x61, 0x37, 0x46, 0xe2, + 0xe2, 0xa3, 0xe6, 0x84, 0x38, 0xd9, 0x3e, 0xe3, 0x5b, 0x8b, 0x71, 0x58, 0x74, 0xc8, 0xfd, 0x31, + 0x3a, 0xe0, 0x7e, 0x1e, 0xee, 0x95, 0xaa, 0x76, 0xf2, 0x51, 0x45, 0x84, 0x67, 0xb3, 0x6b, 0xe8, + 0x04, 0x10, 0xdc, 0x5f, 0x78, 0x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0x0d, 0xd9, 0x90, 0xa2, 0x40, + 0xca, 0xce, 0x79, 0x84, 0x91, 0x2e, 0x18, 0x0f, 0x4f, 0x30, 0xae, 0x3f, 0x3b, 0xd9, 0x15, 0x50, + 0xb6, 0x67, 0x30, 0x1e, 0x9e, 0xfc, 0x0d, 0xb2, 0x2b, 0xa0, 0x2d, 0xcf, 0x78, 0xba, 0x32, 0xc6, + 0xff, 0x37, 0x50, 0x3e, 0xfa, 0x09, 0x65, 0x16, 0x60, 0xbf, 0x0d, 0xb1, 0xac, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE move_target_xpm[1] = {{ png, sizeof( png ), "move_target_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/move_zone.cpp b/bitmaps_png/cpp_26/move_zone.cpp new file mode 100644 index 0000000000..dd00c175f2 --- /dev/null +++ b/bitmaps_png/cpp_26/move_zone.cpp @@ -0,0 +1,62 @@ + +/* 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, 0xcf, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x95, 0xcb, 0x4f, 0x13, + 0x51, 0x14, 0xc6, 0x6f, 0xa2, 0x74, 0xd1, 0x44, 0x8c, 0x1b, 0x71, 0xa6, 0x50, 0x68, 0x54, 0x8c, + 0xb2, 0x70, 0xa1, 0x46, 0xdc, 0x35, 0xa9, 0x76, 0x30, 0x43, 0x42, 0x21, 0xe1, 0x15, 0x56,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b1, 0xa9, 0xf5, 0xb1, 0x86, 0x37, 0xa5, 0xcb, 0x52, 0x5c, 0x78, 0x6e, 0x58, + 0x48, 0xef, 0x3f, 0x4e, 0x48, 0x27, 0x25, 0xe3, 0xc9, 0x13, 0x6a, 0x17, 0x55, 0x42, 0xc9, 0xa5, + 0xa8, 0x30, 0x43, 0x31, 0x29, 0x26, 0x64, 0x6b, 0x33, 0x25, 0xcb, 0xd8, 0x8f, 0xb8, 0xd3, 0x6c, + 0xa7, 0x29, 0xa1, 0x55, 0x31, 0x9a, 0x2e, 0xda, 0x6f, 0x36, 0x0c, 0x52, 0x54, 0xf4, 0xe3, 0x20, + 0xa9, 0xfa, 0x38, 0xdb, 0x61, 0xca, 0xa3, 0x5c, 0x68, 0x84, 0x69, 0xba, 0xc8, 0x78, 0xf2, 0x44, + 0xaf, 0x08, 0x95, 0x90, 0x88, 0x27, 0xb2, 0xf7, 0x54, 0xae, 0x88, 0x25, 0x21, 0xfd, 0xe4, 0x18, + 0x61, 0x9a, 0x2e, 0x32, 0x9e, 0x3c, 0xa1, 0x76, 0x6d, 0xac, 0x64, 0x5b, 0x84, 0x72, 0x3d, 0x23, + 0xe3, 0xc9, 0x93, 0xcd, 0x44, 0xb6, 0x45, 0x68, 0xcd, 0x33, 0x4c, 0xd7, 0xaa, 0xf1, 0xff, 0x4c, + 0x28, 0x1f, 0xfe, 0x00, 0x7b, 0xdc, 0xc2, 0x19, 0xcd, 0xc3, 0x9e, 0x72, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE move_zone_xpm[1] = {{ png, sizeof( png ), "move_zone_xpm" }}; + +//EOF diff --git a/bitmaps_png/sources/array_module.svg b/bitmaps_png/sources/array_module.svg new file mode 100644 index 0000000000..deea56d3c3 --- /dev/null +++ b/bitmaps_png/sources/array_module.svg @@ -0,0 +1,141 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/array_target.svg b/bitmaps_png/sources/array_target.svg new file mode 100644 index 0000000000..6ea4156a65 --- /dev/null +++ b/bitmaps_png/sources/array_target.svg @@ -0,0 +1,174 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/array_zone.svg b/bitmaps_png/sources/array_zone.svg new file mode 100644 index 0000000000..2c11152927 --- /dev/null +++ b/bitmaps_png/sources/array_zone.svg @@ -0,0 +1,161 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/duplicate_module.svg b/bitmaps_png/sources/duplicate_module.svg new file mode 100644 index 0000000000..965b12e464 --- /dev/null +++ b/bitmaps_png/sources/duplicate_module.svg @@ -0,0 +1,145 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/duplicate_target.svg b/bitmaps_png/sources/duplicate_target.svg new file mode 100644 index 0000000000..9676b99b16 --- /dev/null +++ b/bitmaps_png/sources/duplicate_target.svg @@ -0,0 +1,164 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/duplicate_zone.svg b/bitmaps_png/sources/duplicate_zone.svg new file mode 100644 index 0000000000..00417405e1 --- /dev/null +++ b/bitmaps_png/sources/duplicate_zone.svg @@ -0,0 +1,161 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/move_target.svg b/bitmaps_png/sources/move_target.svg new file mode 100644 index 0000000000..71c5b168bb --- /dev/null +++ b/bitmaps_png/sources/move_target.svg @@ -0,0 +1,227 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/move_zone.svg b/bitmaps_png/sources/move_zone.svg new file mode 100644 index 0000000000..c9adba4dcc --- /dev/null +++ b/bitmaps_png/sources/move_zone.svg @@ -0,0 +1,169 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/bitmaps.h b/include/bitmaps.h index 0bdff3217f..bb77f1cf27 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -103,8 +103,11 @@ EXTERN_BITMAP( annotate_down_right_xpm ) EXTERN_BITMAP( annotate_right_down_xpm ) EXTERN_BITMAP( annotate_xpm ) EXTERN_BITMAP( array_line_xpm ) +EXTERN_BITMAP( array_module_xpm ) EXTERN_BITMAP( array_pad_xpm ) +EXTERN_BITMAP( array_target_xpm ) EXTERN_BITMAP( array_text_xpm ) +EXTERN_BITMAP( array_zone_xpm ) EXTERN_BITMAP( auto_associe_xpm ) EXTERN_BITMAP( auto_delete_track_xpm ) EXTERN_BITMAP( auto_track_width_xpm ) @@ -178,8 +181,11 @@ EXTERN_BITMAP( drag_track_segment_xpm ) EXTERN_BITMAP( drc_off_xpm ) EXTERN_BITMAP( drc_xpm ) EXTERN_BITMAP( duplicate_line_xpm ) +EXTERN_BITMAP( duplicate_module_xpm ) EXTERN_BITMAP( duplicate_pad_xpm ) +EXTERN_BITMAP( duplicate_target_xpm ) EXTERN_BITMAP( duplicate_text_xpm ) +EXTERN_BITMAP( duplicate_zone_xpm ) EXTERN_BITMAP( edges_sketch_xpm ) EXTERN_BITMAP( edit_comp_footprint_xpm ) EXTERN_BITMAP( edit_component_xpm ) @@ -338,8 +344,10 @@ EXTERN_BITMAP( move_polygon_xpm ) EXTERN_BITMAP( move_rectangle_xpm ) EXTERN_BITMAP( move_sheet_xpm ) EXTERN_BITMAP( move_text_xpm ) +EXTERN_BITMAP( move_target_xpm ) EXTERN_BITMAP( move_track_segment_xpm ) EXTERN_BITMAP( move_track_xpm ) +EXTERN_BITMAP( move_zone_xpm ) EXTERN_BITMAP( move_xpm ) EXTERN_BITMAP( mw_add_gap_xpm ) EXTERN_BITMAP( mw_add_line_xpm ) diff --git a/include/class_board_item.h b/include/class_board_item.h index f1cb93247e..ebbf4bcff5 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -78,6 +78,9 @@ class BOARD_ITEM : public EDA_ITEM protected: LAYER_ID m_Layer; + static int getTrailingInt( wxString aStr ); + static int getNextNumberInSequence( std::set aSeq, bool aFillSequenceGaps); + public: BOARD_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) : diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 909b7961ce..cd2a341ce7 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -193,6 +193,19 @@ protected: */ void duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone ); + /** + * Function moveExact + * Move the selected item exactly + */ + void moveExact(); + + /** + * Function duplicateItems + * Duplicate selected item if possible and start a move + * @param aIncrement increment the item number if appropriate + */ + void duplicateItem( bool aIncrement ); + // protected so that PCB::IFACE::CreateWindow() is the only factory. PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ); @@ -459,6 +472,15 @@ public: */ int OnHotkeyCopyItem(); + /** + * Function OnHotkeyDuplicateOrArrayItem + * Duplicate an item (optionally incrementing if necessary and possible) + * or invoke array dialog and create an array + * @param aIdCommand = the hotkey command id + * @return true if item duplicated or arrayed + */ + bool OnHotkeyDuplicateOrArrayItem( int aIdCommand ); + /** * Function OnHotkeyMoveItem * Moves or drag the item (footprint, track, text .. ) found under the mouse cursor diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 8fbc69dda5..ee9b9bf856 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -54,6 +54,10 @@ #include #include #include +#include +#include +#include +#include /* This is an odd place for this, but CvPcb won't link if it is @@ -2593,6 +2597,131 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, } +BOARD_ITEM* BOARD::DuplicateAndAddItem( const BOARD_ITEM* aItem, + bool aIncrementReferences ) +{ + BOARD_ITEM* new_item = NULL; + + switch( aItem->Type() ) + { + case PCB_MODULE_T: + { + MODULE* new_module = new MODULE( *static_cast( aItem ) ); + + if( aIncrementReferences ) + { + // Take the next available module number + new_module->IncrementReference( true ); + } + + m_Modules.PushBack( new_module ); + new_item = new_module; + break; + } + case PCB_TEXT_T: + { + const TEXTE_PCB* old_text = static_cast( aItem ); + + TEXTE_PCB* new_text = new TEXTE_PCB( *old_text ); + + m_Drawings.PushBack( new_text ); + new_item = new_text; + + break; + } + case PCB_LINE_T: + { + DRAWSEGMENT* new_edge = new DRAWSEGMENT( + *static_cast(aItem) ); + + m_Drawings.PushBack( new_edge ); + new_item = new_edge; + break; + } + case PCB_TRACE_T: + { + TRACK* new_track = new TRACK( + *static_cast(aItem) ); + + m_Track.PushBack( new_track ); + new_item = new_track; + break; + } + case PCB_ZONE_AREA_T: + { + ZONE_CONTAINER* new_zone = new ZONE_CONTAINER( + *static_cast(aItem) ); + + m_ZoneDescriptorList.push_back( new_zone ); + new_item = new_zone; + break; + } + case PCB_TARGET_T: + { + PCB_TARGET* new_target = new PCB_TARGET( + *static_cast(aItem) ); + + m_Drawings.PushBack( new_target ); + new_item = new_target; + break; + } + case PCB_DIMENSION_T: + { + DIMENSION* new_dim = new DIMENSION( + *static_cast(aItem) ); + + m_Drawings.PushBack( new_dim ); + new_item = new_dim; + break; + } + default: + // Un-handled item for duplication + wxASSERT_MSG( false, "Duplication not supported for items of class " + + aItem->GetClass() ); + break; + } + + return new_item; +} + + +wxString BOARD::GetNextModuleReferenceWithPrefix( const wxString& aPrefix, + bool aFillSequenceGaps ) +{ + wxString nextRef; + + std::set usedNumbers; + + for( MODULE* module = m_Modules; module; module = module->Next() ) + { + const wxString ref = module->GetReference(); + wxString remainder; + + // ONly interested in modules with the right prefix + if( !ref.StartsWith( aPrefix, &remainder ) ) + continue; + + // the suffix must be a number + if ( !remainder.IsNumber() ) + continue; + + long number; + if( remainder.ToCLong( &number ) ) + usedNumbers.insert( number ); + } + + int nextNum = 1; + + if( usedNumbers.size() ) + { + nextNum = getNextNumberInSequence( usedNumbers, aFillSequenceGaps ); + nextRef = wxString::Format( wxT( "%s%i" ), aPrefix, nextNum ); + } + + return nextRef; +} + + /* Extracts the board outlines and build a closed polygon * from lines, arcs and circle items on edge cut layer * Any closed outline inside the main outline is a hole diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index 84891f780c..15b0c22199 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -301,6 +301,16 @@ public: */ BOARD_ITEM* Remove( BOARD_ITEM* aBoardItem ); + BOARD_ITEM* DuplicateAndAddItem( const BOARD_ITEM* aItem, + bool aIncrementReferences ); + + /** + * Function GetNextModuleReferenceWithPrefix + * Get the next available module reference with this prefix + */ + wxString GetNextModuleReferenceWithPrefix( const wxString& aPrefix, + bool aFillSequenceGaps ); + /** * Function GetRatsnest() * returns list of missing connections between components/tracks. diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index 0ab41d1058..9fc1589a21 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -195,3 +195,51 @@ void BOARD_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const aCount = 1; aLayers[0] = m_Layer; } + + +int BOARD_ITEM::getTrailingInt( wxString aStr ) +{ + int number = 0; + int base = 1; + + // Trim and extract the trailing numeric part + int index = aStr.Len() - 1; + while( index >= 0 ) + { + const char chr = aStr.GetChar( index ); + + if( chr < '0' || chr > '9' ) + break; + + number += ( chr - '0' ) * base; + base *= 10; + index--; + } + + return number; +} + +int BOARD_ITEM::getNextNumberInSequence( std::set aSeq, bool aFillSequenceGaps) +{ + // By default go to the end of the sequence + int candidate = *aSeq.end(); + + // Filling in gaps in pad numbering + if( aFillSequenceGaps ) + { + // start at the beginning + candidate = *aSeq.begin(); + + for( std::set::iterator it = aSeq.begin(), + itEnd = aSeq.end(); it != itEnd; ++it ) + { + if( *it - candidate > 1 ) + break; + + candidate = *it; + } + } + + candidate++; + return candidate; +} diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index ac669085af..7fa68712bc 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -1156,6 +1156,10 @@ BOARD_ITEM* MODULE::DuplicateAndAddItem( const BOARD_ITEM* aItem, new_item = new_edge; break; } + case PCB_MODULE_T: + // Ignore the module itself + break; + default: // Un-handled item for duplication wxASSERT_MSG( false, "Duplication not supported for items of class " @@ -1166,6 +1170,7 @@ BOARD_ITEM* MODULE::DuplicateAndAddItem( const BOARD_ITEM* aItem, return new_item; } + wxString MODULE::GetNextPadName( bool aFillSequenceGaps ) const { std::set usedNumbers; @@ -1173,39 +1178,55 @@ wxString MODULE::GetNextPadName( bool aFillSequenceGaps ) const // Create a set of used pad numbers for( D_PAD* pad = Pads(); pad; pad = pad->Next() ) { - wxString padName = pad->GetPadName(); - int padNumber = 0; - int base = 1; - - // Trim and extract the trailing numeric part - while( padName.Len() && padName.Last() >= '0' && padName.Last() <= '9' ) - { - padNumber += ( padName.Last() - '0' ) * base; - padName.RemoveLast(); - base *= 10; - } - + int padNumber = getTrailingInt( pad->GetPadName() ); usedNumbers.insert( padNumber ); } - // By default go to the end of the sequence - int candidate = *usedNumbers.end(); + const int nextNum = getNextNumberInSequence( usedNumbers, aFillSequenceGaps ); - // Filling in gaps in pad numbering - if( aFillSequenceGaps ) + return wxString::Format( wxT( "%i" ), nextNum ); +} + + +wxString MODULE::GetReferencePrefix() const +{ + wxString prefix = GetReference(); + + int strIndex = prefix.length() - 1; + while( strIndex >= 0 ) { - // start at the beginning - candidate = *usedNumbers.begin(); + const wxUniChar chr = prefix.GetChar( strIndex ); - for( std::set::iterator it = usedNumbers.begin(), - itEnd = usedNumbers.end(); it != itEnd; ++it ) - { - if( *it - candidate > 1 ) - break; + // numeric suffix + if( chr >= '0' && chr <= '9' ) + break; - candidate = *it; - } + strIndex--; } - return wxString::Format( wxT( "%i" ), ++candidate ); + prefix = prefix.Mid( 0, strIndex ); + + return prefix; +} + + +bool MODULE::IncrementReference( bool aFillSequenceGaps ) +{ + BOARD* board = GetBoard(); + + if( !board ) + return false; + + bool success = false; + const wxString prefix = GetReferencePrefix(); + const wxString newReference = board->GetNextModuleReferenceWithPrefix( + prefix, aFillSequenceGaps ); + + if( !newReference.IsEmpty() ) + { + SetReference( newReference ); + success = true; + } + + return success; } diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index 9790822c62..33305c9d78 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -396,6 +396,15 @@ public: m_Reference->SetText( aReference ); } + /** + * Function GetReference prefix + * Gets the alphabetic prefix of the module reference - e.g. + * R1 -> R + * IC34 -> IC + * @return the reference prefix (may be empty) + */ + wxString GetReferencePrefix() const; + /** * Function GetValue * @return const wxString& - the value text. @@ -422,6 +431,17 @@ public: TEXTE_MODULE& Value() const { return *m_Value; } TEXTE_MODULE& Reference() const { return *m_Reference; } + /** + * Function INcrementReference + * Increments the module's reference, if possible. A reference with + * a numerical suffix and an optional alphabetical prefix can be + * incremented: "A1" and "1" can be, "B" can't. + * + * @param aFillSequenceGaps if true, the next reference in a sequence + * like A1,A3,A4 will be A2. If false, it will be A5. + * @return true if the reference was incremented. + */ + bool IncrementReference( bool aFillSequenceGaps ); /** * Function FindPadByName @@ -474,6 +494,11 @@ public: int GetPlacementCost90() const { return m_CntRot90; } void SetPlacementCost90( int aCost ) { m_CntRot90 = aCost; } + /** + * Function DuplicateAndAddItem + * Duplicate a given item within the module + * @return the new item, or NULL if the item could not be duplicated + */ BOARD_ITEM* DuplicateAndAddItem( const BOARD_ITEM* item, bool aIncrementPadNumbers ); diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 32d94957df..7a9df04832 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -46,13 +46,17 @@ static const wxString charSetDescriptions[] = }; -DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, ARRAY_OPTIONS** settings ) : +DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, wxPoint aOrigPos, + ARRAY_OPTIONS** aSettings ) : DIALOG_CREATE_ARRAY_BASE( aParent ), CONFIG_SAVE_RESTORE_WINDOW( m_options.m_optionsSet ), - m_settings( settings ) + m_settings( aSettings ), + m_originalItemPosition( aOrigPos ) { + // Set up numbering scheme drop downs m_choicePriAxisNumbering->Set( boost::size( charSetDescriptions ), charSetDescriptions ); m_choiceSecAxisNumbering->Set( boost::size( charSetDescriptions ), charSetDescriptions ); + m_choiceCircNumberingType->Set( boost::size( charSetDescriptions ), charSetDescriptions );; m_choicePriAxisNumbering->SetSelection( 0 ); m_choiceSecAxisNumbering->SetSelection( 0 ); @@ -77,6 +81,7 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, ARRAY_OPTIONS Add( m_entryCircAngle, m_options.m_circAngle ); Add( m_entryCircCount, m_options.m_circCount ); Add( m_entryRotateItemsCb, m_options.m_circRotate ); + Add( m_entryCircNumberingStart, m_options.m_circNumberingOffset ); Add( m_gridTypeNotebook, m_options.m_arrayTypeTab ); @@ -90,7 +95,7 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, ARRAY_OPTIONS RestoreConfigToControls(); - // load units into labels + // Load units into labels { const wxString lengthUnit = GetAbbreviatedUnitsLabel( g_UserUnit ); @@ -102,7 +107,9 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, ARRAY_OPTIONS m_unitLabelOffsetY->SetLabelText( lengthUnit ); } + // Run the callbacks once to process the dialog contents setControlEnablement(); + calculateCircularArrayProperties(); } @@ -116,6 +123,10 @@ void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event ) { setControlEnablement(); } + if( evObj == m_entryCentreX || evObj == m_entryCentreY ) + { + calculateCircularArrayProperties(); + } } @@ -211,23 +222,16 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event ) { 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 = DoubleValueFromString( g_UserUnit, m_entryDx->GetValue() ); + newGrid->m_delta.y = DoubleValueFromString( g_UserUnit, m_entryDy->GetValue() ); - 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 ); + newGrid->m_offset.x = DoubleValueFromString( g_UserUnit, m_entryOffsetX->GetValue() ); + newGrid->m_offset.y = DoubleValueFromString( g_UserUnit, m_entryOffsetY->GetValue() ); ok = ok && m_entryStagger->GetValue().ToLong( &newGrid->m_stagger ); @@ -272,28 +276,26 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event ) 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 = DoubleValueFromString( g_UserUnit, m_entryCentreX->GetValue() ); + newCirc->m_centre.y = DoubleValueFromString( g_UserUnit, m_entryCentreY->GetValue() ); - 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_angle = DoubleValueFromString( DEGREES, m_entryCircAngle->GetValue() ); + 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 + // 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) + // Mind undefined casts to enums (should not be able to happen) if( ok ) newCirc->m_numberingType = (ARRAY_NUMBERING_TYPE_T) m_choiceCircNumberingType->GetSelection(); + ok = ok && m_entryCircNumberingStart->GetValue().ToLong( &newCirc->m_numberingOffset ); + // Only use settings if all values are good if( ok ) newSettings = newCirc; @@ -343,6 +345,22 @@ void DIALOG_CREATE_ARRAY::setControlEnablement() } +void DIALOG_CREATE_ARRAY::calculateCircularArrayProperties() +{ + wxPoint centre; + + centre.x = DoubleValueFromString( g_UserUnit, m_entryCentreX->GetValue() ); + centre.y = DoubleValueFromString( g_UserUnit, m_entryCentreY->GetValue() ); + + // FInd the radius, etc of the circle + centre -= m_originalItemPosition; + + const double radius = VECTOR2I(centre.x, centre.y).EuclideanNorm(); + + m_labelCircRadiusValue->SetLabelText( StringFromValue( g_UserUnit, int(radius), true ) ); +} + + // ARRAY OPTION implementation functions -------------------------------------- std::string DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::getCoordinateNumber( int n, @@ -375,6 +393,16 @@ std::string DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::getCoordinateNumber( int n, } +wxString DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::InterpolateNumberIntoString( + int aN, const wxString& aPattern ) const +{ + wxString newStr( aPattern ); + newStr.Replace( "%s", GetItemNumber( aN ), false ); + + return newStr; +} + + int DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::GetArraySize() const { return m_nx * m_ny; @@ -430,9 +458,9 @@ void DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::TransformItem( int n, BOARD_ITEM* } -std::string DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::GetItemNumber( int n ) const +wxString DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::GetItemNumber( int n ) const { - std::string itemNum; + wxString itemNum; if( m_2dArrayNumbering ) { @@ -466,7 +494,7 @@ void DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::TransformItem( int n, BOARD_IT angle = 3600.0 * n / float(m_nPts); else // n'th step - angle = m_angle * n * 10.0; + angle = m_angle * n; item->Rotate( m_centre, angle ); @@ -476,7 +504,7 @@ void DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::TransformItem( int n, BOARD_IT } -std::string DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::GetItemNumber( int n ) const +wxString DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::GetItemNumber( int aN ) const { - return getCoordinateNumber( n, m_numberingType ); + return getCoordinateNumber( aN + m_numberingOffset, m_numberingType ); } diff --git a/pcbnew/dialogs/dialog_create_array.h b/pcbnew/dialogs/dialog_create_array.h index 0b698d3e47..2f80d27ba0 100644 --- a/pcbnew/dialogs/dialog_create_array.h +++ b/pcbnew/dialogs/dialog_create_array.h @@ -224,7 +224,8 @@ public: 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; + virtual wxString GetItemNumber( int n ) const = 0; + virtual wxString InterpolateNumberIntoString( int n, const wxString& pattern ) const; bool ShouldRenumberItems() const { @@ -263,7 +264,7 @@ protected: 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 + wxString GetItemNumber( int n ) const; // override virtual private: wxPoint getGridCoords( int n ) const; @@ -276,7 +277,8 @@ private: m_nPts( 0 ), m_angle( 0.0f ), m_rotateItems( false ), - m_numberingType( NUMBERING_NUMERIC ) + m_numberingType( NUMBERING_NUMERIC ), + m_numberingOffset( 0 ) {} long m_nPts; @@ -284,27 +286,38 @@ private: wxPoint m_centre; bool m_rotateItems; ARRAY_NUMBERING_TYPE_T m_numberingType; + long m_numberingOffset; 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 + wxString GetItemNumber( int n ) const; // override virtual }; // Constructor and destructor - DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, ARRAY_OPTIONS** settings ); + DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, wxPoint aOrigPos, 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 + /** + * The settings object returned to the caller. + * We update the caller's object and never have ownership + */ ARRAY_OPTIONS** m_settings; + /* + * The position of the original item(s), used for finding radius, etc + */ + const wxPoint m_originalItemPosition; + + // Event callbacks void OnParameterChanged( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event ); + // Internal callback handlers void setControlEnablement(); + void calculateCircularArrayProperties(); struct CREATE_ARRAY_DIALOG_ENTRIES { @@ -334,13 +347,14 @@ private: std::string m_gridPriNumberingOffset, m_gridSecNumberingOffset; std::string m_circCentreX, m_circCentreY, - m_circAngle, m_circCount; + m_circAngle, m_circCount, m_circNumberingOffset; 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 index 3717b13d03..066b6629de 100644 --- a/pcbnew/dialogs/dialog_create_array_base.cpp +++ b/pcbnew/dialogs/dialog_create_array_base.cpp @@ -203,37 +203,45 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_unitLabelCentreY->Wrap( -1 ); gbSizer2->Add( m_unitLabelCentreY, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_labelCircRadius = new wxStaticText( m_circularPanel, wxID_ANY, _("Radius:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircRadius->Wrap( -1 ); + gbSizer2->Add( m_labelCircRadius, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_labelCircRadiusValue = new wxStaticText( m_circularPanel, wxID_ANY, _("0 mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircRadiusValue->Wrap( -1 ); + gbSizer2->Add( m_labelCircRadiusValue, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 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 ); + gbSizer2->Add( m_labelCircAngle, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); m_entryCircAngle = new wxTextCtrl( m_circularPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); m_entryCircAngle->SetToolTip( _("Positive angles represent an anti-clockwise rotation. An angle of 0 will produce a full circle divided evenly into \"Count\" portions.") ); - gbSizer2->Add( m_entryCircAngle, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + gbSizer2->Add( m_entryCircAngle, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); m_unitLabelCircAngle = new wxStaticText( m_circularPanel, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); m_unitLabelCircAngle->Wrap( -1 ); - gbSizer2->Add( m_unitLabelCircAngle, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer2->Add( m_unitLabelCircAngle, wxGBPosition( 3, 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 ); + gbSizer2->Add( m_labelCircCount, wxGBPosition( 4, 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 ); + gbSizer2->Add( m_entryCircCount, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); m_labelCircRotate = new wxStaticText( m_circularPanel, wxID_ANY, _("Rotate:"), wxDefaultPosition, wxDefaultSize, 0 ); m_labelCircRotate->Wrap( -1 ); - gbSizer2->Add( m_labelCircRotate, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + gbSizer2->Add( m_labelCircRotate, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); m_entryRotateItemsCb = new wxCheckBox( m_circularPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_entryRotateItemsCb->SetValue(true); m_entryRotateItemsCb->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 ); + gbSizer2->Add( m_entryRotateItemsCb, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); bSizer4->Add( gbSizer2, 1, wxEXPAND, 5 ); @@ -254,6 +262,19 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID m_choiceCircNumberingType->SetSelection( 0 ); bSizer6->Add( m_choiceCircNumberingType, 0, wxALL|wxEXPAND, 5 ); + wxBoxSizer* bSizer7; + bSizer7 = new wxBoxSizer( wxHORIZONTAL ); + + m_labelCircNumStart = new wxStaticText( m_circularPanel, wxID_ANY, _("Numbering start:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircNumStart->Wrap( -1 ); + bSizer7->Add( m_labelCircNumStart, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_entryCircNumberingStart = new wxTextCtrl( m_circularPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer7->Add( m_entryCircNumberingStart, 0, wxALL, 5 ); + + + bSizer6->Add( bSizer7, 0, wxEXPAND, 5 ); + bSizer4->Add( bSizer6, 1, wxEXPAND, 5 ); @@ -289,8 +310,8 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID 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_entryCentreX->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreY->Connect( wxEVT_COMMAND_TEXT_UPDATED, 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 ); @@ -310,8 +331,8 @@ DIALOG_CREATE_ARRAY_BASE::~DIALOG_CREATE_ARRAY_BASE() 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_entryCentreX->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, 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 ); diff --git a/pcbnew/dialogs/dialog_create_array_base.fbp b/pcbnew/dialogs/dialog_create_array_base.fbp index 0243b6c927..09c058ec23 100644 --- a/pcbnew/dialogs/dialog_create_array_base.fbp +++ b/pcbnew/dialogs/dialog_create_array_base.fbp @@ -3046,11 +3046,11 @@ - + Circular 0 - + 1 1 1 @@ -3124,16 +3124,16 @@ - + bSizer4 wxHORIZONTAL none - + 5 wxEXPAND 1 - + wxBOTH @@ -3317,8 +3317,8 @@ - - OnParameterChanged + OnParameterChanged + @@ -3583,8 +3583,8 @@ - - OnParameterChanged + OnParameterChanged + @@ -3676,12 +3676,184 @@ + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Radius: + + 0 + + + 0 + + 1 + m_labelCircRadius + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 mm + + 0 + + + 0 + + 1 + m_labelCircRadiusValue + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + 5 1 0 wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT - 2 + 3 1 1 @@ -3767,7 +3939,7 @@ 1 1 wxALL - 2 + 3 1 1 @@ -3861,7 +4033,7 @@ 1 2 wxALL|wxALIGN_CENTER_VERTICAL - 2 + 3 1 1 @@ -3947,7 +4119,7 @@ 1 0 wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT - 3 + 4 1 1 @@ -4033,7 +4205,7 @@ 1 1 wxALL - 3 + 4 1 1 @@ -4127,7 +4299,7 @@ 1 0 wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT - 4 + 5 1 1 @@ -4213,7 +4385,7 @@ 1 1 wxALL - 4 + 5 1 1 @@ -4569,6 +4741,191 @@ + + 5 + wxEXPAND + 0 + + + bSizer7 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|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_labelCircNumStart + 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_entryCircNumberingStart + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h index 565e664e7f..442058e86b 100644 --- a/pcbnew/dialogs/dialog_create_array_base.h +++ b/pcbnew/dialogs/dialog_create_array_base.h @@ -86,6 +86,8 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM wxStaticText* m_labelCentreY; wxTextCtrl* m_entryCentreY; wxStaticText* m_unitLabelCentreY; + wxStaticText* m_labelCircRadius; + wxStaticText* m_labelCircRadiusValue; wxStaticText* m_labelCircAngle; wxTextCtrl* m_entryCircAngle; wxStaticText* m_unitLabelCircAngle; @@ -96,6 +98,8 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM wxCheckBox* m_checkBoxCircRestartNumbering; wxStaticText* m_labelCircNumbering; wxChoice* m_choiceCircNumberingType; + wxStaticText* m_labelCircNumStart; + wxTextCtrl* m_entryCircNumberingStart; wxStdDialogButtonSizer* m_stdButtons; wxButton* m_stdButtonsOK; wxButton* m_stdButtonsCancel; diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 4e79cb43db..25b3d8be0f 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -54,6 +54,9 @@ #include #include +#include +#include + #include #include @@ -1188,6 +1191,19 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) } break; + case ID_POPUP_PCB_MOVE_EXACT: + moveExact(); + break; + + case ID_POPUP_PCB_DUPLICATE_ITEM: + case ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT: + duplicateItem( id == ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT ); + break; + + case ID_POPUP_PCB_CREATE_ARRAY: + createArray(); + break; + case ID_MENU_PCB_CLEAN: Clean_Pcb(); break; @@ -1486,3 +1502,196 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) break; } } + + +void PCB_EDIT_FRAME::moveExact() +{ + wxPoint translation; + double rotation = 0; + + DIALOG_MOVE_EXACT dialog( this, translation, rotation ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + { + BOARD_ITEM* item = GetScreen()->GetCurItem(); + + // Could be moved or rotated + SaveCopyInUndoList( item, UR_CHANGED ); + + item->Move( translation ); + item->Rotate( item->GetPosition(), rotation ); + m_canvas->Refresh(); + } + + m_canvas->MoveCursorToCrossHair(); +} + + +void PCB_EDIT_FRAME::duplicateItem( bool aIncrement ) +{ + BOARD_ITEM* item = GetScreen()->GetCurItem(); + + int move_cmd = 0; + + BOARD_ITEM* new_item = GetBoard()->DuplicateAndAddItem( + item, aIncrement ); + + SaveCopyInUndoList( new_item, UR_NEW ); + + if( new_item ) + { + switch( new_item->Type() ) + { + case PCB_MODULE_T: + move_cmd = ID_POPUP_PCB_MOVE_MODULE_REQUEST; + break; + case PCB_TEXT_T: + move_cmd = ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST; + break; + case PCB_LINE_T: + move_cmd = ID_POPUP_PCB_MOVE_DRAWING_REQUEST; + break; + case PCB_ZONE_AREA_T: + move_cmd = ID_POPUP_PCB_MOVE_ZONE_OUTLINES; + break; + case PCB_TRACE_T: + move_cmd = ID_POPUP_PCB_MOVE_TRACK_SEGMENT; + break; + case PCB_TARGET_T: + move_cmd = ID_POPUP_PCB_MOVE_MIRE_REQUEST; + break; + case PCB_DIMENSION_T: + move_cmd = ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST; + break; + case PCB_PAD_T: + move_cmd = ID_POPUP_PCB_MOVE_PAD_REQUEST; + break; + default: + break; + } + + if( move_cmd ) + { + SetMsgPanel( new_item ); + SetCurItem( new_item ); + + m_canvas->MoveCursorToCrossHair(); + + // pick up the item and start moving + PostCommandMenuEvent( move_cmd ); + } + } +} + + +void PCB_BASE_EDIT_FRAME::createArray() +{ + BOARD_ITEM* item = GetScreen()->GetCurItem(); + + if( !item ) + return; + + bool editingModule = NULL != dynamic_cast( this ); + + BOARD* board = GetBoard(); + MODULE* module = static_cast( item->GetParent() ); + + DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL; + + const wxPoint rotPoint = item->GetCenter(); + + DIALOG_CREATE_ARRAY dialog( this, rotPoint, &array_opts ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_CREATE_ARRAY::CREATE_ARRAY_OK && array_opts != NULL ) + { + PICKED_ITEMS_LIST newItemsList; + + if( editingModule ) + { + // modedit saves everything upfront + SaveCopyInUndoList( board->m_Modules, UR_MODEDIT ); + } + else + { + // We may also change the original item + SaveCopyInUndoList( item, UR_CHANGED ); + } + + wxString cachedString; + + if( item->Type() == PCB_MODULE_T ) + { + cachedString = static_cast( item )->GetReferencePrefix(); + } + else if( EDA_TEXT* text = dynamic_cast( item ) ) + { + // Copy the text (not just take a reference + cachedString = text->GetText(); + } + + for( int ptN = 0; ptN < array_opts->GetArraySize(); ptN++) + { + BOARD_ITEM* new_item = NULL; + + if( ptN == 0 ) + { + new_item = item; + } + else + { + if( editingModule ) + new_item = module->DuplicateAndAddItem( item, true ); + else + new_item = board->DuplicateAndAddItem( item, true ); + + if( new_item ) + { + array_opts->TransformItem( ptN, new_item, rotPoint ); + newItemsList.PushItem( new_item ); + } + } + + if( !new_item || !array_opts->ShouldRenumberItems() ) + continue; + + // Renumber items + switch( new_item->Type() ) + { + case PCB_MODULE_TEXT_T: + case PCB_TEXT_T: + { + EDA_TEXT* text = dynamic_cast( new_item ); + text->SetText( array_opts->InterpolateNumberIntoString( ptN, cachedString ) ); + + break; + } + case PCB_MODULE_T: + { + const wxString padName = array_opts->GetItemNumber( ptN ); + static_cast( new_item )->SetReference( cachedString + padName ); + + break; + } + case PCB_PAD_T: + { + const wxString padName = array_opts->GetItemNumber( ptN ); + static_cast( new_item )->SetPadName( padName ); + + break; + } + default: + break; + } + } + + if( !editingModule ) + { + // pcbnew saves the new items like this + SaveCopyInUndoList( newItemsList, UR_NEW ); + } + + m_canvas->Refresh(); + } +} diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index f2df8b54f1..662c81b1e7 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -282,7 +282,9 @@ EDA_HOTKEY* board_edit_Hotkey_List[] = &HkPlaceItem, &HkCopyItem, &HkMoveItem, &HkFlipItem, - &HkRotateItem, &HkDragFootprint, + &HkRotateItem, &HkMoveItemExact, + &HkDuplicateItem, &HkDuplicateItemAndIncrement, &HkCreateArray, + &HkDragFootprint, &HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile, &HkSavefileAs, &HkLoadfile, &HkFindItem, &HkEditBoardItem, &HkSwitch2CopperLayer, &HkSwitch2InnerLayer1, diff --git a/pcbnew/hotkeys_board_editor.cpp b/pcbnew/hotkeys_board_editor.cpp index 2281cb06db..f4477d4432 100644 --- a/pcbnew/hotkeys_board_editor.cpp +++ b/pcbnew/hotkeys_board_editor.cpp @@ -551,6 +551,13 @@ bool PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit OnHotkeyRotateItem( HK_FLIP_ITEM ); break; + case HK_MOVE_ITEM_EXACT: + case HK_DUPLICATE_ITEM: + case HK_DUPLICATE_ITEM_AND_INCREMENT: + case HK_CREATE_ARRAY: + OnHotkeyDuplicateOrArrayItem( HK_Descr->m_Idcommand ); + break; + case HK_SWITCH_HIGHCONTRAST_MODE: // switch to high contrast mode and refresh the canvas displ_opts->m_ContrastModeDisplay = !displ_opts->m_ContrastModeDisplay; m_canvas->Refresh(); @@ -1063,3 +1070,71 @@ bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand ) return false; } + +bool PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem( int aIdCommand ) +{ + BOARD_ITEM* item = GetCurItem(); + bool itemCurrentlyEdited = item && item->GetFlags(); + + if( itemCurrentlyEdited ) + return false; + + item = PcbGeneralLocateAndDisplay(); + + if( item == NULL ) + return false; + + SetCurItem( item ); + + int evt_type = 0; // Used to post a wxCommandEvent on demand + + bool canDuplicate = true; + + switch( item->Type() ) + { + // Only handle items we know we can handle + case PCB_PAD_T: + canDuplicate = false; + // no break + case PCB_MODULE_T: + case PCB_LINE_T: + case PCB_TEXT_T: + case PCB_TRACE_T: + case PCB_ZONE_AREA_T: + case PCB_TARGET_T: + case PCB_DIMENSION_T: + switch( aIdCommand ) + { + case HK_CREATE_ARRAY: + if( canDuplicate ) + evt_type = ID_POPUP_PCB_CREATE_ARRAY; + break; + + case HK_DUPLICATE_ITEM_AND_INCREMENT: + if( canDuplicate ) + evt_type = ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT; + break; + + case HK_DUPLICATE_ITEM: + if( canDuplicate ) + evt_type = ID_POPUP_PCB_DUPLICATE_ITEM; + break; + + case HK_MOVE_ITEM_EXACT: + evt_type = ID_POPUP_PCB_MOVE_EXACT; + break; + + default: + // We don't handle other commands here + break; + } + break; + + default: + wxASSERT_MSG( false, "Unhandled move, duplicate or array for " + "object type " + item->Type() ); + break; + } + + return PostCommandMenuEvent( evt_type ); +} diff --git a/pcbnew/hotkeys_module_editor.cpp b/pcbnew/hotkeys_module_editor.cpp index 0c4bff73b4..2585079e99 100644 --- a/pcbnew/hotkeys_module_editor.cpp +++ b/pcbnew/hotkeys_module_editor.cpp @@ -211,21 +211,6 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey( bool failIfCurrentlyEdit } -bool FOOTPRINT_EDIT_FRAME::PostCommandMenuEvent( int evt_type ) -{ - if( evt_type != 0 ) - { - wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED ); - evt.SetEventObject( this ); - evt.SetId( evt_type ); - wxPostEvent( this, evt ); - return true; - } - - return false; -} - - bool FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem( int aIdCommand ) { BOARD_ITEM* item = PrepareItemForHotkey( true ); diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index 8accd287f1..d135cf880e 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -649,67 +649,12 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) break; case ID_POPUP_PCB_MOVE_EXACT: - { - wxPoint translation; - double rotation = 0; - - DIALOG_MOVE_EXACT dialog( this, translation, rotation ); - int ret = dialog.ShowModal(); - - if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) - { - SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); - - BOARD_ITEM* item = GetScreen()->GetCurItem(); - - item->Move( translation ); - item->Rotate( item->GetPosition(), rotation ); - m_canvas->Refresh(); - } - - m_canvas->MoveCursorToCrossHair(); + moveExact(); 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(); - } + createArray(); break; - } case ID_POPUP_PCB_IMPORT_PAD_SETTINGS: SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); @@ -895,7 +840,30 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) } -void FOOTPRINT_EDIT_FRAME::DuplicateItems( bool aIncrement ) +void FOOTPRINT_EDIT_FRAME::moveExact() +{ + wxPoint translation; + double rotation = 0; + + DIALOG_MOVE_EXACT dialog( this, translation, rotation ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + { + SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); + + BOARD_ITEM* item = GetScreen()->GetCurItem(); + + item->Move( translation ); + item->Rotate( item->GetPosition(), rotation ); + m_canvas->Refresh(); + } + + m_canvas->MoveCursorToCrossHair(); +} + + +void FOOTPRINT_EDIT_FRAME::duplicateItems( bool aIncrement ) { SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); diff --git a/pcbnew/module_editor_frame.h b/pcbnew/module_editor_frame.h index 9988b823c5..54fae136ea 100644 --- a/pcbnew/module_editor_frame.h +++ b/pcbnew/module_editor_frame.h @@ -35,6 +35,7 @@ class FP_LIB_TABLE; +class PCB_LAYER_WIDGET; namespace PCB { struct IFACE; } // A KIFACE_I coded in pcbnew.c @@ -146,7 +147,6 @@ public: bool OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem = NULL ); BOARD_ITEM* PrepareItemForHotkey( bool failIfCurrentlyEdited ); - bool PostCommandMenuEvent( int evt_type ); bool OnHotkeyEditItem( int aIdCommand ); bool OnHotkeyDeleteItem( int aIdCommand ); @@ -371,7 +371,7 @@ public: /** * Function SelectFootprint * Display the list of modules currently existing on the BOARD - * @return a pointer to a module if this module is selected or NULL otherwise + * @return a pointer to a modulvoid FOOTPRINT_EDIT_FRAME::moveExact()e if this module is selected or NULL otherwise * @param aPcb = the board from modules can be loaded */ MODULE* SelectFootprint( BOARD* aPcb ); @@ -539,6 +539,14 @@ protected: private: /** + * Function moveExact + * Move the selected item exactly, popping up a dialog to allow the + * user the enter the move delta + */ + void moveExact(); + + /** + * Function duplicateItems * Duplicate the item under the cursor * @param aIncrement increment the number of pad (if that is what is selected) */ diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 9de056f34f..abc3ad5282 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -200,8 +200,27 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) HK_MOVE_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST, msg, KiBitmap( move_xpm ) ); - AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ), - KiBitmap( edit_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Drawing" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_line_xpm ) ); + + msg = AddHotkeyName( _("Move Drawing Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_line_xpm ) ); + + msg = AddHotkeyName( _("Create Drawing Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_line_xpm ) ); + + msg = AddHotkeyName( _( "Edit Drawing" ), g_Module_Editor_Hokeys_Descr, + HK_EDIT_ITEM ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, + msg, KiBitmap( edit_xpm ) ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING, _( "Delete Drawing" ), KiBitmap( delete_xpm ) ); @@ -252,12 +271,30 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) msg = AddHotkeyName( _( "Edit Dimension" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, KiBitmap( edit_xpm ) ); + msg = AddHotkeyName( _( "Move Dimension Text" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST, msg, KiBitmap( move_text_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Dimension" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_text_xpm ) ); + + msg = AddHotkeyName( _("Move Dimension Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_text_xpm ) ); + + msg = AddHotkeyName( _("Create Dimension Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_text_xpm ) ); + msg = AddHotkeyName( _( "Delete Dimension" ), g_Board_Editor_Hokeys_Descr, HK_DELETE ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION, msg, KiBitmap( delete_xpm ) ); } @@ -268,10 +305,28 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) { msg = AddHotkeyName( _( "Move Target" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); - AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, msg, KiBitmap( move_xpm ) ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, + msg, KiBitmap( move_target_xpm ) ); + + msg = AddHotkeyName( _("Move Target Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_target_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Target" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_target_xpm ) ); + + msg = AddHotkeyName( _("Create Target Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_target_xpm ) ); + msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, KiBitmap( edit_xpm ) ); + msg = AddHotkeyName( _( "Delete Target" ), g_Board_Editor_Hokeys_Descr, HK_DELETE ); AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MIRE, msg, KiBitmap( delete_xpm ) ); @@ -316,7 +371,6 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) switch( GetToolId() ) { case ID_PCB_ZONES_BUTT: - if( GetBoard()->m_ZoneDescriptorList.size() > 0 ) { aPopMenu->AppendSeparator(); msg = AddHotkeyName( _( "Fill or Refill All Zones" ), @@ -500,10 +554,27 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) HK_DRAG_TRACK_KEEP_SLOPE ); AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE, msg, KiBitmap( drag_segment_withslope_xpm ) ); + msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM ); AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT, msg, KiBitmap( drag_track_segment_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Track" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_line_xpm ) ); + + msg = AddHotkeyName( _("Move Track 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 Track Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_line_xpm ) ); + AddMenuItem( PopMenu, ID_POPUP_PCB_BREAK_TRACK, _( "Break Track" ), KiBitmap( break_line_xpm ) ); } @@ -688,7 +759,17 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* _( "Add Cutout Area" ), KiBitmap( add_zone_cutout_xpm ) ); AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_DUPLICATE, - _( "Duplicate Zone" ), KiBitmap( zone_duplicate_xpm ) ); + _( "Duplicate Zone Onto Layer" ), KiBitmap( zone_duplicate_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Zone" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( zones_menu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( zone_duplicate_xpm ) ); + + msg = AddHotkeyName( _("Create Zone Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( zones_menu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_zone_xpm ) ); zones_menu->AppendSeparator(); @@ -705,6 +786,11 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, KiBitmap( move_xpm ) ); + msg = AddHotkeyName( _("Move Zone Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_zone_xpm ) ); + msg = AddHotkeyName( _( "Edit Zone Properties" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS, @@ -741,6 +827,22 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST, msg, KiBitmap( move_module_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( menu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_module_xpm ) ); + + msg = AddHotkeyName( _("Move Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( menu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_module_xpm ) ); + + msg = AddHotkeyName( _("Create Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( menu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_module_xpm ) ); + msg = AddHotkeyName( _( "Drag" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM ); AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST, msg, KiBitmap( drag_module_xpm ) ); @@ -791,6 +893,21 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* me msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, msg, KiBitmap( move_field_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( menu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_text_xpm ) ); + + msg = AddHotkeyName( _("Move Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( menu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_text_xpm ) ); + + msg = AddHotkeyName( _("Create Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( menu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_text_xpm ) ); } msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM ); diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index e4aa24108b..87eb9ed523 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -31,3 +31,17 @@ void PCB_BASE_EDIT_FRAME::SetRotationAngle( int aRotationAngle ) m_rotationAngle = aRotationAngle; } + +bool PCB_BASE_EDIT_FRAME::PostCommandMenuEvent( int evt_type ) +{ + if( evt_type != 0 ) + { + wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED ); + evt.SetEventObject( this ); + evt.SetId( evt_type ); + wxPostEvent( this, evt ); + return true; + } + + return false; +} diff --git a/pcbnew/pcb_base_edit_frame.h b/pcbnew/pcb_base_edit_frame.h index 3d867874d6..430fbdcab6 100644 --- a/pcbnew/pcb_base_edit_frame.h +++ b/pcbnew/pcb_base_edit_frame.h @@ -69,9 +69,19 @@ public: int GetRotationAngle() const { return m_rotationAngle; } void SetRotationAngle( int aRotationAngle ); + bool PostCommandMenuEvent( int evt_type ); + protected: /// User defined rotation angle (in tenths of a degree). int m_rotationAngle; + + /** + * Function createArray + * Create an array of the selected item (invokes the dialogue) + * This function is shared between pcbnew and modedit, as it is virtually + * the same + */ + void createArray(); }; #endif diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index 4c2083f9ae..d747e1e5ee 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -76,6 +76,10 @@ TOOL_ACTION COMMON_ACTIONS::moveExact( "pcbnew.InteractiveEdit.moveExact", AS_GLOBAL, MD_CTRL + int( 'M' ), "Move Exactly...", "Moves the selected item(s) by an exact amount" ); +TOOL_ACTION COMMON_ACTIONS::createArray( "pcbnew.InteractiveEdit.createArray", + AS_GLOBAL, MD_CTRL + int('N'), + "Create array", "Create array", AF_ACTIVATE ); + TOOL_ACTION COMMON_ACTIONS::rotate( "pcbnew.InteractiveEdit.rotate", AS_GLOBAL, 'R', "Rotate", "Rotates selected item(s)" ); @@ -341,10 +345,6 @@ 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/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 344c89e0e2..e8cad3315e 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include @@ -42,6 +44,7 @@ #include "selection_tool.h" #include "edit_tool.h" +#include #include EDIT_TOOL::EDIT_TOOL() : @@ -74,6 +77,8 @@ bool EDIT_TOOL::Init() m_selectionTool->AddMenuItem( COMMON_ACTIONS::remove, SELECTION_CONDITIONS::NotEmpty ); m_selectionTool->AddMenuItem( COMMON_ACTIONS::properties, SELECTION_CONDITIONS::NotEmpty ); m_selectionTool->AddMenuItem( COMMON_ACTIONS::moveExact, SELECTION_CONDITIONS::NotEmpty ); + m_selectionTool->AddMenuItem( COMMON_ACTIONS::duplicate, SELECTION_CONDITIONS::NotEmpty ); + m_selectionTool->AddMenuItem( COMMON_ACTIONS::createArray, SELECTION_CONDITIONS::NotEmpty ); m_offset.x = 0; m_offset.y = 0; @@ -187,7 +192,8 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent ) } } - else if( evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) + else if( evt->IsAction( &COMMON_ACTIONS::editActivate ) + || evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) { m_cursor = controls->GetCursorPosition(); @@ -647,6 +653,255 @@ int EDIT_TOOL::MoveExact( TOOL_EVENT& aEvent ) } +int EDIT_TOOL::Duplicate( TOOL_EVENT& aEvent ) +{ + bool increment = aEvent.IsAction( &COMMON_ACTIONS::duplicateIncrement ); + + // first, check if we have a selection, or try to get one + SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const SELECTION& selection = selTool->GetSelection(); + + // Be sure that there is at least one item that we can modify + if( !makeSelection( selection ) || selTool->CheckLock() ) + { + setTransitions(); + return 0; + } + + // we have a selection to work on now, so start the tool process + + PCB_BASE_FRAME* editFrame = getEditFrame(); + editFrame->OnModify(); + + // prevent other tools making undo points while the duplicate is going on + // so that if you cancel, you don't get a duplicate object hiding over + // the original + m_toolMgr->IncUndoInhibit(); + + std::vector old_items; + + for( int i = 0; i < selection.Size(); ++i ) + { + BOARD_ITEM* item = selection.Item( i ); + + if( item ) + old_items.push_back( item ); + } + + for( unsigned i = 0; i < old_items.size(); ++i ) + { + BOARD_ITEM* item = old_items[i]; + + // Unselect the item, so we won't pick it up again + // Do this first, so a single-item duplicate will correctly call + // SetCurItem and show the item properties + m_toolMgr->RunAction( COMMON_ACTIONS::unselectItem, true, item ); + + BOARD_ITEM* new_item = NULL; + + if ( PCB_EDIT_FRAME* frame = dynamic_cast( editFrame ) ) + new_item = frame->GetBoard()->DuplicateAndAddItem( item, increment ); + else if ( FOOTPRINT_EDIT_FRAME* frame = dynamic_cast( editFrame ) ) + new_item = frame->GetBoard()->m_Modules->DuplicateAndAddItem( item, increment ); + + if( new_item ) + { + if( new_item->Type() == PCB_MODULE_T ) + { + static_cast( new_item )->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, + getView(), _1 ) ); + } + + editFrame->GetGalCanvas()->GetView()->Add( new_item ); + + // Select the new item, so we can pick it up + m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, new_item ); + } + } + + // record the new items as added + editFrame->SaveCopyInUndoList( selection.items, UR_NEW ); + + editFrame->DisplayToolMsg( wxString::Format( _( "Duplicated %d item(s)" ), + (int) old_items.size() ) ); + + // pick up the selected item(s) and start moving + // this works well for "dropping" copies around + TOOL_EVENT evt = COMMON_ACTIONS::editActivate.MakeEvent(); + Main( evt ); + + // and re-enable undos + m_toolMgr->DecUndoInhibit(); + + setTransitions(); + + return 0; +} + + +int EDIT_TOOL::CreateArray( TOOL_EVENT& aEvent ) +{ + // first, check if we have a selection, or try to get one + SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const SELECTION& selection = selTool->GetSelection(); + + // Be sure that there is at least one item that we can modify + if( !makeSelection( selection ) || selTool->CheckLock() ) + { + setTransitions(); + return 0; + } + + bool originalItemsModified = false; + + // we have a selection to work on now, so start the tool process + + PCB_BASE_FRAME* editFrame = getEditFrame(); + editFrame->OnModify(); + + const bool editingModule = NULL != dynamic_cast( editFrame ); + + if( editingModule ) + { + // Module editors do their undo point upfront for the whole module + editFrame->SaveCopyInUndoList( editFrame->GetBoard()->m_Modules, UR_MODEDIT ); + } + else + { + // We may also change the original item + editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED ); + } + + DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL; + + const wxPoint rotPoint = selection.GetCenter(); + + DIALOG_CREATE_ARRAY dialog( editFrame, rotPoint, &array_opts ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_CREATE_ARRAY::CREATE_ARRAY_OK && array_opts != NULL ) + { + PICKED_ITEMS_LIST newItemList; + + for( int i = 0; i < selection.Size(); ++i ) + { + BOARD_ITEM* item = selection.Item( i ); + + if( !item ) + continue; + + wxString cachedString; + + if( item->Type() == PCB_MODULE_T ) + { + cachedString = static_cast( item )->GetReferencePrefix(); + } + else if( EDA_TEXT* text = dynamic_cast( item ) ) + { + // Copy the text (not just take a reference + cachedString = text->GetText(); + } + + // iterate across the array, laying out the item at the + // correct position + const unsigned nPoints = array_opts->GetArraySize(); + + for( unsigned ptN = 0; ptN < nPoints; ++ptN ) + { + BOARD_ITEM* newItem = NULL; + + if( ptN == 0 ) + { + newItem = item; + } + else + { + // if renumbering, no need to increment + const bool increment = !array_opts->ShouldRenumberItems(); + + if ( PCB_EDIT_FRAME* frame = dynamic_cast( editFrame ) ) + newItem = frame->GetBoard()->DuplicateAndAddItem( item, increment ); + else if ( FOOTPRINT_EDIT_FRAME* frame = dynamic_cast( editFrame ) ) + newItem = frame->GetBoard()->m_Modules->DuplicateAndAddItem( item, increment ); + + if( newItem ) + { + array_opts->TransformItem( ptN, newItem, rotPoint ); + + m_toolMgr->RunAction( COMMON_ACTIONS::unselectItem, true, newItem ); + + newItemList.PushItem( newItem ); + + if( newItem->Type() == PCB_MODULE_T) + { + static_cast( newItem )->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, + getView(), _1 ) ); + } + + editFrame->GetGalCanvas()->GetView()->Add( newItem ); + } + } + + // set the number if needed: + if( array_opts->ShouldRenumberItems() ) + { + switch( newItem->Type() ) + { + case PCB_PAD_T: + { + const wxString padName = array_opts->GetItemNumber( ptN ); + static_cast( newItem )->SetPadName( padName ); + + originalItemsModified = true; + break; + } + case PCB_MODULE_T: + { + const wxString moduleName = array_opts->GetItemNumber( ptN ); + MODULE* module = static_cast( newItem ); + module->SetReference( cachedString + moduleName ); + + originalItemsModified = true; + break; + } + case PCB_MODULE_TEXT_T: + case PCB_TEXT_T: + { + EDA_TEXT* text = dynamic_cast( newItem ); + text->SetText( array_opts->InterpolateNumberIntoString( ptN, cachedString ) ); + + originalItemsModified = true; + break; + } + default: + // no renumbering of other items + break; + } + } + } + } + + if( !editingModule ) + { + if( originalItemsModified ) + { + // Update the appearance of the original items + selection.group->ItemsViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); + } + + // Add all items as a single undo point for PCB editors + // TODO: Can this be merged into the previous undo point (where + // we saved the original items) + editFrame->SaveCopyInUndoList( newItemList, UR_NEW ); + } + } + + setTransitions(); + + return 0; +} + + void EDIT_TOOL::setTransitions() { Go( &EDIT_TOOL::Main, COMMON_ACTIONS::editActivate.MakeEvent() ); @@ -655,6 +910,9 @@ void EDIT_TOOL::setTransitions() Go( &EDIT_TOOL::Remove, COMMON_ACTIONS::remove.MakeEvent() ); Go( &EDIT_TOOL::Properties, COMMON_ACTIONS::properties.MakeEvent() ); Go( &EDIT_TOOL::MoveExact, COMMON_ACTIONS::moveExact.MakeEvent() ); + Go( &EDIT_TOOL::Duplicate, COMMON_ACTIONS::duplicate.MakeEvent() ); + Go( &EDIT_TOOL::Duplicate, COMMON_ACTIONS::duplicateIncrement.MakeEvent() ); + Go( &EDIT_TOOL::CreateArray,COMMON_ACTIONS::createArray.MakeEvent() ); } diff --git a/pcbnew/tools/edit_tool.h b/pcbnew/tools/edit_tool.h index 125ec1bd5f..3798723f7e 100644 --- a/pcbnew/tools/edit_tool.h +++ b/pcbnew/tools/edit_tool.h @@ -94,7 +94,7 @@ public: /** * Function Duplicate() * - * Duplicates a component and starts a move action + * Duplicates a selection and starts a move action */ int Duplicate( TOOL_EVENT& aEvent ); @@ -105,6 +105,14 @@ public: */ int MoveExact( TOOL_EVENT& aEvent ); + /** + * Function CreateArray() + * + * Creates an array of the selected items, invoking the array editor dialog + * to set the array options + */ + int CreateArray( TOOL_EVENT& aEvent ); + /** * Function EditModules() * diff --git a/pcbnew/tools/module_tools.cpp b/pcbnew/tools/module_tools.cpp index 0bbe0dda3f..cb87f1da77 100644 --- a/pcbnew/tools/module_tools.cpp +++ b/pcbnew/tools/module_tools.cpp @@ -75,8 +75,6 @@ bool MODULE_TOOLS::Init() } selectionTool->AddMenuItem( COMMON_ACTIONS::enumeratePads ); - selectionTool->AddMenuItem( COMMON_ACTIONS::duplicate ); - selectionTool->AddMenuItem( COMMON_ACTIONS::createArray ); setTransitions(); @@ -491,175 +489,6 @@ int MODULE_TOOLS::PasteItems( TOOL_EVENT& aEvent ) return 0; } -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 - 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 ); - - // prevent other tools making undo points while the duplicate is going on - // so that if you cancel, you don't get a duplicate object hiding over - // the original - m_toolMgr->IncUndoInhibit(); - - std::vector old_items; - - for( int i = 0; i < selection.Size(); ++i ) - { - BOARD_ITEM* item = selection.Item( i ); - - if( item ) - old_items.push_back( item ); - } - - for( unsigned i = 0; i < old_items.size(); ++i ) - { - BOARD_ITEM* item = old_items[i]; - - // Unselect the item, so we won't pick it up again - // Do this first, so a single-item duplicate will correctly call - // SetCurItem and show the item properties - m_toolMgr->RunAction( COMMON_ACTIONS::unselectItem, true, item ); - - BOARD_ITEM* new_item = module->DuplicateAndAddItem( item, increment ); - - if( new_item ) - { - m_view->Add( new_item ); - - // Select the new item, so we can pick it up - m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, new_item ); - } - } - - m_frame->DisplayToolMsg( wxString::Format( _( "Duplicated %d item(s)" ), - (int) old_items.size() ) ); - - // pick up the selected item(s) and start moving - // this works well for "dropping" copies around - m_toolMgr->RunAction( COMMON_ACTIONS::editActivate, true ); - - // and re-enable undos - m_toolMgr->DecUndoInhibit(); - - setTransitions(); - - return 0; -} - - -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 ) { @@ -736,9 +565,6 @@ void MODULE_TOOLS::setTransitions() Go( &MODULE_TOOLS::EnumeratePads, COMMON_ACTIONS::enumeratePads.MakeEvent() ); Go( &MODULE_TOOLS::CopyItems, COMMON_ACTIONS::copyItems.MakeEvent() ); Go( &MODULE_TOOLS::PasteItems, COMMON_ACTIONS::pasteItems.MakeEvent() ); - Go( &MODULE_TOOLS::DuplicateItems, COMMON_ACTIONS::duplicate.MakeEvent() ); - 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 a10c41fbff..c8cb9785bc 100644 --- a/pcbnew/tools/module_tools.h +++ b/pcbnew/tools/module_tools.h @@ -77,9 +77,6 @@ public: */ int PasteItems( TOOL_EVENT& aEvent ); - - int DuplicateItems ( TOOL_EVENT& aEvent ); - /** * Function CreateArray * diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/pcb_editor_control.cpp index 827fd4430f..ae99a806e5 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/pcb_editor_control.cpp @@ -32,6 +32,8 @@ #include #include +#include + class ZONE_CONTEXT_MENU : public CONTEXT_MENU { @@ -68,6 +70,7 @@ bool PCB_EDITOR_CONTROL::Init() SELECTION_CONDITIONS::OnlyType( PCB_ZONE_AREA_T ) ); } + setTransitions(); return true;