diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index 23ecf68c09..2aa170f655 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -72,8 +72,9 @@ include_directories( # A corresponding ${basename}.svg file must exist in 'sources' dir below here. -# small icons (16x16) needed in listboxes +# small icons (16x16) needed in listboxes and dialog buttons set( BMAPS_SMALL + folder pinorient_right pinorient_left pinorient_up @@ -99,6 +100,10 @@ set( BMAPS_SMALL pintype_openemit pintype_noconnect refresh + small_down + small_plus + small_up + trash tree_nosel tree_sel ) diff --git a/bitmaps_png/cpp_16/folder.cpp b/bitmaps_png/cpp_16/folder.cpp new file mode 100644 index 0000000000..0246cfa1da --- /dev/null +++ b/bitmaps_png/cpp_16/folder.cpp @@ -0,0 +1,28 @@ + +/* 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, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, + 0x61, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64, + 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0xc4, 0x00, 0x00, 0x0e, + 0xc4, 0x01, 0x95, 0x2b, 0x0e, 0x1b, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, + 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63, + 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x00, 0x6a, 0x49, + 0x44, 0x41, 0x54, 0x38, 0x8d, 0xed, 0xd2, 0x31, 0x0a, 0x83, 0x40, 0x10, 0x85, 0xe1, 0x0f, 0x11, + 0x3b, 0x9b, 0x3d, 0xb3, 0xa4, 0x30, 0xb7, 0xc8, 0x49, 0xbc, 0x8d, 0x57, 0xc8, 0x5a, 0x68, 0x8a, + 0x2c, 0x11, 0xad, 0x76, 0x0d, 0x82, 0x85, 0x3f, 0x0c, 0x0c, 0x03, 0xef, 0x9f, 0xe6, 0x71, 0x15, + 0x1e, 0x88, 0x58, 0x30, 0x63, 0x40, 0x5b, 0x22, 0x88, 0x08, 0x69, 0xaf, 0xf0, 0x4a, 0xd2, 0x6c, + 0x96, 0xc2, 0x89, 0xe8, 0xf6, 0x82, 0x12, 0x02, 0xde, 0xff, 0x08, 0x7e, 0x99, 0xea, 0x40, 0x70, + 0xc3, 0x2d, 0x58, 0x05, 0x93, 0xb5, 0x48, 0x39, 0x04, 0xdf, 0x2e, 0xa8, 0xd3, 0xe1, 0x89, 0x11, + 0x4d, 0xa6, 0x60, 0x42, 0x5f, 0xf0, 0xf0, 0x44, 0x3e, 0x5a, 0x6d, 0x1d, 0x1a, 0x7b, 0xbc, 0xb7, + 0x37, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE folder_xpm[1] = {{ png, sizeof( png ), "folder_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_16/small_down.cpp b/bitmaps_png/cpp_16/small_down.cpp new file mode 100644 index 0000000000..1aa358c3d6 --- /dev/null +++ b/bitmaps_png/cpp_16/small_down.cpp @@ -0,0 +1,38 @@ + +/* 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, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, + 0x61, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64, + 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0xc4, 0x00, 0x00, 0x0e, + 0xc4, 0x01, 0x95, 0x2b, 0x0e, 0x1b, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, + 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63, + 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x00, 0x44, 0x74, + 0x45, 0x58, 0x74, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x00, 0x43, 0x43, 0x20, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x74, 0x74, 0x70, + 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x76, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x73, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2f, + 0x62, 0x79, 0x2f, 0x34, 0x2e, 0x30, 0x2f, 0x69, 0x10, 0xd7, 0x5d, 0x00, 0x00, 0x00, 0xb5, 0x49, + 0x44, 0x41, 0x54, 0x38, 0x8d, 0xbd, 0xd1, 0xb1, 0x6a, 0x02, 0x41, 0x18, 0x45, 0xe1, 0x4f, 0x3b, + 0x21, 0x6c, 0xa3, 0x85, 0x10, 0x52, 0x05, 0x6c, 0x6d, 0x6c, 0x03, 0x12, 0x10, 0x52, 0xa4, 0xb0, + 0xf1, 0x09, 0x7c, 0x9c, 0xc5, 0x47, 0xb2, 0xd1, 0x4e, 0x2b, 0x53, 0xd8, 0x08, 0x96, 0x96, 0x11, + 0x04, 0x43, 0x8a, 0xa0, 0x16, 0xbb, 0x0b, 0x29, 0xd6, 0x9d, 0x55, 0xd1, 0x5b, 0x0d, 0x33, 0xff, + 0x3d, 0x9c, 0x99, 0xe1, 0xce, 0x79, 0x41, 0xe7, 0x16, 0xc0, 0x08, 0xf3, 0xa2, 0x81, 0x6a, 0x00, + 0x50, 0x0d, 0xcd, 0x84, 0x00, 0xc7, 0xc0, 0x79, 0x10, 0x00, 0x95, 0x87, 0x1a, 0x3c, 0xe5, 0x00, + 0x4a, 0x1b, 0xbc, 0xe3, 0x1b, 0xfd, 0x02, 0x40, 0x13, 0x4b, 0xc4, 0x79, 0xb0, 0x1a, 0x26, 0xf8, + 0xc5, 0x47, 0xba, 0x17, 0x63, 0x91, 0xae, 0xeb, 0xf8, 0xc2, 0x16, 0xed, 0x73, 0x46, 0x91, 0xe4, + 0xdf, 0x7f, 0xd0, 0xfd, 0x07, 0x88, 0x30, 0xc3, 0x1e, 0x6f, 0x45, 0x57, 0x82, 0x46, 0xaa, 0xb9, + 0xc3, 0x18, 0x2b, 0x4c, 0x53, 0xb3, 0x5e, 0xa8, 0x9c, 0xe5, 0x19, 0x6b, 0xc9, 0x1b, 0x1c, 0xf1, + 0x87, 0x41, 0xd9, 0x72, 0x96, 0x57, 0x6c, 0x70, 0xc0, 0xf0, 0xd2, 0x72, 0x96, 0x16, 0x3e, 0xaf, + 0x2d, 0x97, 0xca, 0x09, 0x31, 0x9f, 0x20, 0x35, 0xde, 0x1e, 0xd4, 0xa5, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE small_down_xpm[1] = {{ png, sizeof( png ), "small_down_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_16/small_plus.cpp b/bitmaps_png/cpp_16/small_plus.cpp new file mode 100644 index 0000000000..42cf3ce56b --- /dev/null +++ b/bitmaps_png/cpp_16/small_plus.cpp @@ -0,0 +1,30 @@ + +/* 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, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, + 0x61, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64, + 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0xc4, 0x00, 0x00, 0x0e, + 0xc4, 0x01, 0x95, 0x2b, 0x0e, 0x1b, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, + 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63, + 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x00, 0x82, 0x49, + 0x44, 0x41, 0x54, 0x38, 0x8d, 0x63, 0x60, 0xa0, 0x10, 0x30, 0xe2, 0x91, 0xe3, 0x64, 0x60, 0x60, + 0x30, 0x84, 0xb2, 0xcf, 0x33, 0x30, 0x30, 0x7c, 0x27, 0xd5, 0x70, 0x6d, 0x06, 0x06, 0x86, 0xff, + 0x50, 0xac, 0x89, 0x4b, 0x11, 0x13, 0xa9, 0xa6, 0x0e, 0x3e, 0x03, 0x58, 0xa0, 0x34, 0x07, 0x03, + 0x03, 0x83, 0x38, 0x9a, 0x9c, 0x24, 0x12, 0x5b, 0x8a, 0x81, 0x81, 0xe1, 0x1b, 0x9a, 0xfc, 0x4b, + 0x06, 0x06, 0x86, 0x1f, 0x30, 0x8e, 0x07, 0x03, 0x22, 0xc0, 0x88, 0xc5, 0xae, 0x54, 0xf1, 0x02, + 0x2c, 0x1d, 0xf0, 0x30, 0x30, 0x30, 0x28, 0xa2, 0xc9, 0x29, 0x33, 0x30, 0x30, 0xac, 0x87, 0xb2, + 0xfd, 0x19, 0x18, 0x18, 0xee, 0xa3, 0xc9, 0xdf, 0x67, 0x60, 0x60, 0xf8, 0x82, 0xcf, 0xf0, 0x91, + 0x96, 0x0e, 0xb0, 0x81, 0x87, 0x0c, 0x0c, 0x0c, 0x9e, 0x50, 0xf6, 0x23, 0x4a, 0x2d, 0xc2, 0x09, + 0x00, 0x17, 0x21, 0x1c, 0x73, 0x44, 0x9f, 0x4a, 0x71, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, + 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE small_plus_xpm[1] = {{ png, sizeof( png ), "small_plus_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_16/small_up.cpp b/bitmaps_png/cpp_16/small_up.cpp new file mode 100644 index 0000000000..cde411c251 --- /dev/null +++ b/bitmaps_png/cpp_16/small_up.cpp @@ -0,0 +1,39 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, + 0x61, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64, + 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0xc4, 0x00, 0x00, 0x0e, + 0xc4, 0x01, 0x95, 0x2b, 0x0e, 0x1b, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, + 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63, + 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x00, 0x44, 0x74, + 0x45, 0x58, 0x74, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x00, 0x43, 0x43, 0x20, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x74, 0x74, 0x70, + 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x76, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x73, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2f, + 0x62, 0x79, 0x2f, 0x34, 0x2e, 0x30, 0x2f, 0x69, 0x10, 0xd7, 0x5d, 0x00, 0x00, 0x00, 0xcb, 0x49, + 0x44, 0x41, 0x54, 0x38, 0x8d, 0xb5, 0xd0, 0x31, 0x4b, 0x82, 0x41, 0x00, 0xc6, 0xf1, 0x9f, 0x19, + 0x2d, 0x0e, 0x4d, 0x49, 0x4b, 0x43, 0xa0, 0x4b, 0x6d, 0x41, 0xab, 0x93, 0x83, 0xf8, 0x09, 0xdc, + 0x5b, 0xfa, 0x2e, 0x4e, 0x7d, 0x0c, 0xbf, 0x40, 0xb3, 0x4b, 0x4b, 0x10, 0x14, 0x84, 0x08, 0x82, + 0x35, 0x08, 0x0e, 0x2e, 0x0e, 0x22, 0x14, 0x2f, 0xda, 0xd0, 0xbd, 0x70, 0xbc, 0xbc, 0xf9, 0x96, + 0xda, 0x03, 0x07, 0x77, 0xcf, 0xdd, 0xff, 0xcf, 0xdd, 0xf1, 0xcf, 0x39, 0xc5, 0xf5, 0xb6, 0xf0, + 0x09, 0x06, 0xf8, 0x44, 0xfb, 0xaf, 0xf0, 0x31, 0x9e, 0xb0, 0x0e, 0x63, 0x89, 0xc6, 0x6f, 0xe1, + 0x0a, 0x1e, 0xf0, 0x81, 0x47, 0xbc, 0xe3, 0x15, 0x73, 0x5c, 0x15, 0xc1, 0x47, 0xb8, 0x47, 0x82, + 0x0e, 0xba, 0x78, 0x41, 0x15, 0x43, 0xcc, 0x70, 0xf1, 0x13, 0x5c, 0x46, 0x0f, 0x2b, 0xdc, 0x84, + 0xae, 0x8b, 0xe7, 0x30, 0x3f, 0xc3, 0x1b, 0x26, 0x38, 0xcf, 0x13, 0x34, 0x03, 0x7c, 0x1b, 0x75, + 0xb1, 0x00, 0xea, 0x98, 0xe2, 0x2e, 0x2d, 0x0e, 0xa3, 0xcd, 0x3e, 0x6a, 0x18, 0x47, 0x5d, 0xc9, + 0xf7, 0x27, 0xa6, 0x19, 0x05, 0xc9, 0x2a, 0x4f, 0x90, 0x64, 0xe0, 0x54, 0x90, 0xcd, 0x22, 0x5e, + 0x1c, 0xe4, 0x1c, 0xc8, 0x0a, 0xd6, 0x9b, 0x0e, 0x14, 0x09, 0xec, 0x2a, 0xc8, 0x7b, 0xc2, 0x7e, + 0x6f, 0x50, 0x94, 0x4b, 0xb4, 0x76, 0x11, 0x14, 0xe6, 0x0b, 0xb0, 0x0c, 0x26, 0x7f, 0x3a, 0x29, + 0x55, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE small_up_xpm[1] = {{ png, sizeof( png ), "small_up_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_16/trash.cpp b/bitmaps_png/cpp_16/trash.cpp new file mode 100644 index 0000000000..5c0254e03d --- /dev/null +++ b/bitmaps_png/cpp_16/trash.cpp @@ -0,0 +1,58 @@ + +/* 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, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, + 0x61, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64, + 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0xc4, 0x00, 0x00, 0x0e, + 0xc4, 0x01, 0x95, 0x2b, 0x0e, 0x1b, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, + 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63, + 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x02, 0x40, 0x49, + 0x44, 0x41, 0x54, 0x38, 0x8d, 0xa5, 0x91, 0x31, 0x4b, 0x1b, 0x71, 0x18, 0xc6, 0x7f, 0xe7, 0x05, + 0xe3, 0x19, 0x72, 0x9a, 0x3b, 0x82, 0xa8, 0xd1, 0x18, 0xd0, 0x41, 0x83, 0x34, 0x42, 0x06, 0x67, + 0x21, 0x53, 0x4c, 0x9d, 0x02, 0xdd, 0xfc, 0x14, 0xd2, 0xa5, 0x9f, 0xa0, 0x0e, 0x42, 0x02, 0x05, + 0xbf, 0x81, 0x20, 0x38, 0x9b, 0xba, 0x85, 0x82, 0x1d, 0xaa, 0x4d, 0xd3, 0x9a, 0x2c, 0x36, 0xc4, + 0x72, 0x50, 0x53, 0x9a, 0x4b, 0xfc, 0xc7, 0x5e, 0x02, 0xe7, 0xf9, 0xef, 0x64, 0x48, 0x2a, 0x2d, + 0x14, 0xdf, 0xe9, 0xf9, 0x0d, 0x0f, 0x3c, 0xcf, 0xf3, 0xc2, 0x13, 0x4f, 0x49, 0x24, 0x12, 0x93, + 0xaa, 0xaa, 0x7e, 0x02, 0x82, 0xff, 0xe9, 0xfd, 0x09, 0xc4, 0x7d, 0x4b, 0x4b, 0x4b, 0x9d, 0xcb, + 0xcb, 0xcb, 0x37, 0x33, 0x33, 0x33, 0x2f, 0xe2, 0xf1, 0xf8, 0x77, 0x80, 0x5a, 0xad, 0x16, 0x9d, + 0x9a, 0x9a, 0xfa, 0x11, 0x08, 0x04, 0xba, 0x00, 0xcd, 0x66, 0x73, 0xb2, 0xd7, 0xeb, 0xf9, 0x67, + 0x67, 0x67, 0x1b, 0x00, 0x67, 0x67, 0x67, 0x91, 0x56, 0xab, 0x95, 0x3f, 0x3f, 0x3f, 0x77, 0x01, + 0xc8, 0x66, 0xb3, 0x6a, 0x36, 0x9b, 0xb5, 0x84, 0x10, 0x52, 0x08, 0x21, 0xf3, 0xf9, 0xbc, 0x2c, + 0x16, 0x8b, 0xf2, 0x81, 0x0f, 0x0e, 0x0e, 0xe4, 0xd1, 0xd1, 0x51, 0x9f, 0x37, 0x37, 0x37, 0xbf, + 0x3e, 0xc4, 0x18, 0x01, 0x38, 0x3c, 0x3c, 0xf4, 0x1c, 0xc7, 0x71, 0xa4, 0x94, 0x00, 0x18, 0x86, + 0x81, 0x6d, 0xdb, 0xfd, 0xac, 0xb6, 0x6d, 0x13, 0x0a, 0x85, 0x00, 0x68, 0xb7, 0xdb, 0x28, 0x8a, + 0x62, 0xf5, 0x37, 0x78, 0x10, 0xe9, 0x74, 0xfa, 0xad, 0x69, 0x9a, 0xa9, 0xd1, 0xd1, 0x51, 0xda, + 0xed, 0x36, 0xae, 0xeb, 0x12, 0x0e, 0x87, 0x01, 0xb0, 0x2c, 0x0b, 0xd3, 0x34, 0xd1, 0x34, 0x0d, + 0xd7, 0x75, 0xb9, 0xbe, 0xbe, 0x7e, 0x5d, 0x28, 0x14, 0x5e, 0x0e, 0x2d, 0xb2, 0xb1, 0xb1, 0xf1, + 0xea, 0xf8, 0xf8, 0x58, 0x0a, 0x21, 0xe4, 0xe9, 0xe9, 0xa9, 0xdc, 0xdb, 0xdb, 0xeb, 0x47, 0xde, + 0xd9, 0xd9, 0x91, 0x57, 0x57, 0x57, 0x52, 0x08, 0x21, 0xf7, 0xf7, 0xf7, 0x7f, 0x25, 0x93, 0xc9, + 0xe7, 0x43, 0x15, 0x00, 0x3a, 0x9d, 0xce, 0xfb, 0x6a, 0xb5, 0x2a, 0x00, 0x42, 0xa1, 0xd0, 0x50, + 0x85, 0x9b, 0x9b, 0x1b, 0x26, 0x26, 0x26, 0x00, 0xb8, 0xb8, 0xb8, 0x10, 0x77, 0x77, 0x77, 0xe5, + 0x47, 0x15, 0xd6, 0xd6, 0xd6, 0xc2, 0xcb, 0xcb, 0xcb, 0xd5, 0xe9, 0xe9, 0x69, 0xd3, 0xf3, 0x3c, + 0x2a, 0x95, 0x0a, 0xab, 0xab, 0xab, 0x00, 0x94, 0x4a, 0x25, 0x12, 0x89, 0x04, 0x00, 0xe5, 0x72, + 0xb9, 0x75, 0x72, 0x72, 0x62, 0x02, 0xf2, 0xd1, 0x63, 0xb7, 0xb6, 0xb6, 0xbe, 0xd5, 0xeb, 0x75, + 0x59, 0xaf, 0xd7, 0xe5, 0xf6, 0xf6, 0xb6, 0xfc, 0x53, 0xd7, 0x6a, 0x35, 0x99, 0x4e, 0xa7, 0xab, + 0x83, 0x9e, 0x91, 0x41, 0x70, 0x5d, 0xd7, 0x0e, 0x04, 0x02, 0x18, 0x86, 0x81, 0xcf, 0xe7, 0xc3, + 0x30, 0x0c, 0x74, 0x5d, 0x67, 0x6c, 0x6c, 0x0c, 0xc3, 0x30, 0xb8, 0xbd, 0xbd, 0x45, 0x51, 0x94, + 0x2f, 0x83, 0x1e, 0xdf, 0x20, 0x28, 0x8a, 0x52, 0xda, 0xdd, 0xdd, 0x7d, 0xa6, 0xeb, 0x3a, 0x96, + 0x65, 0x91, 0xcb, 0xe5, 0xe8, 0x76, 0xbb, 0x34, 0x1a, 0x0d, 0x72, 0xb9, 0x1c, 0xad, 0x56, 0x4b, + 0x0a, 0x21, 0xde, 0xfd, 0x35, 0x81, 0x6d, 0xdb, 0xc5, 0xf9, 0xf9, 0x79, 0x2f, 0x93, 0xc9, 0x30, + 0x37, 0x37, 0x47, 0x2a, 0x95, 0x62, 0x7d, 0x7d, 0x9d, 0x95, 0x95, 0x15, 0x32, 0x99, 0x0c, 0x7e, + 0xbf, 0x5f, 0x38, 0x8e, 0xf3, 0xe1, 0x5f, 0x15, 0x3e, 0x36, 0x1a, 0x0d, 0x3b, 0x16, 0x8b, 0x11, + 0x89, 0x44, 0x08, 0x06, 0x83, 0x68, 0x9a, 0xc6, 0xc2, 0xc2, 0x02, 0xb1, 0x58, 0x0c, 0xcb, 0xb2, + 0x1c, 0x55, 0x55, 0x3f, 0x0f, 0xa5, 0x1e, 0x84, 0xc5, 0xc5, 0x45, 0x7f, 0x34, 0x1a, 0xad, 0xe8, + 0xba, 0x3e, 0x22, 0x84, 0x08, 0x6a, 0x9a, 0xd6, 0xf3, 0x3c, 0xcf, 0x77, 0x7f, 0x7f, 0xaf, 0x8c, + 0x8f, 0x8f, 0x3b, 0x8e, 0xe3, 0x34, 0x0b, 0x85, 0x42, 0xf2, 0xd1, 0xfa, 0x4f, 0xb9, 0xdf, 0x1e, + 0xb0, 0x21, 0xd7, 0xd5, 0xc0, 0x37, 0xac, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE trash_xpm[1] = {{ png, sizeof( png ), "trash_xpm" }}; + +//EOF diff --git a/bitmaps_png/png_16/small_plus.png b/bitmaps_png/png_16/small_plus.png new file mode 100644 index 0000000000..bae64142f6 Binary files /dev/null and b/bitmaps_png/png_16/small_plus.png differ diff --git a/bitmaps_png/png_16/trash.png b/bitmaps_png/png_16/trash.png new file mode 100644 index 0000000000..1b1cf466e0 Binary files /dev/null and b/bitmaps_png/png_16/trash.png differ diff --git a/bitmaps_png/sources/folder.svg b/bitmaps_png/sources/folder.svg new file mode 100644 index 0000000000..3fd510d870 --- /dev/null +++ b/bitmaps_png/sources/folder.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/bitmaps_png/sources/small_down.svg b/bitmaps_png/sources/small_down.svg new file mode 100644 index 0000000000..4739dd565e --- /dev/null +++ b/bitmaps_png/sources/small_down.svg @@ -0,0 +1,103 @@ + + + +image/svg+xml + \ No newline at end of file diff --git a/bitmaps_png/sources/small_plus.svg b/bitmaps_png/sources/small_plus.svg new file mode 100644 index 0000000000..f9e68502d5 --- /dev/null +++ b/bitmaps_png/sources/small_plus.svg @@ -0,0 +1,129 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/small_up.svg b/bitmaps_png/sources/small_up.svg new file mode 100644 index 0000000000..23b7c00b2e --- /dev/null +++ b/bitmaps_png/sources/small_up.svg @@ -0,0 +1,103 @@ + + + +image/svg+xml + \ No newline at end of file diff --git a/bitmaps_png/sources/trash.svg b/bitmaps_png/sources/trash.svg new file mode 100644 index 0000000000..faa8357822 --- /dev/null +++ b/bitmaps_png/sources/trash.svg @@ -0,0 +1,555 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dialogs/wx_html_report_panel.cpp b/common/dialogs/wx_html_report_panel.cpp index 48e299326e..45741613df 100644 --- a/common/dialogs/wx_html_report_panel.cpp +++ b/common/dialogs/wx_html_report_panel.cpp @@ -131,12 +131,12 @@ void WX_HTML_REPORT_PANEL::scrollToBottom() } -const static wxSize BADGE_SIZE_DU( 9, 9 ); -const static int BADGE_FONT_SIZE = 9; +#define BADGE_SIZE 20 +#define BADGE_FONT_SIZE 10 static wxBitmap makeBadge( REPORTER::SEVERITY aStyle, int aCount, wxWindow* aWindow ) { - wxSize size( aWindow->ConvertDialogToPixels( BADGE_SIZE_DU ) ); + wxSize size( BADGE_SIZE, BADGE_SIZE ); wxBitmap bitmap( size ); wxBrush brush; wxMemoryDC badgeDC; @@ -155,6 +155,9 @@ static wxBitmap makeBadge( REPORTER::SEVERITY aStyle, int aCount, wxWindow* aWin badgeDC.SetBackground( brush ); badgeDC.Clear(); + if( aCount == 0 ) + return bitmap; + switch( aStyle ) { case REPORTER::RPT_ERROR: @@ -162,8 +165,8 @@ static wxBitmap makeBadge( REPORTER::SEVERITY aStyle, int aCount, wxWindow* aWin textColour = *wxWHITE; break; case REPORTER::RPT_WARNING: - badgeColour = *wxYELLOW; - textColour = *wxBLACK; + badgeColour = wxColour( 235, 120, 80 ); // Orange + textColour = *wxWHITE; break; case REPORTER::RPT_ACTION: badgeColour = *wxGREEN; @@ -182,13 +185,14 @@ static wxBitmap makeBadge( REPORTER::SEVERITY aStyle, int aCount, wxWindow* aWin badgeDC.SetPen( wxPen( badgeColour, 0 ) ); badgeDC.DrawCircle( size.x / 2 - 1, size.y / 2, ( std::max( size.x, size.y ) / 2 ) - 1 ); - wxFont font( BADGE_FONT_SIZE, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD ); - wxString text = wxString::Format( wxT( "%d" ), aCount ); - wxSize textExtent = badgeDC.GetTextExtent( text ); - + wxFont font( fontSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD ); badgeDC.SetFont( font ); + + wxString text = wxString::Format( wxT( "%d" ), aCount ); + wxSize textExtent = badgeDC.GetTextExtent( text ); + badgeDC.SetTextForeground( textColour ); - badgeDC.DrawText( text, size.x / 2 - textExtent.x / 2, size.y / 2 - textExtent.y / 2 + 2 ); + badgeDC.DrawText( text, size.x / 2 - textExtent.x / 2 - 1, size.y / 2 - textExtent.y / 2 ); return bitmap; } @@ -197,24 +201,10 @@ static wxBitmap makeBadge( REPORTER::SEVERITY aStyle, int aCount, wxWindow* aWin void WX_HTML_REPORT_PANEL::updateBadges() { int count = Count( REPORTER::RPT_ERROR ); - - if( count > 0 ) - { - m_errorsBadge->SetBitmap( makeBadge( REPORTER::RPT_ERROR, count, m_errorsBadge ) ); - m_errorsBadge->Show( true ); - } - else - m_errorsBadge->Show( false ); + m_errorsBadge->SetBitmap( makeBadge( REPORTER::RPT_ERROR, count, m_errorsBadge ) ); count = Count( REPORTER::RPT_WARNING ); - - if( count > 0 ) - { - m_warningsBadge->SetBitmap( makeBadge( REPORTER::RPT_WARNING, count, m_warningsBadge ) ); - m_warningsBadge->Show( true ); - } - else - m_warningsBadge->Show( false ); + m_warningsBadge->SetBitmap( makeBadge( REPORTER::RPT_WARNING, count, m_warningsBadge ) ); } diff --git a/common/dialogs/wx_html_report_panel_base.cpp b/common/dialogs/wx_html_report_panel_base.cpp index a13a9e6f9b..565ed54f3e 100644 --- a/common/dialogs/wx_html_report_panel_base.cpp +++ b/common/dialogs/wx_html_report_panel_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 17 2016) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO "NOT" EDIT THIS FILE! +// PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "wx_html_report_panel_base.h" @@ -11,7 +11,7 @@ WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) { - m_box = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Output messages:") ), wxVERTICAL ); + m_box = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Output Messages") ), wxVERTICAL ); m_box->SetMinSize( wxSize( -1,130 ) ); m_fgSizer = new wxFlexGridSizer( 2, 1, 0, 0 ); @@ -25,43 +25,53 @@ WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindow m_fgSizer->Add( m_htmlView, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 2 ); - wxFlexGridSizer* fgSizer3; - fgSizer3 = new wxFlexGridSizer( 1, 9, 0, 0 ); - fgSizer3->AddGrowableCol( 8 ); - fgSizer3->SetFlexibleDirection( wxBOTH ); - fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + wxBoxSizer* bSizer1; + bSizer1 = new wxBoxSizer( wxHORIZONTAL ); m_staticText3 = new wxStaticText( m_box->GetStaticBox(), wxID_ANY, _("Show:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText3->Wrap( -1 ); - fgSizer3->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer1->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_checkBoxShowAll = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("All"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkBoxShowAll->SetValue(true); - fgSizer3->Add( m_checkBoxShowAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer1->Add( m_checkBoxShowAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer1->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); m_checkBoxShowErrors = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("Errors"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer3->Add( m_checkBoxShowErrors, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer1->Add( m_checkBoxShowErrors, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_errorsBadge = new wxStaticBitmap( m_box->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer3->Add( m_errorsBadge, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_errorsBadge->SetMinSize( wxSize( 20,20 ) ); + + bSizer1->Add( m_errorsBadge, 0, wxBOTTOM|wxRIGHT|wxTOP, 4 ); m_checkBoxShowWarnings = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("Warnings"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer3->Add( m_checkBoxShowWarnings, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer1->Add( m_checkBoxShowWarnings, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_warningsBadge = new wxStaticBitmap( m_box->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer3->Add( m_warningsBadge, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_warningsBadge->SetMinSize( wxSize( 20,20 ) ); + + bSizer1->Add( m_warningsBadge, 0, wxBOTTOM|wxRIGHT|wxTOP, 4 ); m_checkBoxShowInfos = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("Infos"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer3->Add( m_checkBoxShowInfos, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer1->Add( m_checkBoxShowInfos, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer1->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); m_checkBoxShowActions = new wxCheckBox( m_box->GetStaticBox(), wxID_ANY, _("Actions"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer3->Add( m_checkBoxShowActions, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_btnSaveReportToFile = new wxButton( m_box->GetStaticBox(), wxID_ANY, _("Save Report File"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer3->Add( m_btnSaveReportToFile, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer1->Add( m_checkBoxShowActions, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - m_fgSizer->Add( fgSizer3, 1, wxEXPAND, 5 ); + bSizer1->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + + m_btnSaveReportToFile = new wxButton( m_box->GetStaticBox(), wxID_ANY, _("Save..."), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer1->Add( m_btnSaveReportToFile, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + m_fgSizer->Add( bSizer1, 1, wxEXPAND, 5 ); m_box->Add( m_fgSizer, 1, wxEXPAND, 5 ); diff --git a/common/dialogs/wx_html_report_panel_base.fbp b/common/dialogs/wx_html_report_panel_base.fbp index 75eea6a5d7..d2cc160661 100644 --- a/common/dialogs/wx_html_report_panel_base.fbp +++ b/common/dialogs/wx_html_report_panel_base.fbp @@ -80,7 +80,7 @@ wxID_ANY - Output messages: + Output Messages -1,130 m_box wxVERTICAL @@ -191,21 +191,14 @@ 5 wxEXPAND 1 - - 9 - wxBOTH - 8 - - 0 + - fgSizer3 - wxFLEX_GROWMODE_SPECIFIED + bSizer1 + wxHORIZONTAL none - 1 - 0 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -374,9 +367,19 @@ + + 10 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 0 + protected + 0 + + 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -463,8 +466,8 @@ - 5 - wxALIGN_CENTER_VERTICAL|wxALL + 4 + wxBOTTOM|wxRIGHT|wxTOP 0 1 @@ -500,7 +503,7 @@ 0 - + 20,20 1 m_errorsBadge 1 @@ -545,7 +548,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -632,8 +635,8 @@ - 5 - wxALIGN_CENTER_VERTICAL|wxALL + 4 + wxBOTTOM|wxRIGHT|wxTOP 0 1 @@ -669,7 +672,7 @@ 0 - + 20,20 1 m_warningsBadge 1 @@ -800,6 +803,16 @@ + + 10 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 0 + protected + 0 + + 5 wxALIGN_CENTER_VERTICAL|wxALL @@ -888,6 +901,16 @@ + + 10 + wxEXPAND|wxRIGHT|wxLEFT + 1 + + 0 + protected + 0 + + 5 wxALIGN_CENTER_VERTICAL|wxALL @@ -921,7 +944,7 @@ 0 0 wxID_ANY - Save Report File + Save... 0 -1,-1 diff --git a/common/dialogs/wx_html_report_panel_base.h b/common/dialogs/wx_html_report_panel_base.h index e9080b6bd5..ec2832ec15 100644 --- a/common/dialogs/wx_html_report_panel_base.h +++ b/common/dialogs/wx_html_report_panel_base.h @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 17 2016) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO "NOT" EDIT THIS FILE! +// PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __WX_HTML_REPORT_PANEL_BASE_H__ diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp index cf68f46d03..775d3f01ac 100644 --- a/eeschema/dialogs/dialog_plot_schematic.cpp +++ b/eeschema/dialogs/dialog_plot_schematic.cpp @@ -70,6 +70,16 @@ DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC( SCH_EDIT_FRAME* parent ) : m_configChanged = false; m_config = Kiface().KifaceSettings(); + m_browseButton->SetBitmap( KiBitmap( folder_xpm ) ); + + // We use a sdbSizer to get platform-dependent ordering of the action buttons, but + // that requires us to correct the button labels here. + m_sdbSizer1OK->SetLabel( _( "Plot All Pages" ) ); + m_sdbSizer1Apply->SetLabel( _( "Plot Current Page" ) ); + m_sdbSizer1Cancel->SetLabel( _( "Close" ) ); + m_sdbSizer1->Layout(); + + m_sdbSizer1OK->SetDefault(); initDlg(); // Now all widgets have the size fixed, call FinishDialogSettings @@ -80,11 +90,6 @@ DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC( SCH_EDIT_FRAME* parent ) : // Initialize the dialog options: void DIALOG_PLOT_SCHEMATIC::initDlg() { - m_browseButton->SetBitmap( KiBitmap( browse_files_xpm ) ); - - // Set paper size option - m_PaperSizeOption->SetSelection( m_pageSizeSelect ); - // Set color or B&W plot option bool tmp; m_config->Read( PLOT_MODECOLOR_KEY, &tmp, true ); @@ -99,7 +104,6 @@ void DIALOG_PLOT_SCHEMATIC::initDlg() SetPlotOriginCenter( tmp ); m_config->Read( PLOT_HPGL_PAPERSIZE_KEY, &m_HPGLPaperSizeSelect, 0 ); - m_HPGLPaperSizeOption->SetSelection( m_HPGLPaperSizeSelect ); // HPGL Pen Size is stored in mm in config m_config->Read( PLOT_HPGL_PEN_SIZE_KEY, &m_HPGLPenSize, 0.5 ); @@ -112,36 +116,19 @@ void DIALOG_PLOT_SCHEMATIC::initDlg() switch( plotfmt ) { default: - case PLOT_FORMAT_POST: - m_plotFormatOpt->SetSelection( 0 ); - break; - - case PLOT_FORMAT_PDF: - m_plotFormatOpt->SetSelection( 1 ); - break; - - case PLOT_FORMAT_SVG: - m_plotFormatOpt->SetSelection( 2 ); - break; - - case PLOT_FORMAT_DXF: - m_plotFormatOpt->SetSelection( 3 ); - break; - - case PLOT_FORMAT_HPGL: - m_plotFormatOpt->SetSelection( 4 ); - break; + case PLOT_FORMAT_POST: m_plotFormatOpt->SetSelection( 0 ); break; + case PLOT_FORMAT_PDF: m_plotFormatOpt->SetSelection( 1 ); break; + case PLOT_FORMAT_SVG: m_plotFormatOpt->SetSelection( 2 ); break; + case PLOT_FORMAT_DXF: m_plotFormatOpt->SetSelection( 3 ); break; + case PLOT_FORMAT_HPGL: m_plotFormatOpt->SetSelection( 4 ); break; } // Set the default line width (pen width which should be used for // items that do not have a pen size defined (like frame ref) - AddUnitSymbol( *m_defaultLineWidthTitle, g_UserUnit ); PutValueInLocalUnits( *m_DefaultLineSizeCtrl, GetDefaultLineThickness() ); // Initialize HPGL specific widgets - AddUnitSymbol( *m_penHPLGWidthTitle, g_UserUnit ); PutValueInLocalUnits( *m_penHPGLWidthCtrl, m_HPGLPenSize ); - m_HPGLPaperSizeOption->SetSelection( m_HPGLPaperSizeSelect ); // Plot directory wxString path = m_parent->GetPlotDirectoryName(); @@ -149,10 +136,6 @@ void DIALOG_PLOT_SCHEMATIC::initDlg() path.Replace( '/', '\\' ); #endif m_outputDirectoryName->SetValue( path ); - - // Hide/show widgets that are not always displayed: - wxCommandEvent cmd_event; - OnPlotFormatSelection( cmd_event ); } @@ -179,8 +162,7 @@ void DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked( wxCommandEvent& even fn = Prj().AbsolutePath( g_RootSheet->GetFileName() ); wxString defaultPath = fn.GetPathWithSep(); wxString msg; - msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ), - GetChars( defaultPath ) ); + msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ), GetChars( defaultPath ) ); wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ), wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT ); @@ -211,9 +193,56 @@ PlotFormat DIALOG_PLOT_SCHEMATIC::GetPlotFileFormat() } -void DIALOG_PLOT_SCHEMATIC::OnButtonCancelClick( wxCommandEvent& event ) +void DIALOG_PLOT_SCHEMATIC::OnPageSizeSelected( wxCommandEvent& event ) { - EndModal( wxID_CANCEL ); + if( GetPlotFileFormat() == PLOT_FORMAT_HPGL ) + m_HPGLPaperSizeSelect = m_paperSizeOption->GetSelection(); + else + m_pageSizeSelect = m_paperSizeOption->GetSelection(); +} + + +void DIALOG_PLOT_SCHEMATIC::OnUpdateUI( wxUpdateUIEvent& event ) +{ + PlotFormat fmt = GetPlotFileFormat(); + + wxArrayString paperSizes; + paperSizes.push_back( _( "Schematic size" ) ); + + int selection; + + if( fmt == PLOT_FORMAT_HPGL ) + { + paperSizes.push_back( _( "A4" ) ); + paperSizes.push_back( _( "A3" ) ); + paperSizes.push_back( _( "A2" ) ); + paperSizes.push_back( _( "A1" ) ); + paperSizes.push_back( _( "A0" ) ); + paperSizes.push_back( _( "A" ) ); + paperSizes.push_back( _( "B" ) ); + paperSizes.push_back( _( "C" ) ); + paperSizes.push_back( _( "D" ) ); + paperSizes.push_back( _( "E" ) ); + + selection = m_HPGLPaperSizeSelect; + } + else + { + paperSizes.push_back( _( "A4" ) ); + paperSizes.push_back( _( "A" ) ); + + selection = m_pageSizeSelect; + } + + m_paperSizeOption->Set( paperSizes ); + m_paperSizeOption->SetSelection( selection ); + + m_DefaultLineSizeCtrl->Enable( fmt == PLOT_FORMAT_POST + || fmt == PLOT_FORMAT_PDF + || fmt == PLOT_FORMAT_SVG ); + + m_plotOriginOpt->Enable( fmt == PLOT_FORMAT_HPGL ); + m_penHPGLWidthCtrl->Enable( fmt == PLOT_FORMAT_HPGL ); } @@ -223,13 +252,11 @@ void DIALOG_PLOT_SCHEMATIC::getPlotOptions() m_config->Write( PLOT_FRAME_REFERENCE_KEY, getPlotFrameRef() ); m_config->Write( PLOT_FORMAT_KEY, (long) GetPlotFileFormat() ); m_config->Write( PLOT_HPGL_ORIGIN_KEY, GetPlotOriginCenter() ); - m_HPGLPaperSizeSelect = m_HPGLPaperSizeOption->GetSelection(); m_config->Write( PLOT_HPGL_PAPERSIZE_KEY, m_HPGLPaperSizeSelect ); // HPGL Pen Size is stored in mm in config m_config->Write( PLOT_HPGL_PEN_SIZE_KEY, m_HPGLPenSize/IU_PER_MM ); - m_pageSizeSelect = m_PaperSizeOption->GetSelection(); SetDefaultLineThickness( ValueFromTextCtrl( *m_DefaultLineSizeCtrl ) ); // Plot directory @@ -243,59 +270,13 @@ void DIALOG_PLOT_SCHEMATIC::getPlotOptions() } -void DIALOG_PLOT_SCHEMATIC::OnPlotFormatSelection( wxCommandEvent& event ) -{ - - switch( GetPlotFileFormat() ) - { - default: - case PLOT_FORMAT_POST: - m_paperOptionsSizer->Hide( m_paperHPGLSizer ); - m_paperOptionsSizer->Show( m_PaperSizeOption ); - m_PaperSizeOption->Enable( true ); - m_DefaultLineSizeCtrl->Enable( true ); - break; - - case PLOT_FORMAT_PDF: - m_paperOptionsSizer->Hide( m_paperHPGLSizer ); - m_paperOptionsSizer->Show(m_PaperSizeOption); - m_PaperSizeOption->Enable( true ); - m_DefaultLineSizeCtrl->Enable( true ); - break; - - case PLOT_FORMAT_SVG: - m_paperOptionsSizer->Hide( m_paperHPGLSizer ); - m_paperOptionsSizer->Show(m_PaperSizeOption); - m_PaperSizeOption->Enable( false ); - m_DefaultLineSizeCtrl->Enable( true ); - break; - - case PLOT_FORMAT_DXF: - m_paperOptionsSizer->Hide( m_paperHPGLSizer ); - m_paperOptionsSizer->Show(m_PaperSizeOption); - m_PaperSizeOption->Enable( false ); - m_DefaultLineSizeCtrl->Enable( false ); - break; - - case PLOT_FORMAT_HPGL: - m_paperOptionsSizer->Show( m_paperHPGLSizer ); - m_paperOptionsSizer->Hide(m_PaperSizeOption); - m_DefaultLineSizeCtrl->Enable( false ); - break; - - } - - GetSizer()->SetSizeHints( this ); -} - - -void DIALOG_PLOT_SCHEMATIC::OnButtonPlotCurrentClick( wxCommandEvent& event ) +void DIALOG_PLOT_SCHEMATIC::OnPlotCurrent( wxCommandEvent& event ) { PlotSchematic( false ); } -void DIALOG_PLOT_SCHEMATIC::OnButtonPlotAllClick( wxCommandEvent& event ) +void DIALOG_PLOT_SCHEMATIC::OnPlotAll( wxCommandEvent& event ) { PlotSchematic( true ); } @@ -307,28 +288,12 @@ void DIALOG_PLOT_SCHEMATIC::PlotSchematic( bool aPlotAll ) switch( GetPlotFileFormat() ) { - case PLOT_FORMAT_HPGL: - createHPGLFile( aPlotAll, getPlotFrameRef() ); - break; - - case PLOT_FORMAT_DXF: - CreateDXFFile( aPlotAll, getPlotFrameRef() ); - break; - - case PLOT_FORMAT_PDF: - createPDFFile( aPlotAll, getPlotFrameRef() ); - break; - - case PLOT_FORMAT_SVG: - createSVGFile( aPlotAll, getPlotFrameRef() ); - break; - - case PLOT_FORMAT_POST: - // Fall through. Default to Postscript. default: - createPSFile( aPlotAll, getPlotFrameRef() ); - break; - + case PLOT_FORMAT_POST: createPSFile( aPlotAll, getPlotFrameRef() ); break; + case PLOT_FORMAT_DXF: CreateDXFFile( aPlotAll, getPlotFrameRef() ); break; + case PLOT_FORMAT_PDF: createPDFFile( aPlotAll, getPlotFrameRef() ); break; + case PLOT_FORMAT_SVG: createSVGFile( aPlotAll, getPlotFrameRef() ); break; + case PLOT_FORMAT_HPGL: createHPGLFile( aPlotAll, getPlotFrameRef() ); break; } } diff --git a/eeschema/dialogs/dialog_plot_schematic.h b/eeschema/dialogs/dialog_plot_schematic.h index 353f950558..5dd7552218 100644 --- a/eeschema/dialogs/dialog_plot_schematic.h +++ b/eeschema/dialogs/dialog_plot_schematic.h @@ -63,10 +63,10 @@ public: // and therefore should be saved private: - void OnPlotFormatSelection( wxCommandEvent& event ) override; - void OnButtonPlotCurrentClick( wxCommandEvent& event ) override; - void OnButtonPlotAllClick( wxCommandEvent& event ) override; - void OnButtonCancelClick( wxCommandEvent& event ) override; + void OnPageSizeSelected( wxCommandEvent& event ) override; + void OnPlotCurrent( wxCommandEvent& event ) override; + void OnPlotAll( wxCommandEvent& event ) override; + void OnUpdateUI( wxUpdateUIEvent& event ) override; void initDlg(); diff --git a/eeschema/dialogs/dialog_plot_schematic_base.cpp b/eeschema/dialogs/dialog_plot_schematic_base.cpp index 8c60ddedf4..44063f7755 100644 --- a/eeschema/dialogs/dialog_plot_schematic_base.cpp +++ b/eeschema/dialogs/dialog_plot_schematic_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -31,108 +31,108 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind bSizerDir->Add( m_outputDirectoryName, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 4 ); m_browseButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + m_browseButton->SetMinSize( wxSize( 30,28 ) ); + bSizerDir->Add( m_browseButton, 0, wxRIGHT, 5 ); - bMainSizer->Add( bSizerDir, 0, wxALL|wxEXPAND, 5 ); + bMainSizer->Add( bSizerDir, 0, wxALL|wxEXPAND, 7 ); m_optionsSizer = new wxBoxSizer( wxHORIZONTAL ); wxString m_plotFormatOptChoices[] = { _("Postscript"), _("PDF"), _("SVG"), _("DXF"), _("HPGL") }; int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString ); - m_plotFormatOpt = new wxRadioBox( this, wxID_ANY, _("Output Format:"), wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 1, wxRA_SPECIFY_COLS ); + m_plotFormatOpt = new wxRadioBox( this, wxID_ANY, _("Output Format"), wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 1, wxRA_SPECIFY_COLS ); m_plotFormatOpt->SetSelection( 2 ); - m_optionsSizer->Add( m_plotFormatOpt, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); + m_optionsSizer->Add( m_plotFormatOpt, 0, wxALIGN_TOP|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - m_paperOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Paper Options:") ), wxVERTICAL ); + wxStaticBoxSizer* sbOptions; + sbOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); - wxString m_PaperSizeOptionChoices[] = { _("Schematic size"), _("A4"), _("A") }; - int m_PaperSizeOptionNChoices = sizeof( m_PaperSizeOptionChoices ) / sizeof( wxString ); - m_PaperSizeOption = new wxRadioBox( m_paperOptionsSizer->GetStaticBox(), wxID_ANY, _("Page Size:"), wxDefaultPosition, wxDefaultSize, m_PaperSizeOptionNChoices, m_PaperSizeOptionChoices, 1, wxRA_SPECIFY_COLS ); - m_PaperSizeOption->SetSelection( 1 ); - m_paperOptionsSizer->Add( m_PaperSizeOption, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 ); + wxGridBagSizer* gbSizer1; + gbSizer1 = new wxGridBagSizer( 0, 0 ); + gbSizer1->SetFlexibleDirection( wxBOTH ); + gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_paperHPGLSizer = new wxStaticBoxSizer( new wxStaticBox( m_paperOptionsSizer->GetStaticBox(), wxID_ANY, _("HPGL Options:") ), wxVERTICAL ); - - m_staticText4 = new wxStaticText( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, _("Page size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText4 = new wxStaticText( sbOptions->GetStaticBox(), wxID_ANY, _("Page size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText4->Wrap( -1 ); - m_paperHPGLSizer->Add( m_staticText4, 0, wxLEFT|wxRIGHT, 5 ); + gbSizer1->Add( m_staticText4, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - wxString m_HPGLPaperSizeOptionChoices[] = { _("Schematic size"), _("A4"), _("A3"), _("A2"), _("A1"), _("A0"), _("A"), _("B"), _("C"), _("D"), _("E") }; - int m_HPGLPaperSizeOptionNChoices = sizeof( m_HPGLPaperSizeOptionChoices ) / sizeof( wxString ); - m_HPGLPaperSizeOption = new wxChoice( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_HPGLPaperSizeOptionNChoices, m_HPGLPaperSizeOptionChoices, 0 ); - m_HPGLPaperSizeOption->SetSelection( 0 ); - m_paperHPGLSizer->Add( m_HPGLPaperSizeOption, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + wxString m_paperSizeOptionChoices[] = { _("Schematic size"), _("A4"), _("A") }; + int m_paperSizeOptionNChoices = sizeof( m_paperSizeOptionChoices ) / sizeof( wxString ); + m_paperSizeOption = new wxChoice( sbOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_paperSizeOptionNChoices, m_paperSizeOptionChoices, 0 ); + m_paperSizeOption->SetSelection( 0 ); + gbSizer1->Add( m_paperSizeOption, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxRIGHT|wxLEFT, 5 ); - wxString m_plotOriginOptChoices[] = { _("Bottom left"), _("Center on page") }; - int m_plotOriginOptNChoices = sizeof( m_plotOriginOptChoices ) / sizeof( wxString ); - m_plotOriginOpt = new wxRadioBox( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, _("Align:"), wxDefaultPosition, wxDefaultSize, m_plotOriginOptNChoices, m_plotOriginOptChoices, 1, wxRA_SPECIFY_COLS ); - m_plotOriginOpt->SetSelection( 0 ); - m_paperHPGLSizer->Add( m_plotOriginOpt, 0, wxBOTTOM|wxTOP, 5 ); - - m_penHPLGWidthTitle = new wxStaticText( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, _("Pen width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_penHPLGWidthTitle->Wrap( -1 ); - m_paperHPGLSizer->Add( m_penHPLGWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_penHPGLWidthCtrl = new wxTextCtrl( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_paperHPGLSizer->Add( m_penHPGLWidthCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - - m_paperOptionsSizer->Add( m_paperHPGLSizer, 1, wxEXPAND, 5 ); - - - m_optionsSizer->Add( m_paperOptionsSizer, 0, wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizerPlotFormat; - sbSizerPlotFormat = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("General Options:") ), wxVERTICAL ); - - m_defaultLineWidthTitle = new wxStaticText( sbSizerPlotFormat->GetStaticBox(), wxID_ANY, _("Default line thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_defaultLineWidthTitle->Wrap( -1 ); - sbSizerPlotFormat->Add( m_defaultLineWidthTitle, 0, wxLEFT|wxRIGHT, 5 ); - - m_DefaultLineSizeCtrl = new wxTextCtrl( sbSizerPlotFormat->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_DefaultLineSizeCtrl->SetToolTip( _("Selection of the default pen thickness used to draw items, when their thickness is set to 0.") ); - - sbSizerPlotFormat->Add( m_DefaultLineSizeCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") }; - int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString ); - m_ModeColorOption = new wxRadioBox( sbSizerPlotFormat->GetStaticBox(), wxID_ANY, _("Output Mode:"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS ); - m_ModeColorOption->SetSelection( 1 ); - m_ModeColorOption->SetToolTip( _("Choose if you want to draw the sheet like it appears on screen,\nor in black and white mode, better to print it when using black and white printers") ); - - sbSizerPlotFormat->Add( m_ModeColorOption, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 ); - - m_PlotFrameRefOpt = new wxCheckBox( sbSizerPlotFormat->GetStaticBox(), wxID_ANY, _("Plot border and title block"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PlotFrameRefOpt = new wxCheckBox( sbOptions->GetStaticBox(), wxID_ANY, _("Plot border and title block"), wxDefaultPosition, wxDefaultSize, 0 ); m_PlotFrameRefOpt->SetValue(true); m_PlotFrameRefOpt->SetToolTip( _("Print the frame references.") ); - sbSizerPlotFormat->Add( m_PlotFrameRefOpt, 0, wxALL, 5 ); + gbSizer1->Add( m_PlotFrameRefOpt, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), wxALL, 5 ); + + wxStaticText* bOutputModeLabel; + bOutputModeLabel = new wxStaticText( sbOptions->GetStaticBox(), wxID_ANY, _("Output mode:"), wxDefaultPosition, wxDefaultSize, 0 ); + bOutputModeLabel->Wrap( -1 ); + gbSizer1->Add( bOutputModeLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and White") }; + int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString ); + m_ModeColorOption = new wxChoice( sbOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 0 ); + m_ModeColorOption->SetSelection( 0 ); + gbSizer1->Add( m_ModeColorOption, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_defaultLineWidthTitle = new wxStaticText( sbOptions->GetStaticBox(), wxID_ANY, _("Default line thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_defaultLineWidthTitle->Wrap( -1 ); + gbSizer1->Add( m_defaultLineWidthTitle, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_DefaultLineSizeCtrl = new wxTextCtrl( sbOptions->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_DefaultLineSizeCtrl->SetToolTip( _("Selection of the default pen thickness used to draw items, when their thickness is set to 0.") ); + + gbSizer1->Add( m_DefaultLineSizeCtrl, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxRIGHT|wxLEFT, 5 ); - m_optionsSizer->Add( sbSizerPlotFormat, 0, wxEXPAND|wxLEFT, 5 ); + gbSizer1->AddGrowableCol( 1 ); - m_ButtonsSizer = new wxBoxSizer( wxVERTICAL ); + sbOptions->Add( gbSizer1, 1, wxEXPAND, 5 ); - m_ButtonsSizer->Add( 0, 0, 1, wxALL|wxEXPAND, 5 ); + m_optionsSizer->Add( sbOptions, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - m_buttonPlotCurrent = new wxButton( this, wxID_PRINT_CURRENT, _("Plot Current Page"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonPlotCurrent->SetDefault(); - m_ButtonsSizer->Add( m_buttonPlotCurrent, 0, wxALL|wxEXPAND, 5 ); + m_HPGLOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options") ), wxVERTICAL ); - m_buttonPlotAll = new wxButton( this, wxID_PRINT_ALL, _("Plot All Pages"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonPlotAll->SetDefault(); - m_ButtonsSizer->Add( m_buttonPlotAll, 0, wxALL|wxEXPAND, 5 ); + wxGridBagSizer* gbSizer2; + gbSizer2 = new wxGridBagSizer( 0, 0 ); + gbSizer2->SetFlexibleDirection( wxBOTH ); + gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxEXPAND, 5 ); + wxStaticText* sPositionLabel; + sPositionLabel = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Position:"), wxDefaultPosition, wxDefaultSize, 0 ); + sPositionLabel->Wrap( -1 ); + gbSizer2->Add( sPositionLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + + wxString m_plotOriginOptChoices[] = { _("Bottom left"), _("Center on page") }; + int m_plotOriginOptNChoices = sizeof( m_plotOriginOptChoices ) / sizeof( wxString ); + m_plotOriginOpt = new wxChoice( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotOriginOptNChoices, m_plotOriginOptChoices, 0 ); + m_plotOriginOpt->SetSelection( 0 ); + gbSizer2->Add( m_plotOriginOpt, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_penHPLGWidthTitle = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_penHPLGWidthTitle->Wrap( -1 ); + gbSizer2->Add( m_penHPLGWidthTitle, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + + m_penHPGLWidthCtrl = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer2->Add( m_penHPGLWidthCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_optionsSizer->Add( m_ButtonsSizer, 0, 0, 5 ); + gbSizer2->AddGrowableCol( 1 ); + + m_HPGLOptionsSizer->Add( gbSizer2, 1, wxEXPAND, 5 ); - bMainSizer->Add( m_optionsSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + m_optionsSizer->Add( m_HPGLOptionsSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + + bMainSizer->Add( m_optionsSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizerMsgPanel; bSizerMsgPanel = new wxBoxSizer( wxVERTICAL ); @@ -143,7 +143,18 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind bSizerMsgPanel->Add( m_MessagesBox, 1, wxEXPAND | wxALL, 5 ); - bMainSizer->Add( bSizerMsgPanel, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + bMainSizer->Add( bSizerMsgPanel, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Apply = new wxButton( this, wxID_APPLY ); + m_sdbSizer1->AddButton( m_sdbSizer1Apply ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + + bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bMainSizer ); @@ -152,23 +163,23 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnCloseWindow ) ); + this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnUpdateUI ) ); m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); m_plotFormatOpt->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnPlotFormatSelection ), NULL, this ); - m_HPGLPaperSizeOption->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnHPGLPageSelected ), NULL, this ); - m_buttonPlotCurrent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnButtonPlotCurrentClick ), NULL, this ); - m_buttonPlotAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnButtonPlotAllClick ), NULL, this ); - m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnButtonCancelClick ), NULL, this ); + m_paperSizeOption->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnPageSizeSelected ), NULL, this ); + m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnPlotCurrent ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnPlotAll ), NULL, this ); } DIALOG_PLOT_SCHEMATIC_BASE::~DIALOG_PLOT_SCHEMATIC_BASE() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnCloseWindow ) ); + this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnUpdateUI ) ); m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); m_plotFormatOpt->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnPlotFormatSelection ), NULL, this ); - m_HPGLPaperSizeOption->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnHPGLPageSelected ), NULL, this ); - m_buttonPlotCurrent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnButtonPlotCurrentClick ), NULL, this ); - m_buttonPlotAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnButtonPlotAllClick ), NULL, this ); - m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnButtonCancelClick ), NULL, this ); + m_paperSizeOption->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnPageSizeSelected ), NULL, this ); + m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnPlotCurrent ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_BASE::OnPlotAll ), NULL, this ); } diff --git a/eeschema/dialogs/dialog_plot_schematic_base.fbp b/eeschema/dialogs/dialog_plot_schematic_base.fbp index 2b4dfac0df..4168486b88 100644 --- a/eeschema/dialogs/dialog_plot_schematic_base.fbp +++ b/eeschema/dialogs/dialog_plot_schematic_base.fbp @@ -14,7 +14,6 @@ dialog_plot_schematic_base 1000 none - 1 Dialog_plot_schematic_base @@ -88,14 +87,14 @@ - + OnUpdateUI bMainSizer wxVERTICAL none - 5 + 7 wxALL|wxEXPAND 0 @@ -320,7 +319,7 @@ 0 - + 30,28 1 m_browseButton 1 @@ -374,7 +373,7 @@ 5 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxRIGHT|wxLEFT 0 @@ -383,7 +382,7 @@ protected 5 - wxEXPAND|wxLEFT|wxRIGHT + wxALIGN_TOP|wxEXPAND|wxLEFT|wxRIGHT 0 1 @@ -414,7 +413,7 @@ 0 0 wxID_ANY - Output Format: + Output Format 1 0 @@ -471,126 +470,41 @@ - + 5 - wxEXPAND + wxEXPAND|wxRIGHT|wxLEFT 0 - + wxID_ANY - Paper Options: + Options - m_paperOptionsSizer + sbOptions wxVERTICAL 1 - protected + none - - 5 - wxBOTTOM|wxEXPAND|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Schematic size" "A4" "A" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Page Size: - 1 - - 0 - - - 0 - - 1 - m_PaperSizeOption - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxEXPAND 1 - - wxID_ANY - HPGL Options: + + + wxBOTH + 1 + + 0 - m_paperHPGLSizer - wxVERTICAL - 1 - protected - - + gbSizer1 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 5 - wxLEFT|wxRIGHT - 0 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + 0 + 1 1 1 @@ -670,10 +584,13 @@ - + 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 + 1 + 1 + wxEXPAND|wxRIGHT|wxLEFT + 0 + 1 1 1 @@ -688,7 +605,7 @@ 1 0 - "Schematic size" "A4" "A3" "A2" "A1" "A0" "A" "B" "C" "D" "E" + "Schematic size" "A4" "A" 1 1 @@ -710,7 +627,7 @@ 0 1 - m_HPGLPaperSizeOption + m_paperSizeOption 1 @@ -733,7 +650,7 @@ - OnHPGLPageSelected + OnPageSizeSelected @@ -758,11 +675,580 @@ - + 5 - wxBOTTOM|wxTOP - 0 - + 2 + 0 + wxALL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Plot border and title block + + 0 + + + 0 + + 1 + m_PlotFrameRefOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Print the frame references. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxLEFT + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Output mode: + + 0 + + + 0 + + 1 + bOutputModeLabel + 1 + + + none + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Color" "Black and White" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_ModeColorOption + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxLEFT + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Default line thickness: + + 0 + + + 0 + + 1 + m_defaultLineWidthTitle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxEXPAND|wxRIGHT|wxLEFT + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_DefaultLineSizeCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Selection of the default pen thickness used to draw items, when their thickness is set to 0. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + wxID_ANY + HPGL Options + + m_HPGLOptionsSizer + wxVERTICAL + 1 + protected + + + 5 + wxEXPAND + 1 + + + wxBOTH + 1 + + 0 + + gbSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Position: + + 0 + + + 0 + + 1 + sPositionLabel + 1 + + + none + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + 1 + 1 1 1 @@ -791,8 +1277,6 @@ 0 0 wxID_ANY - Align: - 1 0 @@ -811,8 +1295,8 @@ 0 1 - wxRA_SPECIFY_COLS - + + ; forward_declare 0 @@ -823,6 +1307,7 @@ + @@ -839,7 +1324,6 @@ - @@ -848,10 +1332,13 @@ - + 5 - wxTOP|wxRIGHT|wxLEFT - 0 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + 1 + 1 1 1 @@ -931,10 +1418,13 @@ - + 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 + 1 + 1 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + 1 1 1 @@ -1026,663 +1516,11 @@ - - 5 - wxEXPAND|wxLEFT - 0 - - wxID_ANY - General Options: - - sbSizerPlotFormat - wxVERTICAL - 1 - none - - - 5 - wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Default line thickness: - - 0 - - - 0 - - 1 - m_defaultLineWidthTitle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_DefaultLineSizeCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Selection of the default pen thickness used to draw items, when their thickness is set to 0. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Color" "Black and white" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Output Mode: - 1 - - 0 - - - 0 - - 1 - m_ModeColorOption - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - Choose if you want to draw the sheet like it appears on screen, or in black and white mode, better to print it when using black and white printers - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Plot border and title block - - 0 - - - 0 - - 1 - m_PlotFrameRefOpt - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Print the frame references. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - - m_ButtonsSizer - wxVERTICAL - protected - - 5 - wxALL|wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_PRINT_CURRENT - Plot Current Page - - 0 - - - 0 - - 1 - m_buttonPlotCurrent - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnButtonPlotCurrentClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_PRINT_ALL - Plot All Pages - - 0 - - - 0 - - 1 - m_buttonPlotAll - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnButtonPlotAllClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Close - - 0 - - - 0 - - 1 - m_buttonQuit - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnButtonCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 1 @@ -1771,6 +1609,32 @@ + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + OnPlotCurrent + + + + + OnPlotAll + + + + diff --git a/eeschema/dialogs/dialog_plot_schematic_base.h b/eeschema/dialogs/dialog_plot_schematic_base.h index 29b915518a..75f67ab5ea 100644 --- a/eeschema/dialogs/dialog_plot_schematic_base.h +++ b/eeschema/dialogs/dialog_plot_schematic_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -29,8 +29,9 @@ class WX_HTML_REPORT_PANEL; #include #include #include -#include #include +#include +#include #include #include @@ -44,43 +45,35 @@ class DIALOG_PLOT_SCHEMATIC_BASE : public DIALOG_SHIM private: protected: - enum - { - wxID_PRINT_CURRENT = 1000, - wxID_PRINT_ALL - }; - wxStaticText* m_staticTextOutputDirectory; wxTextCtrl* m_outputDirectoryName; wxBitmapButton* m_browseButton; wxBoxSizer* m_optionsSizer; wxRadioBox* m_plotFormatOpt; - wxStaticBoxSizer* m_paperOptionsSizer; - wxRadioBox* m_PaperSizeOption; - wxStaticBoxSizer* m_paperHPGLSizer; wxStaticText* m_staticText4; - wxChoice* m_HPGLPaperSizeOption; - wxRadioBox* m_plotOriginOpt; - wxStaticText* m_penHPLGWidthTitle; - wxTextCtrl* m_penHPGLWidthCtrl; + wxChoice* m_paperSizeOption; + wxCheckBox* m_PlotFrameRefOpt; + wxChoice* m_ModeColorOption; wxStaticText* m_defaultLineWidthTitle; wxTextCtrl* m_DefaultLineSizeCtrl; - wxRadioBox* m_ModeColorOption; - wxCheckBox* m_PlotFrameRefOpt; - wxBoxSizer* m_ButtonsSizer; - wxButton* m_buttonPlotCurrent; - wxButton* m_buttonPlotAll; - wxButton* m_buttonQuit; + wxStaticBoxSizer* m_HPGLOptionsSizer; + wxChoice* m_plotOriginOpt; + wxStaticText* m_penHPLGWidthTitle; + wxTextCtrl* m_penHPGLWidthCtrl; WX_HTML_REPORT_PANEL* m_MessagesBox; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Apply; + wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } + virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnPlotFormatSelection( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHPGLPageSelected( wxCommandEvent& event ) { event.Skip(); } - virtual void OnButtonPlotCurrentClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnButtonPlotAllClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnPageSizeSelected( wxCommandEvent& event ) { event.Skip(); } + virtual void OnPlotCurrent( wxCommandEvent& event ) { event.Skip(); } + virtual void OnPlotAll( wxCommandEvent& event ) { event.Skip(); } public: diff --git a/eeschema/plot_schematic_HPGL.cpp b/eeschema/plot_schematic_HPGL.cpp index 8928817ef8..b49aa3e00e 100644 --- a/eeschema/plot_schematic_HPGL.cpp +++ b/eeschema/plot_schematic_HPGL.cpp @@ -52,46 +52,21 @@ enum HPGL_PAGEZ_T { static const wxChar* plot_sheet_list( int aSize ) { - const wxChar* ret; - switch( aSize ) { default: - case PAGE_DEFAULT: - ret = NULL; break; - - case HPGL_PAGE_SIZE_A4: - ret = wxT( "A4" ); break; - - case HPGL_PAGE_SIZE_A3: - ret = wxT( "A3" ); break; - - case HPGL_PAGE_SIZE_A2: - ret = wxT( "A2" ); break; - - case HPGL_PAGE_SIZE_A1: - ret = wxT( "A1" ); break; - - case HPGL_PAGE_SIZE_A0: - ret = wxT( "A0" ); break; - - case HPGL_PAGE_SIZE_A: - ret = wxT( "A" ); break; - - case HPGL_PAGE_SIZE_B: - ret = wxT( "B" ); break; - - case HPGL_PAGE_SIZE_C: - ret = wxT( "C" ); break; - - case HPGL_PAGE_SIZE_D: - ret = wxT( "D" ); break; - - case HPGL_PAGE_SIZE_E: - ret = wxT( "E" ); break; + case PAGE_DEFAULT: return nullptr; + case HPGL_PAGE_SIZE_A4: return wxT( "A4" ); + case HPGL_PAGE_SIZE_A3: return wxT( "A3" ); + case HPGL_PAGE_SIZE_A2: return wxT( "A2" ); + case HPGL_PAGE_SIZE_A1: return wxT( "A1" ); + case HPGL_PAGE_SIZE_A0: return wxT( "A0" ); + case HPGL_PAGE_SIZE_A: return wxT( "A" ); + case HPGL_PAGE_SIZE_B: return wxT( "B" ); + case HPGL_PAGE_SIZE_C: return wxT( "C" ); + case HPGL_PAGE_SIZE_D: return wxT( "D" ); + case HPGL_PAGE_SIZE_E: return wxT( "E" ); } - - return ret; } @@ -145,8 +120,8 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef ) PAGE_INFO plotPage = curPage; // if plotting on a page size other than curPage - if( m_HPGLPaperSizeOption->GetSelection() != PAGE_DEFAULT ) - plotPage.SetType( plot_sheet_list( m_HPGLPaperSizeOption->GetSelection() ) ); + if( m_paperSizeOption->GetSelection() != PAGE_DEFAULT ) + plotPage.SetType( plot_sheet_list( m_paperSizeOption->GetSelection() ) ); // Calculation of conversion scales. double plot_scale = (double) plotPage.GetWidthMils() / curPage.GetWidthMils(); diff --git a/include/bitmaps.h b/include/bitmaps.h index f7e11688c5..42b7858fa1 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -183,6 +183,7 @@ EXTERN_BITMAP( find_xpm ) EXTERN_BITMAP( find_replace_xpm ) EXTERN_BITMAP( flag_xpm ) EXTERN_BITMAP( flip_board_xpm ) +EXTERN_BITMAP( folder_xpm ) EXTERN_BITMAP( fonts_xpm ) EXTERN_BITMAP( footprint_text_xpm ) EXTERN_BITMAP( gbr_select_mode0_xpm ) @@ -498,6 +499,7 @@ EXTERN_BITMAP( showtrack_xpm ) EXTERN_BITMAP( show_zone_xpm ) EXTERN_BITMAP( show_zone_disable_xpm ) EXTERN_BITMAP( show_zone_outline_only_xpm ) +EXTERN_BITMAP( small_plus_xpm ) EXTERN_BITMAP( spreadsheet_xpm ) EXTERN_BITMAP( svg_file_xpm ) EXTERN_BITMAP( swap_layer_xpm ) @@ -510,6 +512,7 @@ EXTERN_BITMAP( track_locked_xpm ) EXTERN_BITMAP( track_sketch_xpm ) EXTERN_BITMAP( track_unlocked_xpm ) EXTERN_BITMAP( transistor_xpm ) +EXTERN_BITMAP( trash_xpm ) EXTERN_BITMAP( tree_nosel_xpm ) EXTERN_BITMAP( tree_sel_xpm ) EXTERN_BITMAP( undelete_xpm ) diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 9361024158..6ec28c08e9 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -157,10 +158,7 @@ void DIALOG_DRC_CONTROL::InitValues() m_config->Read( RefillZonesBeforeDrc, &value, false ); m_cbRefillZones->SetValue( value ); - // Set the initial "enabled" status of the browse button and the text - // field for report name - wxCommandEvent junk; - OnReportCheckBoxClicked( junk ); + m_BrowseButton->SetBitmap( KiBitmap( folder_xpm ) ); Layout(); // adding the units above expanded Clearance text, now resize. diff --git a/pcbnew/dialogs/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h index 5e4446a07d..00b0dab0fb 100644 --- a/pcbnew/dialogs/dialog_drc.h +++ b/pcbnew/dialogs/dialog_drc.h @@ -39,7 +39,6 @@ #include #include - // forward declarations class DRCLISTBOX; class BOARD_DESIGN_SETTINGS; diff --git a/pcbnew/dialogs/dialog_fp_plugin_options.cpp b/pcbnew/dialogs/dialog_fp_plugin_options.cpp index 865195dae9..7d479c460c 100644 --- a/pcbnew/dialogs/dialog_fp_plugin_options.cpp +++ b/pcbnew/dialogs/dialog_fp_plugin_options.cpp @@ -291,16 +291,13 @@ private: void onDeleteRow( wxMouseEvent& event ) override { - int rowCount = m_grid->GetNumberRows(); int curRow = getCursorRow(); m_grid->DeleteRows( curRow ); - if( curRow && curRow == rowCount - 1 ) - { - m_grid->MakeCellVisible( curRow-1, getCursorCol() ); - m_grid->SetGridCursor( curRow-1, getCursorCol() ); - } + curRow = std::max( 0, curRow - 1 ); + m_grid->MakeCellVisible( curRow, m_grid->GetGridCursorCol() ); + m_grid->SetGridCursor( curRow, m_grid->GetGridCursorCol() ); } void onMoveUp( wxMouseEvent& event ) override diff --git a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.cpp b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.cpp index 46b9e65b4c..dcfacb2b73 100644 --- a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.cpp +++ b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.cpp @@ -20,97 +20,67 @@ DIALOG_GEN_FOOTPRINT_POSITION_BASE::DIALOG_GEN_FOOTPRINT_POSITION_BASE( wxWindow wxBoxSizer* bUpperSizer; bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bDirSizer; - bDirSizer = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizerdirBrowse; + bSizerdirBrowse = new wxBoxSizer( wxHORIZONTAL ); m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDir->Wrap( -1 ); - bDirSizer->Add( m_staticTextDir, 0, wxEXPAND, 10 ); - - wxBoxSizer* bSizerdirBrowse; - bSizerdirBrowse = new wxBoxSizer( wxHORIZONTAL ); + bSizerdirBrowse->Add( m_staticTextDir, 0, wxEXPAND|wxRIGHT|wxTOP, 5 ); m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_outputDirectoryName->SetToolTip( _("Target directory for plot files. Can be absolute or relative to the board file location.") ); m_outputDirectoryName->SetMinSize( wxSize( 350,-1 ) ); - bSizerdirBrowse->Add( m_outputDirectoryName, 1, wxBOTTOM|wxEXPAND|wxTOP, 4 ); + bSizerdirBrowse->Add( m_outputDirectoryName, 1, wxBOTTOM|wxEXPAND|wxTOP, 3 ); m_browseButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); - bSizerdirBrowse->Add( m_browseButton, 0, wxRIGHT, 1 ); + m_browseButton->SetMinSize( wxSize( 30,28 ) ); + + bSizerdirBrowse->Add( m_browseButton, 0, 0, 0 ); - bDirSizer->Add( bSizerdirBrowse, 1, wxEXPAND, 5 ); + bUpperSizer->Add( bSizerdirBrowse, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 ); - bUpperSizer->Add( bDirSizer, 1, wxALL, 10 ); + m_MainSizer->Add( bUpperSizer, 0, wxEXPAND, 2 ); - - m_MainSizer->Add( bUpperSizer, 0, wxEXPAND|wxLEFT|wxRIGHT, 2 ); - - wxGridBagSizer* gbSizer1; - gbSizer1 = new wxGridBagSizer( 0, 0 ); - gbSizer1->SetFlexibleDirection( wxBOTH ); - gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - wxBoxSizer* bOptionsSizer; - bOptionsSizer = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer71; + bSizer71 = new wxBoxSizer( wxHORIZONTAL ); wxString m_rbFormatChoices[] = { _("ASCII"), _("CSV") }; int m_rbFormatNChoices = sizeof( m_rbFormatChoices ) / sizeof( wxString ); - m_rbFormat = new wxRadioBox( this, wxID_ANY, _("Format:"), wxDefaultPosition, wxDefaultSize, m_rbFormatNChoices, m_rbFormatChoices, 1, wxRA_SPECIFY_COLS ); + m_rbFormat = new wxRadioBox( this, wxID_ANY, _("Format"), wxDefaultPosition, wxDefaultSize, m_rbFormatNChoices, m_rbFormatChoices, 1, wxRA_SPECIFY_COLS ); m_rbFormat->SetSelection( 0 ); m_rbFormat->SetMinSize( wxSize( 90,-1 ) ); - bOptionsSizer->Add( m_rbFormat, 0, wxALL, 5 ); + bSizer71->Add( m_rbFormat, 1, wxALL, 5 ); wxString m_radioBoxUnitsChoices[] = { _("Inches"), _("mm") }; int m_radioBoxUnitsNChoices = sizeof( m_radioBoxUnitsChoices ) / sizeof( wxString ); - m_radioBoxUnits = new wxRadioBox( this, wxID_ANY, _("Units:"), wxDefaultPosition, wxDefaultSize, m_radioBoxUnitsNChoices, m_radioBoxUnitsChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxUnits = new wxRadioBox( this, wxID_ANY, _("Units"), wxDefaultPosition, wxDefaultSize, m_radioBoxUnitsNChoices, m_radioBoxUnitsChoices, 1, wxRA_SPECIFY_COLS ); m_radioBoxUnits->SetSelection( 0 ); m_radioBoxUnits->SetMinSize( wxSize( 90,-1 ) ); - bOptionsSizer->Add( m_radioBoxUnits, 0, wxALL|wxEXPAND, 5 ); + bSizer71->Add( m_radioBoxUnits, 1, wxALL, 5 ); wxString m_radioBoxFilesCountChoices[] = { _("One file per side"), _("Single file for board") }; int m_radioBoxFilesCountNChoices = sizeof( m_radioBoxFilesCountChoices ) / sizeof( wxString ); - m_radioBoxFilesCount = new wxRadioBox( this, wxID_ANY, _("Files:"), wxDefaultPosition, wxDefaultSize, m_radioBoxFilesCountNChoices, m_radioBoxFilesCountChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxFilesCount = new wxRadioBox( this, wxID_ANY, _("Files"), wxDefaultPosition, wxDefaultSize, m_radioBoxFilesCountNChoices, m_radioBoxFilesCountChoices, 1, wxRA_SPECIFY_COLS ); m_radioBoxFilesCount->SetSelection( 1 ); m_radioBoxFilesCount->SetToolTip( _("Creates 2 files: one for each board side or\nCreates only one file containing all footprints to place\n") ); - bOptionsSizer->Add( m_radioBoxFilesCount, 1, wxALL, 5 ); + bSizer71->Add( m_radioBoxFilesCount, 2, wxALL, 5 ); - - gbSizer1->Add( bOptionsSizer, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 ); - - wxString m_radioBoxForceSmdChoices[] = { _("With INSERT attribute set"), _("Force INSERT attribute for all SMD footprints") }; + wxString m_radioBoxForceSmdChoices[] = { _("Footprints with INSERT attribute set"), _("All SMD footprints") }; int m_radioBoxForceSmdNChoices = sizeof( m_radioBoxForceSmdChoices ) / sizeof( wxString ); - m_radioBoxForceSmd = new wxRadioBox( this, wxID_ANY, _("Footprints Selection:"), wxDefaultPosition, wxDefaultSize, m_radioBoxForceSmdNChoices, m_radioBoxForceSmdChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxForceSmd = new wxRadioBox( this, wxID_ANY, _("Include"), wxDefaultPosition, wxDefaultSize, m_radioBoxForceSmdNChoices, m_radioBoxForceSmdChoices, 1, wxRA_SPECIFY_COLS ); m_radioBoxForceSmd->SetSelection( 0 ); m_radioBoxForceSmd->SetToolTip( _("Only footprints with option INSERT are listed in placement file.\nThis option can force this option for all footprints having only SMD pads.\nWarning: this options will modify the board.") ); - gbSizer1->Add( m_radioBoxForceSmd, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 ); + bSizer71->Add( m_radioBoxForceSmd, 3, wxALL, 5 ); - gbSizer1->Add( 0, 0, wxGBPosition( 0, 1 ), wxGBSpan( 2, 1 ), wxEXPAND, 5 ); - - wxBoxSizer* bButtonsSizer; - bButtonsSizer = new wxBoxSizer( wxVERTICAL ); - - bButtonsSizer->SetMinSize( wxSize( 140,-1 ) ); - m_generateButton = new wxButton( this, wxID_ANY, _("Generate File"), wxDefaultPosition, wxDefaultSize, 0 ); - bButtonsSizer->Add( m_generateButton, 0, wxALL|wxEXPAND, 5 ); - - m_closeButton = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bButtonsSizer->Add( m_closeButton, 0, wxALL|wxEXPAND|wxTOP, 5 ); - - - gbSizer1->Add( bButtonsSizer, wxGBPosition( 0, 2 ), wxGBSpan( 2, 1 ), wxEXPAND|wxLEFT|wxTOP, 25 ); - - - gbSizer1->AddGrowableCol( 1 ); - - m_MainSizer->Add( gbSizer1, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); + m_MainSizer->Add( bSizer71, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer7; bSizer7 = new wxBoxSizer( wxVERTICAL ); @@ -121,7 +91,16 @@ DIALOG_GEN_FOOTPRINT_POSITION_BASE::DIALOG_GEN_FOOTPRINT_POSITION_BASE( wxWindow bSizer7->Add( m_messagesPanel, 1, wxEXPAND | wxALL, 5 ); - m_MainSizer->Add( bSizer7, 1, wxEXPAND, 5 ); + m_MainSizer->Add( bSizer7, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + + m_MainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( m_MainSizer ); @@ -132,13 +111,13 @@ DIALOG_GEN_FOOTPRINT_POSITION_BASE::DIALOG_GEN_FOOTPRINT_POSITION_BASE( wxWindow // Connect Events m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_FOOTPRINT_POSITION_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); - m_generateButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_FOOTPRINT_POSITION_BASE::OnGenerate ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_FOOTPRINT_POSITION_BASE::OnGenerate ), NULL, this ); } DIALOG_GEN_FOOTPRINT_POSITION_BASE::~DIALOG_GEN_FOOTPRINT_POSITION_BASE() { // Disconnect Events m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_FOOTPRINT_POSITION_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); - m_generateButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_FOOTPRINT_POSITION_BASE::OnGenerate ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_FOOTPRINT_POSITION_BASE::OnGenerate ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp index da92393fb8..39db999ce8 100644 --- a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp +++ b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp @@ -95,7 +95,7 @@ protected 2 - wxEXPAND|wxLEFT|wxRIGHT + wxEXPAND 0 @@ -104,16 +104,16 @@ none 10 - wxALL + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 1 - bDirSizer - wxVERTICAL + bSizerdirBrowse + wxHORIZONTAL none - 10 - wxEXPAND + 5 + wxEXPAND|wxRIGHT|wxTOP 0 1 @@ -194,199 +194,188 @@ - - 5 - wxEXPAND + + 3 + wxBOTTOM|wxEXPAND|wxTOP 1 - - - bSizerdirBrowse - wxHORIZONTAL - none - - 4 - wxBOTTOM|wxEXPAND|wxTOP - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - 350,-1 - 1 - m_outputDirectoryName - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Target directory for plot files. Can be absolute or relative to the board file location. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - - wxID_ANY - MyButton - - 0 - - - 0 - - 1 - m_browseButton - 1 - - - protected - 1 - - Resizable - - 1 - - wxBU_AUTODRAW - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOutputDirectoryBrowseClicked - - - - - - - - - - - - - - - - - - - - - - - - - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + 350,-1 + 1 + m_outputDirectoryName + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Target directory for plot files. Can be absolute or relative to the board file location. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_ANY + MyButton + + 0 + + + 0 + 30,28 + 1 + m_browseButton + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnOutputDirectoryBrowseClicked + + + + + + + + + + + + + + + + + + + + + + + @@ -395,310 +384,17 @@ 5 - wxEXPAND|wxLEFT|wxRIGHT + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 - - - wxBOTH - 1 - - 0 + - gbSizer1 - wxFLEX_GROWMODE_SPECIFIED + bSizer71 + wxHORIZONTAL none - 0 - + 5 - 1 - 0 - wxEXPAND - 0 - 1 - - - bOptionsSizer - wxHORIZONTAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "ASCII" "CSV" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Format: - 1 - - 0 - - - 0 - 90,-1 - 1 - m_rbFormat - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Inches" "mm" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Units: - 1 - - 0 - - - 0 - 90,-1 - 1 - m_radioBoxUnits - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "One file per side" "Single file for board" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Files: - 1 - - 0 - - - 0 - - 1 - m_radioBoxFilesCount - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - Creates 2 files: one for each board side or Creates only one file containing all footprints to place - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - 1 - 0 - wxALL|wxEXPAND - 1 - 1 + wxALL + 1 1 1 @@ -713,7 +409,7 @@ 1 0 - "With INSERT attribute set" "Force INSERT attribute for all SMD footprints" + "ASCII" "CSV" 1 1 @@ -728,7 +424,277 @@ 0 0 wxID_ANY - Footprints Selection: + Format + 1 + + 0 + + + 0 + 90,-1 + 1 + m_rbFormat + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Inches" "mm" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Units + 1 + + 0 + + + 0 + 90,-1 + 1 + m_radioBoxUnits + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 2 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "One file per side" "Single file for board" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Files + 1 + + 0 + + + 0 + + 1 + m_radioBoxFilesCount + 1 + + + protected + 1 + + Resizable + 1 + 1 + + wxRA_SPECIFY_COLS + + 0 + Creates 2 files: one for each board side or Creates only one file containing all footprints to place + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 3 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Footprints with INSERT attribute set" "All SMD footprints" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Include 1 0 @@ -785,214 +751,11 @@ - - 5 - 1 - 1 - wxEXPAND - 0 - 2 - - 0 - protected - 0 - - - - 25 - 1 - 2 - wxEXPAND|wxLEFT|wxTOP - 0 - 2 - - 140,-1 - bButtonsSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Generate File - - 0 - - - 0 - - 1 - m_generateButton - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnGenerate - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Close - - 0 - - - 0 - - 1 - m_closeButton - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 1 @@ -1081,6 +844,32 @@ + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + + + + + OnGenerate + + + + diff --git a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.h b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.h index a4d5754d4e..7d321651c5 100644 --- a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.h +++ b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.h @@ -28,7 +28,6 @@ class WX_HTML_REPORT_PANEL; #include #include #include -#include #include #include @@ -50,9 +49,10 @@ class DIALOG_GEN_FOOTPRINT_POSITION_BASE : public DIALOG_SHIM wxRadioBox* m_radioBoxUnits; wxRadioBox* m_radioBoxFilesCount; wxRadioBox* m_radioBoxForceSmd; - wxButton* m_generateButton; - wxButton* m_closeButton; WX_HTML_REPORT_PANEL* m_messagesPanel; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index 62fa84eba0..3f4e7ff488 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -49,12 +49,10 @@ // Keywords for read and write config #define ZerosFormatKey wxT( "DrillZerosFormat" ) -#define PrecisionKey wxT( "DrilltPrecisionOpt" ) #define MirrorKey wxT( "DrillMirrorYOpt" ) #define MinimalHeaderKey wxT( "DrillMinHeader" ) #define MergePTHNPTHKey wxT( "DrillMergePTHNPTH" ) #define UnitDrillInchKey wxT( "DrillUnit" ) -#define DrillOriginIsAuxAxisKey wxT( "DrillAuxAxis" ) #define DrillMapFileTypeKey wxT( "DrillMapFileType" ) #define DrillFileFormatKey wxT( "DrillFileType" ) @@ -83,6 +81,14 @@ DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* parent ) : m_config = Kiface().KifaceSettings(); m_plotOpts = m_parent->GetPlotSettings(); + // We use a sdbSizer to get platform-dependent ordering of the action buttons, but + // that requires us to correct the button labels here. + m_sdbSizer1OK->SetLabel( _( "Generate Drill File" ) ); + m_sdbSizer1Apply->SetLabel( _( "Generate Map File" ) ); + m_sdbSizer1Cancel->SetLabel( _( "Close" ) ); + m_buttonsSizer->Layout(); + + m_sdbSizer1OK->SetDefault(); SetReturnCode( 1 ); initDialog(); GetSizer()->SetSizeHints( this ); @@ -122,9 +128,10 @@ void DIALOG_GENDRILL::initDialog() void DIALOG_GENDRILL::InitDisplayParams() { - m_browseButton->SetBitmap( KiBitmap( browse_files_xpm ) ); + m_browseButton->SetBitmap( KiBitmap( folder_xpm ) ); - m_rbFileFormat->SetSelection( m_drillFileType ); + m_rbExcellon->SetValue( m_drillFileType == 0 ); + m_rbGerberX2->SetValue( m_drillFileType == 1 ); m_Choice_Unit->SetSelection( m_UnitDrillIsInch ? 1 : 0 ); m_Choice_Zeros_Format->SetSelection( m_ZerosFormat ); UpdatePrecisionOptions(); @@ -136,46 +143,13 @@ void DIALOG_GENDRILL::InitDisplayParams() m_Check_Mirror->SetValue( m_Mirror ); m_Check_Merge_PTH_NPTH->SetValue( m_Merge_PTH_NPTH ); m_Choice_Drill_Map->SetSelection( m_mapFileType ); - m_ViaDrillValue->SetLabel( _( "Use Netclass values" ) ); - m_MicroViaDrillValue->SetLabel( _( "Use Netclass values" ) ); - // See if we have some buried vias or/and microvias, and display - // microvias drill value if so + m_platedPadsHoleCount = 0; + m_notplatedPadsHoleCount = 0; m_throughViasCount = 0; m_microViasCount = 0; m_blindOrBuriedViasCount = 0; - for( TRACK* track = m_parent->GetBoard()->m_Track; track != NULL; track = track->Next() ) - { - const VIA *via = dynamic_cast( track ); - if( via ) - { - switch( via->GetViaType() ) - { - case VIA_THROUGH: - m_throughViasCount++; - break; - - case VIA_MICROVIA: - m_microViasCount++; - break; - - case VIA_BLIND_BURIED: - m_blindOrBuriedViasCount++; - break; - - default: - break; - } - } - } - - m_MicroViaDrillValue->Enable( m_microViasCount ); - - // Count plated pad holes and not plated pad holes: - m_platedPadsHoleCount = 0; - m_notplatedPadsHoleCount = 0; - for( MODULE* module = m_parent->GetBoard()->m_Modules; module; module = module->Next() ) { for( D_PAD* pad = module->PadsList(); pad != NULL; pad = pad->Next() ) @@ -203,6 +177,31 @@ void DIALOG_GENDRILL::InitDisplayParams() } } + for( TRACK* track = m_parent->GetBoard()->m_Track; track != NULL; track = track->Next() ) + { + const VIA *via = dynamic_cast( track ); + if( via ) + { + switch( via->GetViaType() ) + { + case VIA_THROUGH: + m_throughViasCount++; + break; + + case VIA_MICROVIA: + m_microViasCount++; + break; + + case VIA_BLIND_BURIED: + m_blindOrBuriedViasCount++; + break; + + default: + break; + } + } + } + // Display hole counts: m_PlatedPadsCountInfoMsg-> SetLabel( wxString() << m_platedPadsHoleCount ); m_NotPlatedPadsCountInfoMsg->SetLabel( wxString() << m_notplatedPadsHoleCount ); @@ -220,8 +219,9 @@ void DIALOG_GENDRILL::InitDisplayParams() void DIALOG_GENDRILL::onFileFormatSelection( wxCommandEvent& event ) { - m_drillFileType = m_rbFileFormat->GetSelection(); - bool enbl_Excellon = m_drillFileType == 0; + bool enbl_Excellon = m_rbExcellon->GetValue(); + + m_drillFileType = enbl_Excellon ? 0 : 1; m_Choice_Unit->Enable( enbl_Excellon ); m_Choice_Zeros_Format->Enable( enbl_Excellon ); @@ -271,13 +271,6 @@ void DIALOG_GENDRILL::OnGenDrillFile( wxCommandEvent& event ) } -void DIALOG_GENDRILL::OnCancelClick( wxCommandEvent& event ) -{ - UpdateConfig(); // Save drill options: - EndModal( wxID_CANCEL ); // Process the default cancel event (close dialog) -} - - void DIALOG_GENDRILL::OnSelZerosFmtSelected( wxCommandEvent& event ) { UpdatePrecisionOptions(); diff --git a/pcbnew/dialogs/dialog_gendrill.h b/pcbnew/dialogs/dialog_gendrill.h index 26eb65edcb..3b72b74ea8 100644 --- a/pcbnew/dialogs/dialog_gendrill.h +++ b/pcbnew/dialogs/dialog_gendrill.h @@ -81,7 +81,6 @@ private: */ void OnGenReportFile( wxCommandEvent& event ) override; - void OnCancelClick( wxCommandEvent& event ) override; void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override; // Specific functions: diff --git a/pcbnew/dialogs/dialog_gendrill_base.cpp b/pcbnew/dialogs/dialog_gendrill_base.cpp index bdc2ba0c54..2e8d59d88f 100644 --- a/pcbnew/dialogs/dialog_gendrill_base.cpp +++ b/pcbnew/dialogs/dialog_gendrill_base.cpp @@ -19,46 +19,97 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con wxBoxSizer* bupperSizer; bupperSizer = new wxBoxSizer( wxHORIZONTAL ); - staticTextOutputDir = new wxStaticText( this, wxID_ANY, _("Output Directory:"), wxDefaultPosition, wxDefaultSize, 0 ); + staticTextOutputDir = new wxStaticText( this, wxID_ANY, _("Output folder:"), wxDefaultPosition, wxDefaultSize, 0 ); staticTextOutputDir->Wrap( -1 ); - bupperSizer->Add( staticTextOutputDir, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bupperSizer->Add( staticTextOutputDir, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 10 ); m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_outputDirectoryName->SetMinSize( wxSize( -1,24 ) ); + m_outputDirectoryName->SetMinSize( wxSize( -1,22 ) ); bupperSizer->Add( m_outputDirectoryName, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 0 ); m_browseButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); - bupperSizer->Add( m_browseButton, 0, wxRIGHT, 2 ); + m_browseButton->SetMinSize( wxSize( 30,28 ) ); + + bupperSizer->Add( m_browseButton, 0, wxRIGHT, 7 ); - bMainSizer->Add( bupperSizer, 0, wxALL|wxEXPAND, 5 ); + bMainSizer->Add( bupperSizer, 0, wxEXPAND|wxTOP, 10 ); wxBoxSizer* bmiddlerSizer; bmiddlerSizer = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* m_LeftBoxSizer; - m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bMiddleSizer; + bMiddleSizer = new wxBoxSizer( wxVERTICAL ); - wxString m_rbFileFormatChoices[] = { _("Excellon"), _("Gerber X2 (experimental)") }; - int m_rbFileFormatNChoices = sizeof( m_rbFileFormatChoices ) / sizeof( wxString ); - m_rbFileFormat = new wxRadioBox( this, wxID_ANY, _("File Format:"), wxDefaultPosition, wxDefaultSize, m_rbFileFormatNChoices, m_rbFileFormatChoices, 1, wxRA_SPECIFY_COLS ); - m_rbFileFormat->SetSelection( 0 ); - m_LeftBoxSizer->Add( m_rbFileFormat, 0, wxALL|wxEXPAND, 5 ); + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Drill File Format") ), wxVERTICAL ); + + m_rbExcellon = new wxRadioButton( sbSizer6->GetStaticBox(), wxID_ANY, _("Excellon"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer6->Add( m_rbExcellon, 0, wxBOTTOM|wxRIGHT, 5 ); + + wxBoxSizer* bSizerExcellonOptions; + bSizerExcellonOptions = new wxBoxSizer( wxVERTICAL ); + + m_Check_Mirror = new wxCheckBox( sbSizer6->GetStaticBox(), wxID_ANY, _("Mirror Y axis"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Check_Mirror->SetToolTip( _("Not recommended.\nUsed mostly by users who make the boards themselves.") ); + + bSizerExcellonOptions->Add( m_Check_Mirror, 0, wxLEFT, 5 ); + + m_Check_Minimal = new wxCheckBox( sbSizer6->GetStaticBox(), wxID_ANY, _("Minimal header"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Check_Minimal->SetToolTip( _("Not recommended.\nOnly use it for board houses which do not accept fully featured headers.") ); + + bSizerExcellonOptions->Add( m_Check_Minimal, 0, wxRIGHT|wxLEFT, 5 ); + + m_Check_Merge_PTH_NPTH = new wxCheckBox( sbSizer6->GetStaticBox(), wxID_ANY, _("PTH and NPTH in single file"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Check_Merge_PTH_NPTH->SetToolTip( _("Not recommended.\nOnly use for board houses which ask for merged PTH and NPTH into a single file.") ); + + bSizerExcellonOptions->Add( m_Check_Merge_PTH_NPTH, 0, wxBOTTOM|wxLEFT, 5 ); + + + sbSizer6->Add( bSizerExcellonOptions, 1, wxEXPAND|wxLEFT, 12 ); + + m_rbGerberX2 = new wxRadioButton( sbSizer6->GetStaticBox(), wxID_ANY, _("Gerber X2 (experimental)"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer6->Add( m_rbGerberX2, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bMiddleSizer->Add( sbSizer6, 1, wxEXPAND|wxALL, 5 ); + + wxString m_Choice_Drill_MapChoices[] = { _("HPGL"), _("PostScript"), _("Gerber"), _("DXF"), _("SVG"), _("PDF") }; + int m_Choice_Drill_MapNChoices = sizeof( m_Choice_Drill_MapChoices ) / sizeof( wxString ); + m_Choice_Drill_Map = new wxRadioBox( this, wxID_ANY, _("Map File Format"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_MapNChoices, m_Choice_Drill_MapChoices, 1, wxRA_SPECIFY_COLS ); + m_Choice_Drill_Map->SetSelection( 1 ); + m_Choice_Drill_Map->SetToolTip( _("Creates a drill map in PS, HPGL or other formats") ); + + bMiddleSizer->Add( m_Choice_Drill_Map, 0, wxALL|wxEXPAND, 5 ); + + + bmiddlerSizer->Add( bMiddleSizer, 1, wxEXPAND, 5 ); + + wxBoxSizer* bLeftSizer; + bLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_Choice_Drill_OffsetChoices[] = { _("Absolute"), _("Auxiliary axis") }; + int m_Choice_Drill_OffsetNChoices = sizeof( m_Choice_Drill_OffsetChoices ) / sizeof( wxString ); + m_Choice_Drill_Offset = new wxRadioBox( this, wxID_ANY, _("Drill Origin"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_OffsetNChoices, m_Choice_Drill_OffsetChoices, 1, wxRA_SPECIFY_COLS ); + m_Choice_Drill_Offset->SetSelection( 0 ); + m_Choice_Drill_Offset->SetToolTip( _("Choose the coordinate origin: absolute or relative to the auxiliray axis") ); + + bLeftSizer->Add( m_Choice_Drill_Offset, 0, wxALL|wxEXPAND, 5 ); wxString m_Choice_UnitChoices[] = { _("Millimeters"), _("Inches") }; int m_Choice_UnitNChoices = sizeof( m_Choice_UnitChoices ) / sizeof( wxString ); - m_Choice_Unit = new wxRadioBox( this, wxID_ANY, _("Drill Units:"), wxDefaultPosition, wxDefaultSize, m_Choice_UnitNChoices, m_Choice_UnitChoices, 1, wxRA_SPECIFY_COLS ); + m_Choice_Unit = new wxRadioBox( this, wxID_ANY, _("Drill Units"), wxDefaultPosition, wxDefaultSize, m_Choice_UnitNChoices, m_Choice_UnitChoices, 1, wxRA_SPECIFY_COLS ); m_Choice_Unit->SetSelection( 1 ); - m_LeftBoxSizer->Add( m_Choice_Unit, 0, wxALL|wxEXPAND, 5 ); + bLeftSizer->Add( m_Choice_Unit, 0, wxALL|wxEXPAND, 5 ); wxString m_Choice_Zeros_FormatChoices[] = { _("Decimal format"), _("Suppress leading zeros"), _("Suppress trailing zeros"), _("Keep zeros") }; int m_Choice_Zeros_FormatNChoices = sizeof( m_Choice_Zeros_FormatChoices ) / sizeof( wxString ); - m_Choice_Zeros_Format = new wxRadioBox( this, wxID_ANY, _("Zeros Format:"), wxDefaultPosition, wxDefaultSize, m_Choice_Zeros_FormatNChoices, m_Choice_Zeros_FormatChoices, 1, wxRA_SPECIFY_COLS ); + m_Choice_Zeros_Format = new wxRadioBox( this, wxID_ANY, _("Zeros Format"), wxDefaultPosition, wxDefaultSize, m_Choice_Zeros_FormatNChoices, m_Choice_Zeros_FormatChoices, 1, wxRA_SPECIFY_COLS ); m_Choice_Zeros_Format->SetSelection( 0 ); m_Choice_Zeros_Format->SetToolTip( _("Choose EXCELLON numbers notation") ); - m_LeftBoxSizer->Add( m_Choice_Zeros_Format, 0, wxALL|wxEXPAND, 5 ); + bLeftSizer->Add( m_Choice_Zeros_Format, 0, wxALL|wxEXPAND, 5 ); wxFlexGridSizer* fgSizer1; fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 ); @@ -75,77 +126,16 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con fgSizer1->Add( m_staticTextPrecision, 0, wxALL, 10 ); - m_LeftBoxSizer->Add( fgSizer1, 0, wxEXPAND, 5 ); + bLeftSizer->Add( fgSizer1, 0, wxEXPAND, 5 ); - bmiddlerSizer->Add( m_LeftBoxSizer, 0, wxEXPAND, 5 ); - - wxBoxSizer* bMiddleBoxSizer; - bMiddleBoxSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_Choice_Drill_MapChoices[] = { _("HPGL"), _("PostScript"), _("Gerber"), _("DXF"), _("SVG"), _("PDF") }; - int m_Choice_Drill_MapNChoices = sizeof( m_Choice_Drill_MapChoices ) / sizeof( wxString ); - m_Choice_Drill_Map = new wxRadioBox( this, wxID_ANY, _("Drill Map File Format:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_MapNChoices, m_Choice_Drill_MapChoices, 1, wxRA_SPECIFY_COLS ); - m_Choice_Drill_Map->SetSelection( 1 ); - m_Choice_Drill_Map->SetToolTip( _("Creates a drill map in PS, HPGL or other formats") ); - - bMiddleBoxSizer->Add( m_Choice_Drill_Map, 0, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* sbExcellonOptSizer; - sbExcellonOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Excellon Drill File Options:") ), wxVERTICAL ); - - m_Check_Mirror = new wxCheckBox( sbExcellonOptSizer->GetStaticBox(), wxID_ANY, _("Mirror Y axis"), wxDefaultPosition, wxDefaultSize, 0 ); - m_Check_Mirror->SetToolTip( _("Not recommended.\nUsed mostly by users who make the boards themselves.") ); - - sbExcellonOptSizer->Add( m_Check_Mirror, 0, wxRIGHT|wxLEFT, 5 ); - - m_Check_Minimal = new wxCheckBox( sbExcellonOptSizer->GetStaticBox(), wxID_ANY, _("Minimal header"), wxDefaultPosition, wxDefaultSize, 0 ); - m_Check_Minimal->SetToolTip( _("Not recommended.\nOnly use it for board houses which do not accept fully featured headers.") ); - - sbExcellonOptSizer->Add( m_Check_Minimal, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - - m_Check_Merge_PTH_NPTH = new wxCheckBox( sbExcellonOptSizer->GetStaticBox(), wxID_ANY, _("PTH and NPTH holes in single file"), wxDefaultPosition, wxDefaultSize, 0 ); - m_Check_Merge_PTH_NPTH->SetToolTip( _("Not recommended.\nOnly use for board houses which ask for merged PTH and NPTH into a single file.") ); - - sbExcellonOptSizer->Add( m_Check_Merge_PTH_NPTH, 0, wxALL, 5 ); - - - bMiddleBoxSizer->Add( sbExcellonOptSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - wxString m_Choice_Drill_OffsetChoices[] = { _("Absolute"), _("Auxiliary axis") }; - int m_Choice_Drill_OffsetNChoices = sizeof( m_Choice_Drill_OffsetChoices ) / sizeof( wxString ); - m_Choice_Drill_Offset = new wxRadioBox( this, wxID_ANY, _("Drill Origin:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_OffsetNChoices, m_Choice_Drill_OffsetChoices, 1, wxRA_SPECIFY_COLS ); - m_Choice_Drill_Offset->SetSelection( 0 ); - m_Choice_Drill_Offset->SetToolTip( _("Choose the coordinate origin: absolute or relative to the auxiliray axis") ); - - bMiddleBoxSizer->Add( m_Choice_Drill_Offset, 0, wxALL|wxEXPAND, 5 ); - - - bmiddlerSizer->Add( bMiddleBoxSizer, 0, wxEXPAND, 5 ); + bmiddlerSizer->Add( bLeftSizer, 1, wxEXPAND, 5 ); wxBoxSizer* bRightBoxSizer; bRightBoxSizer = new wxBoxSizer( wxVERTICAL ); - m_DefaultViasDrillSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default Via Drill:") ), wxVERTICAL ); - - m_ViaDrillValue = new wxStaticText( m_DefaultViasDrillSizer->GetStaticBox(), wxID_ANY, _("Via Drill Value"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ViaDrillValue->Wrap( -1 ); - m_DefaultViasDrillSizer->Add( m_ViaDrillValue, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - - bRightBoxSizer->Add( m_DefaultViasDrillSizer, 0, wxALL|wxEXPAND, 5 ); - - m_MicroViasDrillSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Micro Vias Drill:") ), wxVERTICAL ); - - m_MicroViaDrillValue = new wxStaticText( m_MicroViasDrillSizer->GetStaticBox(), wxID_ANY, _("Micro via drill size"), wxDefaultPosition, wxDefaultSize, 0 ); - m_MicroViaDrillValue->Wrap( -1 ); - m_MicroViasDrillSizer->Add( m_MicroViaDrillValue, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - - bRightBoxSizer->Add( m_MicroViasDrillSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - wxStaticBoxSizer* sbSizerHoles; - sbSizerHoles = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Holes Count:") ), wxVERTICAL ); + sbSizerHoles = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Hole Counts") ), wxVERTICAL ); wxFlexGridSizer* fgSizer2; fgSizer2 = new wxFlexGridSizer( 0, 2, 0, 0 ); @@ -199,43 +189,40 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con bRightBoxSizer->Add( sbSizerHoles, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - bmiddlerSizer->Add( bRightBoxSizer, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizerButtons; - bSizerButtons = new wxBoxSizer( wxVERTICAL ); - - - bSizerButtons->Add( 0, 0, 0, wxALL, 5 ); - - m_buttonDrill = new wxButton( this, ID_GEN_DRILL_FILE, _("Generate Drill File"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonDrill->SetDefault(); - bSizerButtons->Add( m_buttonDrill, 0, wxALL|wxEXPAND, 5 ); - - m_buttonMap = new wxButton( this, wxID_ANY, _("Generate Map File"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerButtons->Add( m_buttonMap, 0, wxALL|wxEXPAND, 5 ); - - m_buttonReport = new wxButton( this, wxID_ANY, _("Generate Report File"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerButtons->Add( m_buttonReport, 0, wxALL|wxEXPAND, 5 ); - - m_CancelButton = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerButtons->Add( m_CancelButton, 0, wxALL|wxEXPAND, 5 ); - - - bmiddlerSizer->Add( bSizerButtons, 1, wxEXPAND|wxRIGHT, 5 ); + bmiddlerSizer->Add( bRightBoxSizer, 1, wxEXPAND|wxTOP, 5 ); bMainSizer->Add( bmiddlerSizer, 0, wxEXPAND|wxTOP, 2 ); - wxStaticBoxSizer* bmsgSizer; - bmsgSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxVERTICAL ); + wxStaticBoxSizer* bMsgSizer; + bMsgSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages") ), wxVERTICAL ); - m_messagesBox = new wxTextCtrl( bmsgSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); + m_messagesBox = new wxTextCtrl( bMsgSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); m_messagesBox->SetMinSize( wxSize( -1,90 ) ); - bmsgSizer->Add( m_messagesBox, 1, wxALL|wxEXPAND, 5 ); + bMsgSizer->Add( m_messagesBox, 1, wxALL|wxEXPAND, 5 ); - bMainSizer->Add( bmsgSizer, 1, wxEXPAND, 5 ); + bMainSizer->Add( bMsgSizer, 1, wxALL|wxEXPAND, 5 ); + + m_buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonReport = new wxButton( this, wxID_ANY, _("Generate Report File"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonsSizer->Add( m_buttonReport, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Apply = new wxButton( this, wxID_APPLY ); + m_sdbSizer1->AddButton( m_sdbSizer1Apply ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + + m_buttonsSizer->Add( m_sdbSizer1, 1, wxEXPAND, 5 ); + + + bMainSizer->Add( m_buttonsSizer, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bMainSizer ); @@ -246,25 +233,25 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con // Connect Events m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); - m_rbFileFormat->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this ); + m_rbExcellon->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this ); + m_rbGerberX2->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this ); m_Choice_Unit->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelDrillUnitsSelected ), NULL, this ); m_Choice_Zeros_Format->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelZerosFmtSelected ), NULL, this ); - m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenDrillFile ), NULL, this ); - m_buttonMap->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenMapFile ), NULL, this ); m_buttonReport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenReportFile ), NULL, this ); - m_CancelButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnCancelClick ), NULL, this ); + m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenMapFile ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenDrillFile ), NULL, this ); } DIALOG_GENDRILL_BASE::~DIALOG_GENDRILL_BASE() { // Disconnect Events m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); - m_rbFileFormat->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this ); + m_rbExcellon->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this ); + m_rbGerberX2->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this ); m_Choice_Unit->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelDrillUnitsSelected ), NULL, this ); m_Choice_Zeros_Format->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelZerosFmtSelected ), NULL, this ); - m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenDrillFile ), NULL, this ); - m_buttonMap->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenMapFile ), NULL, this ); m_buttonReport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenReportFile ), NULL, this ); - m_CancelButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnCancelClick ), NULL, this ); + m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenMapFile ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenDrillFile ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_gendrill_base.fbp b/pcbnew/dialogs/dialog_gendrill_base.fbp index 8693907a91..325a5d6231 100644 --- a/pcbnew/dialogs/dialog_gendrill_base.fbp +++ b/pcbnew/dialogs/dialog_gendrill_base.fbp @@ -94,8 +94,8 @@ wxVERTICAL none - 5 - wxALL|wxEXPAND + 10 + wxEXPAND|wxTOP 0 @@ -103,8 +103,8 @@ wxHORIZONTAL none - 5 - wxALIGN_CENTER_VERTICAL|wxALL + 10 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 0 1 @@ -134,7 +134,7 @@ 0 0 wxID_ANY - Output Directory: + Output folder: 0 @@ -223,7 +223,7 @@ 0 0 - -1,24 + -1,22 1 m_outputDirectoryName 1 @@ -277,7 +277,7 @@ - 2 + 7 wxRIGHT 0 @@ -319,7 +319,7 @@ 0 - + 30,28 1 m_browseButton 1 @@ -383,12 +383,478 @@ 5 wxEXPAND - 0 + 1 - m_LeftBoxSizer + bMiddleSizer wxVERTICAL none + + 5 + wxEXPAND|wxALL + 1 + + wxID_ANY + Drill File Format + + sbSizer6 + wxVERTICAL + 1 + none + + + 5 + wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Excellon + + 0 + + + 0 + + 1 + m_rbExcellon + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + onFileFormatSelection + + + + + + + + + + 12 + wxEXPAND|wxLEFT + 1 + + + bSizerExcellonOptions + wxVERTICAL + none + + 5 + wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Mirror Y axis + + 0 + + + 0 + + 1 + m_Check_Mirror + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Not recommended. Used mostly by users who make the boards themselves. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Minimal header + + 0 + + + 0 + + 1 + m_Check_Minimal + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Not recommended. Only use it for board houses which do not accept fully featured headers. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + PTH and NPTH in single file + + 0 + + + 0 + + 1 + m_Check_Merge_PTH_NPTH + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Not recommended. Only use for board houses which ask for merged PTH and NPTH into a single file. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Gerber X2 (experimental) + + 0 + + + 0 + + 1 + m_rbGerberX2 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + onFileFormatSelection + + + + + + + + + + 5 wxALL|wxEXPAND @@ -407,7 +873,7 @@ 1 0 - "Excellon" "Gerber X2 (experimental)" + "HPGL" "PostScript" "Gerber" "DXF" "SVG" "PDF" 1 1 @@ -422,7 +888,7 @@ 0 0 wxID_ANY - File Format: + Map File Format 1 0 @@ -431,7 +897,7 @@ 0 1 - m_rbFileFormat + m_Choice_Drill_Map 1 @@ -439,13 +905,13 @@ 1 Resizable - 0 + 1 1 wxRA_SPECIFY_COLS 0 - + Creates a drill map in PS, HPGL or other formats wxFILTER_NONE wxDefaultValidator @@ -470,7 +936,108 @@ - onFileFormatSelection + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bLeftSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Absolute" "Auxiliary axis" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Drill Origin + 1 + + 0 + + + 0 + + 1 + m_Choice_Drill_Offset + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + Choose the coordinate origin: absolute or relative to the auxiliray axis + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + @@ -512,7 +1079,7 @@ 0 0 wxID_ANY - Drill Units: + Drill Units 1 0 @@ -602,7 +1169,7 @@ 0 0 wxID_ANY - Zeros Format: + Zeros Format 1 0 @@ -847,686 +1414,20 @@ 5 - wxEXPAND - 0 - - - bMiddleBoxSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "HPGL" "PostScript" "Gerber" "DXF" "SVG" "PDF" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Drill Map File Format: - 1 - - 0 - - - 0 - - 1 - m_Choice_Drill_Map - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - Creates a drill map in PS, HPGL or other formats - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - wxID_ANY - Excellon Drill File Options: - - sbExcellonOptSizer - wxVERTICAL - 1 - none - - - 5 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Mirror Y axis - - 0 - - - 0 - - 1 - m_Check_Mirror - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Not recommended. Used mostly by users who make the boards themselves. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Minimal header - - 0 - - - 0 - - 1 - m_Check_Minimal - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Not recommended. Only use it for board houses which do not accept fully featured headers. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - PTH and NPTH holes in single file - - 0 - - - 0 - - 1 - m_Check_Merge_PTH_NPTH - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Not recommended. Only use for board houses which ask for merged PTH and NPTH into a single file. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Absolute" "Auxiliary axis" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Drill Origin: - 1 - - 0 - - - 0 - - 1 - m_Choice_Drill_Offset - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Choose the coordinate origin: absolute or relative to the auxiliray axis - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 + wxEXPAND|wxTOP + 1 bRightBoxSizer wxVERTICAL none - - 5 - wxALL|wxEXPAND - 0 - - wxID_ANY - Default Via Drill: - - m_DefaultViasDrillSizer - wxVERTICAL - 1 - protected - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Via Drill Value - - 0 - - - 0 - - 1 - m_ViaDrillValue - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - wxID_ANY - Micro Vias Drill: - - m_MicroViasDrillSizer - wxVERTICAL - 1 - protected - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Micro via drill size - - 0 - - - 0 - - 1 - m_MicroViaDrillValue - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 1 wxID_ANY - Holes Count: + Hole Counts sbSizerHoles wxVERTICAL @@ -2385,390 +2286,17 @@ - - 5 - wxEXPAND|wxRIGHT - 1 - - - bSizerButtons - wxVERTICAL - none - - 5 - wxALL - 0 - - 0 - protected - 0 - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_GEN_DRILL_FILE - Generate Drill File - - 0 - - - 0 - - 1 - m_buttonDrill - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnGenDrillFile - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Generate Map File - - 0 - - - 0 - - 1 - m_buttonMap - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnGenMapFile - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Generate Report File - - 0 - - - 0 - - 1 - m_buttonReport - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnGenReportFile - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Close - - 0 - - - 0 - - 1 - m_CancelButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND + wxALL|wxEXPAND 1 wxID_ANY - Messages: + Messages - bmsgSizer + bMsgSizer wxVERTICAL 1 none @@ -2866,6 +2394,131 @@ + + 5 + wxALL|wxEXPAND + 0 + + + m_buttonsSizer + wxHORIZONTAL + protected + + 10 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Generate Report File + + 0 + + + 0 + + 1 + m_buttonReport + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnGenReportFile + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + OnGenMapFile + + + + + OnGenDrillFile + + + + + + diff --git a/pcbnew/dialogs/dialog_gendrill_base.h b/pcbnew/dialogs/dialog_gendrill_base.h index 50ef51951f..cba6f37de7 100644 --- a/pcbnew/dialogs/dialog_gendrill_base.h +++ b/pcbnew/dialogs/dialog_gendrill_base.h @@ -25,14 +25,14 @@ #include #include #include -#include +#include #include #include +#include #include /////////////////////////////////////////////////////////////////////////// -#define ID_GEN_DRILL_FILE 1000 /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_GENDRILL_BASE @@ -45,20 +45,17 @@ class DIALOG_GENDRILL_BASE : public DIALOG_SHIM wxStaticText* staticTextOutputDir; wxTextCtrl* m_outputDirectoryName; wxBitmapButton* m_browseButton; - wxRadioBox* m_rbFileFormat; + wxRadioButton* m_rbExcellon; + wxCheckBox* m_Check_Mirror; + wxCheckBox* m_Check_Minimal; + wxCheckBox* m_Check_Merge_PTH_NPTH; + wxRadioButton* m_rbGerberX2; + wxRadioBox* m_Choice_Drill_Map; + wxRadioBox* m_Choice_Drill_Offset; wxRadioBox* m_Choice_Unit; wxRadioBox* m_Choice_Zeros_Format; wxStaticText* m_staticTextTitle; wxStaticText* m_staticTextPrecision; - wxRadioBox* m_Choice_Drill_Map; - wxCheckBox* m_Check_Mirror; - wxCheckBox* m_Check_Minimal; - wxCheckBox* m_Check_Merge_PTH_NPTH; - wxRadioBox* m_Choice_Drill_Offset; - wxStaticBoxSizer* m_DefaultViasDrillSizer; - wxStaticText* m_ViaDrillValue; - wxStaticBoxSizer* m_MicroViasDrillSizer; - wxStaticText* m_MicroViaDrillValue; wxStaticText* staticTextPlatedPads; wxStaticText* m_PlatedPadsCountInfoMsg; wxStaticText* staticTextNonPlatedPads; @@ -69,21 +66,22 @@ class DIALOG_GENDRILL_BASE : public DIALOG_SHIM wxStaticText* m_MicroViasInfoMsg; wxStaticText* staticTextBuriedVias; wxStaticText* m_BuriedViasInfoMsg; - wxButton* m_buttonDrill; - wxButton* m_buttonMap; - wxButton* m_buttonReport; - wxButton* m_CancelButton; wxTextCtrl* m_messagesBox; + wxBoxSizer* m_buttonsSizer; + wxButton* m_buttonReport; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Apply; + wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } virtual void onFileFormatSelection( wxCommandEvent& event ) { event.Skip(); } virtual void OnSelDrillUnitsSelected( wxCommandEvent& event ) { event.Skip(); } virtual void OnSelZerosFmtSelected( wxCommandEvent& event ) { event.Skip(); } - virtual void OnGenDrillFile( wxCommandEvent& event ) { event.Skip(); } - virtual void OnGenMapFile( wxCommandEvent& event ) { event.Skip(); } virtual void OnGenReportFile( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnGenMapFile( wxCommandEvent& event ) { event.Skip(); } + virtual void OnGenDrillFile( wxCommandEvent& event ) { event.Skip(); } public: diff --git a/pcbnew/dialogs/dialog_netlist.cpp b/pcbnew/dialogs/dialog_netlist.cpp index cba95c9bc0..c2ba624746 100644 --- a/pcbnew/dialogs/dialog_netlist.cpp +++ b/pcbnew/dialogs/dialog_netlist.cpp @@ -49,31 +49,17 @@ #include #include -#define NETLIST_SILENTMODE_KEY wxT("SilentMode") #define NETLIST_FILTER_MESSAGES_KEY wxT("NetlistReportFilterMsg") +#define NETLIST_UPDATEFOOTPRINTS_KEY wxT("NetlistUpdateFootprints") +#define NETLIST_DELETESHORTINGTRACKS_KEY wxT("NetlistDeleteShortingTracks") +#define NETLIST_DELETEEXTRAFOOTPRINTS_KEY wxT("NetlistDeleteExtraFootprints") #define NETLIST_DELETESINGLEPADNETS_KEY wxT("NetlistDeleteSinglePadNets") void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC ) { - /* Setup the netlist file name to the last netlist file read, - * or the board file name if the last filename is empty or last file not existing. - */ wxString netlistName = GetLastNetListRead(); - wxFileName fn = netlistName; - - if( !fn.IsOk() || !fn.FileExists() ) - { - fn = GetBoard()->GetFileName(); - fn.SetExt( NetlistFileExtension ); - - if( fn.GetName().IsEmpty() ) - netlistName.Clear(); - else - netlistName = fn.GetFullPath(); - } - - DIALOG_NETLIST dlg( this, DC, netlistName ); + DIALOG_NETLIST dlg( this, netlistName ); dlg.ShowModal(); @@ -84,139 +70,112 @@ void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC ) if( configChanged && !GetBoard()->GetFileName().IsEmpty() && IsOK( this, _( "The project configuration has changed. Do you want to save it?" ) ) ) { - fn = Prj().AbsolutePath( GetBoard()->GetFileName() ); + wxFileName fn = Prj().AbsolutePath( GetBoard()->GetFileName() ); fn.SetExt( ProjectFileExtension ); - - wxString pro_name = fn.GetFullPath(); - - Prj().ConfigSave( Kiface().KifaceSearch(), GROUP_PCB, - GetProjectFileParameters(), pro_name ); + wxString path = fn.GetFullPath(); + Prj().ConfigSave( Kiface().KifaceSearch(), GROUP_PCB, GetProjectFileParameters(), path ); } } -DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC, - const wxString & aNetlistFullFilename ) - : DIALOG_NETLIST_BASE( aParent ) +DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, const wxString & aNetlistFullFilename ) + : DIALOG_NETLIST_BASE( aParent ), + m_parent( aParent ), + m_initialized( false ) { - m_parent = aParent; - m_dc = aDC; m_config = Kiface().KifaceSettings(); - m_silentMode = m_config->Read( NETLIST_SILENTMODE_KEY, 0l ); - bool tmp = m_config->Read( NETLIST_DELETESINGLEPADNETS_KEY, 0l ); - m_rbSingleNets->SetSelection( tmp == 0 ? 0 : 1); - m_browseButton->SetBitmap( KiBitmap( browse_files_xpm ) ); m_NetlistFilenameCtrl->SetValue( aNetlistFullFilename ); - m_checkBoxSilentMode->SetValue( m_silentMode ); + m_browseButton->SetBitmap( KiBitmap( folder_xpm ) ); - int severities = m_config->Read( NETLIST_FILTER_MESSAGES_KEY, -1l ); - m_MessageWindow->SetVisibleSeverities( severities ); + m_cbUpdateFootprints->SetValue( m_config->Read( NETLIST_UPDATEFOOTPRINTS_KEY, 0l ) ); + m_cbDeleteShortingTracks->SetValue( m_config->Read( NETLIST_DELETESHORTINGTRACKS_KEY, 0l ) ); + m_cbDeleteExtraFootprints->SetValue( m_config->Read( NETLIST_DELETEEXTRAFOOTPRINTS_KEY, 0l ) ); + m_cbDeleteSinglePadNets->SetValue( m_config->Read( NETLIST_DELETESINGLEPADNETS_KEY, 0l ) ); - // Update sizes and sizers: - m_MessageWindow->MsgPanelSetMinSize( wxSize( -1, 160 ) ); - GetSizer()->SetSizeHints( this ); + m_MessageWindow->SetLabel( _("Changes To Be Applied") ); + m_MessageWindow->SetVisibleSeverities( m_config->Read( NETLIST_FILTER_MESSAGES_KEY, -1l ) ); + + // We use a sdbSizer to get platform-dependent ordering of the action buttons, but + // that requires us to correct the button labels here. + m_sdbSizer1OK->SetLabel( _( "Update PCB" ) ); + m_sdbSizer1Apply->SetLabel( _( "Rebuild Ratsnest" ) ); + m_sdbSizer1Cancel->SetLabel( _( "Close" ) ); + m_buttonsSizer->Layout(); + + m_sdbSizer1OK->SetDefault(); + FinishDialogSettings(); + + m_initialized = true; + loadNetlist( true ); } DIALOG_NETLIST::~DIALOG_NETLIST() { - m_config->Write( NETLIST_SILENTMODE_KEY, (long) m_silentMode ); - m_config->Write( NETLIST_DELETESINGLEPADNETS_KEY, - (long) m_rbSingleNets->GetSelection() ); - m_config->Write( NETLIST_FILTER_MESSAGES_KEY, - (long) m_MessageWindow->GetVisibleSeverities() ); + m_config->Write( NETLIST_UPDATEFOOTPRINTS_KEY, m_cbUpdateFootprints->GetValue() ); + m_config->Write( NETLIST_DELETESHORTINGTRACKS_KEY, m_cbDeleteShortingTracks->GetValue() ); + m_config->Write( NETLIST_DELETEEXTRAFOOTPRINTS_KEY, m_cbDeleteExtraFootprints->GetValue() ); + m_config->Write( NETLIST_DELETESINGLEPADNETS_KEY, m_cbDeleteSinglePadNets->GetValue() ); + m_config->Write( NETLIST_FILTER_MESSAGES_KEY, (long) m_MessageWindow->GetVisibleSeverities() ); } void DIALOG_NETLIST::OnOpenNetlistClick( wxCommandEvent& event ) { - wxString lastPath = wxFileName( Prj().GetProjectFullName() ).GetPath(); + wxString dirPath = wxFileName( Prj().GetProjectFullName() ).GetPath(); - wxString lastNetlistRead = m_parent->GetLastNetListRead(); + wxString filename = m_parent->GetLastNetListRead(); - if( !lastNetlistRead.IsEmpty() && !wxFileName::FileExists( lastNetlistRead ) ) + if( !filename.IsEmpty() ) { - lastNetlistRead = wxEmptyString; - } - else - { - wxFileName fn = lastNetlistRead; - lastPath = fn.GetPath(); - lastNetlistRead = fn.GetFullName(); + wxFileName fn = filename; + dirPath = fn.GetPath(); + filename = fn.GetFullName(); } - wxLogDebug( wxT( "Last net list read path '%s', file name '%s'." ), - GetChars( lastPath ), GetChars( lastNetlistRead ) ); - - wxFileDialog FilesDialog( this, _( "Select Netlist" ), lastPath, lastNetlistRead, + wxFileDialog FilesDialog( this, _( "Select Netlist" ), dirPath, filename, NetlistFileWildcard(), wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST ); if( FilesDialog.ShowModal() != wxID_OK ) return; m_NetlistFilenameCtrl->SetValue( FilesDialog.GetPath() ); + onFilenameChanged(); } -void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event ) +void DIALOG_NETLIST::OnUpdatePCB( wxCommandEvent& event ) { - wxString netlistFileName = m_NetlistFilenameCtrl->GetValue(); - wxFileName fn = netlistFileName; + wxFileName fn = m_NetlistFilenameCtrl->GetValue(); if( !fn.IsOk() ) { - wxMessageBox( _("Please, choose a valid netlist file") ); + wxMessageBox( _("Please, choose a valid netlist file.") ); return; } if( !fn.FileExists() ) { - wxMessageBox( _("The netlist file does not exist") ); + wxMessageBox( _("The netlist file does not exist.") ); return; } // Give the user a chance to bail out when making changes from a netlist. - if( !m_checkDryRun->GetValue() && !m_silentMode - && !m_parent->GetBoard()->IsEmpty() - && !IsOK( this, _( "The changes made by reading the netlist cannot be undone. Are you " - "sure you want to read the netlist?" ) ) ) - return; + if( m_parent->GetBoard()->IsEmpty() + || IsOK( this, _( "The changes made cannot be undone. Are you sure you want to update the PCB?" ) ) ) + { + m_MessageWindow->SetLabel( _( "Changes Applied To PCB" ) ); + loadNetlist( false ); - m_MessageWindow->Clear(); - REPORTER& reporter = m_MessageWindow->Reporter(); - - wxBusyCursor busy; - - wxString msg; - msg.Printf( _( "Reading netlist file \"%s\".\n" ), GetChars( netlistFileName ) ); - reporter.ReportHead( msg, REPORTER::RPT_INFO ); - - if( m_Select_By_Timestamp->GetSelection() == 1 ) - msg = _( "Using time stamps to match components and footprints.\n" ); - else - msg = _( "Using references to match components and footprints.\n" ); - - reporter.ReportHead( msg, REPORTER::RPT_INFO ); - m_MessageWindow->SetLazyUpdate( true ); // use a "lazy" update to speed up the creation of the report - // (The window is not updated for each message) - - m_parent->ReadPcbNetlist( netlistFileName, wxEmptyString, &reporter, - m_ChangeExistingFootprintCtrl->GetSelection() == 1, - m_DeleteBadTracks->GetSelection() == 1, - m_RemoveExtraFootprintsCtrl->GetSelection() == 1, - m_Select_By_Timestamp->GetSelection() == 1, - m_rbSingleNets->GetSelection() == 1, - m_checkDryRun->GetValue() ); - // The creation of the report was made without window update: - // the full page must be displayed - m_MessageWindow->Flush( true ); + m_sdbSizer1Cancel->SetDefault(); + } } void DIALOG_NETLIST::OnTestFootprintsClick( wxCommandEvent& event ) { - if( m_parent->GetBoard()->m_Modules == NULL ) + if( m_parent->GetBoard()->m_Modules == nullptr ) { - DisplayInfoMessage( this, _( "No footprints" ) ); + DisplayInfoMessage( this, _( "No footprints." ) ); return; } @@ -324,9 +283,47 @@ void DIALOG_NETLIST::OnTestFootprintsClick( wxCommandEvent& event ) } -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COMPILE_RATSNEST - */ +void DIALOG_NETLIST::OnFilenameKillFocus( wxFocusEvent& event ) +{ + onFilenameChanged(); +} + + +void DIALOG_NETLIST::onFilenameChanged() +{ + if( m_initialized ) + { + wxFileName fn = m_NetlistFilenameCtrl->GetValue(); + if( fn.IsOk() ) + { + if( fn.FileExists() ) + { + loadNetlist( true ); + } + else + { + m_MessageWindow->Clear(); + REPORTER& reporter = m_MessageWindow->Reporter(); + reporter.Report( _("The netlist file does not exist."), REPORTER::RPT_ERROR ); + } + } + } +} + + +void DIALOG_NETLIST::OnMatchChanged( wxCommandEvent& event ) +{ + if( m_initialized ) + loadNetlist( true ); +} + + +void DIALOG_NETLIST::OnOptionChanged( wxCommandEvent& event ) +{ + if( m_initialized ) + loadNetlist( true ); +} + void DIALOG_NETLIST::OnCompileRatsnestClick( wxCommandEvent& event ) { @@ -336,16 +333,6 @@ void DIALOG_NETLIST::OnCompileRatsnestClick( wxCommandEvent& event ) } -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL - */ - -void DIALOG_NETLIST::OnCancelClick( wxCommandEvent& event ) -{ - EndModal( wxID_CANCEL ); -} - - void DIALOG_NETLIST::OnUpdateUIValidNetlistFile( wxUpdateUIEvent& aEvent ) { aEvent.Enable( !m_NetlistFilenameCtrl->GetValue().IsEmpty() ); @@ -435,3 +422,44 @@ bool DIALOG_NETLIST::verifyFootprints( const wxString& aNetlistFilename, return true; } + + +void DIALOG_NETLIST::loadNetlist( bool aDryRun ) +{ + wxString netlistFileName = m_NetlistFilenameCtrl->GetValue(); + wxFileName fn = netlistFileName; + + if( !fn.IsOk() || !fn.FileExists() ) + return; + + m_MessageWindow->Clear(); + REPORTER& reporter = m_MessageWindow->Reporter(); + + wxBusyCursor busy; + + wxString msg; + msg.Printf( _( "Reading netlist file \"%s\".\n" ), GetChars( netlistFileName ) ); + reporter.ReportHead( msg, REPORTER::RPT_INFO ); + + if( m_matchByTimestamp->GetSelection() == 0 ) + msg = _( "Using time stamps to match components and footprints.\n" ); + else + msg = _( "Using references to match components and footprints.\n" ); + + reporter.ReportHead( msg, REPORTER::RPT_INFO ); + m_MessageWindow->SetLazyUpdate( true ); // Use lazy update to speed the creation of the report + // (the window is not updated for each message) + + m_parent->ReadPcbNetlist( netlistFileName, wxEmptyString, &reporter, + m_cbUpdateFootprints->GetValue(), + m_cbDeleteShortingTracks->GetValue(), + m_cbDeleteExtraFootprints->GetValue(), + m_matchByTimestamp->GetSelection() == 0, + m_cbDeleteSinglePadNets->GetValue(), + aDryRun ); + + // The creation of the report was made without window update: the full page must be displayed + m_MessageWindow->Flush( true ); +} + + diff --git a/pcbnew/dialogs/dialog_netlist.h b/pcbnew/dialogs/dialog_netlist.h index 4fe8b93052..aab1a4bdf9 100644 --- a/pcbnew/dialogs/dialog_netlist.h +++ b/pcbnew/dialogs/dialog_netlist.h @@ -39,15 +39,16 @@ class DIALOG_NETLIST : public DIALOG_NETLIST_BASE { private: PCB_EDIT_FRAME* m_parent; - wxDC* m_dc; - bool m_silentMode; // if true, do not display warning message about undo wxConfigBase* m_config; + bool m_initialized; public: - DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC* aDC, const wxString & aNetlistFullFilename ); + DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, const wxString & aNetlistFullFilename ); ~DIALOG_NETLIST(); private: + void onFilenameChanged(); + /** * Function verifyFootprints * compares the netlist to the board and builds a list of duplicate, missing, and @@ -69,25 +70,16 @@ private: wxArrayString& aMissing, std::vector< MODULE* >& aNotInNetlist ); - /** - * Function loadFootprints - * loads the footprints for each #COMPONENT in \a aNetlist from the list of libraries. - * - * @param aNetlist is the netlist of components to load the footprints into. - */ - void loadFootprints( NETLIST& aNetlist ); + void loadNetlist( bool aDryRun ); // Virtual event handlers: void OnOpenNetlistClick( wxCommandEvent& event ) override; - void OnReadNetlistFileClick( wxCommandEvent& event ) override; + void OnUpdatePCB( wxCommandEvent& event ) override; + void OnFilenameKillFocus( wxFocusEvent& event ) override; + void OnMatchChanged( wxCommandEvent& event ) override; + void OnOptionChanged( wxCommandEvent& event ) override; void OnTestFootprintsClick( wxCommandEvent& event ) override; void OnCompileRatsnestClick( wxCommandEvent& event ) override; - void OnCancelClick( wxCommandEvent& event ) override; - void OnClickSilentMode( wxCommandEvent& event ) override - { - m_silentMode = m_checkBoxSilentMode->GetValue(); - } - void OnUpdateUIValidNetlistFile( wxUpdateUIEvent& aEvent ) override; }; diff --git a/pcbnew/dialogs/dialog_netlist_base.cpp b/pcbnew/dialogs/dialog_netlist_base.cpp index 6cb91cd605..647cf8818d 100644 --- a/pcbnew/dialogs/dialog_netlist_base.cpp +++ b/pcbnew/dialogs/dialog_netlist_base.cpp @@ -18,151 +18,87 @@ DIALOG_NETLIST_BASE::DIALOG_NETLIST_BASE( wxWindow* parent, wxWindowID id, const wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bUpperSizer; - bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bleftSizer; - bleftSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bnetlistOptSizer; - bnetlistOptSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bmodulesOptSizer; - bmodulesOptSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_Select_By_TimestampChoices[] = { _("Reference"), _("Timestamp") }; - int m_Select_By_TimestampNChoices = sizeof( m_Select_By_TimestampChoices ) / sizeof( wxString ); - m_Select_By_Timestamp = new wxRadioBox( this, wxID_ANY, _("Footprint Selection:"), wxDefaultPosition, wxDefaultSize, m_Select_By_TimestampNChoices, m_Select_By_TimestampChoices, 1, wxRA_SPECIFY_COLS ); - m_Select_By_Timestamp->SetSelection( 0 ); - m_Select_By_Timestamp->SetToolTip( _("Select how footprints are recognized:\nby their reference (U1, R3...) (normal setting)\nor their time stamp (special setting after a full schematic reannotation)") ); - - bmodulesOptSizer->Add( m_Select_By_Timestamp, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxString m_ChangeExistingFootprintCtrlChoices[] = { _("Keep"), _("Change") }; - int m_ChangeExistingFootprintCtrlNChoices = sizeof( m_ChangeExistingFootprintCtrlChoices ) / sizeof( wxString ); - m_ChangeExistingFootprintCtrl = new wxRadioBox( this, wxID_ANY, _("Exchange Footprint:"), wxDefaultPosition, wxDefaultSize, m_ChangeExistingFootprintCtrlNChoices, m_ChangeExistingFootprintCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_ChangeExistingFootprintCtrl->SetSelection( 0 ); - m_ChangeExistingFootprintCtrl->SetToolTip( _("Keep or change an existing footprint when the netlist gives a different footprint") ); - - bmodulesOptSizer->Add( m_ChangeExistingFootprintCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - - bnetlistOptSizer->Add( bmodulesOptSizer, 1, wxEXPAND, 5 ); - - wxBoxSizer* bTracksSizer; - bTracksSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_DeleteBadTracksChoices[] = { _("Keep"), _("Delete") }; - int m_DeleteBadTracksNChoices = sizeof( m_DeleteBadTracksChoices ) / sizeof( wxString ); - m_DeleteBadTracks = new wxRadioBox( this, wxID_ANY, _("Tracks Joining Multiple Nets:"), wxDefaultPosition, wxDefaultSize, m_DeleteBadTracksNChoices, m_DeleteBadTracksChoices, 1, wxRA_SPECIFY_COLS ); - m_DeleteBadTracks->SetSelection( 0 ); - m_DeleteBadTracks->SetToolTip( _("Keep or delete tracks creating a short circuit between two nets after a netlist change") ); - - bTracksSizer->Add( m_DeleteBadTracks, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxString m_RemoveExtraFootprintsCtrlChoices[] = { _("Keep"), _("Delete") }; - int m_RemoveExtraFootprintsCtrlNChoices = sizeof( m_RemoveExtraFootprintsCtrlChoices ) / sizeof( wxString ); - m_RemoveExtraFootprintsCtrl = new wxRadioBox( this, wxID_ANY, _("Extra Footprints:"), wxDefaultPosition, wxDefaultSize, m_RemoveExtraFootprintsCtrlNChoices, m_RemoveExtraFootprintsCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_RemoveExtraFootprintsCtrl->SetSelection( 0 ); - m_RemoveExtraFootprintsCtrl->SetToolTip( _("Remove footprints found on the Board but not in netlist\nNote: only not locked footprints will be removed") ); - - bTracksSizer->Add( m_RemoveExtraFootprintsCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxString m_rbSingleNetsChoices[] = { _("Keep"), _("Delete") }; - int m_rbSingleNetsNChoices = sizeof( m_rbSingleNetsChoices ) / sizeof( wxString ); - m_rbSingleNets = new wxRadioBox( this, wxID_ANY, _("Single Pad Nets:"), wxDefaultPosition, wxDefaultSize, m_rbSingleNetsNChoices, m_rbSingleNetsChoices, 1, wxRA_SPECIFY_COLS ); - m_rbSingleNets->SetSelection( 0 ); - bTracksSizer->Add( m_rbSingleNets, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - - bnetlistOptSizer->Add( bTracksSizer, 1, wxEXPAND, 5 ); - - - bleftSizer->Add( bnetlistOptSizer, 1, wxEXPAND, 5 ); - - - bUpperSizer->Add( bleftSizer, 1, wxEXPAND, 5 ); - - wxBoxSizer* bRightSizerButtons; - bRightSizerButtons = new wxBoxSizer( wxVERTICAL ); - - - bRightSizerButtons->Add( 0, 0, 1, wxALL|wxEXPAND, 5 ); - - m_buttonRead = new wxButton( this, ID_READ_NETLIST_FILE, _("Read Current Netlist"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonRead->SetDefault(); - m_buttonRead->SetToolTip( _("Read the current netlist and update connections and connectivity info") ); - - bRightSizerButtons->Add( m_buttonRead, 0, wxEXPAND|wxALL, 5 ); - - m_buttonClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizerButtons->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 ); - - m_buttonFPTest = new wxButton( this, ID_TEST_NETLIST, _("Test Footprints"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonFPTest->SetToolTip( _("Read the current netlist file and list missing and extra footprints") ); - - bRightSizerButtons->Add( m_buttonFPTest, 0, wxEXPAND|wxALL, 5 ); - - m_buttonRebild = new wxButton( this, ID_COMPILE_RATSNEST, _("Rebuild Board Connectivity"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonRebild->SetToolTip( _("Rebuild the full ratsnest (useful after a manual pad netname edition)") ); - - bRightSizerButtons->Add( m_buttonRebild, 0, wxEXPAND|wxALL, 5 ); - - - bUpperSizer->Add( bRightSizerButtons, 0, wxBOTTOM|wxLEFT|wxTOP, 5 ); - - - bMainSizer->Add( bUpperSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_staticline11 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainSizer->Add( m_staticline11, 0, wxEXPAND | wxALL, 5 ); - - wxBoxSizer* bCenterSizer; - bCenterSizer = new wxBoxSizer( wxVERTICAL ); - - m_checkDryRun = new wxCheckBox( this, wxID_ANY, _("Dry run. Only report changes in message panel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkDryRun->SetToolTip( _("Dry Run:\nThe netlist is read, but no change is actually made on board.\nChanges are only reported in message panel, for info") ); - - bCenterSizer->Add( m_checkDryRun, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_checkBoxSilentMode = new wxCheckBox( this, wxID_ANY, _("Silent mode"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxSilentMode->SetToolTip( _("Silent mode:\nDo not show the warning message before reading the netlist") ); - - bCenterSizer->Add( m_checkBoxSilentMode, 0, wxRIGHT|wxLEFT, 5 ); - - - bMainSizer->Add( bCenterSizer, 0, wxALL|wxEXPAND, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); - - wxBoxSizer* bLowerSizer; - bLowerSizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizerNetlistFilename; bSizerNetlistFilename = new wxBoxSizer( wxHORIZONTAL ); wxStaticText* staticTextNetlistFile; staticTextNetlistFile = new wxStaticText( this, wxID_ANY, _("Netlist file:"), wxDefaultPosition, wxDefaultSize, 0 ); staticTextNetlistFile->Wrap( -1 ); - bSizerNetlistFilename->Add( staticTextNetlistFile, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizerNetlistFilename->Add( staticTextNetlistFile, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); m_NetlistFilenameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); bSizerNetlistFilename->Add( m_NetlistFilenameCtrl, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 ); m_browseButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); - bSizerNetlistFilename->Add( m_browseButton, 0, 0, 5 ); + m_browseButton->SetMinSize( wxSize( 30,28 ) ); + + bSizerNetlistFilename->Add( m_browseButton, 0, wxRIGHT|wxTOP, 2 ); - bLowerSizer->Add( bSizerNetlistFilename, 0, wxEXPAND, 5 ); + bMainSizer->Add( bSizerNetlistFilename, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 ); + wxBoxSizer* bUpperSizer; + bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxString m_matchByTimestampChoices[] = { _("Keep existing symbol to footprint associations"), _("Re-associate footprints by reference") }; + int m_matchByTimestampNChoices = sizeof( m_matchByTimestampChoices ) / sizeof( wxString ); + m_matchByTimestamp = new wxRadioBox( this, wxID_ANY, _("Match Method"), wxDefaultPosition, wxDefaultSize, m_matchByTimestampNChoices, m_matchByTimestampChoices, 1, wxRA_SPECIFY_COLS ); + m_matchByTimestamp->SetSelection( 0 ); + m_matchByTimestamp->SetToolTip( _("Select how footprints are recognized:\nby their reference (U1, R3...) (normal setting)\nor their time stamp (special setting after a full schematic reannotation)") ); + + bUpperSizer->Add( m_matchByTimestamp, 1, wxALIGN_TOP|wxEXPAND|wxTOP|wxRIGHT, 5 ); + + wxStaticBoxSizer* sbSizer1; + sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); + + m_cbUpdateFootprints = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Update footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_cbUpdateFootprints, 0, wxBOTTOM, 5 ); + + m_cbDeleteShortingTracks = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Delete tracks shorting multiple nets"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_cbDeleteShortingTracks, 0, wxBOTTOM, 5 ); + + m_cbDeleteExtraFootprints = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Delete extra footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_cbDeleteExtraFootprints, 0, wxBOTTOM, 5 ); + + m_cbDeleteSinglePadNets = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Delete single-pad nets"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_cbDeleteSinglePadNets, 0, wxBOTTOM, 5 ); + + + bUpperSizer->Add( sbSizer1, 1, wxEXPAND|wxTOP|wxLEFT, 5 ); + + + bMainSizer->Add( bUpperSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + + wxBoxSizer* bLowerSizer; + bLowerSizer = new wxBoxSizer( wxVERTICAL ); + + bLowerSizer->SetMinSize( wxSize( 660,250 ) ); m_MessageWindow = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_MessageWindow->SetMinSize( wxSize( -300,150 ) ); - bLowerSizer->Add( m_MessageWindow, 1, wxEXPAND | wxALL, 5 ); - bMainSizer->Add( bLowerSizer, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + bMainSizer->Add( bLowerSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonFPTest = new wxButton( this, ID_TEST_NETLIST, _("Test Footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonFPTest->SetToolTip( _("Read the current netlist file and list missing and extra footprints") ); + + m_buttonsSizer->Add( m_buttonFPTest, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Apply = new wxButton( this, wxID_APPLY ); + m_sdbSizer1->AddButton( m_sdbSizer1Apply ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + + m_buttonsSizer->Add( m_sdbSizer1, 1, wxEXPAND, 5 ); + + + bMainSizer->Add( m_buttonsSizer, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bMainSizer ); @@ -170,28 +106,32 @@ DIALOG_NETLIST_BASE::DIALOG_NETLIST_BASE( wxWindow* parent, wxWindowID id, const bMainSizer->Fit( this ); // Connect Events - m_buttonRead->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnReadNetlistFileClick ), NULL, this ); - m_buttonRead->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_BASE::OnUpdateUIValidNetlistFile ), NULL, this ); - m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnCancelClick ), NULL, this ); + m_NetlistFilenameCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_NETLIST_BASE::OnFilenameKillFocus ), NULL, this ); + m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOpenNetlistClick ), NULL, this ); + m_matchByTimestamp->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnMatchChanged ), NULL, this ); + m_cbUpdateFootprints->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteShortingTracks->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteExtraFootprints->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteSinglePadNets->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOptionChanged ), NULL, this ); m_buttonFPTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnTestFootprintsClick ), NULL, this ); m_buttonFPTest->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_BASE::OnUpdateUIValidNetlistFile ), NULL, this ); - m_buttonRebild->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnCompileRatsnestClick ), NULL, this ); - m_buttonRebild->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_BASE::OnUpdateUIValidNetlistFile ), NULL, this ); - m_checkBoxSilentMode->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnClickSilentMode ), NULL, this ); - m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOpenNetlistClick ), NULL, this ); + m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnCompileRatsnestClick ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnUpdatePCB ), NULL, this ); } DIALOG_NETLIST_BASE::~DIALOG_NETLIST_BASE() { // Disconnect Events - m_buttonRead->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnReadNetlistFileClick ), NULL, this ); - m_buttonRead->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_BASE::OnUpdateUIValidNetlistFile ), NULL, this ); - m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnCancelClick ), NULL, this ); + m_NetlistFilenameCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_NETLIST_BASE::OnFilenameKillFocus ), NULL, this ); + m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOpenNetlistClick ), NULL, this ); + m_matchByTimestamp->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnMatchChanged ), NULL, this ); + m_cbUpdateFootprints->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteShortingTracks->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteExtraFootprints->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteSinglePadNets->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOptionChanged ), NULL, this ); m_buttonFPTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnTestFootprintsClick ), NULL, this ); m_buttonFPTest->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_BASE::OnUpdateUIValidNetlistFile ), NULL, this ); - m_buttonRebild->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnCompileRatsnestClick ), NULL, this ); - m_buttonRebild->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_BASE::OnUpdateUIValidNetlistFile ), NULL, this ); - m_checkBoxSilentMode->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnClickSilentMode ), NULL, this ); - m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnOpenNetlistClick ), NULL, this ); + m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnCompileRatsnestClick ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_BASE::OnUpdatePCB ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_netlist_base.fbp b/pcbnew/dialogs/dialog_netlist_base.fbp index 7193b33f6c..3df1788dcb 100644 --- a/pcbnew/dialogs/dialog_netlist_base.fbp +++ b/pcbnew/dialogs/dialog_netlist_base.fbp @@ -94,7 +94,285 @@ wxVERTICAL none - 5 + 10 + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 0 + + + bSizerNetlistFilename + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Netlist file: + + 0 + + + 0 + + 1 + staticTextNetlistFile + 1 + + + none + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxTOP + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + -1,-1 + 1 + m_NetlistFilenameCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + OnFilenameKillFocus + + + + + + + + + + + + + + + + + + + + + + + + + 2 + wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_ANY + Browse + + 0 + + + 0 + 30,28 + 1 + m_browseButton + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnOpenNetlistClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 wxEXPAND|wxRIGHT|wxLEFT 0 @@ -102,524 +380,114 @@ bUpperSizer wxHORIZONTAL none - + 5 - wxEXPAND + wxALIGN_TOP|wxEXPAND|wxTOP|wxRIGHT 1 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Keep existing symbol to footprint associations" "Re-associate footprints by reference" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Match Method + 1 + + 0 + + + 0 - bleftSizer - wxVERTICAL - none - - 5 - wxEXPAND - 1 - - - bnetlistOptSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - bmodulesOptSizer - wxVERTICAL - none - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Reference" "Timestamp" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Footprint Selection: - 1 - - 0 - - - 0 - - 1 - m_Select_By_Timestamp - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Select how footprints are recognized: by their reference (U1, R3...) (normal setting) or their time stamp (special setting after a full schematic reannotation) - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Keep" "Change" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Exchange Footprint: - 1 - - 0 - - - 0 - - 1 - m_ChangeExistingFootprintCtrl - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Keep or change an existing footprint when the netlist gives a different footprint - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - - bTracksSizer - wxVERTICAL - none - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Keep" "Delete" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Tracks Joining Multiple Nets: - 1 - - 0 - - - 0 - - 1 - m_DeleteBadTracks - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Keep or delete tracks creating a short circuit between two nets after a netlist change - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Keep" "Delete" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Extra Footprints: - 1 - - 0 - - - 0 - - 1 - m_RemoveExtraFootprintsCtrl - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Remove footprints found on the Board but not in netlist Note: only not locked footprints will be removed - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Keep" "Delete" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Single Pad Nets: - 1 - - 0 - - - 0 - - 1 - m_rbSingleNets - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + m_matchByTimestamp + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + Select how footprints are recognized: by their reference (U1, R3...) (normal setting) or their time stamp (special setting after a full schematic reannotation) + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + OnMatchChanged + + + + + + 5 - wxBOTTOM|wxLEFT|wxTOP - 0 - + wxEXPAND|wxTOP|wxLEFT + 1 + + wxID_ANY + Options - bRightSizerButtons + sbSizer1 wxVERTICAL + 1 none + 5 - wxALL|wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND|wxALL + wxBOTTOM 0 - + 1 1 1 @@ -633,10 +501,10 @@ 1 0 + 0 1 1 - 1 0 Dock 0 @@ -647,8 +515,8 @@ 0 0 - ID_READ_NETLIST_FILE - Read Current Netlist + wxID_ANY + Update footprints 0 @@ -656,7 +524,7 @@ 0 1 - m_buttonRead + m_cbUpdateFootprints 1 @@ -667,95 +535,7 @@ 1 - - 0 - Read the current netlist and update connections and connectivity info - - wxFILTER_NONE - wxDefaultValidator - - - - - OnReadNetlistFileClick - - - - - - - - - - - - - - - - - - - - - - - OnUpdateUIValidNetlistFile - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Close - - 0 - - - 0 - - 1 - m_buttonClose - 1 - - - protected - 1 - - Resizable - 1 - - - + ; forward_declare 0 @@ -765,8 +545,8 @@ - OnCancelClick + OnOptionChanged @@ -793,9 +573,9 @@ 5 - wxEXPAND|wxALL + wxBOTTOM 0 - + 1 1 1 @@ -809,10 +589,10 @@ 1 0 + 0 1 1 - 0 0 Dock 0 @@ -823,8 +603,8 @@ 0 0 - ID_TEST_NETLIST - Test Footprints + wxID_ANY + Delete tracks shorting multiple nets 0 @@ -832,7 +612,7 @@ 0 1 - m_buttonFPTest + m_cbDeleteShortingTracks 1 @@ -843,9 +623,9 @@ 1 - + ; forward_declare 0 - Read the current netlist file and list missing and extra footprints + wxFILTER_NONE wxDefaultValidator @@ -853,8 +633,8 @@ - OnTestFootprintsClick + OnOptionChanged @@ -876,14 +656,14 @@ - OnUpdateUIValidNetlistFile + 5 - wxEXPAND|wxALL + wxBOTTOM 0 - + 1 1 1 @@ -897,10 +677,10 @@ 1 0 + 0 1 1 - 0 0 Dock 0 @@ -911,8 +691,8 @@ 0 0 - ID_COMPILE_RATSNEST - Rebuild Board Connectivity + wxID_ANY + Delete extra footprints 0 @@ -920,7 +700,7 @@ 0 1 - m_buttonRebild + m_cbDeleteExtraFootprints 1 @@ -931,9 +711,9 @@ 1 - + ; forward_declare 0 - Rebuild the full ratsnest (useful after a manual pad netname edition) + wxFILTER_NONE wxDefaultValidator @@ -941,8 +721,8 @@ - OnCompileRatsnestClick + OnOptionChanged @@ -964,7 +744,95 @@ - OnUpdateUIValidNetlistFile + + + + + 5 + wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete single-pad nets + + 0 + + + 0 + + 1 + m_cbDeleteSinglePadNets + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnOptionChanged + + + + + + + + + + + + + + + + + + + + + + @@ -973,645 +841,18 @@ 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline11 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - bCenterSizer - wxVERTICAL - none - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Dry run. Only report changes in message panel - - 0 - - - 0 - - 1 - m_checkDryRun - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Dry Run: The netlist is read, but no change is actually made on board. Changes are only reported in message panel, for info - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Silent mode - - 0 - - - 0 - - 1 - m_checkBoxSilentMode - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Silent mode: Do not show the warning message before reading the netlist - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnClickSilentMode - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 1 - + 660,250 bLowerSizer wxVERTICAL none - - 5 - wxEXPAND - 0 - - - bSizerNetlistFilename - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Netlist file: - - 0 - - - 0 - - 1 - staticTextNetlistFile - 1 - - - none - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxTOP - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_NetlistFilenameCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - - wxID_ANY - Browse - - 0 - - - 0 - - 1 - m_browseButton - 1 - - - protected - 1 - - Resizable - - 1 - - wxBU_AUTODRAW - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOpenNetlistClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 5 wxEXPAND | wxALL 1 - + 1 1 1 @@ -1644,7 +885,7 @@ 0 - -300,150 + -1,-1 1 m_MessageWindow 1 @@ -1689,6 +930,131 @@ + + 5 + wxALL|wxEXPAND + 0 + + + m_buttonsSizer + wxHORIZONTAL + protected + + 10 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_TEST_NETLIST + Test Footprints + + 0 + + + 0 + + 1 + m_buttonFPTest + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Read the current netlist file and list missing and extra footprints + + wxFILTER_NONE + wxDefaultValidator + + + + + OnTestFootprintsClick + + + + + + + + + + + + + + + + + + + + + + + OnUpdateUIValidNetlistFile + + + + 5 + wxEXPAND + 1 + + 1 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + OnCompileRatsnestClick + + + + + OnUpdatePCB + + + + + + diff --git a/pcbnew/dialogs/dialog_netlist_base.h b/pcbnew/dialogs/dialog_netlist_base.h index 4a1a52a2b0..d480ea3938 100644 --- a/pcbnew/dialogs/dialog_netlist_base.h +++ b/pcbnew/dialogs/dialog_netlist_base.h @@ -15,21 +15,21 @@ class WX_HTML_REPORT_PANEL; #include "dialog_shim.h" #include -#include +#include #include #include #include #include -#include -#include -#include -#include -#include #include #include #include #include #include +#include +#include +#include +#include +#include #include #include @@ -45,36 +45,33 @@ class DIALOG_NETLIST_BASE : public DIALOG_SHIM protected: enum { - ID_READ_NETLIST_FILE = 1000, - ID_TEST_NETLIST, - ID_COMPILE_RATSNEST + ID_TEST_NETLIST = 1000 }; - wxRadioBox* m_Select_By_Timestamp; - wxRadioBox* m_ChangeExistingFootprintCtrl; - wxRadioBox* m_DeleteBadTracks; - wxRadioBox* m_RemoveExtraFootprintsCtrl; - wxRadioBox* m_rbSingleNets; - wxButton* m_buttonRead; - wxButton* m_buttonClose; - wxButton* m_buttonFPTest; - wxButton* m_buttonRebild; - wxStaticLine* m_staticline11; - wxCheckBox* m_checkDryRun; - wxCheckBox* m_checkBoxSilentMode; - wxStaticLine* m_staticline1; wxTextCtrl* m_NetlistFilenameCtrl; wxBitmapButton* m_browseButton; + wxRadioBox* m_matchByTimestamp; + wxCheckBox* m_cbUpdateFootprints; + wxCheckBox* m_cbDeleteShortingTracks; + wxCheckBox* m_cbDeleteExtraFootprints; + wxCheckBox* m_cbDeleteSinglePadNets; WX_HTML_REPORT_PANEL* m_MessageWindow; + wxBoxSizer* m_buttonsSizer; + wxButton* m_buttonFPTest; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Apply; + wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class - virtual void OnReadNetlistFileClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnUpdateUIValidNetlistFile( wxUpdateUIEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnTestFootprintsClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCompileRatsnestClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnClickSilentMode( wxCommandEvent& event ) { event.Skip(); } + virtual void OnFilenameKillFocus( wxFocusEvent& event ) { event.Skip(); } virtual void OnOpenNetlistClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMatchChanged( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOptionChanged( wxCommandEvent& event ) { event.Skip(); } + virtual void OnTestFootprintsClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnUpdateUIValidNetlistFile( wxUpdateUIEvent& event ) { event.Skip(); } + virtual void OnCompileRatsnestClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnUpdatePCB( wxCommandEvent& event ) { event.Skip(); } public: diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 21ce22ab77..b4387f71da 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -1,7 +1,3 @@ -/** - * @file dialog_plot.cpp - */ - /* * This program source code file is part of KiCad, a free EDA CAD application. * @@ -54,7 +50,8 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) : m_plotOpts = aParent->GetPlotSettings(); init_Dialog(); - // We use a sdbSizer here to get the order right, which is platform-dependent + // We use a sdbSizer to get platform-dependent ordering of the action buttons, but + // that requires us to correct the button labels here. m_sdbSizer1OK->SetLabel( _( "Plot" ) ); m_sdbSizer1Apply->SetLabel( _( "Generate Drill Files..." ) ); m_sdbSizer1Cancel->SetLabel( _( "Close" ) ); @@ -80,7 +77,7 @@ void DIALOG_PLOT::init_Dialog() m_config->Read( OPTKEY_PLOT_CHECK_ZONES, &checkZones, true ); m_zoneFillCheck->SetValue( checkZones ); - m_browseButton->SetBitmap( KiBitmap( browse_files_xpm ) ); + m_browseButton->SetBitmap( KiBitmap( folder_xpm ) ); // m_PSWidthAdjust is stored in mm in user config double dtmp; @@ -95,29 +92,12 @@ void DIALOG_PLOT::init_Dialog() switch( m_plotOpts.GetFormat() ) { default: - case PLOT_FORMAT_GERBER: - m_plotFormatOpt->SetSelection( 0 ); - break; - - case PLOT_FORMAT_POST: - m_plotFormatOpt->SetSelection( 1 ); - break; - - case PLOT_FORMAT_SVG: - m_plotFormatOpt->SetSelection( 2 ); - break; - - case PLOT_FORMAT_DXF: - m_plotFormatOpt->SetSelection( 3 ); - break; - - case PLOT_FORMAT_HPGL: - m_plotFormatOpt->SetSelection( 4 ); - break; - - case PLOT_FORMAT_PDF: - m_plotFormatOpt->SetSelection( 5 ); - break; + case PLOT_FORMAT_GERBER: m_plotFormatOpt->SetSelection( 0 ); break; + case PLOT_FORMAT_POST: m_plotFormatOpt->SetSelection( 1 ); break; + case PLOT_FORMAT_SVG: m_plotFormatOpt->SetSelection( 2 ); break; + case PLOT_FORMAT_DXF: m_plotFormatOpt->SetSelection( 3 ); break; + case PLOT_FORMAT_HPGL: m_plotFormatOpt->SetSelection( 4 ); break; + case PLOT_FORMAT_PDF: m_plotFormatOpt->SetSelection( 5 ); break; } msg = StringFromValue( m_userUnits, board->GetDesignSettings().m_SolderMaskMargin, true ); @@ -125,37 +105,25 @@ void DIALOG_PLOT::init_Dialog() msg = StringFromValue( m_userUnits, board->GetDesignSettings().m_SolderMaskMinWidth, true ); m_SolderMaskMinWidthCurrValue->SetLabel( msg ); - // Set units and value for HPGL pen size (this param is stored in mils). - AddUnitSymbol( *m_textPenSize, m_userUnits ); - - msg = StringFromValue( m_userUnits, - m_plotOpts.GetHPGLPenDiameter() * IU_PER_MILS ); + // Set units and value for HPGL pen size (this param is in mils). + msg = StringFromValue( m_userUnits, m_plotOpts.GetHPGLPenDiameter() * IU_PER_MILS, true ); m_HPGLPenSizeOpt->SetValue( msg ); - AddUnitSymbol( *m_textDefaultPenSize, m_userUnits ); - msg = StringFromValue( m_userUnits, m_plotOpts.GetLineWidth() ); - m_linesWidth->SetValue( msg ); - - // Set units for PS global width correction. - AddUnitSymbol( *m_textPSFineAdjustWidth, m_userUnits ); + m_linesWidth->SetValue( StringFromValue( m_userUnits, m_plotOpts.GetLineWidth(), true ) ); // Test for a reasonable scale value. Set to 1 if problem if( m_XScaleAdjust < PLOT_MIN_SCALE || m_YScaleAdjust < PLOT_MIN_SCALE || m_XScaleAdjust > PLOT_MAX_SCALE || m_YScaleAdjust > PLOT_MAX_SCALE ) m_XScaleAdjust = m_YScaleAdjust = 1.0; - msg.Printf( wxT( "%f" ), m_XScaleAdjust ); - m_fineAdjustXscaleOpt->AppendText( msg ); - - msg.Printf( wxT( "%f" ), m_YScaleAdjust ); - m_fineAdjustYscaleOpt->SetValue( msg ); + m_fineAdjustXscaleOpt->SetValue( StringFromValue( UNSCALED_UNITS, m_XScaleAdjust ) ); + m_fineAdjustYscaleOpt->SetValue( StringFromValue( UNSCALED_UNITS, m_YScaleAdjust ) ); // Test for a reasonable PS width correction value. Set to 0 if problem. if( m_PSWidthAdjust < m_widthAdjustMinValue || m_PSWidthAdjust > m_widthAdjustMaxValue ) m_PSWidthAdjust = 0.; - msg.Printf( wxT( "%f" ), To_User_Unit( m_userUnits, m_PSWidthAdjust ) ); - m_PSFineAdjustWidthOpt->SetValue( msg ); + m_PSFineAdjustWidthOpt->SetValue( StringFromValue( m_userUnits, m_PSWidthAdjust, true ) ); m_plotPSNegativeOpt->SetValue( m_plotOpts.GetNegative() ); m_forcePSA4OutputOpt->SetValue( m_plotOpts.GetA4Output() ); @@ -853,12 +821,10 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) // XXX could this actually happen? isn't it constrained in the apply // function? if( m_plotOpts.GetScale() < PLOT_MIN_SCALE ) - DisplayInfoMessage( this, - _( "Warning: Scale option set to a very small value" ) ); + DisplayInfoMessage( this, _( "Warning: Scale option set to a very small value" ) ); if( m_plotOpts.GetScale() > PLOT_MAX_SCALE ) - DisplayInfoMessage( this, - _( "Warning: Scale option set to a very large value" ) ); + DisplayInfoMessage( this, _( "Warning: Scale option set to a very large value" ) ); GERBER_JOBFILE_WRITER jobfile_writer( board, &reporter ); diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index b93482ec45..1f6c365884 100644 --- a/pcbnew/dialogs/dialog_plot_base.cpp +++ b/pcbnew/dialogs/dialog_plot_base.cpp @@ -1,477 +1,475 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 4 2017) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "wx_html_report_panel.h" - -#include "dialog_plot_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); - - m_MainSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bupperSizer; - bupperSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizerPlotFmt; - bSizerPlotFmt = new wxBoxSizer( wxVERTICAL ); - - m_staticTextPlotFmt = new wxStaticText( this, wxID_ANY, _("Plot format:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextPlotFmt->Wrap( -1 ); - bSizerPlotFmt->Add( m_staticTextPlotFmt, 0, wxTOP, 5 ); - - wxString m_plotFormatOptChoices[] = { _("Gerber"), _("Postscript"), _("SVG"), _("DXF"), _("HPGL"), _("PDF") }; - int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString ); - m_plotFormatOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 0 ); - m_plotFormatOpt->SetSelection( 0 ); - bSizerPlotFmt->Add( m_plotFormatOpt, 0, wxTOP, 6 ); - - - bupperSizer->Add( bSizerPlotFmt, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); - - wxBoxSizer* bSizerOutDir; - bSizerOutDir = new wxBoxSizer( wxVERTICAL ); - - m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDir->Wrap( -1 ); - bSizerOutDir->Add( m_staticTextDir, 0, wxEXPAND|wxTOP, 5 ); - - wxBoxSizer* bSizer29; - bSizer29 = new wxBoxSizer( wxHORIZONTAL ); - - m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_outputDirectoryName->SetToolTip( _("Target directory for plot files. Can be absolute or relative to the board file location.") ); - - bSizer29->Add( m_outputDirectoryName, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 ); - - m_browseButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); - bSizer29->Add( m_browseButton, 0, wxRIGHT, 5 ); - - - bSizerOutDir->Add( bSizer29, 1, wxEXPAND, 5 ); - - - bupperSizer->Add( bSizerOutDir, 1, wxLEFT|wxRIGHT, 5 ); - - - m_MainSizer->Add( bupperSizer, 0, wxEXPAND|wxLEFT|wxTOP, 5 ); - - wxBoxSizer* bmiddleSizer; - bmiddleSizer = new wxBoxSizer( wxHORIZONTAL ); - - m_LayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Included Layers:") ), wxHORIZONTAL ); - - wxArrayString m_layerCheckListBoxChoices; - m_layerCheckListBox = new wxCheckListBox( m_LayersSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_layerCheckListBoxChoices, 0 ); - m_layerCheckListBox->SetMinSize( wxSize( 150,-1 ) ); - - m_LayersSizer->Add( m_layerCheckListBox, 1, wxEXPAND, 5 ); - - - bmiddleSizer->Add( m_LayersSizer, 1, wxALL|wxEXPAND, 3 ); - - m_PlotOptionsSizer = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbOptionsSizer; - sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("General Options:") ), wxVERTICAL ); - - wxBoxSizer* bSizer192; - bSizer192 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizerPlotItems; - bSizerPlotItems = new wxBoxSizer( wxVERTICAL ); - - m_plotSheetRef = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot sheet reference on all layers"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerPlotItems->Add( m_plotSheetRef, 0, wxRIGHT|wxLEFT, 2 ); - - m_plotModuleValueOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot footprint values"), wxDefaultPosition, wxDefaultSize, 0 ); - m_plotModuleValueOpt->SetValue(true); - bSizerPlotItems->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); - - m_plotModuleRefOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_PRINT_REF, _("Plot footprint references"), wxDefaultPosition, wxDefaultSize, 0 ); - m_plotModuleRefOpt->SetValue(true); - bSizerPlotItems->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); - - m_plotInvisibleText = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Force plotting of invisible values/references"), wxDefaultPosition, wxDefaultSize, 0 ); - m_plotInvisibleText->SetToolTip( _("Force plot invisible values and/or references") ); - - bSizerPlotItems->Add( m_plotInvisibleText, 0, wxALL, 2 ); - - m_plotNoViaOnMaskOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Do not tent vias"), wxDefaultPosition, wxDefaultSize, 0 ); - m_plotNoViaOnMaskOpt->SetToolTip( _("Remove soldermask on vias") ); - - bSizerPlotItems->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 2 ); - - m_excludeEdgeLayerOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Exclude PCB edge layer from other layers"), wxDefaultPosition, wxDefaultSize, 0 ); - m_excludeEdgeLayerOpt->SetToolTip( _("Do not plot the contents of the PCB edge layer on any other layers.") ); - - bSizerPlotItems->Add( m_excludeEdgeLayerOpt, 0, wxALL, 2 ); - - m_excludePadsFromSilkscreen = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Exclude pads from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); - m_excludePadsFromSilkscreen->SetToolTip( _("Do not plot pads on silkscreen layers, even when they are assigned to them.\nUncheck this if you wish to create assembly drawings from silkscreen layers.") ); - - bSizerPlotItems->Add( m_excludePadsFromSilkscreen, 0, wxALL, 2 ); - - m_useAuxOriginCheckBox = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Use auxiliary axis as origin"), wxDefaultPosition, wxDefaultSize, 0 ); - m_useAuxOriginCheckBox->SetToolTip( _("Use auxiliary axis as coordinates origin in plot files") ); - - bSizerPlotItems->Add( m_useAuxOriginCheckBox, 0, wxALL, 2 ); - - m_plotMirrorOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_MIROR_OPT, _("Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerPlotItems->Add( m_plotMirrorOpt, 0, wxALL, 2 ); - - m_plotPSNegativeOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Negative plot"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerPlotItems->Add( m_plotPSNegativeOpt, 0, wxALL, 2 ); - - m_zoneFillCheck = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Check zone fills before plotting"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerPlotItems->Add( m_zoneFillCheck, 0, wxALL, 2 ); - - - bSizer192->Add( bSizerPlotItems, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer14; - bSizer14 = new wxBoxSizer( wxVERTICAL ); - - m_staticText11 = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText11->Wrap( -1 ); - bSizer14->Add( m_staticText11, 0, wxRIGHT|wxLEFT, 5 ); - - wxString m_drillShapeOptChoices[] = { _("None"), _("Small"), _("Actual size") }; - int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString ); - m_drillShapeOpt = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 ); - m_drillShapeOpt->SetSelection( 0 ); - bSizer14->Add( m_drillShapeOpt, 0, wxEXPAND|wxLEFT, 5 ); - - m_staticText12 = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Scaling:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText12->Wrap( -1 ); - bSizer14->Add( m_staticText12, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxString m_scaleOptChoices[] = { _("Auto"), _("1:1"), _("3:2"), _("2:1"), _("3:1") }; - int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString ); - m_scaleOpt = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 ); - m_scaleOpt->SetSelection( 1 ); - bSizer14->Add( m_scaleOpt, 0, wxEXPAND|wxLEFT, 5 ); - - m_staticText13 = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot mode:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText13->Wrap( -1 ); - bSizer14->Add( m_staticText13, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxString m_plotModeOptChoices[] = { _("Filled"), _("Sketch") }; - int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString ); - m_plotModeOpt = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 0 ); - m_plotModeOpt->SetSelection( 0 ); - bSizer14->Add( m_plotModeOpt, 0, wxEXPAND|wxLEFT, 5 ); - - m_textDefaultPenSize = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Line width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_textDefaultPenSize->Wrap( -1 ); - m_textDefaultPenSize->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") ); - - bSizer14->Add( m_textDefaultPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_linesWidth = new wxTextCtrl( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") ); - - bSizer14->Add( m_linesWidth, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 ); - - - bSizer192->Add( bSizer14, 1, wxRIGHT|wxLEFT, 3 ); - - - sbOptionsSizer->Add( bSizer192, 0, wxEXPAND, 5 ); - - - m_PlotOptionsSizer->Add( sbOptionsSizer, 0, wxALL|wxEXPAND, 3 ); - - m_sizerSoldMaskLayerOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Solder Mask Options:") ), wxVERTICAL ); - - wxFlexGridSizer* fgSizerSoldMaskOpts; - fgSizerSoldMaskOpts = new wxFlexGridSizer( 2, 2, 0, 0 ); - fgSizerSoldMaskOpts->SetFlexibleDirection( wxBOTH ); - fgSizerSoldMaskOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_SolderMaskMarginLabel = new wxStaticText( m_sizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("Clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_SolderMaskMarginLabel->Wrap( -1 ); - m_SolderMaskMarginLabel->SetToolTip( _("Margin between pads and solder mask") ); - - fgSizerSoldMaskOpts->Add( m_SolderMaskMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - m_SolderMaskMarginCurrValue = new wxStaticText( m_sizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 ); - m_SolderMaskMarginCurrValue->Wrap( -1 ); - fgSizerSoldMaskOpts->Add( m_SolderMaskMarginCurrValue, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - m_solderMaskMinWidthLabel = new wxStaticText( m_sizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("Width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_solderMaskMinWidthLabel->Wrap( -1 ); - m_solderMaskMinWidthLabel->SetToolTip( _("Minimum distance between 2 pad areas.\nTwo pad areas nearer than this value will be merged during plotting") ); - - fgSizerSoldMaskOpts->Add( m_solderMaskMinWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_SolderMaskMinWidthCurrValue = new wxStaticText( m_sizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 ); - m_SolderMaskMinWidthCurrValue->Wrap( -1 ); - fgSizerSoldMaskOpts->Add( m_SolderMaskMinWidthCurrValue, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - m_sizerSoldMaskLayerOpt->Add( fgSizerSoldMaskOpts, 1, wxEXPAND, 5 ); - - - m_PlotOptionsSizer->Add( m_sizerSoldMaskLayerOpt, 1, wxALL|wxEXPAND, 3 ); - - m_GerberOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Gerber Options:") ), wxHORIZONTAL ); - - wxBoxSizer* bSizerGbrOpt; - bSizerGbrOpt = new wxBoxSizer( wxVERTICAL ); - - m_useGerberExtensions = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Use Protel filename extensions"), wxDefaultPosition, wxDefaultSize, 0 ); - m_useGerberExtensions->SetToolTip( _("Use Protel Gerber extensions (.GBL, .GTL, etc...)\nNo longer recommended. The official extension is .gbr") ); - - bSizerGbrOpt->Add( m_useGerberExtensions, 0, wxBOTTOM|wxRIGHT|wxLEFT, 2 ); - - m_useGerberX2Attributes = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Include extended (X2) attributes"), wxDefaultPosition, wxDefaultSize, 0 ); - m_useGerberX2Attributes->SetToolTip( _("Include extended attributes (X2 Gerber files format) in the Gerber file.\nMainly File Format attributes.") ); - - bSizerGbrOpt->Add( m_useGerberX2Attributes, 0, wxALL, 2 ); - - m_useGerberNetAttributes = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Include advanced X2 features"), wxDefaultPosition, wxDefaultSize, 0 ); - m_useGerberNetAttributes->SetToolTip( _("Only available in X2 Gerber files format.\nInclude netlist metadata and aperture attributes.") ); - - bSizerGbrOpt->Add( m_useGerberNetAttributes, 0, wxALL, 2 ); - - m_generateGerberJobFile = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Generate Gerber job file"), wxDefaultPosition, wxDefaultSize, 0 ); - m_generateGerberJobFile->SetToolTip( _("Generate a Gerber job file that contains info about the board,\nand the list of generated Gerber plot files") ); - - bSizerGbrOpt->Add( m_generateGerberJobFile, 0, wxALL, 2 ); - - m_subtractMaskFromSilk = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); - m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") ); - - bSizerGbrOpt->Add( m_subtractMaskFromSilk, 0, wxALL, 2 ); - - - m_GerberOptionsSizer->Add( bSizerGbrOpt, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - wxString m_rbGerberFormatChoices[] = { _("4.5, unit mm"), _("4.6, unit mm") }; - int m_rbGerberFormatNChoices = sizeof( m_rbGerberFormatChoices ) / sizeof( wxString ); - m_rbGerberFormat = new wxRadioBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Coordinate Format"), wxDefaultPosition, wxDefaultSize, m_rbGerberFormatNChoices, m_rbGerberFormatChoices, 1, wxRA_SPECIFY_COLS ); - m_rbGerberFormat->SetSelection( 0 ); - m_rbGerberFormat->SetToolTip( _("Resolution of coordinates in Gerber files.\nUse the higher value if possible.") ); - - m_GerberOptionsSizer->Add( m_rbGerberFormat, 0, wxALIGN_LEFT|wxALIGN_TOP|wxBOTTOM|wxLEFT, 5 ); - - - m_PlotOptionsSizer->Add( m_GerberOptionsSizer, 0, wxALL|wxEXPAND, 3 ); - - m_HPGLOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options:") ), wxVERTICAL ); - - wxBoxSizer* bSizerHPGL_options; - bSizerHPGL_options = new wxBoxSizer( wxVERTICAL ); - - m_textPenSize = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_textPenSize->Wrap( -1 ); - bSizerHPGL_options->Add( m_textPenSize, 0, wxRIGHT|wxLEFT, 5 ); - - m_HPGLPenSizeOpt = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerHPGL_options->Add( m_HPGLPenSizeOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - - m_HPGLOptionsSizer->Add( bSizerHPGL_options, 1, wxEXPAND, 5 ); - - - m_PlotOptionsSizer->Add( m_HPGLOptionsSizer, 0, wxALL|wxEXPAND, 3 ); - - m_PSOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Postscript Options:") ), wxVERTICAL ); - - wxBoxSizer* bSizer17; - bSizer17 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer18; - bSizer18 = new wxBoxSizer( wxVERTICAL ); - - m_staticText7 = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("X scale:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText7->Wrap( -1 ); - bSizer18->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 ); - - m_fineAdjustXscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fineAdjustXscaleOpt->SetToolTip( _("Set global X scale adjust for exact scale postscript output.") ); - - bSizer18->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer17->Add( bSizer18, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer19; - bSizer19 = new wxBoxSizer( wxVERTICAL ); - - m_staticText8 = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Y scale:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText8->Wrap( -1 ); - bSizer19->Add( m_staticText8, 0, wxRIGHT|wxLEFT, 5 ); - - m_fineAdjustYscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fineAdjustYscaleOpt->SetToolTip( _("Set global Y scale adjust for exact scale postscript output.") ); - - bSizer19->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer17->Add( bSizer19, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer191; - bSizer191 = new wxBoxSizer( wxVERTICAL ); - - m_textPSFineAdjustWidth = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Width correction:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_textPSFineAdjustWidth->Wrap( -1 ); - bSizer191->Add( m_textPSFineAdjustWidth, 0, wxRIGHT|wxLEFT, 5 ); - - m_PSFineAdjustWidthOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_PSFineAdjustWidthOpt->SetToolTip( _("Set global width correction for exact width postscript output.\nThese width correction is intended to compensate tracks width and also pads and vias size errors.\nThe reasonable width correction value must be in a range of [-(MinTrackWidth-1), +(MinClearanceValue-1)] in decimils.") ); - - bSizer191->Add( m_PSFineAdjustWidthOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - - bSizer17->Add( bSizer191, 1, wxEXPAND, 5 ); - - - m_PSOptionsSizer->Add( bSizer17, 1, wxEXPAND, 5 ); - - m_forcePSA4OutputOpt = new wxCheckBox( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Force A4 output"), wxDefaultPosition, wxDefaultSize, 0 ); - m_PSOptionsSizer->Add( m_forcePSA4OutputOpt, 0, wxALL, 2 ); - - - m_PlotOptionsSizer->Add( m_PSOptionsSizer, 0, wxALL|wxEXPAND, 3 ); - - m_SizerDXF_options = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("DXF options:") ), wxVERTICAL ); - - m_DXF_plotModeOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Plot all layers in outline (polygon) mode"), wxDefaultPosition, wxDefaultSize, 0 ); - m_DXF_plotModeOpt->SetValue(true); - m_DXF_plotModeOpt->SetToolTip( _("DXF only:\nCheck to plot all layers in polygon mode.\nUncheck to plot in sketch mode layers that don't support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab)\nand plot in polygon mode other layers (*.Cu, *.Adhes, *.Paste, *.Mask)") ); - - m_SizerDXF_options->Add( m_DXF_plotModeOpt, 0, wxALL, 2 ); - - m_DXF_plotTextStrokeFontOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Use Pcbnew font to plot texts"), wxDefaultPosition, wxDefaultSize, 0 ); - m_DXF_plotTextStrokeFontOpt->SetToolTip( _("Check to use Pcbnew stroke font\nUncheck to plot oneline ASCII texts as editable text (using DXF font)") ); - - m_SizerDXF_options->Add( m_DXF_plotTextStrokeFontOpt, 0, wxALL, 2 ); - - - m_PlotOptionsSizer->Add( m_SizerDXF_options, 0, wxALL|wxEXPAND, 3 ); - - - bmiddleSizer->Add( m_PlotOptionsSizer, 0, 0, 5 ); - - - m_MainSizer->Add( bmiddleSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); - - wxBoxSizer* sbSizerMsg; - sbSizerMsg = new wxBoxSizer( wxVERTICAL ); - - m_messagesPanel = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_messagesPanel->SetMinSize( wxSize( -300,150 ) ); - - sbSizerMsg->Add( m_messagesPanel, 1, wxEXPAND | wxALL, 5 ); - - - m_MainSizer->Add( sbSizerMsg, 1, wxEXPAND, 5 ); - - m_sizerButtons = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonDRC = new wxButton( this, wxID_ANY, _("Run DRC..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_sizerButtons->Add( m_buttonDRC, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - m_sizerButtons->Add( 10, 0, 1, wxEXPAND, 5 ); - - m_sdbSizer1 = new wxStdDialogButtonSizer(); - m_sdbSizer1OK = new wxButton( this, wxID_OK ); - m_sdbSizer1->AddButton( m_sdbSizer1OK ); - m_sdbSizer1Apply = new wxButton( this, wxID_APPLY ); - m_sdbSizer1->AddButton( m_sdbSizer1Apply ); - m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); - m_sdbSizer1->Realize(); - - m_sizerButtons->Add( m_sdbSizer1, 0, wxEXPAND, 5 ); - - - m_MainSizer->Add( m_sizerButtons, 0, wxALIGN_RIGHT|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - - this->SetSizer( m_MainSizer ); - this->Layout(); - m_MainSizer->Fit( this ); - m_popMenu = new wxMenu(); - wxMenuItem* m_menuItem1; - m_menuItem1 = new wxMenuItem( m_popMenu, ID_LAYER_FAB, wxString( _("Select Fab Layers") ) , wxEmptyString, wxITEM_NORMAL ); - m_popMenu->Append( m_menuItem1 ); - - wxMenuItem* m_menuItem2; - m_menuItem2 = new wxMenuItem( m_popMenu, ID_SELECT_COPPER_LAYERS, wxString( _("Select all Copper Layers") ) , wxEmptyString, wxITEM_NORMAL ); - m_popMenu->Append( m_menuItem2 ); - - wxMenuItem* m_menuItem3; - m_menuItem3 = new wxMenuItem( m_popMenu, ID_DESELECT_COPPER_LAYERS, wxString( _("Deselect all Copper Layers") ) , wxEmptyString, wxITEM_NORMAL ); - m_popMenu->Append( m_menuItem3 ); - - wxMenuItem* m_menuItem4; - m_menuItem4 = new wxMenuItem( m_popMenu, ID_SELECT_ALL_LAYERS, wxString( _("Select all Layers") ) , wxEmptyString, wxITEM_NORMAL ); - m_popMenu->Append( m_menuItem4 ); - - wxMenuItem* m_menuItem5; - m_menuItem5 = new wxMenuItem( m_popMenu, ID_DESELECT_ALL_LAYERS, wxString( _("Deselect all Layers") ) , wxEmptyString, wxITEM_NORMAL ); - m_popMenu->Append( m_menuItem5 ); - - this->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::DIALOG_PLOT_BASEOnContextMenu ), NULL, this ); - - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_ACTIVATE, wxActivateEventHandler( DIALOG_PLOT_BASE::onActivate ) ); - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnClose ) ); - this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); - this->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ) ); - m_plotFormatOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); - m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); - m_layerCheckListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this ); - m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); - m_useGerberX2Attributes->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); - m_DXF_plotModeOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this ); - m_buttonDRC->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); - m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); - m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); - m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); - this->Connect( m_menuItem1->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); - this->Connect( m_menuItem2->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); - this->Connect( m_menuItem3->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); - this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); - this->Connect( m_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); -} - -DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() -{ - // Disconnect Events - this->Disconnect( wxEVT_ACTIVATE, wxActivateEventHandler( DIALOG_PLOT_BASE::onActivate ) ); - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnClose ) ); - this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); - this->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ) ); - m_plotFormatOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); - m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); - m_layerCheckListBox->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this ); - m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); - m_useGerberX2Attributes->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); - m_DXF_plotModeOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this ); - m_buttonDRC->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); - m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); - m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); - m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); - this->Disconnect( ID_LAYER_FAB, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); - this->Disconnect( ID_SELECT_COPPER_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); - this->Disconnect( ID_DESELECT_COPPER_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); - this->Disconnect( ID_SELECT_ALL_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); - this->Disconnect( ID_DESELECT_ALL_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); - - delete m_popMenu; -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "wx_html_report_panel.h" + +#include "dialog_plot_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); + + m_MainSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bupperSizer; + bupperSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizerPlotFmt; + bSizerPlotFmt = new wxBoxSizer( wxVERTICAL ); + + m_staticTextPlotFmt = new wxStaticText( this, wxID_ANY, _("Plot format:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextPlotFmt->Wrap( -1 ); + bSizerPlotFmt->Add( m_staticTextPlotFmt, 0, wxTOP, 5 ); + + wxString m_plotFormatOptChoices[] = { _("Gerber"), _("Postscript"), _("SVG"), _("DXF"), _("HPGL"), _("PDF") }; + int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString ); + m_plotFormatOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 0 ); + m_plotFormatOpt->SetSelection( 0 ); + bSizerPlotFmt->Add( m_plotFormatOpt, 0, wxTOP, 6 ); + + + bupperSizer->Add( bSizerPlotFmt, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + + wxBoxSizer* bSizerOutDir; + bSizerOutDir = new wxBoxSizer( wxVERTICAL ); + + m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDir->Wrap( -1 ); + bSizerOutDir->Add( m_staticTextDir, 0, wxEXPAND|wxTOP, 5 ); + + wxBoxSizer* bSizer29; + bSizer29 = new wxBoxSizer( wxHORIZONTAL ); + + m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_outputDirectoryName->SetToolTip( _("Target directory for plot files. Can be absolute or relative to the board file location.") ); + + bSizer29->Add( m_outputDirectoryName, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 ); + + m_browseButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + m_browseButton->SetMinSize( wxSize( 29,29 ) ); + + bSizer29->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + + bSizerOutDir->Add( bSizer29, 1, wxEXPAND, 5 ); + + + bupperSizer->Add( bSizerOutDir, 1, wxLEFT|wxRIGHT, 5 ); + + + m_MainSizer->Add( bupperSizer, 0, wxEXPAND|wxLEFT|wxTOP, 5 ); + + wxBoxSizer* bmiddleSizer; + bmiddleSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_LayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Included Layers") ), wxHORIZONTAL ); + + wxArrayString m_layerCheckListBoxChoices; + m_layerCheckListBox = new wxCheckListBox( m_LayersSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_layerCheckListBoxChoices, 0 ); + m_layerCheckListBox->SetMinSize( wxSize( 150,-1 ) ); + + m_LayersSizer->Add( m_layerCheckListBox, 1, wxEXPAND, 5 ); + + + bmiddleSizer->Add( m_LayersSizer, 1, wxALL|wxEXPAND, 3 ); + + m_PlotOptionsSizer = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbOptionsSizer; + sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("General Options") ), wxVERTICAL ); + + wxBoxSizer* bSizer192; + bSizer192 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizerPlotItems; + bSizerPlotItems = new wxBoxSizer( wxVERTICAL ); + + m_plotSheetRef = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot sheet reference on all layers"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerPlotItems->Add( m_plotSheetRef, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); + + m_plotModuleValueOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot footprint values"), wxDefaultPosition, wxDefaultSize, 0 ); + m_plotModuleValueOpt->SetValue(true); + bSizerPlotItems->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); + + m_plotModuleRefOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_PRINT_REF, _("Plot footprint references"), wxDefaultPosition, wxDefaultSize, 0 ); + m_plotModuleRefOpt->SetValue(true); + bSizerPlotItems->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); + + m_plotInvisibleText = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Force plotting of invisible values/references"), wxDefaultPosition, wxDefaultSize, 0 ); + m_plotInvisibleText->SetToolTip( _("Force plot invisible values and/or references") ); + + bSizerPlotItems->Add( m_plotInvisibleText, 0, wxALL, 2 ); + + m_plotNoViaOnMaskOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Do not tent vias"), wxDefaultPosition, wxDefaultSize, 0 ); + m_plotNoViaOnMaskOpt->SetToolTip( _("Remove soldermask on vias") ); + + bSizerPlotItems->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 2 ); + + m_excludeEdgeLayerOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Exclude PCB edge layer from other layers"), wxDefaultPosition, wxDefaultSize, 0 ); + m_excludeEdgeLayerOpt->SetToolTip( _("Do not plot the contents of the PCB edge layer on any other layers.") ); + + bSizerPlotItems->Add( m_excludeEdgeLayerOpt, 0, wxALL, 2 ); + + m_excludePadsFromSilkscreen = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Exclude pads from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); + m_excludePadsFromSilkscreen->SetToolTip( _("Do not plot pads on silkscreen layers, even when they are assigned to them.\nUncheck this if you wish to create assembly drawings from silkscreen layers.") ); + + bSizerPlotItems->Add( m_excludePadsFromSilkscreen, 0, wxALL, 2 ); + + m_plotMirrorOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_MIROR_OPT, _("Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerPlotItems->Add( m_plotMirrorOpt, 0, wxALL, 2 ); + + m_plotPSNegativeOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Negative plot"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerPlotItems->Add( m_plotPSNegativeOpt, 0, wxALL, 2 ); + + m_useAuxOriginCheckBox = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Use auxiliary axis as origin"), wxDefaultPosition, wxDefaultSize, 0 ); + m_useAuxOriginCheckBox->SetToolTip( _("Use auxiliary axis as coordinates origin in plot files") ); + + bSizerPlotItems->Add( m_useAuxOriginCheckBox, 0, wxALL, 2 ); + + m_zoneFillCheck = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Check zone fills before plotting"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerPlotItems->Add( m_zoneFillCheck, 0, wxALL, 2 ); + + + bSizer192->Add( bSizerPlotItems, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer14; + bSizer14 = new wxBoxSizer( wxVERTICAL ); + + m_staticText11 = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText11->Wrap( -1 ); + bSizer14->Add( m_staticText11, 0, wxRIGHT|wxLEFT, 5 ); + + wxString m_drillShapeOptChoices[] = { _("None"), _("Small"), _("Actual size") }; + int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString ); + m_drillShapeOpt = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 ); + m_drillShapeOpt->SetSelection( 0 ); + bSizer14->Add( m_drillShapeOpt, 0, wxEXPAND|wxLEFT, 5 ); + + m_staticText12 = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Scaling:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText12->Wrap( -1 ); + bSizer14->Add( m_staticText12, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxString m_scaleOptChoices[] = { _("Auto"), _("1:1"), _("3:2"), _("2:1"), _("3:1") }; + int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString ); + m_scaleOpt = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 ); + m_scaleOpt->SetSelection( 1 ); + bSizer14->Add( m_scaleOpt, 0, wxEXPAND|wxLEFT, 5 ); + + m_staticText13 = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot mode:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText13->Wrap( -1 ); + bSizer14->Add( m_staticText13, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxString m_plotModeOptChoices[] = { _("Filled"), _("Sketch") }; + int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString ); + m_plotModeOpt = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 0 ); + m_plotModeOpt->SetSelection( 0 ); + bSizer14->Add( m_plotModeOpt, 0, wxEXPAND|wxLEFT, 5 ); + + m_textDefaultPenSize = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Line width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textDefaultPenSize->Wrap( -1 ); + m_textDefaultPenSize->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") ); + + bSizer14->Add( m_textDefaultPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_linesWidth = new wxTextCtrl( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") ); + + bSizer14->Add( m_linesWidth, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 ); + + + bSizer192->Add( bSizer14, 1, wxRIGHT|wxLEFT, 3 ); + + + sbOptionsSizer->Add( bSizer192, 0, wxEXPAND, 5 ); + + + m_PlotOptionsSizer->Add( sbOptionsSizer, 0, wxALL|wxEXPAND, 3 ); + + wxStaticBoxSizer* sbSizerSoldMaskLayerOpt; + sbSizerSoldMaskLayerOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Solder Mask Settings") ), wxVERTICAL ); + + wxFlexGridSizer* fgSizerSoldMaskOpts; + fgSizerSoldMaskOpts = new wxFlexGridSizer( 2, 2, 0, 0 ); + fgSizerSoldMaskOpts->SetFlexibleDirection( wxBOTH ); + fgSizerSoldMaskOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_SolderMaskMarginLabel = new wxStaticText( sbSizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("Clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SolderMaskMarginLabel->Wrap( -1 ); + m_SolderMaskMarginLabel->SetToolTip( _("Margin between pads and solder mask") ); + + fgSizerSoldMaskOpts->Add( m_SolderMaskMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + m_SolderMaskMarginCurrValue = new wxStaticText( sbSizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SolderMaskMarginCurrValue->Wrap( -1 ); + fgSizerSoldMaskOpts->Add( m_SolderMaskMarginCurrValue, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + m_solderMaskMinWidthLabel = new wxStaticText( sbSizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("Minimum width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_solderMaskMinWidthLabel->Wrap( -1 ); + m_solderMaskMinWidthLabel->SetToolTip( _("Minimum distance between 2 pad areas.\nTwo pad areas nearer than this value will be merged during plotting") ); + + fgSizerSoldMaskOpts->Add( m_solderMaskMinWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_SolderMaskMinWidthCurrValue = new wxStaticText( sbSizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SolderMaskMinWidthCurrValue->Wrap( -1 ); + fgSizerSoldMaskOpts->Add( m_SolderMaskMinWidthCurrValue, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + sbSizerSoldMaskLayerOpt->Add( fgSizerSoldMaskOpts, 1, wxEXPAND, 5 ); + + + m_PlotOptionsSizer->Add( sbSizerSoldMaskLayerOpt, 1, wxEXPAND|wxALL, 3 ); + + m_GerberOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Gerber Options") ), wxHORIZONTAL ); + + wxBoxSizer* bSizerGbrOpt; + bSizerGbrOpt = new wxBoxSizer( wxVERTICAL ); + + m_useGerberExtensions = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Use Protel filename extensions"), wxDefaultPosition, wxDefaultSize, 0 ); + m_useGerberExtensions->SetToolTip( _("Use Protel Gerber extensions (.GBL, .GTL, etc...)\nNo longer recommended. The official extension is .gbr") ); + + bSizerGbrOpt->Add( m_useGerberExtensions, 0, wxALL, 2 ); + + m_useGerberX2Attributes = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Include extended (X2) attributes"), wxDefaultPosition, wxDefaultSize, 0 ); + m_useGerberX2Attributes->SetToolTip( _("Include extended attributes (X2 Gerber files format) in the Gerber file.\nMainly File Format attributes.") ); + + bSizerGbrOpt->Add( m_useGerberX2Attributes, 0, wxALL, 2 ); + + m_useGerberNetAttributes = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Include advanced X2 features"), wxDefaultPosition, wxDefaultSize, 0 ); + m_useGerberNetAttributes->SetToolTip( _("Only available in X2 Gerber files format.\nInclude netlist metadata and aperture attributes.") ); + + bSizerGbrOpt->Add( m_useGerberNetAttributes, 0, wxALL, 2 ); + + m_generateGerberJobFile = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Generate Gerber job file"), wxDefaultPosition, wxDefaultSize, 0 ); + m_generateGerberJobFile->SetToolTip( _("Generate a Gerber job file that contains info about the board,\nand the list of generated Gerber plot files") ); + + bSizerGbrOpt->Add( m_generateGerberJobFile, 0, wxALL, 2 ); + + m_subtractMaskFromSilk = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); + m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") ); + + bSizerGbrOpt->Add( m_subtractMaskFromSilk, 0, wxALL, 2 ); + + + m_GerberOptionsSizer->Add( bSizerGbrOpt, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + wxString m_rbGerberFormatChoices[] = { _("4.5, unit mm"), _("4.6, unit mm") }; + int m_rbGerberFormatNChoices = sizeof( m_rbGerberFormatChoices ) / sizeof( wxString ); + m_rbGerberFormat = new wxRadioBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Coordinate Format"), wxDefaultPosition, wxDefaultSize, m_rbGerberFormatNChoices, m_rbGerberFormatChoices, 1, wxRA_SPECIFY_COLS ); + m_rbGerberFormat->SetSelection( 0 ); + m_rbGerberFormat->SetToolTip( _("Resolution of coordinates in Gerber files.\nUse the higher value if possible.") ); + + m_GerberOptionsSizer->Add( m_rbGerberFormat, 0, wxALIGN_LEFT|wxALIGN_TOP|wxALL, 5 ); + + + m_PlotOptionsSizer->Add( m_GerberOptionsSizer, 0, wxALL|wxEXPAND, 3 ); + + m_HPGLOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options") ), wxVERTICAL ); + + wxBoxSizer* bSizerHPGL_options; + bSizerHPGL_options = new wxBoxSizer( wxVERTICAL ); + + m_textPenSize = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textPenSize->Wrap( -1 ); + bSizerHPGL_options->Add( m_textPenSize, 0, wxRIGHT|wxLEFT, 5 ); + + m_HPGLPenSizeOpt = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerHPGL_options->Add( m_HPGLPenSizeOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + + m_HPGLOptionsSizer->Add( bSizerHPGL_options, 1, wxEXPAND, 5 ); + + + m_PlotOptionsSizer->Add( m_HPGLOptionsSizer, 0, wxALL|wxEXPAND, 3 ); + + m_PSOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Postscript Options") ), wxVERTICAL ); + + wxBoxSizer* bSizer17; + bSizer17 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer18; + bSizer18 = new wxBoxSizer( wxVERTICAL ); + + m_staticText7 = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("X scale:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText7->Wrap( -1 ); + bSizer18->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 ); + + m_fineAdjustXscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_fineAdjustXscaleOpt->SetToolTip( _("Set global X scale adjust for exact scale postscript output.") ); + + bSizer18->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer17->Add( bSizer18, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer19; + bSizer19 = new wxBoxSizer( wxVERTICAL ); + + m_staticText8 = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Y scale:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText8->Wrap( -1 ); + bSizer19->Add( m_staticText8, 0, wxRIGHT|wxLEFT, 5 ); + + m_fineAdjustYscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_fineAdjustYscaleOpt->SetToolTip( _("Set global Y scale adjust for exact scale postscript output.") ); + + bSizer19->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer17->Add( bSizer19, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer191; + bSizer191 = new wxBoxSizer( wxVERTICAL ); + + m_textPSFineAdjustWidth = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Width correction:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textPSFineAdjustWidth->Wrap( -1 ); + bSizer191->Add( m_textPSFineAdjustWidth, 0, wxRIGHT|wxLEFT, 5 ); + + m_PSFineAdjustWidthOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_PSFineAdjustWidthOpt->SetToolTip( _("Set global width correction for exact width postscript output.\nThese width correction is intended to compensate tracks width and also pads and vias size errors.\nThe reasonable width correction value must be in a range of [-(MinTrackWidth-1), +(MinClearanceValue-1)] in decimils.") ); + + bSizer191->Add( m_PSFineAdjustWidthOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + + bSizer17->Add( bSizer191, 1, wxEXPAND, 5 ); + + + m_PSOptionsSizer->Add( bSizer17, 1, wxEXPAND, 5 ); + + m_forcePSA4OutputOpt = new wxCheckBox( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Force A4 output"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PSOptionsSizer->Add( m_forcePSA4OutputOpt, 0, wxALL, 2 ); + + + m_PlotOptionsSizer->Add( m_PSOptionsSizer, 0, wxALL|wxEXPAND, 3 ); + + m_SizerDXF_options = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("DXF Options") ), wxVERTICAL ); + + m_DXF_plotModeOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Plot all layers in outline (polygon) mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_DXF_plotModeOpt->SetValue(true); + m_DXF_plotModeOpt->SetToolTip( _("DXF only:\nCheck to plot all layers in polygon mode.\nUncheck to plot in sketch mode layers that don't support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab)\nand plot in polygon mode other layers (*.Cu, *.Adhes, *.Paste, *.Mask)") ); + + m_SizerDXF_options->Add( m_DXF_plotModeOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 2 ); + + m_DXF_plotTextStrokeFontOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Use Pcbnew font to plot texts"), wxDefaultPosition, wxDefaultSize, 0 ); + m_DXF_plotTextStrokeFontOpt->SetToolTip( _("Check to use Pcbnew stroke font\nUncheck to plot oneline ASCII texts as editable text (using DXF font)") ); + + m_SizerDXF_options->Add( m_DXF_plotTextStrokeFontOpt, 0, wxALL, 2 ); + + + m_PlotOptionsSizer->Add( m_SizerDXF_options, 0, wxEXPAND|wxALL, 3 ); + + + bmiddleSizer->Add( m_PlotOptionsSizer, 0, 0, 5 ); + + + m_MainSizer->Add( bmiddleSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + + wxBoxSizer* sbSizerMsg; + sbSizerMsg = new wxBoxSizer( wxVERTICAL ); + + m_messagesPanel = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_messagesPanel->SetMinSize( wxSize( -300,150 ) ); + + sbSizerMsg->Add( m_messagesPanel, 1, wxEXPAND | wxALL, 5 ); + + + m_MainSizer->Add( sbSizerMsg, 1, wxEXPAND, 5 ); + + m_sizerButtons = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonDRC = new wxButton( this, wxID_ANY, _("Run DRC..."), wxDefaultPosition, wxDefaultSize, 0 ); + m_sizerButtons->Add( m_buttonDRC, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Apply = new wxButton( this, wxID_APPLY ); + m_sdbSizer1->AddButton( m_sdbSizer1Apply ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + + m_sizerButtons->Add( m_sdbSizer1, 1, wxEXPAND, 5 ); + + + m_MainSizer->Add( m_sizerButtons, 0, wxALIGN_RIGHT|wxEXPAND|wxALL, 5 ); + + + this->SetSizer( m_MainSizer ); + this->Layout(); + m_MainSizer->Fit( this ); + m_popMenu = new wxMenu(); + wxMenuItem* m_menuItem1; + m_menuItem1 = new wxMenuItem( m_popMenu, ID_LAYER_FAB, wxString( _("Select Fab Layers") ) , wxEmptyString, wxITEM_NORMAL ); + m_popMenu->Append( m_menuItem1 ); + + wxMenuItem* m_menuItem2; + m_menuItem2 = new wxMenuItem( m_popMenu, ID_SELECT_COPPER_LAYERS, wxString( _("Select all Copper Layers") ) , wxEmptyString, wxITEM_NORMAL ); + m_popMenu->Append( m_menuItem2 ); + + wxMenuItem* m_menuItem3; + m_menuItem3 = new wxMenuItem( m_popMenu, ID_DESELECT_COPPER_LAYERS, wxString( _("Deselect all Copper Layers") ) , wxEmptyString, wxITEM_NORMAL ); + m_popMenu->Append( m_menuItem3 ); + + wxMenuItem* m_menuItem4; + m_menuItem4 = new wxMenuItem( m_popMenu, ID_SELECT_ALL_LAYERS, wxString( _("Select all Layers") ) , wxEmptyString, wxITEM_NORMAL ); + m_popMenu->Append( m_menuItem4 ); + + wxMenuItem* m_menuItem5; + m_menuItem5 = new wxMenuItem( m_popMenu, ID_DESELECT_ALL_LAYERS, wxString( _("Deselect all Layers") ) , wxEmptyString, wxITEM_NORMAL ); + m_popMenu->Append( m_menuItem5 ); + + this->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::DIALOG_PLOT_BASEOnContextMenu ), NULL, this ); + + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnClose ) ); + this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); + this->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ) ); + m_plotFormatOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); + m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); + m_layerCheckListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this ); + m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); + m_useGerberX2Attributes->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); + m_DXF_plotModeOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this ); + m_buttonDRC->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); + m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); + this->Connect( m_menuItem1->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); + this->Connect( m_menuItem2->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); + this->Connect( m_menuItem3->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); + this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); + this->Connect( m_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); +} + +DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnClose ) ); + this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); + this->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ) ); + m_plotFormatOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); + m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); + m_layerCheckListBox->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this ); + m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); + m_useGerberX2Attributes->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); + m_DXF_plotModeOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this ); + m_buttonDRC->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); + m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); + this->Disconnect( ID_LAYER_FAB, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); + this->Disconnect( ID_SELECT_COPPER_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); + this->Disconnect( ID_DESELECT_COPPER_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); + this->Disconnect( ID_SELECT_ALL_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); + this->Disconnect( ID_DESELECT_ALL_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); + + delete m_popMenu; +} diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 10a646879e..a48047b9b6 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -478,7 +478,7 @@ 5 - wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -519,7 +519,7 @@ 0 - + 29,29 1 m_browseButton 1 @@ -576,7 +576,7 @@ - 8 + 5 wxEXPAND|wxLEFT|wxRIGHT|wxTOP 0 @@ -590,7 +590,7 @@ 1 wxID_ANY - Included Layers: + Included Layers m_LayersSizer wxHORIZONTAL @@ -703,7 +703,7 @@ 0 wxID_ANY - General Options: + General Options sbOptionsSizer wxVERTICAL @@ -730,7 +730,7 @@ none 2 - wxRIGHT|wxLEFT + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1344,94 +1344,6 @@ - - 2 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Use auxiliary axis as origin - - 0 - - - 0 - - 1 - m_useAuxOriginCheckBox - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Use auxiliary axis as coordinates origin in plot files - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 wxALL @@ -1608,6 +1520,94 @@ + + 2 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Use auxiliary axis as origin + + 0 + + + 0 + + 1 + m_useAuxOriginCheckBox + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Use auxiliary axis as coordinates origin in plot files + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 wxALL @@ -1698,11 +1698,11 @@ - + 3 wxRIGHT|wxLEFT 1 - + bSizer14 wxVERTICAL @@ -2400,24 +2400,24 @@ - + 3 - wxALL|wxEXPAND + wxEXPAND|wxALL 1 - + wxID_ANY - Solder Mask Options: + Solder Mask Settings - m_sizerSoldMaskLayerOpt + sbSizerSoldMaskLayerOpt wxVERTICAL 1 - protected + none - + 5 wxEXPAND 1 - + 2 wxBOTH @@ -2627,7 +2627,7 @@ 0 0 wxID_ANY - Width: + Minimum width: 0 @@ -2769,9 +2769,9 @@ 3 wxALL|wxEXPAND 0 - + wxID_ANY - Gerber Options: + Gerber Options m_GerberOptionsSizer wxHORIZONTAL @@ -2789,7 +2789,7 @@ none 2 - wxBOTTOM|wxRIGHT|wxLEFT + wxALL 0 1 @@ -3231,7 +3231,7 @@ 5 - wxALIGN_LEFT|wxALIGN_TOP|wxBOTTOM|wxLEFT + wxALIGN_LEFT|wxALIGN_TOP|wxALL 0 1 @@ -3327,7 +3327,7 @@ 0 wxID_ANY - HPGL Options: + HPGL Options m_HPGLOptionsSizer wxVERTICAL @@ -3527,7 +3527,7 @@ 0 wxID_ANY - Postscript Options: + Postscript Options m_PSOptionsSizer wxVERTICAL @@ -4192,11 +4192,11 @@ 3 - wxALL|wxEXPAND + wxEXPAND|wxALL 0 wxID_ANY - DXF options: + DXF Options m_SizerDXF_options wxVERTICAL @@ -4205,7 +4205,7 @@ 2 - wxALL + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -4478,7 +4478,7 @@ 5 - wxALIGN_RIGHT|wxEXPAND|wxLEFT|wxRIGHT + wxALIGN_RIGHT|wxEXPAND|wxALL 0 @@ -4486,8 +4486,8 @@ wxHORIZONTAL protected - 5 - wxALIGN_CENTER_VERTICAL|wxALL + 10 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -4573,20 +4573,10 @@ - - 5 - wxEXPAND - 1 - - 0 - protected - 10 - - 5 wxEXPAND - 0 + 1 1 1 diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index e4e9c79fcd..c6fe06bc50 100644 --- a/pcbnew/dialogs/dialog_plot_base.h +++ b/pcbnew/dialogs/dialog_plot_base.h @@ -1,154 +1,151 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 4 2017) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_PLOT_BASE_H__ -#define __DIALOG_PLOT_BASE_H__ - -#include -#include -#include -class DIALOG_SHIM; -class WX_HTML_REPORT_PANEL; - -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_PLOT_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_PLOT_BASE : public DIALOG_SHIM -{ - private: - - protected: - enum - { - ID_PRINT_REF = 1000, - ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, - ID_MIROR_OPT, - ID_LAYER_FAB, - ID_SELECT_COPPER_LAYERS, - ID_DESELECT_COPPER_LAYERS, - ID_SELECT_ALL_LAYERS, - ID_DESELECT_ALL_LAYERS - }; - - wxBoxSizer* m_MainSizer; - wxStaticText* m_staticTextPlotFmt; - wxChoice* m_plotFormatOpt; - wxStaticText* m_staticTextDir; - wxTextCtrl* m_outputDirectoryName; - wxBitmapButton* m_browseButton; - wxStaticBoxSizer* m_LayersSizer; - wxCheckListBox* m_layerCheckListBox; - wxBoxSizer* m_PlotOptionsSizer; - wxCheckBox* m_plotSheetRef; - wxCheckBox* m_plotModuleValueOpt; - wxCheckBox* m_plotModuleRefOpt; - wxCheckBox* m_plotInvisibleText; - wxCheckBox* m_plotNoViaOnMaskOpt; - wxCheckBox* m_excludeEdgeLayerOpt; - wxCheckBox* m_excludePadsFromSilkscreen; - wxCheckBox* m_useAuxOriginCheckBox; - wxCheckBox* m_plotMirrorOpt; - wxCheckBox* m_plotPSNegativeOpt; - wxCheckBox* m_zoneFillCheck; - wxStaticText* m_staticText11; - wxChoice* m_drillShapeOpt; - wxStaticText* m_staticText12; - wxChoice* m_scaleOpt; - wxStaticText* m_staticText13; - wxChoice* m_plotModeOpt; - wxStaticText* m_textDefaultPenSize; - wxTextCtrl* m_linesWidth; - wxStaticBoxSizer* m_sizerSoldMaskLayerOpt; - wxStaticText* m_SolderMaskMarginLabel; - wxStaticText* m_SolderMaskMarginCurrValue; - wxStaticText* m_solderMaskMinWidthLabel; - wxStaticText* m_SolderMaskMinWidthCurrValue; - wxStaticBoxSizer* m_GerberOptionsSizer; - wxCheckBox* m_useGerberExtensions; - wxCheckBox* m_useGerberX2Attributes; - wxCheckBox* m_useGerberNetAttributes; - wxCheckBox* m_generateGerberJobFile; - wxCheckBox* m_subtractMaskFromSilk; - wxRadioBox* m_rbGerberFormat; - wxStaticBoxSizer* m_HPGLOptionsSizer; - wxStaticText* m_textPenSize; - wxTextCtrl* m_HPGLPenSizeOpt; - wxStaticBoxSizer* m_PSOptionsSizer; - wxStaticText* m_staticText7; - wxTextCtrl* m_fineAdjustXscaleOpt; - wxStaticText* m_staticText8; - wxTextCtrl* m_fineAdjustYscaleOpt; - wxStaticText* m_textPSFineAdjustWidth; - wxTextCtrl* m_PSFineAdjustWidthOpt; - wxCheckBox* m_forcePSA4OutputOpt; - wxStaticBoxSizer* m_SizerDXF_options; - wxCheckBox* m_DXF_plotModeOpt; - wxCheckBox* m_DXF_plotTextStrokeFontOpt; - WX_HTML_REPORT_PANEL* m_messagesPanel; - wxBoxSizer* m_sizerButtons; - wxButton* m_buttonDRC; - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - wxButton* m_sdbSizer1Apply; - wxButton* m_sdbSizer1Cancel; - wxMenu* m_popMenu; - - // Virtual event handlers, overide them in your derived class - virtual void onActivate( wxActivateEvent& event ) { event.Skip(); } - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } - virtual void OnRightClick( wxMouseEvent& event ) { event.Skip(); } - virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); } - virtual void OnGerberX2Checked( wxCommandEvent& event ) { event.Skip(); } - virtual void OnChangeDXFPlotMode( wxCommandEvent& event ) { event.Skip(); } - virtual void onRunDRC( wxCommandEvent& event ) { event.Skip(); } - virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); } - virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); } - virtual void Plot( wxCommandEvent& event ) { event.Skip(); } - virtual void OnPopUpLayers( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_PLOT_BASE(); - - void DIALOG_PLOT_BASEOnContextMenu( wxMouseEvent &event ) - { - this->PopupMenu( m_popMenu, event.GetPosition() ); - } - -}; - -#endif //__DIALOG_PLOT_BASE_H__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_PLOT_BASE_H__ +#define __DIALOG_PLOT_BASE_H__ + +#include +#include +#include +class WX_HTML_REPORT_PANEL; + +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_PLOT_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_PLOT_BASE : public DIALOG_SHIM +{ + private: + + protected: + enum + { + ID_PRINT_REF = 1000, + ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, + ID_MIROR_OPT, + ID_LAYER_FAB, + ID_SELECT_COPPER_LAYERS, + ID_DESELECT_COPPER_LAYERS, + ID_SELECT_ALL_LAYERS, + ID_DESELECT_ALL_LAYERS + }; + + wxBoxSizer* m_MainSizer; + wxStaticText* m_staticTextPlotFmt; + wxChoice* m_plotFormatOpt; + wxStaticText* m_staticTextDir; + wxTextCtrl* m_outputDirectoryName; + wxBitmapButton* m_browseButton; + wxStaticBoxSizer* m_LayersSizer; + wxCheckListBox* m_layerCheckListBox; + wxBoxSizer* m_PlotOptionsSizer; + wxCheckBox* m_plotSheetRef; + wxCheckBox* m_plotModuleValueOpt; + wxCheckBox* m_plotModuleRefOpt; + wxCheckBox* m_plotInvisibleText; + wxCheckBox* m_plotNoViaOnMaskOpt; + wxCheckBox* m_excludeEdgeLayerOpt; + wxCheckBox* m_excludePadsFromSilkscreen; + wxCheckBox* m_plotMirrorOpt; + wxCheckBox* m_plotPSNegativeOpt; + wxCheckBox* m_useAuxOriginCheckBox; + wxCheckBox* m_zoneFillCheck; + wxStaticText* m_staticText11; + wxChoice* m_drillShapeOpt; + wxStaticText* m_staticText12; + wxChoice* m_scaleOpt; + wxStaticText* m_staticText13; + wxChoice* m_plotModeOpt; + wxStaticText* m_textDefaultPenSize; + wxTextCtrl* m_linesWidth; + wxStaticText* m_SolderMaskMarginLabel; + wxStaticText* m_SolderMaskMarginCurrValue; + wxStaticText* m_solderMaskMinWidthLabel; + wxStaticText* m_SolderMaskMinWidthCurrValue; + wxStaticBoxSizer* m_GerberOptionsSizer; + wxCheckBox* m_useGerberExtensions; + wxCheckBox* m_useGerberX2Attributes; + wxCheckBox* m_useGerberNetAttributes; + wxCheckBox* m_generateGerberJobFile; + wxCheckBox* m_subtractMaskFromSilk; + wxRadioBox* m_rbGerberFormat; + wxStaticBoxSizer* m_HPGLOptionsSizer; + wxStaticText* m_textPenSize; + wxTextCtrl* m_HPGLPenSizeOpt; + wxStaticBoxSizer* m_PSOptionsSizer; + wxStaticText* m_staticText7; + wxTextCtrl* m_fineAdjustXscaleOpt; + wxStaticText* m_staticText8; + wxTextCtrl* m_fineAdjustYscaleOpt; + wxStaticText* m_textPSFineAdjustWidth; + wxTextCtrl* m_PSFineAdjustWidthOpt; + wxCheckBox* m_forcePSA4OutputOpt; + wxStaticBoxSizer* m_SizerDXF_options; + wxCheckBox* m_DXF_plotModeOpt; + wxCheckBox* m_DXF_plotTextStrokeFontOpt; + WX_HTML_REPORT_PANEL* m_messagesPanel; + wxBoxSizer* m_sizerButtons; + wxButton* m_buttonDRC; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Apply; + wxButton* m_sdbSizer1Cancel; + wxMenu* m_popMenu; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } + virtual void OnRightClick( wxMouseEvent& event ) { event.Skip(); } + virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); } + virtual void OnGerberX2Checked( wxCommandEvent& event ) { event.Skip(); } + virtual void OnChangeDXFPlotMode( wxCommandEvent& event ) { event.Skip(); } + virtual void onRunDRC( wxCommandEvent& event ) { event.Skip(); } + virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); } + virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); } + virtual void Plot( wxCommandEvent& event ) { event.Skip(); } + virtual void OnPopUpLayers( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_PLOT_BASE(); + + void DIALOG_PLOT_BASEOnContextMenu( wxMouseEvent &event ) + { + this->PopupMenu( m_popMenu, event.GetPosition() ); + } + +}; + +#endif //__DIALOG_PLOT_BASE_H__ diff --git a/pcbnew/dialogs/dialog_select_net_from_list.cpp b/pcbnew/dialogs/dialog_select_net_from_list.cpp index 6ec6cde44e..bfaaaa1d9b 100644 --- a/pcbnew/dialogs/dialog_select_net_from_list.cpp +++ b/pcbnew/dialogs/dialog_select_net_from_list.cpp @@ -27,8 +27,6 @@ * @brief methods to show available net names and select and highligth a net */ -#include - #include #include #include @@ -44,9 +42,6 @@ #include #include -#define COL_NETNAME 0 -#define COL_NETINFO 1 - class DIALOG_SELECT_NET_FROM_LIST: public DIALOG_SELECT_NET_FROM_LIST_BASE { private: @@ -59,25 +54,22 @@ public: /** * Visually highlights a net. - * @param aEnabled true to enable highlight mode, false to disable. - * @param aNetName is the name of net to be highlighted. + * @param aNetName is the name of net to be highlighted. An empty string will unhighlight + * any currently highlighted net. */ - void HighlightNet( bool aEnabled, const wxString& aNetName ); + void HighlightNet( const wxString& aNetName ); private: - void onCellClick( wxGridEvent& event ) override; + void onSelChanged( wxDataViewEvent& event ) override; void onFilterChange( wxCommandEvent& event ) override; - void onColumnResize( wxGridSizeEvent& event ) override; - void onSelectCell( wxGridEvent& event ) override; - void updateSize( wxSizeEvent& event ) override; + void onListSize( wxSizeEvent& event ) override; - void setColumnSize(); void buildNetsList(); + void adjustListColumns( int aWidth ); - wxString m_selection; - int m_firstWidth; - bool m_wasSelected; - BOARD* m_brd; + wxString m_selection; + bool m_wasSelected; + BOARD* m_brd; PCB_EDIT_FRAME* m_frame; }; @@ -90,7 +82,7 @@ void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event ) if( dlg.ShowModal() == wxID_CANCEL ) { // Clear highlight - dlg.HighlightNet( false, "" ); + dlg.HighlightNet( "" ); } } @@ -101,27 +93,32 @@ DIALOG_SELECT_NET_FROM_LIST::DIALOG_SELECT_NET_FROM_LIST( PCB_EDIT_FRAME* aParen m_brd = aParent->GetBoard(); m_wasSelected = false; - // Choose selection mode - m_netsListGrid->SetSelectionMode( wxGrid::wxGridSelectRows ); + m_netsList->AppendTextColumn( _( "Net" ), wxDATAVIEW_CELL_INERT, 0, wxALIGN_LEFT, 0 ); + m_netsList->AppendTextColumn( _( "Name" ), wxDATAVIEW_CELL_INERT, 0, wxALIGN_LEFT, 0 ); + m_netsList->AppendTextColumn( _( "Pad Count" ), wxDATAVIEW_CELL_INERT, 0, wxALIGN_CENTER, 0 ); + + // The fact that we're a list should keep the control from reserving space for the + // expander buttons... but it doesn't. Fix by forcing the indent to 0. + m_netsList->SetIndent( 0 ); + buildNetsList(); - m_sdbSizerOK->SetDefault(); - GetSizer()->SetSizeHints( this ); - Center(); + adjustListColumns( wxCOL_WIDTH_AUTOSIZE ); - m_firstWidth = m_netsListGrid->GetColSize( 0 ); - setColumnSize(); + m_sdbSizerOK->SetDefault(); + + FinishDialogSettings(); } void DIALOG_SELECT_NET_FROM_LIST::buildNetsList() { - wxString netFilter = m_textCtrlFilter->GetValue(); + wxString netFilter = m_textCtrlFilter->GetValue(); EDA_PATTERN_MATCH_WILDCARD filter; - filter.SetPattern( netFilter.MakeUpper() ); - wxString txt; - int row_idx = 0; + filter.SetPattern( netFilter.MakeUpper() ); + + m_netsList->DeleteAllItems(); // Populate the nets list with nets names matching the filters: // Note: the filtering is case insensitive. @@ -141,50 +138,39 @@ void DIALOG_SELECT_NET_FROM_LIST::buildNetsList() if( !m_cbShowZeroPad->IsChecked() && nodes == 0 ) continue; - if( m_netsListGrid->GetNumberRows() <= row_idx ) - m_netsListGrid->AppendRows( 1 ); + wxVector dataLine; - txt.Printf( _( "net %.3d" ), net->GetNet() ); - m_netsListGrid->SetRowLabelValue( row_idx, txt ); - - m_netsListGrid->SetCellValue( row_idx, COL_NETNAME, net->GetNetname() ); + dataLine.push_back( wxVariant( wxString::Format( _( "%.3d" ), netcode ) ) ); + dataLine.push_back( wxVariant( net->GetNetname() ) ); if( netcode ) - { - txt.Printf( wxT( "%u" ), nodes ); - m_netsListGrid->SetCellValue( row_idx, COL_NETINFO, txt ); - } + dataLine.push_back( wxVariant( wxString::Format( _( "%u" ), nodes ) ) ); else // For the net 0 (unconnected pads), the pad count is not known - m_netsListGrid->SetCellValue( row_idx, COL_NETINFO, "---" ); + dataLine.push_back( wxVariant( wxT( "---" ) ) ); - row_idx++; + m_netsList->AppendItem( dataLine ); } - // Remove extra rows, if any: - int extra_row_idx = m_netsListGrid->GetNumberRows() - row_idx; - - if( extra_row_idx > 0 ) - m_netsListGrid->DeleteRows( row_idx, extra_row_idx ); - - m_netsListGrid->SetColLabelSize( wxGRID_AUTOSIZE ); - m_netsListGrid->SetRowLabelSize( wxGRID_AUTOSIZE ); - - m_netsListGrid->ClearSelection(); m_wasSelected = false; } -void DIALOG_SELECT_NET_FROM_LIST::HighlightNet( bool aEnabled, const wxString& aNetName ) +void DIALOG_SELECT_NET_FROM_LIST::HighlightNet( const wxString& aNetName ) { - // Search for the net selected. - NETINFO_ITEM* net = aEnabled ? m_brd->FindNet( aNetName ) : nullptr; - int netCode = net ? net->GetNet() : -1; + NETINFO_ITEM* net = nullptr; + int netCode = -1; + + if( !aNetName.IsEmpty() ) + { + net = m_brd->FindNet( aNetName ); + netCode = net->GetNet(); + } if( m_frame->IsGalCanvasActive() ) { auto galCanvas = m_frame->GetGalCanvas(); KIGFX::RENDER_SETTINGS* render = galCanvas->GetView()->GetPainter()->GetSettings(); - render->SetHighlight( aEnabled, netCode ); + render->SetHighlight( netCode >= 0, netCode ); galCanvas->GetView()->UpdateAllLayersColor(); galCanvas->Refresh(); @@ -201,13 +187,6 @@ void DIALOG_SELECT_NET_FROM_LIST::HighlightNet( bool aEnabled, const wxString& a } } -void DIALOG_SELECT_NET_FROM_LIST::setColumnSize() -{ - auto size = m_netsListGrid->GetGridWindow()->GetSize(); - - m_netsListGrid->SetColSize( 0, m_firstWidth ); - m_netsListGrid->SetColSize( 1, size.x - m_firstWidth ); -} DIALOG_SELECT_NET_FROM_LIST::~DIALOG_SELECT_NET_FROM_LIST() { @@ -220,46 +199,46 @@ void DIALOG_SELECT_NET_FROM_LIST::onFilterChange( wxCommandEvent& event ) } -void DIALOG_SELECT_NET_FROM_LIST::updateSize( wxSizeEvent& event ) +void DIALOG_SELECT_NET_FROM_LIST::onSelChanged( wxDataViewEvent& ) { - setColumnSize(); - this->Refresh(); - event.Skip(); + int selected_row = m_netsList->GetSelectedRow(); + + if( selected_row >= 0 ) + { + m_selection = m_netsList->GetTextValue( selected_row, 1 ); + m_wasSelected = true; + + HighlightNet( m_selection ); + } + else + { + HighlightNet( "" ); + m_wasSelected = false; + } } -void DIALOG_SELECT_NET_FROM_LIST::onColumnResize( wxGridSizeEvent& event ) +void DIALOG_SELECT_NET_FROM_LIST::adjustListColumns( int aWidth ) { - m_firstWidth = m_netsListGrid->GetColSize( 0 ); - setColumnSize(); + if( aWidth == wxCOL_WIDTH_AUTOSIZE ) + { + m_netsList->GetColumn( 0 )->SetWidth( wxCOL_WIDTH_AUTOSIZE ); + m_netsList->GetColumn( 0 )->SetWidth( m_netsList->GetColumn( 0 )->GetWidth() + 12 ); + m_netsList->GetColumn( 2 )->SetWidth( wxCOL_WIDTH_AUTOSIZE ); + m_netsList->GetColumn( 2 )->SetWidth( m_netsList->GetColumn( 2 )->GetWidth() + 12 ); + aWidth = m_netsList->GetRect().GetWidth(); + } + + aWidth -= m_netsList->GetColumn( 0 )->GetWidth(); + aWidth -= m_netsList->GetColumn( 2 )->GetWidth(); + + m_netsList->GetColumn( 1 )->SetWidth( aWidth - 8 ); } -void DIALOG_SELECT_NET_FROM_LIST::onSelectCell( wxGridEvent& event ) +void DIALOG_SELECT_NET_FROM_LIST::onListSize( wxSizeEvent& aEvent ) { - - int selected_row = event.GetRow(); - m_selection = m_netsListGrid->GetCellValue( selected_row, COL_NETNAME ); - - // Select the full row when clicking on any cell off the row - m_netsListGrid->SelectRow( selected_row, false ); - - HighlightNet( true, m_selection ); -} - - -void DIALOG_SELECT_NET_FROM_LIST::onCellClick( wxGridEvent& event ) -{ - int selected_row = event.GetRow(); - - m_selection = m_netsListGrid->GetCellValue( selected_row, COL_NETNAME ); - m_wasSelected = true; - - // Select the full row when clicking on any cell off the row - m_netsListGrid->SelectRow( selected_row, false ); - m_netsListGrid->SetGridCursor(selected_row, COL_NETNAME ); - - HighlightNet( true, m_selection ); + adjustListColumns( aEvent.GetSize().GetX() ); } diff --git a/pcbnew/dialogs/dialog_select_net_from_list_base.cpp b/pcbnew/dialogs/dialog_select_net_from_list_base.cpp index db946298ad..a64ffaf772 100644 --- a/pcbnew/dialogs/dialog_select_net_from_list_base.cpp +++ b/pcbnew/dialogs/dialog_select_net_from_list_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -16,61 +16,33 @@ DIALOG_SELECT_NET_FROM_LIST_BASE::DIALOG_SELECT_NET_FROM_LIST_BASE( wxWindow* pa wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxVERTICAL ); - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 3, 0, 0 ); - fgSizer1->AddGrowableCol( 1 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + wxBoxSizer* bTopSizer; + bTopSizer = new wxBoxSizer( wxHORIZONTAL ); m_staticTextFilter = new wxStaticText( this, wxID_ANY, _("Net name filter:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextFilter->Wrap( -1 ); - fgSizer1->Add( m_staticTextFilter, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bTopSizer->Add( m_staticTextFilter, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlFilter = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_textCtrlFilter, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + bTopSizer->Add( m_textCtrlFilter, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bTopSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); m_cbShowZeroPad = new wxCheckBox( this, wxID_ANY, _("Show zero pad nets"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbShowZeroPad->SetValue(true); - fgSizer1->Add( m_cbShowZeroPad, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bTopSizer->Add( m_cbShowZeroPad, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizerMain->Add( fgSizer1, 0, wxEXPAND, 5 ); + bSizerMain->Add( bTopSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - m_netsListGrid = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_netsList = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_netsList->SetMinSize( wxSize( 400,300 ) ); - // Grid - m_netsListGrid->CreateGrid( 1, 2 ); - m_netsListGrid->EnableEditing( false ); - m_netsListGrid->EnableGridLines( true ); - m_netsListGrid->EnableDragGridSize( false ); - m_netsListGrid->SetMargins( 0, 0 ); - - // Columns - m_netsListGrid->SetColSize( 0, 300 ); - m_netsListGrid->SetColSize( 1, 130 ); - m_netsListGrid->EnableDragColMove( false ); - m_netsListGrid->EnableDragColSize( true ); - m_netsListGrid->SetColLabelSize( 20 ); - m_netsListGrid->SetColLabelValue( 0, _("Net name") ); - m_netsListGrid->SetColLabelValue( 1, _("Number of pads") ); - m_netsListGrid->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); - - // Rows - m_netsListGrid->AutoSizeRows(); - m_netsListGrid->EnableDragRowSize( true ); - m_netsListGrid->SetRowLabelSize( 50 ); - m_netsListGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Label Appearance - - // Cell Defaults - m_netsListGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); - m_netsListGrid->SetMinSize( wxSize( 485,300 ) ); - - bSizerMain->Add( m_netsListGrid, 1, wxALL|wxEXPAND, 5 ); + bSizerMain->Add( m_netsList, 1, wxALL|wxEXPAND, 10 ); m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerMain->Add( m_staticline, 0, wxEXPAND, 5 ); + bSizerMain->Add( m_staticline, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); @@ -79,7 +51,7 @@ DIALOG_SELECT_NET_FROM_LIST_BASE::DIALOG_SELECT_NET_FROM_LIST_BASE( wxWindow* pa m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 ); + bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bSizerMain ); @@ -89,22 +61,18 @@ DIALOG_SELECT_NET_FROM_LIST_BASE::DIALOG_SELECT_NET_FROM_LIST_BASE( wxWindow* pa this->Centre( wxBOTH ); // Connect Events - this->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::updateSize ) ); m_textCtrlFilter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onFilterChange ), NULL, this ); m_cbShowZeroPad->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onFilterChange ), NULL, this ); - m_netsListGrid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onCellClick ), NULL, this ); - m_netsListGrid->Connect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onColumnResize ), NULL, this ); - m_netsListGrid->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onSelectCell ), NULL, this ); + m_netsList->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onSelChanged ), NULL, this ); + m_netsList->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onListSize ), NULL, this ); } DIALOG_SELECT_NET_FROM_LIST_BASE::~DIALOG_SELECT_NET_FROM_LIST_BASE() { // Disconnect Events - this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::updateSize ) ); m_textCtrlFilter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onFilterChange ), NULL, this ); m_cbShowZeroPad->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onFilterChange ), NULL, this ); - m_netsListGrid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onCellClick ), NULL, this ); - m_netsListGrid->Disconnect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onColumnResize ), NULL, this ); - m_netsListGrid->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onSelectCell ), NULL, this ); + m_netsList->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onSelChanged ), NULL, this ); + m_netsList->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SELECT_NET_FROM_LIST_BASE::onListSize ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_select_net_from_list_base.fbp b/pcbnew/dialogs/dialog_select_net_from_list_base.fbp index 73ec71578f..35ff042cad 100644 --- a/pcbnew/dialogs/dialog_select_net_from_list_base.fbp +++ b/pcbnew/dialogs/dialog_select_net_from_list_base.fbp @@ -14,7 +14,6 @@ dialog_select_net_from_list_base 1000 none - 1 dialog_select_net_from_list_base @@ -87,7 +86,7 @@ - updateSize + @@ -96,20 +95,13 @@ none 5 - wxEXPAND + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 - - 3 - wxBOTH - 1 - - 0 + - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED + bTopSizer + wxHORIZONTAL none - 0 - 0 5 wxALL|wxALIGN_CENTER_VERTICAL @@ -195,8 +187,8 @@ 5 - wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL - 0 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 1 1 1 @@ -284,6 +276,16 @@ + + 10 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 0 + protected + 0 + + 5 wxALL|wxALIGN_CENTER_VERTICAL @@ -374,127 +376,52 @@ - - 5 + + 10 wxALL|wxEXPAND 1 - - 1 - 1 - 1 - 1 - - - - - 0 - 1 - + - - 1 - - - wxALIGN_LEFT - - wxALIGN_TOP - 0 - 1 - wxALIGN_LEFT - 20 - "Net name" "Number of pads" - wxALIGN_CENTRE - 2 - 300,130 1 - 0 - Dock - 0 - Left - 0 - 1 - 0 - 1 - 0 1 - 1 - - 1 - 0 0 wxID_ANY - - - - 0 - 0 - - 0 - - 0 - 485,300 - 1 - m_netsListGrid - 1 - - + 400,300 + m_netsList protected - 1 - Resizable - wxALIGN_CENTRE - 50 - - wxALIGN_CENTRE - - 1 - 1 - - 0 + + ; forward_declare + + + + + + + + + + + + + + + + + + onSelChanged - - onCellClick - - - - - - - - - - - - - - - - - - - - onColumnResize - - - - - - - - - - onSelectCell @@ -513,13 +440,13 @@ - + onListSize 5 - wxEXPAND + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -600,7 +527,7 @@ 5 - wxEXPAND|wxALL + wxALL|wxEXPAND 0 0 diff --git a/pcbnew/dialogs/dialog_select_net_from_list_base.h b/pcbnew/dialogs/dialog_select_net_from_list_base.h index ddc7c5df2f..dc68ac49a6 100644 --- a/pcbnew/dialogs/dialog_select_net_from_list_base.h +++ b/pcbnew/dialogs/dialog_select_net_from_list_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -40,18 +40,16 @@ class DIALOG_SELECT_NET_FROM_LIST_BASE : public DIALOG_SHIM wxStaticText* m_staticTextFilter; wxTextCtrl* m_textCtrlFilter; wxCheckBox* m_cbShowZeroPad; - wxGrid* m_netsListGrid; + wxDataViewListCtrl* m_netsList; wxStaticLine* m_staticline; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class - virtual void updateSize( wxSizeEvent& event ) { event.Skip(); } virtual void onFilterChange( wxCommandEvent& event ) { event.Skip(); } - virtual void onCellClick( wxGridEvent& event ) { event.Skip(); } - virtual void onColumnResize( wxGridSizeEvent& event ) { event.Skip(); } - virtual void onSelectCell( wxGridEvent& event ) { event.Skip(); } + virtual void onSelChanged( wxDataViewEvent& event ) { event.Skip(); } + virtual void onListSize( wxSizeEvent& event ) { event.Skip(); } public: diff --git a/pcbnew/dialogs/dialog_update_pcb.cpp b/pcbnew/dialogs/dialog_update_pcb.cpp index 719161b37f..53f1e25b28 100644 --- a/pcbnew/dialogs/dialog_update_pcb.cpp +++ b/pcbnew/dialogs/dialog_update_pcb.cpp @@ -40,27 +40,57 @@ #include #include +#include + using namespace std::placeholders; +#define NETLIST_FILTER_MESSAGES_KEY wxT("NetlistReportFilterMsg") +#define NETLIST_UPDATEFOOTPRINTS_KEY wxT("NetlistUpdateFootprints") +#define NETLIST_DELETESHORTINGTRACKS_KEY wxT("NetlistDeleteShortingTracks") +#define NETLIST_DELETEEXTRAFOOTPRINTS_KEY wxT("NetlistDeleteExtraFootprints") +#define NETLIST_DELETESINGLEPADNETS_KEY wxT("NetlistDeleteSinglePadNets") + + DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB( PCB_EDIT_FRAME* aParent, NETLIST* aNetlist ) : DIALOG_UPDATE_PCB_BASE( aParent ), m_frame( aParent ), - m_netlist( aNetlist ) + m_netlist( aNetlist ), + m_initialized( false ) { - m_messagePanel->SetLabel( _("Changes to be applied:") ); + m_config = Kiface().KifaceSettings(); + + m_cbUpdateFootprints->SetValue( m_config->Read( NETLIST_UPDATEFOOTPRINTS_KEY, 0l ) ); + m_cbDeleteExtraFootprints->SetValue( m_config->Read( NETLIST_DELETEEXTRAFOOTPRINTS_KEY, 0l ) ); + m_cbDeleteSinglePadNets->SetValue( m_config->Read( NETLIST_DELETESINGLEPADNETS_KEY, 0l ) ); + + m_messagePanel->SetLabel( _("Changes To Be Applied") ); m_messagePanel->SetLazyUpdate( true ); m_netlist->SortByReference(); - m_btnPerformUpdate->SetFocus(); - m_messagePanel->SetVisibleSeverities( REPORTER::RPT_WARNING | REPORTER::RPT_ERROR | REPORTER::RPT_ACTION ); + m_messagePanel->SetVisibleSeverities( m_config->Read( NETLIST_FILTER_MESSAGES_KEY, -1l ) ); m_messagePanel->GetSizer()->SetSizeHints( this ); - GetSizer()->SetSizeHints( this ); + + // We use a sdbSizer to get platform-dependent ordering of the action buttons, but + // that requires us to correct the button labels here. + m_sdbSizer1OK->SetLabel( _( "Update PCB" ) ); + m_sdbSizer1Cancel->SetLabel( _( "Close" ) ); + m_sdbSizer1->Layout(); + + m_sdbSizer1OK->SetDefault(); + FinishDialogSettings(); + + m_initialized = true; + PerformUpdate( true ); } DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB() { + m_config->Write( NETLIST_UPDATEFOOTPRINTS_KEY, m_cbUpdateFootprints->GetValue() ); + m_config->Write( NETLIST_DELETEEXTRAFOOTPRINTS_KEY, m_cbDeleteExtraFootprints->GetValue() ); + m_config->Write( NETLIST_DELETESINGLEPADNETS_KEY, m_cbDeleteSinglePadNets->GetValue() ); + m_config->Write( NETLIST_FILTER_MESSAGES_KEY, (long) m_messagePanel->GetVisibleSeverities() ); } @@ -78,14 +108,13 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun ) if( !aDryRun ) { - // Clear selection, just in case a selected item has to be removed toolManager->RunAction( PCB_ACTIONS::selectionClear, true ); } - m_netlist->SetDeleteExtraFootprints( true ); - m_netlist->SetFindByTimeStamp( m_matchByTimestamp->GetValue() ); - m_netlist->SetReplaceFootprints( true ); + m_netlist->SetDeleteExtraFootprints( m_cbDeleteExtraFootprints->GetValue() ); + m_netlist->SetFindByTimeStamp( m_matchByTimestamp->GetSelection() == 0 ); + m_netlist->SetReplaceFootprints( m_cbUpdateFootprints->GetValue() ); try { @@ -93,8 +122,6 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun ) } catch( IO_ERROR &error ) { - wxString msg; - reporter.ReportTail( _( "Failed to load one or more footprints. Please add the missing libraries in PCBNew configuration. " "The PCB will not update completely." ), REPORTER::RPT_ERROR ); reporter.ReportTail( error.What(), REPORTER::RPT_INFO ); @@ -103,10 +130,10 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun ) BOARD_NETLIST_UPDATER updater( m_frame, m_frame->GetBoard() ); updater.SetReporter ( &reporter ); updater.SetIsDryRun( aDryRun ); - updater.SetLookupByTimestamp( m_matchByTimestamp->GetValue() ); - updater.SetDeleteUnusedComponents ( true ); - updater.SetReplaceFootprints( true ); - updater.SetDeleteSinglePadNets( false ); + updater.SetLookupByTimestamp( m_matchByTimestamp->GetSelection() == 0 ); + updater.SetDeleteUnusedComponents ( m_cbDeleteExtraFootprints->GetValue() ); + updater.SetReplaceFootprints( m_cbUpdateFootprints->GetValue() ); + updater.SetDeleteSinglePadNets( m_cbDeleteSinglePadNets->GetValue() ); updater.UpdateNetlist( *m_netlist ); m_messagePanel->Flush( true ); @@ -114,7 +141,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun ) if( aDryRun ) return; - m_frame->SetCurItem( NULL ); + m_frame->SetCurItem( nullptr ); m_frame->SetMsgPanel( board ); // Update rendered tracks and vias net labels @@ -145,32 +172,33 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun ) if( !newFootprints.empty() ) { for( MODULE* footprint : newFootprints ) - { toolManager->RunAction( PCB_ACTIONS::selectItem, true, footprint ); - } toolManager->InvokeTool( "pcbnew.InteractiveEdit" ); } } else // Legacy canvas m_frame->GetCanvas()->Refresh(); - - m_btnPerformUpdate->Enable( false ); - m_btnPerformUpdate->SetLabel( _( "Update complete" ) ); - m_btnCancel->SetLabel( _( "Close" ) ); - m_btnCancel->SetFocus(); } -void DIALOG_UPDATE_PCB::OnMatchChange( wxCommandEvent& event ) +void DIALOG_UPDATE_PCB::OnMatchChanged( wxCommandEvent& event ) { - PerformUpdate( true ); + if( m_initialized ) + PerformUpdate( true ); +} + + +void DIALOG_UPDATE_PCB::OnOptionChanged( wxCommandEvent& event ) +{ + if( m_initialized ) + PerformUpdate( true ); } void DIALOG_UPDATE_PCB::OnUpdateClick( wxCommandEvent& event ) { - m_messagePanel->SetLabel( _( "Changes applied to the PCB:" ) ); + m_messagePanel->SetLabel( _( "Changes Applied To PCB" ) ); PerformUpdate( false ); - m_btnCancel->SetFocus(); + m_sdbSizer1Cancel->SetDefault(); } diff --git a/pcbnew/dialogs/dialog_update_pcb.fbp b/pcbnew/dialogs/dialog_update_pcb.fbp deleted file mode 100644 index 6db6969b09..0000000000 --- a/pcbnew/dialogs/dialog_update_pcb.fbp +++ /dev/null @@ -1,661 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_update_pcb_base - 1000 - none - 1 - dialog_update_pcb_base - - . - - 1 - 1 - 1 - 1 - UI - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - -1,-1 - DIALOG_UPDATE_PCB_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Update PCB from Schematic - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxVERTICAL - none - - 5 - wxEXPAND|wxALL - 0 - - 3 - wxBOTH - - - 0 - - fgSizer2 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Match footprints by: - - 0 - - - 0 - - 1 - m_staticText1 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Reference - - 0 - - - 0 - - 1 - m_matchByReference - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - - - - - - - - - - - - - - - OnMatchChange - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Timestamp - - 0 - - - 0 - - 1 - m_matchByTimestamp - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - - - - - - - - - - - - - - - OnMatchChange - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 1 - - 500,300 - bLowerSizer - wxVERTICAL - none - - 5 - wxEXPAND | wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - -1,-1 - 1 - m_messagePanel - 1 - - - protected - 1 - - Resizable - 1 - - WX_HTML_REPORT_PANEL; wx_html_report_panel.h - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 5 - wxBOTH - 0 - - 0 - - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 1 - 0 - - 5 - wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Close - - 0 - - - 0 - - 1 - m_btnCancel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Update PCB - - 0 - - - 0 - 140,-1 - 1 - m_btnPerformUpdate - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnUpdateClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pcbnew/dialogs/dialog_update_pcb.h b/pcbnew/dialogs/dialog_update_pcb.h index 4541f71bcf..ed4e331b3a 100644 --- a/pcbnew/dialogs/dialog_update_pcb.h +++ b/pcbnew/dialogs/dialog_update_pcb.h @@ -37,7 +37,9 @@ class DIALOG_UPDATE_PCB : public DIALOG_UPDATE_PCB_BASE { private: PCB_EDIT_FRAME* m_frame; - NETLIST *m_netlist; + NETLIST* m_netlist; + wxConfigBase* m_config; + bool m_initialized; public: DIALOG_UPDATE_PCB( PCB_EDIT_FRAME* aParent, NETLIST *aNetlist ); @@ -47,8 +49,9 @@ public: private: - virtual void OnMatchChange( wxCommandEvent& event ) override; - virtual void OnUpdateClick( wxCommandEvent& event ) override; + void OnMatchChanged( wxCommandEvent& event ) override; + void OnOptionChanged( wxCommandEvent& event ) override; + void OnUpdateClick( wxCommandEvent& event ) override; }; diff --git a/pcbnew/dialogs/dialog_update_pcb_base.cpp b/pcbnew/dialogs/dialog_update_pcb_base.cpp index 764388c4a7..10860a4b7e 100644 --- a/pcbnew/dialogs/dialog_update_pcb_base.cpp +++ b/pcbnew/dialogs/dialog_update_pcb_base.cpp @@ -18,50 +18,53 @@ DIALOG_UPDATE_PCB_BASE::DIALOG_UPDATE_PCB_BASE( wxWindow* parent, wxWindowID id, wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - wxFlexGridSizer* fgSizer2; - fgSizer2 = new wxFlexGridSizer( 0, 3, 0, 0 ); - fgSizer2->SetFlexibleDirection( wxBOTH ); - fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + wxBoxSizer* bUpperSizer; + bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); - m_staticText1 = new wxStaticText( this, wxID_ANY, _("Match footprints by:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1->Wrap( -1 ); - fgSizer2->Add( m_staticText1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + wxString m_matchByTimestampChoices[] = { _("Keep existing symbol to footprint associations"), _("Re-associate footprints by reference") }; + int m_matchByTimestampNChoices = sizeof( m_matchByTimestampChoices ) / sizeof( wxString ); + m_matchByTimestamp = new wxRadioBox( this, wxID_ANY, _("Match Method"), wxDefaultPosition, wxDefaultSize, m_matchByTimestampNChoices, m_matchByTimestampChoices, 1, wxRA_SPECIFY_COLS ); + m_matchByTimestamp->SetSelection( 0 ); + m_matchByTimestamp->SetToolTip( _("Select how footprints are recognized:\nby their reference (U1, R3...) (normal setting)\nor their time stamp (special setting after a full schematic reannotation)") ); - m_matchByReference = new wxRadioButton( this, wxID_ANY, _("Reference"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_matchByReference, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bUpperSizer->Add( m_matchByTimestamp, 1, wxALIGN_TOP|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - m_matchByTimestamp = new wxRadioButton( this, wxID_ANY, _("Timestamp"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_matchByTimestamp, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + wxStaticBoxSizer* sbSizer1; + sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); + + m_cbUpdateFootprints = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Update footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_cbUpdateFootprints, 0, wxBOTTOM, 5 ); + + m_cbDeleteExtraFootprints = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Delete extra footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_cbDeleteExtraFootprints, 0, wxBOTTOM, 5 ); + + m_cbDeleteSinglePadNets = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Delete single-pad nets"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_cbDeleteSinglePadNets, 0, wxBOTTOM, 5 ); - bMainSizer->Add( fgSizer2, 0, wxEXPAND|wxALL, 5 ); + bUpperSizer->Add( sbSizer1, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + + bMainSizer->Add( bUpperSizer, 0, wxALL|wxEXPAND, 5 ); wxBoxSizer* bLowerSizer; bLowerSizer = new wxBoxSizer( wxVERTICAL ); - bLowerSizer->SetMinSize( wxSize( 500,300 ) ); + bLowerSizer->SetMinSize( wxSize( 660,300 ) ); m_messagePanel = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); bLowerSizer->Add( m_messagePanel, 1, wxEXPAND | wxALL, 5 ); - bMainSizer->Add( bLowerSizer, 1, wxALL|wxEXPAND, 5 ); + bMainSizer->Add( bLowerSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 1, 5, 0, 0 ); - fgSizer1->AddGrowableCol( 0 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); - m_btnCancel = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_btnCancel, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); - - m_btnPerformUpdate = new wxButton( this, wxID_ANY, _("Update PCB"), wxDefaultPosition, wxDefaultSize, 0 ); - m_btnPerformUpdate->SetMinSize( wxSize( 140,-1 ) ); - - fgSizer1->Add( m_btnPerformUpdate, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - - bMainSizer->Add( fgSizer1, 0, wxALL|wxEXPAND, 5 ); + bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bMainSizer ); @@ -69,16 +72,20 @@ DIALOG_UPDATE_PCB_BASE::DIALOG_UPDATE_PCB_BASE( wxWindow* parent, wxWindowID id, bMainSizer->Fit( this ); // Connect Events - m_matchByReference->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnMatchChange ), NULL, this ); - m_matchByTimestamp->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnMatchChange ), NULL, this ); - m_btnPerformUpdate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnUpdateClick ), NULL, this ); + m_matchByTimestamp->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnMatchChanged ), NULL, this ); + m_cbUpdateFootprints->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteExtraFootprints->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteSinglePadNets->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnOptionChanged ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnUpdateClick ), NULL, this ); } DIALOG_UPDATE_PCB_BASE::~DIALOG_UPDATE_PCB_BASE() { // Disconnect Events - m_matchByReference->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnMatchChange ), NULL, this ); - m_matchByTimestamp->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnMatchChange ), NULL, this ); - m_btnPerformUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnUpdateClick ), NULL, this ); + m_matchByTimestamp->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnMatchChanged ), NULL, this ); + m_cbUpdateFootprints->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteExtraFootprints->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnOptionChanged ), NULL, this ); + m_cbDeleteSinglePadNets->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnOptionChanged ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_PCB_BASE::OnUpdateClick ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_update_pcb_base.fbp b/pcbnew/dialogs/dialog_update_pcb_base.fbp new file mode 100644 index 0000000000..8f0de6eaba --- /dev/null +++ b/pcbnew/dialogs/dialog_update_pcb_base.fbp @@ -0,0 +1,596 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_update_pcb_base + 1000 + none + 1 + dialog_update_pcb_base + + . + + 1 + 1 + 1 + 1 + UI + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + -1,-1 + DIALOG_UPDATE_PCB_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Update PCB from Schematic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + bUpperSizer + wxHORIZONTAL + none + + 5 + wxALIGN_TOP|wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Keep existing symbol to footprint associations" "Re-associate footprints by reference" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Match Method + 1 + + 0 + + + 0 + + 1 + m_matchByTimestamp + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + Select how footprints are recognized: by their reference (U1, R3...) (normal setting) or their time stamp (special setting after a full schematic reannotation) + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + OnMatchChanged + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + wxID_ANY + Options + + sbSizer1 + wxVERTICAL + 1 + none + + + 5 + wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Update footprints + + 0 + + + 0 + + 1 + m_cbUpdateFootprints + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnOptionChanged + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete extra footprints + + 0 + + + 0 + + 1 + m_cbDeleteExtraFootprints + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnOptionChanged + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete single-pad nets + + 0 + + + 0 + + 1 + m_cbDeleteSinglePadNets + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnOptionChanged + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + 660,300 + bLowerSizer + wxVERTICAL + none + + 5 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,-1 + 1 + m_messagePanel + 1 + + + protected + 1 + + Resizable + 1 + + WX_HTML_REPORT_PANEL; wx_html_report_panel.h + 0 + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + + + + + OnUpdateClick + + + + + + + + diff --git a/pcbnew/dialogs/dialog_update_pcb_base.h b/pcbnew/dialogs/dialog_update_pcb_base.h index 3c05abd69f..d549c3ac81 100644 --- a/pcbnew/dialogs/dialog_update_pcb_base.h +++ b/pcbnew/dialogs/dialog_update_pcb_base.h @@ -15,13 +15,14 @@ class WX_HTML_REPORT_PANEL; #include "dialog_shim.h" #include -#include +#include #include #include #include #include -#include +#include #include +#include #include #include #include @@ -36,15 +37,18 @@ class DIALOG_UPDATE_PCB_BASE : public DIALOG_SHIM private: protected: - wxStaticText* m_staticText1; - wxRadioButton* m_matchByReference; - wxRadioButton* m_matchByTimestamp; + wxRadioBox* m_matchByTimestamp; + wxCheckBox* m_cbUpdateFootprints; + wxCheckBox* m_cbDeleteExtraFootprints; + wxCheckBox* m_cbDeleteSinglePadNets; WX_HTML_REPORT_PANEL* m_messagePanel; - wxButton* m_btnCancel; - wxButton* m_btnPerformUpdate; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class - virtual void OnMatchChange( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMatchChanged( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOptionChanged( wxCommandEvent& event ) { event.Skip(); } virtual void OnUpdateClick( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/exporters/gen_footprints_placefile.cpp b/pcbnew/exporters/gen_footprints_placefile.cpp index 86829de76f..acab0791f4 100644 --- a/pcbnew/exporters/gen_footprints_placefile.cpp +++ b/pcbnew/exporters/gen_footprints_placefile.cpp @@ -103,6 +103,14 @@ public: m_reporter = &m_messagesPanel->Reporter(); initDialog(); + // We use a sdbSizer to get platform-dependent ordering of the action buttons, but + // that requires us to correct the button labels here. + m_sdbSizer1OK->SetLabel( _( "Generate Position File" ) ); + m_sdbSizer1Cancel->SetLabel( _( "Close" ) ); + m_sdbSizer1->Layout(); + + m_sdbSizer1OK->SetDefault(); + GetSizer()->SetSizeHints(this); Centre(); } @@ -158,7 +166,7 @@ const wxString backSideName = wxT( "bottom" ); void DIALOG_GEN_FOOTPRINT_POSITION::initDialog() { - m_browseButton->SetBitmap( KiBitmap( browse_files_xpm ) ); + m_browseButton->SetBitmap( KiBitmap( folder_xpm ) ); m_config = Kiface().KifaceSettings(); m_config->Read( PLACEFILE_UNITS_KEY, &m_unitsOpt, 1 ); @@ -174,8 +182,6 @@ void DIALOG_GEN_FOOTPRINT_POSITION::initDialog() // Update sizes and sizers: m_messagesPanel->MsgPanelSetMinSize( wxSize( -1, 160 ) ); GetSizer()->SetSizeHints( this ); - - m_generateButton->SetDefault(); } void DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )