ADDED: Editing style of multiple graphical lines at the same time.
Provides the ability to quickly set the style of multiple lines. This is only allowed if the selection includes _only_ graphical lines.
This commit is contained in:
parent
8bf9a4c811
commit
b84fe2b703
|
@ -91,6 +91,7 @@ set( BMAPS_SMALL
|
||||||
pintype_opencoll
|
pintype_opencoll
|
||||||
pintype_openemit
|
pintype_openemit
|
||||||
pintype_noconnect
|
pintype_noconnect
|
||||||
|
question_mark
|
||||||
refresh
|
refresh
|
||||||
small_down
|
small_down
|
||||||
small_edit
|
small_edit
|
||||||
|
@ -534,6 +535,10 @@ set( BMAPS_BIG
|
||||||
)
|
)
|
||||||
|
|
||||||
set( BMAPS_OTHER
|
set( BMAPS_OTHER
|
||||||
|
stroke_dash
|
||||||
|
stroke_dashdot
|
||||||
|
stroke_dot
|
||||||
|
stroke_solid
|
||||||
tune_diff_pair_length_legend
|
tune_diff_pair_length_legend
|
||||||
tune_diff_pair_skew_legend
|
tune_diff_pair_skew_legend
|
||||||
tune_single_track_length_legend
|
tune_single_track_length_legend
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
/* Do not modify this file, it was automatically generated by the
|
||||||
|
* PNG2cpp CMake script, using a *.png file as input.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <bitmaps_png/bitmaps_list.h>
|
||||||
|
|
||||||
|
static const unsigned char png[] = {
|
||||||
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||||
|
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0xb5, 0xfa, 0x37,
|
||||||
|
0xea, 0x00, 0x00, 0x00, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0x18, 0x6c, 0xc0,
|
||||||
|
0x83, 0x21, 0x8c, 0xa1, 0x8c, 0x21, 0x88, 0x81, 0x11, 0xbb, 0xb4, 0x09, 0x43, 0x1b, 0x90, 0x94,
|
||||||
|
0x63, 0xf8, 0xc1, 0x60, 0x83, 0x5d, 0x01, 0x3b, 0x83, 0x0b, 0x90, 0x14, 0x66, 0xf8, 0xce, 0xa0,
|
||||||
|
0x80, 0xcf, 0x9a, 0x44, 0x86, 0x6e, 0xfc, 0xee, 0x98, 0xc6, 0xc0, 0x8c, 0x4f, 0x5a, 0x98, 0xc1,
|
||||||
|
0x02, 0xbf, 0x7e, 0x0d, 0x06, 0x69, 0xfc, 0x0a, 0x9a, 0x18, 0xf2, 0x06, 0x5d, 0xe0, 0x33, 0x00,
|
||||||
|
0x00, 0x29, 0xbc, 0x07, 0xec, 0x3c, 0xd3, 0xa9, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
|
||||||
|
0x44, 0xae, 0x42, 0x60, 0x82,
|
||||||
|
};
|
||||||
|
|
||||||
|
const BITMAP_OPAQUE question_mark_xpm[1] = {{ png, sizeof( png ), "question_mark_xpm" }};
|
||||||
|
|
||||||
|
//EOF
|
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
/* Do not modify this file, it was automatically generated by the
|
||||||
|
* PNG2cpp CMake script, using a *.png file as input.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <bitmaps_png/bitmaps_list.h>
|
||||||
|
|
||||||
|
static const unsigned char png[] = {
|
||||||
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||||
|
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa6, 0xe7, 0x79,
|
||||||
|
0x29, 0x00, 0x00, 0x00, 0xa5, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0x63, 0x60, 0x18, 0x05, 0xa3,
|
||||||
|
0x60, 0x14, 0x8c, 0x02, 0x04, 0x60, 0x04, 0x62, 0x6e, 0x12, 0x31, 0x23, 0x91, 0xe6, 0x72, 0x90,
|
||||||
|
0x88, 0xe9, 0x68, 0x2e, 0x77, 0x16, 0x0f, 0x83, 0xc8, 0xb1, 0x02, 0x06, 0xf1, 0x87, 0x17, 0x18,
|
||||||
|
0xa4, 0xbe, 0xfc, 0x27, 0x09, 0x83, 0xf4, 0x80, 0xf4, 0x82, 0xcc, 0xc0, 0x69, 0xee, 0x83, 0x73,
|
||||||
|
0x0c, 0x92, 0xef, 0xff, 0x92, 0x84, 0xc5, 0x1f, 0x9e, 0xa3, 0x9f, 0xb9, 0xa2, 0xe7, 0xa7, 0x32,
|
||||||
|
0x48, 0xff, 0xff, 0x4f, 0x11, 0x06, 0x99, 0x81, 0x0e, 0xc4, 0x2e, 0x50, 0x6e, 0x2e, 0xc8, 0x0c,
|
||||||
|
0x1a, 0x9b, 0xcb, 0xc4, 0x20, 0xf1, 0xf4, 0x05, 0xc5, 0x06, 0x82, 0xcc, 0x00, 0x99, 0x85, 0x00,
|
||||||
|
0x40, 0x73, 0x9f, 0x51, 0xc1, 0xdc, 0x67, 0x34, 0x37, 0x97, 0x4a, 0x01, 0xf0, 0x6c, 0xc8, 0x06,
|
||||||
|
0xc0, 0x88, 0xcf, 0x02, 0xc8, 0x85, 0xca, 0x79, 0x06, 0xa9, 0xcf, 0x24, 0x14, 0x82, 0x40, 0xb5,
|
||||||
|
0x20, 0x3d, 0x78, 0x0b, 0xab, 0xa3, 0xf9, 0xe4, 0x17, 0x56, 0x40, 0xbd, 0xf4, 0x34, 0x77, 0xe4,
|
||||||
|
0x56, 0x83, 0xa3, 0x60, 0x14, 0x8c, 0x82, 0x91, 0x0a, 0x00, 0xfd, 0x46, 0x7a, 0xf6, 0xe4, 0x09,
|
||||||
|
0x17, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||||
|
};
|
||||||
|
|
||||||
|
const BITMAP_OPAQUE stroke_dash_xpm[1] = {{ png, sizeof( png ), "stroke_dash_xpm" }};
|
||||||
|
|
||||||
|
//EOF
|
|
@ -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 <bitmaps_png/bitmaps_list.h>
|
||||||
|
|
||||||
|
static const unsigned char png[] = {
|
||||||
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||||
|
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa6, 0xe7, 0x79,
|
||||||
|
0x29, 0x00, 0x00, 0x00, 0xd6, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0x63, 0x60, 0x18, 0x05, 0xa3,
|
||||||
|
0x60, 0x14, 0x8c, 0x02, 0x04, 0x60, 0x04, 0x62, 0x6e, 0x12, 0x31, 0x23, 0x99, 0x76, 0xb1, 0x22,
|
||||||
|
0x99, 0xc1, 0x31, 0xb0, 0xee, 0xe5, 0xce, 0xe2, 0x61, 0x10, 0x39, 0x56, 0xc0, 0x20, 0xfe, 0xf0,
|
||||||
|
0x02, 0x83, 0xd4, 0x97, 0xff, 0x24, 0x61, 0x90, 0x1e, 0x90, 0x5e, 0x90, 0x19, 0xc4, 0x00, 0x81,
|
||||||
|
0xb9, 0x5a, 0x0c, 0x62, 0x97, 0xa7, 0x30, 0x48, 0xbc, 0x7c, 0x03, 0x37, 0x43, 0xf2, 0xdd, 0x4f,
|
||||||
|
0x06, 0xf1, 0xdb, 0x6b, 0x19, 0x84, 0x36, 0x7a, 0x10, 0x65, 0x06, 0xd5, 0xdd, 0x2b, 0x7a, 0x7e,
|
||||||
|
0x2a, 0x83, 0xf4, 0xff, 0xff, 0x14, 0x61, 0x90, 0x19, 0x84, 0x00, 0x4f, 0x85, 0x30, 0xd0, 0xe3,
|
||||||
|
0xf7, 0x71, 0x9a, 0x21, 0xf5, 0xfd, 0x17, 0x83, 0xd0, 0x6a, 0x07, 0x82, 0xe6, 0x50, 0xd9, 0xbd,
|
||||||
|
0x4c, 0x0c, 0x12, 0x4f, 0x5f, 0x50, 0x6c, 0x20, 0xc8, 0x0c, 0x90, 0x59, 0xf8, 0x80, 0xf0, 0xf6,
|
||||||
|
0x50, 0x82, 0xe6, 0x88, 0x5d, 0x9d, 0x4c, 0xc0, 0xfb, 0x54, 0x77, 0x2f, 0x95, 0x0c, 0x7c, 0x36,
|
||||||
|
0xc4, 0x02, 0x00, 0xd9, 0xbd, 0x23, 0x3c, 0x0b, 0x20, 0x15, 0x2a, 0x0f, 0xce, 0x33, 0x48, 0x7d,
|
||||||
|
0x26, 0xa1, 0x50, 0x01, 0xaa, 0x05, 0xe9, 0x21, 0xa5, 0x10, 0x14, 0x5c, 0xa8, 0x09, 0x2c, 0x04,
|
||||||
|
0x27, 0xa3, 0x15, 0x82, 0x3f, 0x20, 0x85, 0xe0, 0x7a, 0x77, 0xd2, 0x0a, 0x41, 0xea, 0xbb, 0x77,
|
||||||
|
0x84, 0x56, 0x83, 0xa3, 0x60, 0x14, 0x8c, 0x82, 0x91, 0x0a, 0x00, 0x52, 0xd0, 0x0d, 0xf8, 0xc1,
|
||||||
|
0xaa, 0x4a, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||||
|
};
|
||||||
|
|
||||||
|
const BITMAP_OPAQUE stroke_dashdot_xpm[1] = {{ png, sizeof( png ), "stroke_dashdot_xpm" }};
|
||||||
|
|
||||||
|
//EOF
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
/* Do not modify this file, it was automatically generated by the
|
||||||
|
* PNG2cpp CMake script, using a *.png file as input.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <bitmaps_png/bitmaps_list.h>
|
||||||
|
|
||||||
|
static const unsigned char png[] = {
|
||||||
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||||
|
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa6, 0xe7, 0x79,
|
||||||
|
0x29, 0x00, 0x00, 0x00, 0xda, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0x63, 0x60, 0x18, 0x05, 0xa3,
|
||||||
|
0x60, 0x14, 0x8c, 0x02, 0x04, 0x60, 0x04, 0x62, 0x6e, 0x24, 0xcc, 0x48, 0x23, 0x3d, 0x20, 0xc0,
|
||||||
|
0x8e, 0xa4, 0x87, 0x7d, 0x60, 0xdd, 0xc7, 0x9d, 0xc5, 0xc3, 0x20, 0x72, 0xac, 0x80, 0x41, 0xfc,
|
||||||
|
0xe1, 0x05, 0x06, 0xa9, 0x2f, 0xff, 0xe1, 0x18, 0xc4, 0x07, 0x89, 0x83, 0xe4, 0xa9, 0xa1, 0x07,
|
||||||
|
0x04, 0x84, 0x56, 0x59, 0x32, 0x88, 0xdd, 0x58, 0xc0, 0x20, 0xf9, 0xf6, 0x33, 0x5c, 0x0f, 0x88,
|
||||||
|
0x0d, 0x12, 0x13, 0x5c, 0x61, 0x81, 0x55, 0x0f, 0xcd, 0xdd, 0x27, 0x7a, 0x7e, 0x2a, 0x83, 0xf4,
|
||||||
|
0xff, 0xff, 0x38, 0x31, 0x48, 0x1e, 0x1d, 0x90, 0xa3, 0x47, 0x60, 0x8e, 0x3a, 0x83, 0xe4, 0xc7,
|
||||||
|
0x0f, 0x38, 0xf5, 0x80, 0xe4, 0x40, 0x6a, 0xa8, 0x61, 0x17, 0x09, 0x7a, 0x98, 0x18, 0x24, 0x9e,
|
||||||
|
0xbe, 0xc0, 0xab, 0x18, 0x24, 0x0f, 0x52, 0x87, 0x00, 0xe4, 0xe8, 0x01, 0x3a, 0xea, 0x54, 0x09,
|
||||||
|
0x5e, 0x3d, 0x60, 0x87, 0x01, 0xd5, 0xa0, 0x02, 0x9a, 0xbb, 0x8f, 0x08, 0xc5, 0xcf, 0xc8, 0xb0,
|
||||||
|
0xe0, 0x19, 0x1d, 0x03, 0x80, 0x52, 0xf7, 0x0d, 0x9e, 0x2c, 0xf0, 0x7e, 0x20, 0xb2, 0x00, 0x52,
|
||||||
|
0x81, 0xf1, 0xe0, 0x3c, 0x83, 0xd4, 0x67, 0x68, 0x81, 0x01, 0xa4, 0x41, 0x7c, 0x82, 0x85, 0x0c,
|
||||||
|
0x09, 0x7a, 0x40, 0x00, 0x54, 0xd0, 0x89, 0xdd, 0x98, 0x8f, 0xa5, 0x10, 0x9c, 0x4f, 0xb8, 0x10,
|
||||||
|
0xa4, 0xbd, 0xfb, 0x46, 0x68, 0x35, 0x38, 0x0a, 0x46, 0xc1, 0x28, 0x18, 0xa9, 0x00, 0x00, 0xba,
|
||||||
|
0xdf, 0xf2, 0x05, 0x94, 0xde, 0xe7, 0x97, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
|
||||||
|
0x42, 0x60, 0x82,
|
||||||
|
};
|
||||||
|
|
||||||
|
const BITMAP_OPAQUE stroke_dot_xpm[1] = {{ png, sizeof( png ), "stroke_dot_xpm" }};
|
||||||
|
|
||||||
|
//EOF
|
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
/* Do not modify this file, it was automatically generated by the
|
||||||
|
* PNG2cpp CMake script, using a *.png file as input.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <bitmaps_png/bitmaps_list.h>
|
||||||
|
|
||||||
|
static const unsigned char png[] = {
|
||||||
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||||
|
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa6, 0xe7, 0x79,
|
||||||
|
0x29, 0x00, 0x00, 0x00, 0x79, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0x63, 0x60, 0x18, 0x05, 0xa3,
|
||||||
|
0x60, 0x14, 0x8c, 0x02, 0x04, 0x60, 0x02, 0x62, 0xee, 0x61, 0x8e, 0x99, 0x30, 0xbd, 0xcd, 0x9d,
|
||||||
|
0xc5, 0xc3, 0x20, 0x7a, 0x7e, 0x2a, 0x83, 0xc4, 0xb3, 0x17, 0x0c, 0x52, 0x5f, 0xfe, 0x0f, 0x6b,
|
||||||
|
0x0c, 0xf2, 0xa3, 0xd8, 0x85, 0xa9, 0x60, 0x3f, 0xc3, 0x81, 0xc8, 0xb1, 0x02, 0x06, 0xe9, 0xff,
|
||||||
|
0xff, 0x47, 0x14, 0x06, 0xf9, 0x19, 0x0a, 0x18, 0x19, 0xc4, 0x1f, 0x5c, 0x18, 0x71, 0x01, 0x00,
|
||||||
|
0xf2, 0x33, 0xc8, 0xef, 0x90, 0x00, 0x78, 0x38, 0xa2, 0x03, 0x60, 0xc4, 0x67, 0x01, 0xa4, 0x42,
|
||||||
|
0xf0, 0x29, 0xb0, 0x10, 0xfc, 0x3c, 0x8c, 0x0b, 0x41, 0xa0, 0xdf, 0x40, 0x7e, 0x04, 0xf9, 0x15,
|
||||||
|
0xa5, 0x10, 0x1c, 0xf1, 0xd5, 0xe0, 0x28, 0x18, 0x05, 0xa3, 0x60, 0xa4, 0x02, 0x00, 0xa5, 0x1e,
|
||||||
|
0xfd, 0xde, 0x95, 0x35, 0x0a, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
|
||||||
|
0x60, 0x82,
|
||||||
|
};
|
||||||
|
|
||||||
|
const BITMAP_OPAQUE stroke_solid_xpm[1] = {{ png, sizeof( png ), "stroke_solid_xpm" }};
|
||||||
|
|
||||||
|
//EOF
|
|
@ -375,6 +375,7 @@ EXTERN_BITMAP( ps_diff_pair_tune_phase_xpm )
|
||||||
EXTERN_BITMAP( ps_diff_pair_via_gap_xpm )
|
EXTERN_BITMAP( ps_diff_pair_via_gap_xpm )
|
||||||
EXTERN_BITMAP( ps_tune_length_xpm )
|
EXTERN_BITMAP( ps_tune_length_xpm )
|
||||||
EXTERN_BITMAP( py_script_xpm )
|
EXTERN_BITMAP( py_script_xpm )
|
||||||
|
EXTERN_BITMAP( question_mark_xpm )
|
||||||
EXTERN_BITMAP( ratsnest_xpm )
|
EXTERN_BITMAP( ratsnest_xpm )
|
||||||
EXTERN_BITMAP( read_setup_xpm )
|
EXTERN_BITMAP( read_setup_xpm )
|
||||||
EXTERN_BITMAP( recent_xpm )
|
EXTERN_BITMAP( recent_xpm )
|
||||||
|
@ -437,6 +438,10 @@ EXTERN_BITMAP( small_library_xpm )
|
||||||
EXTERN_BITMAP( small_plus_xpm )
|
EXTERN_BITMAP( small_plus_xpm )
|
||||||
EXTERN_BITMAP( small_up_xpm )
|
EXTERN_BITMAP( small_up_xpm )
|
||||||
EXTERN_BITMAP( spreadsheet_xpm )
|
EXTERN_BITMAP( spreadsheet_xpm )
|
||||||
|
EXTERN_BITMAP( stroke_dash_xpm )
|
||||||
|
EXTERN_BITMAP( stroke_dashdot_xpm )
|
||||||
|
EXTERN_BITMAP( stroke_dot_xpm )
|
||||||
|
EXTERN_BITMAP( stroke_solid_xpm )
|
||||||
EXTERN_BITMAP( svg_file_xpm )
|
EXTERN_BITMAP( svg_file_xpm )
|
||||||
EXTERN_BITMAP( swap_layer_xpm )
|
EXTERN_BITMAP( swap_layer_xpm )
|
||||||
EXTERN_BITMAP( text_xpm )
|
EXTERN_BITMAP( text_xpm )
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 16 16" version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<metadata
|
||||||
|
id="metadata43">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<path id="path3094" d="M7.846,4.15c0.878,0 1.569,0.222 2.073,0.664c0.337,0.301 0.505,0.661 0.505,1.081c0,0.518 -0.308,1.1 -0.925,1.745c-0.112,0.113 -0.294,0.293 -0.546,0.54c-0.449,0.451 -0.743,0.976 -0.883,1.576c-0.009,0.053 -0.019,0.105 -0.028,0.158l-0.238,0c0.019,-0.578 0.159,-1.111 0.42,-1.599l0.392,-0.72c0.346,-0.638 0.519,-1.224 0.519,-1.757c0,-0.487 -0.229,-0.866 -0.687,-1.136c-0.243,-0.143 -0.518,-0.214 -0.826,-0.214c-0.486,0 -0.869,0.12 -1.149,0.36c-0.121,0.112 -0.182,0.225 -0.182,0.338c0,0.067 0.098,0.199 0.294,0.394c0.159,0.172 0.238,0.319 0.238,0.439c0,0.232 -0.131,0.379 -0.392,0.439c-0.056,0.015 -0.117,0.022 -0.182,0.022c-0.449,0 -0.673,-0.232 -0.673,-0.698c0,-0.57 0.304,-1.013 0.911,-1.328c0.392,-0.203 0.845,-0.304 1.359,-0.304m0.098,6.495c0.308,0 0.532,0.117 0.672,0.349c0.056,0.083 0.084,0.173 0.084,0.271c0,0.27 -0.158,0.45 -0.476,0.54c-0.093,0.03 -0.191,0.045 -0.294,0.045c-0.346,0 -0.574,-0.12 -0.687,-0.36c-0.028,-0.068 -0.042,-0.139 -0.042,-0.214c0,-0.285 0.15,-0.48 0.449,-0.585c0.093,-0.031 0.191,-0.045 0.294,-0.045" style="fill-rule:nonzero;"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
|
@ -0,0 +1,40 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 64 16" version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||||
|
<metadata
|
||||||
|
id="metadata43">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<path d="M41,8c0,-1.648 -1.338,-2.987 -2.987,-2.987l-12.026,0c-1.649,0 -2.987,1.339 -2.987,2.987c0,1.648 1.338,2.987 2.987,2.987l12.026,0c1.649,0 2.987,-1.339 2.987,-2.987Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
<path d="M19,8c0,-1.656 -1.344,-3 -3,-3l-12,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l12,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
<path d="M63,8c0,-1.648 -1.338,-2.987 -2.987,-2.987l-12.026,0c-1.649,0 -2.987,1.339 -2.987,2.987c0,1.648 1.338,2.987 2.987,2.987l12.026,0c1.649,0 2.987,-1.339 2.987,-2.987Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
|
@ -0,0 +1,40 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 64 16" version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||||
|
<metadata
|
||||||
|
id="metadata43">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<path d="M36.635,8c0,-1.656 -1.344,-3 -3,-3l-3,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l3,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
<path d="M19,8c0,-1.656 -1.344,-3 -3,-3l-12,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l12,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
<path d="M63,8c0,-1.656 -1.344,-3 -3,-3l-12,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l12,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
|
@ -0,0 +1,42 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 64 16" version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||||
|
<metadata
|
||||||
|
id="metadata43">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<path d="M36.5,8c0,-1.656 -1.344,-3 -3,-3l-3,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l3,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
<path d="M10,8c0,-1.656 -1.344,-3 -3,-3l-3,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l3,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
<path d="M50,8c0,-1.656 -1.344,-3 -3,-3l-3,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l3,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
<path d="M23,8c0,-1.656 -1.344,-3 -3,-3l-3,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l3,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
<path d="M63,8c0,-1.656 -1.344,-3 -3,-3l-3,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l3,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
|
@ -0,0 +1,38 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 64 16" version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||||
|
<metadata
|
||||||
|
id="metadata43">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<path d="M63,8c0,-1.656 -1.344,-3 -3,-3l-56,0c-1.656,0 -3,1.344 -3,3c0,1.656 1.344,3 3,3l56,0c1.656,0 3,-1.344 3,-3Z" style="fill:#001bff;stroke:#000;stroke-width:0.09px;"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
|
@ -22,29 +22,50 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cassert>
|
#include <bitmaps.h>
|
||||||
#include <sch_edit_frame.h>
|
|
||||||
#include <sch_line.h>
|
#include <sch_line.h>
|
||||||
#include <dialogs/dialog_color_picker.h>
|
|
||||||
#include <dialog_edit_line_style.h>
|
#include <dialog_edit_line_style.h>
|
||||||
|
#include <dialogs/dialog_color_picker.h>
|
||||||
|
#include <sch_edit_frame.h>
|
||||||
|
|
||||||
const int BUTT_COLOR_MINSIZE_X = 32;
|
const int BUTT_COLOR_MINSIZE_X = 32;
|
||||||
const int BUTT_COLOR_MINSIZE_Y = 20;
|
const int BUTT_COLOR_MINSIZE_Y = 20;
|
||||||
|
|
||||||
DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE( SCH_EDIT_FRAME* aParent, SCH_LINE* aLine ) :
|
|
||||||
DIALOG_EDIT_LINE_STYLE_BASE( aParent ),
|
struct lineTypeStruct
|
||||||
m_frame( aParent ),
|
{
|
||||||
m_line( aLine ),
|
wxString name;
|
||||||
m_width( aParent, m_staticTextWidth, m_lineWidth, m_staticWidthUnits, true )
|
const BITMAP_OPAQUE* bitmap;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Conversion map between PLOT_DASH_TYPE values and style names displayed
|
||||||
|
*/
|
||||||
|
const std::map<PLOT_DASH_TYPE, struct lineTypeStruct> lineTypeNames = {
|
||||||
|
{ PLOT_DASH_TYPE::SOLID, { _( "Solid" ), stroke_solid_xpm } },
|
||||||
|
{ PLOT_DASH_TYPE::DASH, { _( "Dashed" ), stroke_dash_xpm } },
|
||||||
|
{ PLOT_DASH_TYPE::DOT, { _( "Dotted" ), stroke_dot_xpm } },
|
||||||
|
{ PLOT_DASH_TYPE::DASHDOT, { _( "Dash-Dot" ), stroke_dashdot_xpm } },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(
|
||||||
|
SCH_EDIT_FRAME* aParent, std::deque<SCH_LINE*>& lines )
|
||||||
|
: DIALOG_EDIT_LINE_STYLE_BASE( aParent ),
|
||||||
|
m_frame( aParent ),
|
||||||
|
m_lines( lines ),
|
||||||
|
m_width( aParent, m_staticTextWidth, m_lineWidth, m_staticWidthUnits, true )
|
||||||
{
|
{
|
||||||
m_sdbSizerApply->SetLabel( _( "Default" ) );
|
m_sdbSizerApply->SetLabel( _( "Default" ) );
|
||||||
|
|
||||||
wxBitmap bitmap( std::max( m_colorButton->GetSize().x, BUTT_COLOR_MINSIZE_X ),
|
|
||||||
std::max( m_colorButton->GetSize().y, BUTT_COLOR_MINSIZE_Y ) );
|
|
||||||
m_colorButton->SetBitmap( bitmap );
|
|
||||||
|
|
||||||
SetInitialFocus( m_lineWidth );
|
SetInitialFocus( m_lineWidth );
|
||||||
|
|
||||||
|
for( auto& typeEntry : lineTypeNames )
|
||||||
|
{
|
||||||
|
m_typeCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) );
|
||||||
|
}
|
||||||
|
|
||||||
m_sdbSizerOK->SetDefault();
|
m_sdbSizerOK->SetDefault();
|
||||||
|
|
||||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||||
|
@ -54,9 +75,49 @@ DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE( SCH_EDIT_FRAME* aParent, SCH_LIN
|
||||||
|
|
||||||
bool DIALOG_EDIT_LINE_STYLE::TransferDataToWindow()
|
bool DIALOG_EDIT_LINE_STYLE::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
m_width.SetValue( m_line->GetPenSize() );
|
auto first_line = m_lines.front();
|
||||||
setColor( m_line->GetLineColor() );
|
|
||||||
m_lineStyle->SetSelection( static_cast<int>( m_line->GetLineStyle() ) );
|
if( std::all_of( m_lines.begin() + 1, m_lines.end(),
|
||||||
|
[&]( const SCH_LINE* r )
|
||||||
|
{
|
||||||
|
return r->GetPenSize() == first_line->GetPenSize();
|
||||||
|
} ) )
|
||||||
|
{
|
||||||
|
m_width.SetValue( first_line->GetPenSize() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_width.SetValue( INDETERMINATE );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( std::all_of( m_lines.begin() + 1, m_lines.end(),
|
||||||
|
[&]( const SCH_LINE* r )
|
||||||
|
{
|
||||||
|
return r->GetLineColor() == first_line->GetLineColor();
|
||||||
|
} ) )
|
||||||
|
{
|
||||||
|
setColor( first_line->GetLineColor() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setColor( COLOR4D::UNSPECIFIED );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( std::all_of( m_lines.begin() + 1, m_lines.end(),
|
||||||
|
[&]( const SCH_LINE* r )
|
||||||
|
{
|
||||||
|
return r->GetLineStyle() == first_line->GetLineStyle();
|
||||||
|
} ) )
|
||||||
|
{
|
||||||
|
int style = static_cast<int>( first_line->GetLineStyle() );
|
||||||
|
wxCHECK_MSG( style < lineTypeNames.size(), false,
|
||||||
|
"Line type for first line is not found in the type lookup map" );
|
||||||
|
m_typeCombo->SetSelection( style );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_typeCombo->SetSelection( wxNOT_FOUND );
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +125,7 @@ bool DIALOG_EDIT_LINE_STYLE::TransferDataToWindow()
|
||||||
|
|
||||||
void DIALOG_EDIT_LINE_STYLE::onColorButtonClicked( wxCommandEvent& event )
|
void DIALOG_EDIT_LINE_STYLE::onColorButtonClicked( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
COLOR4D newColor = COLOR4D::UNSPECIFIED;
|
COLOR4D newColor = COLOR4D::UNSPECIFIED;
|
||||||
DIALOG_COLOR_PICKER dialog( this, m_selectedColor, false );
|
DIALOG_COLOR_PICKER dialog( this, m_selectedColor, false );
|
||||||
|
|
||||||
if( dialog.ShowModal() == wxID_OK )
|
if( dialog.ShowModal() == wxID_OK )
|
||||||
|
@ -74,25 +135,36 @@ void DIALOG_EDIT_LINE_STYLE::onColorButtonClicked( wxCommandEvent& event )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setColor( newColor );
|
setColor( newColor );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_EDIT_LINE_STYLE::updateColorButton( COLOR4D& aColor )
|
void DIALOG_EDIT_LINE_STYLE::updateColorButton( COLOR4D& aColor )
|
||||||
{
|
{
|
||||||
wxMemoryDC iconDC;
|
wxMemoryDC iconDC;
|
||||||
|
|
||||||
wxBitmap bitmap = m_colorButton->GetBitmapLabel();
|
|
||||||
iconDC.SelectObject( bitmap );
|
|
||||||
iconDC.SetPen( *wxBLACK_PEN );
|
|
||||||
|
|
||||||
wxBrush brush( aColor.ToColour() );
|
if( aColor == COLOR4D::UNSPECIFIED )
|
||||||
iconDC.SetBrush( brush );
|
{
|
||||||
|
m_colorButton->SetBitmap( KiBitmap( question_mark_xpm ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxBitmap bitmap( std::max( m_colorButton->GetSize().x, BUTT_COLOR_MINSIZE_X ),
|
||||||
|
std::max( m_colorButton->GetSize().y, BUTT_COLOR_MINSIZE_Y ) );
|
||||||
|
|
||||||
// Paint the full bitmap in aColor:
|
iconDC.SelectObject( bitmap );
|
||||||
iconDC.SetBackground( brush );
|
iconDC.SetPen( *wxBLACK_PEN );
|
||||||
iconDC.Clear();
|
|
||||||
|
wxBrush brush( aColor.ToColour() );
|
||||||
|
iconDC.SetBrush( brush );
|
||||||
|
|
||||||
|
// Paint the full bitmap in aColor:
|
||||||
|
iconDC.SetBackground( brush );
|
||||||
|
iconDC.Clear();
|
||||||
|
|
||||||
|
m_colorButton->SetBitmap( bitmap );
|
||||||
|
}
|
||||||
|
|
||||||
m_colorButton->SetBitmapLabel( bitmap );
|
|
||||||
m_colorButton->Refresh();
|
m_colorButton->Refresh();
|
||||||
|
|
||||||
Refresh( false );
|
Refresh( false );
|
||||||
|
@ -101,9 +173,14 @@ void DIALOG_EDIT_LINE_STYLE::updateColorButton( COLOR4D& aColor )
|
||||||
|
|
||||||
void DIALOG_EDIT_LINE_STYLE::resetDefaults( wxCommandEvent& event )
|
void DIALOG_EDIT_LINE_STYLE::resetDefaults( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
m_width.SetValue( m_line->GetDefaultWidth() );
|
m_width.SetValue( m_lines.front()->GetDefaultWidth() );
|
||||||
setColor( m_line->GetDefaultColor() );
|
setColor( m_lines.front()->GetDefaultColor() );
|
||||||
m_lineStyle->SetSelection( static_cast<int>( m_line->GetDefaultStyle() ) );
|
|
||||||
|
auto typeIt = lineTypeNames.find( m_lines.front()->GetDefaultStyle() );
|
||||||
|
wxCHECK_RET( typeIt != lineTypeNames.end(),
|
||||||
|
"Default line type not found line dialogs line type lookup map" );
|
||||||
|
|
||||||
|
m_typeCombo->SetSelection( static_cast<int>( typeIt->first ) );
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,13 +194,35 @@ void DIALOG_EDIT_LINE_STYLE::setColor( const COLOR4D& aColor )
|
||||||
|
|
||||||
bool DIALOG_EDIT_LINE_STYLE::TransferDataFromWindow()
|
bool DIALOG_EDIT_LINE_STYLE::TransferDataFromWindow()
|
||||||
{
|
{
|
||||||
m_frame->SaveCopyInUndoList( m_line, UR_CHANGED );
|
for( auto& line : m_lines )
|
||||||
|
{
|
||||||
|
m_frame->SaveCopyInUndoList( line, UR_CHANGED );
|
||||||
|
|
||||||
m_line->SetLineWidth( m_width.GetValue() );
|
if( !m_width.IsIndeterminate() )
|
||||||
m_line->SetLineStyle( m_lineStyle->GetSelection() );
|
{
|
||||||
m_line->SetLineColor( m_selectedColor );
|
line->SetLineWidth( m_width.GetValue() );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( m_typeCombo->GetSelection() != wxNOT_FOUND )
|
||||||
|
{
|
||||||
|
int selection = m_typeCombo->GetSelection();
|
||||||
|
wxCHECK_MSG( selection < lineTypeNames.size(), false,
|
||||||
|
"Selected line type index exceeds size of line type lookup map" );
|
||||||
|
|
||||||
|
auto it = lineTypeNames.begin();
|
||||||
|
std::advance( it, selection );
|
||||||
|
|
||||||
|
line->SetLineStyle( it->first );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( m_selectedColor != COLOR4D::UNSPECIFIED )
|
||||||
|
{
|
||||||
|
line->SetLineColor( m_selectedColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_frame->RefreshItem( line );
|
||||||
|
}
|
||||||
|
|
||||||
m_frame->RefreshItem( m_line );
|
|
||||||
m_frame->GetCanvas()->Refresh();
|
m_frame->GetCanvas()->Refresh();
|
||||||
m_frame->OnModify();
|
m_frame->OnModify();
|
||||||
|
|
||||||
|
|
|
@ -36,14 +36,14 @@ class SCH_LINE;
|
||||||
class DIALOG_EDIT_LINE_STYLE : public DIALOG_EDIT_LINE_STYLE_BASE
|
class DIALOG_EDIT_LINE_STYLE : public DIALOG_EDIT_LINE_STYLE_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DIALOG_EDIT_LINE_STYLE( SCH_EDIT_FRAME* aParent, SCH_LINE* aLine );
|
DIALOG_EDIT_LINE_STYLE( SCH_EDIT_FRAME* aParent, std::deque<SCH_LINE*>& lines );
|
||||||
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SCH_EDIT_FRAME* m_frame;
|
SCH_EDIT_FRAME* m_frame;
|
||||||
SCH_LINE* m_line;
|
std::deque<SCH_LINE*> m_lines;
|
||||||
|
|
||||||
UNIT_BINDER m_width;
|
UNIT_BINDER m_width;
|
||||||
COLOR4D m_selectedColor;
|
COLOR4D m_selectedColor;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
@ -17,63 +17,65 @@ END_EVENT_TABLE()
|
||||||
DIALOG_EDIT_LINE_STYLE_BASE::DIALOG_EDIT_LINE_STYLE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
DIALOG_EDIT_LINE_STYLE_BASE::DIALOG_EDIT_LINE_STYLE_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( wxDefaultSize, wxDefaultSize );
|
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||||
|
|
||||||
wxBoxSizer* mainSizer;
|
wxBoxSizer* mainSizer;
|
||||||
mainSizer = new wxBoxSizer( wxVERTICAL );
|
mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
wxBoxSizer* bSizerUpper;
|
|
||||||
bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
|
mainSizer->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxStaticBoxSizer* sbSizerGeneral;
|
|
||||||
sbSizerGeneral = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("General:") ), wxVERTICAL );
|
|
||||||
|
|
||||||
wxFlexGridSizer* fgSizerGeneral;
|
wxFlexGridSizer* fgSizerGeneral;
|
||||||
fgSizerGeneral = new wxFlexGridSizer( 0, 3, 0, 0 );
|
fgSizerGeneral = new wxFlexGridSizer( 0, 3, 0, 0 );
|
||||||
fgSizerGeneral->AddGrowableCol( 1 );
|
fgSizerGeneral->AddGrowableCol( 1 );
|
||||||
fgSizerGeneral->SetFlexibleDirection( wxBOTH );
|
fgSizerGeneral->SetFlexibleDirection( wxBOTH );
|
||||||
fgSizerGeneral->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
fgSizerGeneral->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||||
|
|
||||||
m_staticTextWidth = new wxStaticText( sbSizerGeneral->GetStaticBox(), wxID_ANY, _("Width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextWidth = new wxStaticText( this, wxID_ANY, _("Width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticTextWidth->Wrap( -1 );
|
m_staticTextWidth->Wrap( -1 );
|
||||||
fgSizerGeneral->Add( m_staticTextWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
fgSizerGeneral->Add( m_staticTextWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||||
|
|
||||||
m_lineWidth = new wxTextCtrl( sbSizerGeneral->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 );
|
m_lineWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 );
|
||||||
m_lineWidth->SetMinSize( wxSize( 80,-1 ) );
|
m_lineWidth->SetMinSize( wxSize( 80,-1 ) );
|
||||||
|
|
||||||
fgSizerGeneral->Add( m_lineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
fgSizerGeneral->Add( m_lineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
||||||
|
|
||||||
m_staticWidthUnits = new wxStaticText( sbSizerGeneral->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticWidthUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticWidthUnits->Wrap( -1 );
|
m_staticWidthUnits->Wrap( -1 );
|
||||||
fgSizerGeneral->Add( m_staticWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1 );
|
m_staticWidthUnits->SetMinSize( wxSize( 40,-1 ) );
|
||||||
|
|
||||||
m_staticText5 = new wxStaticText( sbSizerGeneral->GetStaticBox(), wxID_ANY, _("Color:"), wxDefaultPosition, wxDefaultSize, 0 );
|
fgSizerGeneral->Add( m_staticWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||||
|
|
||||||
|
m_staticText5 = new wxStaticText( this, wxID_ANY, _("Color:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticText5->Wrap( -1 );
|
m_staticText5->Wrap( -1 );
|
||||||
fgSizerGeneral->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
fgSizerGeneral->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||||
|
|
||||||
m_colorButton = new wxBitmapButton( sbSizerGeneral->GetStaticBox(), idColorBtn, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
m_colorButton = new wxBitmapButton( this, idColorBtn, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||||
fgSizerGeneral->Add( m_colorButton, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
|
||||||
|
m_colorButton->SetBitmap( wxNullBitmap );
|
||||||
|
fgSizerGeneral->Add( m_colorButton, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 3 );
|
||||||
sbSizerGeneral->Add( fgSizerGeneral, 3, wxEXPAND, 5 );
|
|
||||||
|
m_staticText4 = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_staticText4->Wrap( -1 );
|
||||||
bSizerUpper->Add( sbSizerGeneral, 3, wxALL|wxEXPAND, 5 );
|
fgSizerGeneral->Add( m_staticText4, 0, wxALL, 5 );
|
||||||
|
|
||||||
wxString m_lineStyleChoices[] = { _("Solid"), _("Dashed"), _("Dotted"), _("Dash-Dot") };
|
m_staticText51 = new wxStaticText( this, wxID_ANY, _("Type:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
int m_lineStyleNChoices = sizeof( m_lineStyleChoices ) / sizeof( wxString );
|
m_staticText51->Wrap( -1 );
|
||||||
m_lineStyle = new wxRadioBox( this, wxID_ANY, _("Line Style:"), wxDefaultPosition, wxDefaultSize, m_lineStyleNChoices, m_lineStyleChoices, 4, wxRA_SPECIFY_ROWS );
|
fgSizerGeneral->Add( m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||||
m_lineStyle->SetSelection( 1 );
|
|
||||||
bSizerUpper->Add( m_lineStyle, 2, wxALL|wxEXPAND, 5 );
|
m_typeCombo = new wxBitmapComboBox( this, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
|
||||||
|
m_typeCombo->SetMinSize( wxSize( 140,-1 ) );
|
||||||
|
|
||||||
mainSizer->Add( bSizerUpper, 0, wxEXPAND, 5 );
|
fgSizerGeneral->Add( m_typeCombo, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
||||||
|
|
||||||
|
|
||||||
|
mainSizer->Add( fgSizerGeneral, 3, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
mainSizer->Add( 0, 0, 1, wxALL|wxEXPAND, 1 );
|
mainSizer->Add( 0, 0, 1, wxALL|wxEXPAND, 1 );
|
||||||
|
|
||||||
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||||
mainSizer->Add( m_staticline, 0, wxEXPAND | wxALL, 5 );
|
mainSizer->Add( m_staticline, 0, wxEXPAND | wxALL, 5 );
|
||||||
|
|
||||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||||
|
@ -82,13 +84,13 @@ DIALOG_EDIT_LINE_STYLE_BASE::DIALOG_EDIT_LINE_STYLE_BASE( wxWindow* parent, wxWi
|
||||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||||
m_sdbSizer->Realize();
|
m_sdbSizer->Realize();
|
||||||
|
|
||||||
mainSizer->Add( m_sdbSizer, 0, wxALL|wxALIGN_RIGHT, 5 );
|
mainSizer->Add( m_sdbSizer, 0, wxALL|wxALIGN_RIGHT, 5 );
|
||||||
|
|
||||||
|
|
||||||
this->SetSizer( mainSizer );
|
this->SetSizer( mainSizer );
|
||||||
this->Layout();
|
this->Layout();
|
||||||
|
|
||||||
this->Centre( wxBOTH );
|
this->Centre( wxBOTH );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,11 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __DIALOG_EDIT_LINE_STYLE_BASE_H__
|
#pragma once
|
||||||
#define __DIALOG_EDIT_LINE_STYLE_BASE_H__
|
|
||||||
|
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
|
@ -19,14 +18,13 @@
|
||||||
#include <wx/colour.h>
|
#include <wx/colour.h>
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
|
#include <wx/bmpbuttn.h>
|
||||||
#include <wx/bitmap.h>
|
#include <wx/bitmap.h>
|
||||||
#include <wx/image.h>
|
#include <wx/image.h>
|
||||||
#include <wx/icon.h>
|
#include <wx/icon.h>
|
||||||
#include <wx/bmpbuttn.h>
|
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
|
#include <wx/bmpcbox.h>
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/statbox.h>
|
|
||||||
#include <wx/radiobox.h>
|
|
||||||
#include <wx/statline.h>
|
#include <wx/statline.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
|
|
||||||
|
@ -39,41 +37,42 @@ class DIALOG_EDIT_LINE_STYLE_BASE : public DIALOG_SHIM
|
||||||
{
|
{
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private event handlers
|
// Private event handlers
|
||||||
void _wxFB_onColorButtonClicked( wxCommandEvent& event ){ onColorButtonClicked( event ); }
|
void _wxFB_onColorButtonClicked( wxCommandEvent& event ){ onColorButtonClicked( event ); }
|
||||||
void _wxFB_resetDefaults( wxCommandEvent& event ){ resetDefaults( event ); }
|
void _wxFB_resetDefaults( wxCommandEvent& event ){ resetDefaults( event ); }
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
idColorBtn = 1000
|
idColorBtn = 1000
|
||||||
};
|
};
|
||||||
|
|
||||||
wxStaticText* m_staticTextWidth;
|
wxStaticText* m_staticTextWidth;
|
||||||
wxTextCtrl* m_lineWidth;
|
wxTextCtrl* m_lineWidth;
|
||||||
wxStaticText* m_staticWidthUnits;
|
wxStaticText* m_staticWidthUnits;
|
||||||
wxStaticText* m_staticText5;
|
wxStaticText* m_staticText5;
|
||||||
wxBitmapButton* m_colorButton;
|
wxBitmapButton* m_colorButton;
|
||||||
wxRadioBox* m_lineStyle;
|
wxStaticText* m_staticText4;
|
||||||
|
wxStaticText* m_staticText51;
|
||||||
|
wxBitmapComboBox* m_typeCombo;
|
||||||
wxStaticLine* m_staticline;
|
wxStaticLine* m_staticline;
|
||||||
wxStdDialogButtonSizer* m_sdbSizer;
|
wxStdDialogButtonSizer* m_sdbSizer;
|
||||||
wxButton* m_sdbSizerOK;
|
wxButton* m_sdbSizerOK;
|
||||||
wxButton* m_sdbSizerApply;
|
wxButton* m_sdbSizerApply;
|
||||||
wxButton* m_sdbSizerCancel;
|
wxButton* m_sdbSizerCancel;
|
||||||
|
|
||||||
// Virtual event handlers, overide them in your derived class
|
// Virtual event handlers, overide them in your derived class
|
||||||
virtual void onColorButtonClicked( wxCommandEvent& event ) { event.Skip(); }
|
virtual void onColorButtonClicked( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void resetDefaults( wxCommandEvent& event ) { event.Skip(); }
|
virtual void resetDefaults( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool m_isValid;
|
bool m_isValid;
|
||||||
|
|
||||||
DIALOG_EDIT_LINE_STYLE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Line Style"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 298,204 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
DIALOG_EDIT_LINE_STYLE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Line Style"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 325,180 ), long style = wxDEFAULT_DIALOG_STYLE );
|
||||||
~DIALOG_EDIT_LINE_STYLE_BASE();
|
~DIALOG_EDIT_LINE_STYLE_BASE();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__DIALOG_EDIT_LINE_STYLE_BASE_H__
|
|
||||||
|
|
|
@ -176,7 +176,9 @@ bool SCH_EDIT_TOOL::Init()
|
||||||
};
|
};
|
||||||
|
|
||||||
auto propertiesCondition = []( const SELECTION& aSel ) {
|
auto propertiesCondition = []( const SELECTION& aSel ) {
|
||||||
if( aSel.GetSize() != 1 )
|
if( aSel.GetSize() != 1
|
||||||
|
&& !( aSel.GetSize() >= 1 && aSel.Front()->Type() == SCH_LINE_T
|
||||||
|
&& aSel.AreAllItemsIdentical() ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
auto item = static_cast<EDA_ITEM*>( aSel.Front() );
|
auto item = static_cast<EDA_ITEM*>( aSel.Front() );
|
||||||
|
@ -192,12 +194,25 @@ bool SCH_EDIT_TOOL::Init()
|
||||||
return false;
|
return false;
|
||||||
case SCH_LINE_T:
|
case SCH_LINE_T:
|
||||||
{
|
{
|
||||||
SCH_LINE* line = static_cast<SCH_LINE*>( item );
|
const std::deque<EDA_ITEM*> items = aSel.GetItems();
|
||||||
|
if( !std::all_of( items.begin(), items.end(),
|
||||||
assert( line != nullptr );
|
[&]( const EDA_ITEM* item )
|
||||||
|
{
|
||||||
|
const SCH_LINE* line = dynamic_cast<const SCH_LINE*>( item );
|
||||||
|
if ( line == nullptr )
|
||||||
|
{
|
||||||
|
wxLogWarning(
|
||||||
|
"Non-line object encountered in selection, this shouldn't have bypassed the preceeding check" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return line->IsGraphicLine();
|
||||||
|
} ) )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Only graphic lines support properties in the file format
|
// Only graphic lines support properties in the file format
|
||||||
return line->IsGraphicLine();
|
return true;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
|
@ -1297,7 +1312,22 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
||||||
if( !line->IsGraphicLine() )
|
if( !line->IsGraphicLine() )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
DIALOG_EDIT_LINE_STYLE dlg( m_frame, line );
|
if( !selection.AreAllItemsIdentical() )
|
||||||
|
break;
|
||||||
|
|
||||||
|
std::deque<SCH_LINE*> lines;
|
||||||
|
for( auto item : selection.Items() )
|
||||||
|
{
|
||||||
|
auto line = dynamic_cast<SCH_LINE*>( item );
|
||||||
|
assert( line != nullptr );
|
||||||
|
lines.push_back( line );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !std::all_of( lines.begin(), lines.end(),
|
||||||
|
[&]( const SCH_LINE* r ) { return r->IsGraphicLine(); } ) )
|
||||||
|
break;
|
||||||
|
|
||||||
|
DIALOG_EDIT_LINE_STYLE dlg( m_frame, lines );
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_OK )
|
if( dlg.ShowModal() == wxID_OK )
|
||||||
{
|
{
|
||||||
|
@ -1305,7 +1335,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
||||||
m_frame->OnModify();
|
m_frame->OnModify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCH_MARKER_T: // These items have no properties to edit
|
case SCH_MARKER_T: // These items have no properties to edit
|
||||||
case SCH_JUNCTION_T:
|
case SCH_JUNCTION_T:
|
||||||
|
|
|
@ -250,6 +250,20 @@ public:
|
||||||
m_referencePoint = NULLOPT;
|
m_referencePoint = NULLOPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if all items in the selection are the same KICAD_T type
|
||||||
|
*
|
||||||
|
* @return True if all items are the same type, this includes zero or single items
|
||||||
|
*/
|
||||||
|
bool AreAllItemsIdentical() const
|
||||||
|
{
|
||||||
|
return ( std::all_of( m_items.begin() + 1, m_items.end(),
|
||||||
|
[&]( const EDA_ITEM* r )
|
||||||
|
{
|
||||||
|
return r->Type() == m_items.front()->Type();
|
||||||
|
} ) );
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
OPT<VECTOR2I> m_referencePoint;
|
OPT<VECTOR2I> m_referencePoint;
|
||||||
std::deque<EDA_ITEM*> m_items;
|
std::deque<EDA_ITEM*> m_items;
|
||||||
|
|
Loading…
Reference in New Issue