33 virtual wchar_t get_character()
const = 0;
35 virtual int32_t get_thickness()
const = 0;
38 virtual void set_back_digit_opacity(
double value) = 0;
39 virtual void set_character(
wchar_t value) = 0;
42 virtual void set_show_back_digit(
bool value) = 0;
43 virtual void set_thickness(int32_t value) = 0;
48 dot_matrix_display_digit() =
default;
50 wchar_t get_character()
const override {
return character_;}
51 xtd::ustring get_valid_characters()
const override {
return "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=+-*/%\\_°\"'[](){}<>| .,:;!?&$€";}
56 void set_character(
wchar_t value)
override {
57 static std::map<wchar_t, dot_matrix_display::points_collection> characters {
58 {
'0', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {4, 2}, {5, 2}, {1, 3}, {3, 3}, {5, 3}, {1, 4}, {2, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
59 {
'1', {{3, 0}, {2, 1}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}}},
60 {
'2', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {5, 2}, {4, 3}, {3, 4}, {2, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}},
61 {
'3', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {5, 2}, {2, 3}, {3, 3}, {4, 3}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
62 {
'4', {{1, 0}, {5, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {5, 4}, {5, 5}, {5, 6}}},
63 {
'5', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {1, 1}, {1, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 4}, {5, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}}},
64 {
'6', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {1, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
65 {
'7', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {5, 1}, {5, 2}, {4, 3}, {4, 4}, {3, 5}, {3, 6}}},
66 {
'8', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {2, 3}, {3, 3}, {4, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
67 {
'9', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {2, 3}, {3, 3}, {4, 3}, {5, 4}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
68 {
'A', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {1, 6}, {5, 6}}},
69 {
'B', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}}},
70 {
'C', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 6}, {3, 6}, {5, 5}, {4, 6}}},
71 {
'D', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}}},
72 {
'E', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {1, 1}, {1, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {1, 4}, {1, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}},
73 {
'F', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {1, 1}, {1, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {1, 4}, {1, 5}, {1, 6}}},
74 {
'G', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {1, 2}, {1, 3}, {4, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
75 {
'H', {{1, 0}, {5, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {1, 6}, {5, 6}}},
76 {
'I', {{3, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}}},
77 {
'J', {{5, 0}, {5, 1}, {5, 2}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
78 {
'K', {{1, 0}, {5, 0}, {1, 1}, {4, 1}, {1, 2}, {3, 2}, {1, 3}, {2, 3}, {1, 4}, {3, 4}, {1, 5}, {4, 5}, {1, 6}, {5, 6}}},
79 {
'L', {{1, 0}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}},
80 {
'M', {{1, 0}, {5, 0}, {1, 1}, {2, 1}, {4, 1}, {5, 1}, {1, 2}, {3, 2}, {5, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {1, 6}, {5, 6}}},
81 {
'N', {{1, 0}, {5, 0}, {1, 1}, {2, 1}, {5, 1}, {1, 2}, {3, 2}, {5, 2}, {1, 3}, {4, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {1, 6}, {5, 6}}},
82 {
'O', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
83 {
'P', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {1, 4}, {1, 5}, {1, 6}}},
84 {
'Q', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {4, 5}, {2, 6}, {3, 6}, {5, 6}}},
85 {
'R', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {1, 4}, {3, 4}, {1, 5}, {4, 5}, {1, 6}, {5, 6}}},
86 {
'S', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {2, 3}, {3, 3}, {4, 3}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
87 {
'T', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}}},
88 {
'U', {{1, 0}, {5, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
89 {
'V', {{1, 0}, {5, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {2, 3}, {4, 3}, {2, 4}, {4, 4}, {3, 5}, {3, 6}}},
90 {
'W', {{1, 0}, {5, 0}, {1, 1}, {5, 1}, {1, 2}, {3, 2}, {5, 2}, {1, 3}, {3, 3}, {5, 3}, {1, 4}, {3, 4}, {5, 4}, {1, 5}, {2, 5}, {4, 5}, {5, 5}, {1, 6}, {5, 6}}},
91 {
'X', {{1, 0}, {5, 0}, {1, 1}, {5, 1}, {2, 2}, {4, 2}, {3, 3}, {2, 4}, {4, 4}, {1, 5}, {5, 5}, {1, 6}, {5, 6}}},
92 {
'Y', {{1, 0}, {5, 0}, {1, 1}, {5, 1}, {2, 2}, {4, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}}},
93 {
'Z', {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {5, 1}, {4, 2}, {3, 3}, {2, 4}, {1, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}},
94 {
'a', {{2, 2}, {3, 2}, {4, 2}, {5, 3}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}},
95 {
'b', {{1, 0}, {1, 1}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}}},
96 {
'c', {{2, 2}, {3, 2}, {4, 2}, {5, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}},
97 {
'd', {{5, 0}, {5, 1}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}},
98 {
'e', {{2, 2}, {3, 2}, {4, 2}, {1, 3}, {5, 3}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {1, 5}, {2, 6}, {3, 6}, {4, 6}}},
99 {
'f', {{3, 0}, {4, 0}, {2, 1}, {2, 2}, {3, 2}, {2, 3}, {2, 4}, {2, 5}, {2, 6}}},
100 {
'g', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {5, 3}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
101 {
'h', {{1, 0}, {1, 1}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {1, 6}, {5, 6}}},
102 {
'i', {{3, 0}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}}},
103 {
'j', {{4, 0}, {4, 2}, {4, 3}, {4, 4}, {4, 5}, {2, 6}, {3, 6}}},
104 {
'k', {{1, 0}, {1, 1}, {1, 2}, {5, 2}, {1, 3}, {4, 3}, {1, 4}, {2, 4}, {3, 4}, {1, 5}, {4, 5}, {1, 6}, {5, 6}}},
105 {
'l', {{3, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {4, 6}}},
106 {
'm', {{2, 2}, {4, 2}, {1, 3}, {3, 3}, {5, 3}, {1, 4}, {3, 4}, {5, 4}, {1, 5}, {3, 5}, {5, 5}, {1, 6}, {3, 6}, {5, 6}}},
107 {
'n', {{2, 2}, {3, 2}, {4, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {1, 6}, {5, 6}}},
108 {
'o', {{2, 2}, {3, 2}, {4, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
109 {
'p', {{1, 1}, {2, 1}, {3, 1}, {4, 1}, {1, 2}, {5, 2}, {1, 3}, {5, 3}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {1, 5}, {1, 6}}},
110 {
'q', {{2, 1}, {3, 1}, {4, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {5, 3}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {5, 5}, {5, 6}}},
111 {
'r', {{2, 2}, {3, 2}, {4, 2}, {5, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}}},
112 {
's', {{2, 2}, {3, 2}, {4, 2}, {5, 2}, {1, 3}, {2, 4}, {3, 4}, {4, 4}, {5, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}}},
113 {
't', {{3, 0}, {3, 1}, {2, 2}, {3, 2}, {4, 2}, {3, 3}, {3, 4}, {3, 5}, {4, 6}, {5, 6}}},
114 {
'u', {{1, 2}, {5, 2}, {1, 3}, {5, 3}, {1, 4}, {5, 4}, {1, 5}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
115 {
'v', {{1, 2}, {5, 2}, {1, 3}, {5, 3}, {2, 4}, {4, 4}, {2, 5}, {4, 5}, {3, 6}}},
116 {
'w', {{1, 2}, {3, 2}, {5, 2}, {1, 3}, {3, 3}, {5, 3}, {1, 4}, {3, 4}, {5, 4}, {1, 5}, {3, 5}, {5, 5}, {2, 6}, {4, 6}}},
117 {
'x', {{1, 2}, {5, 2}, {2, 3}, {4, 3}, {3, 4}, {2, 5}, {4, 5}, {1, 6}, {5, 6}}},
118 {
'y', {{1, 1}, {5, 1}, {1, 2}, {5, 2}, {1, 3}, {5, 3}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {5, 5}, {2, 6}, {3, 6}, {4, 6}}},
119 {
'z', {{1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {4, 3}, {3, 4}, {2, 5}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}},
120 {
'=', {{1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}}},
121 {
'+', {{3, 1}, {3, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {3, 4}, {3, 5}}},
122 {
'-', {{1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}}},
123 {
'*', {{3, 0}, {1, 1}, {3, 1}, {5, 1}, {2, 2}, {3, 2}, {4, 2}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {2, 4}, {3, 4}, {4, 4}, {1, 5}, {3, 5}, {5, 5}, {3, 6}}},
124 {
'/', {{5, 1}, {4, 2}, {3, 3}, {2, 4}, {1, 5}}},
125 {
'%', {{1, 0}, {2, 0}, {1, 1}, {2, 1}, {5, 1}, {4, 2}, {3, 3}, {2, 4}, {1, 5}, {4, 5}, {5, 5}, {4, 6}, {5, 6}}},
126 {
'\\', {{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}}},
127 {
'_', {{1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}},
128 {L
'\u00B0', {{2, 0}, {3, 0}, {1, 1}, {4, 1}, {1, 2}, {4, 2}, {2, 3}, {3, 3}}},
129 {
'"', {{2, 0}, {5, 0}, {2, 1}, {5, 1}, {1, 2}, {4, 2}}},
130 {
'\'', {{3, 0}, {3, 1}, {2, 2}}},
131 {
'[', {{3, 0}, {4, 0}, {5, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}, {4, 6}, {5, 6}}},
132 {
']', {{1, 0}, {2, 0}, {3, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {1, 6}, {2, 6}, {3, 6}}},
133 {
'(', {{4, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {4, 6}}},
134 {
')', {{2, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {2, 6}}},
135 {
'{', {{4, 0}, {5, 0}, {3, 1}, {3, 2}, {2, 3}, {3, 4}, {3, 5}, {4, 6}, {5, 6}}},
136 {
'}', {{1, 0}, {2, 0}, {3, 1}, {3, 2}, {4, 3}, {3, 4}, {3, 5}, {1, 6}, {2, 6}}},
137 {
'<', {{4, 1}, {3, 2}, {2, 3}, {3, 4}, {4, 5}}},
138 {
'>', {{2, 1}, {3, 2}, {4, 3}, {3, 4}, {2, 5}}},
139 {
'|', {{3, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}}},
142 {
',', {{3, 5}, {2, 6}}},
143 {
':', {{3, 1}, {3, 5}}},
144 {
';', {{3, 2}, {3, 5}, {2, 6}}},
145 {
'!', {{3, 0}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 6}}},
146 {
'?', {{2, 0}, {3, 0}, {4, 0}, {1, 1}, {5, 1}, {5, 2}, {4, 3}, {3, 4}, {3, 6}}},
147 {
'&', {{2, 0}, {3, 0}, {1, 1}, {4, 1}, {1, 2}, {4, 2}, {2, 3}, {3, 3}, {5, 3}, {1, 4}, {4, 4}, {1, 5}, {4, 5}, {2, 6}, {3, 6}, {5, 6}}},
148 {
'$', {{3, 0}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {1, 2}, {3, 2}, {2, 3}, {3, 3}, {4, 3}, {3, 4}, {5, 4}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {3, 6}}},
149 {L
'\u20AC', {{3, 0}, {4, 0}, {5, 0}, {2, 1}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {2, 3}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {2, 5}, {3, 6}, {4, 6}, {5, 6}}},
151 if (character_ != value) {
152 auto it = characters.find(value);
164 wchar_t character_ =
' ';
169 fourteen_segment_display_digit() =
default;
171 wchar_t get_character()
const override {
return character_;}
172 xtd::ustring get_valid_characters()
const override {
return "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=+-*/\\_°\"'[]()| .,:";}
177 void set_character(
wchar_t value)
override {
178 static std::map<wchar_t, forms::segments> characters {
261 if (character_ != value) {
262 auto it = characters.find(value);
274 wchar_t character_ =
' ';
279 nine_segment_display_digit() =
default;
281 wchar_t get_character()
const override {
return character_;}
282 xtd::ustring get_valid_characters()
const override {
return "0123456789ABCDEFGHIJLNOPQRSTUYabcdefghijlnopqrstuy=-_°\"'[]| .,:";}
287 void set_character(
wchar_t value)
override {
288 static std::map<wchar_t, forms::segments> characters {
351 if (character_ != value) {
352 auto it = characters.find(value);
364 wchar_t character_ =
' ';
369 seven_segment_display_digit() =
default;
371 wchar_t get_character()
const override {
return character_;}
372 xtd::ustring get_valid_characters()
const override {
return "0123456789ABCDEFGHIJLNOPQRSTUYabcdefghijlnopqrstuy=-_°\"'[]| .,:";}
377 void set_character(
wchar_t value)
override {
378 static std::map<wchar_t, forms::segments> characters {
441 if (character_ != value) {
442 auto it = characters.find(value);
454 wchar_t character_ =
' ';
459 sixteen_segment_display_digit() =
default;
461 wchar_t get_character()
const override {
return character_;}
462 xtd::ustring get_valid_characters()
const override {
return "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=+-*/\\_°\"'[]()| .,:";}
467 void set_character(
wchar_t value)
override {
468 static std::map<wchar_t, forms::segments> characters {
551 if (character_ != value) {
552 auto it = characters.find(value);
564 wchar_t character_ =
' ';
583 if (!back_digit_color_.has_value() || back_digit_color_.value() != value) {
584 back_digit_color_ = value;
599 if (back_digit_opacity_ != value) {
600 back_digit_opacity_ = value;
613 if (show_back_digit_ != value) {
614 show_back_digit_ = value;
629 if (digit_spacing_ != value) {
630 digit_spacing_ = value;
643 if (lcd_style_ != value) {
659 if (segment_style_ != value) {
660 segment_style_ = value;
661 for (
auto& digit : digits_)
662 digit->set_segment_style(value);
674 if (dot_matrix_style_ != value) {
675 dot_matrix_style_ = value;
676 for (
auto& digit : digits_)
677 digit->set_dot_matrix_style(value);
684 int32_t
thickness()
const {
return thickness_.value_or(digits_.size() ? digits_[0]->get_thickness() : 1);}
689 if (thickness_ != value) {
701 if (text_ != value) {
703 std::wstring str = to_wstring(value.c_str());
704 if (str.size() < digits_.size())
705 digits_.erase(digits_.begin() + value.size(), digits_.end());
706 if (str.size() > digits_.size())
707 for (
size_t index = digits_.size(); index < str.size(); index++) {
708 switch (lcd_style_) {
716 dynamic_cast<control*
>(digits_[digits_.size() - 1].get())->
parent(*
this);
722 for (
size_t index = 0; index < str.size(); index++)
723 digits_[index]->set_character(str[index]);
735 switch (lcd_style_) {
774 if (digits_.size() == 0)
return {0, size_.
height()};
779 static std::wstring to_wstring(
const char* str) noexcept {
783 unsigned char ch =
static_cast<unsigned char>(*str);
784 if (ch <= 0x7f) codepoint = ch;
785 else if (ch <= 0xbf) codepoint = (codepoint << 6) | (ch & 0x3f);
786 else if (ch <= 0xdf) codepoint = ch & 0x1f;
787 else if (ch <= 0xef) codepoint = ch & 0x0f;
788 else codepoint = ch & 0x07;
790 if (((*str & 0xc0) != 0x80) && (codepoint <= 0x10ffff)) {
791 if (
sizeof(
wchar) > 2)
792 out.append(1,
static_cast<wchar>(codepoint));
793 else if (codepoint > 0xffff) {
794 out.append(1,
static_cast<wchar>(0xd800 + (
static_cast<wchar>(codepoint) >> 10)));
795 out.append(1,
static_cast<wchar>(0xdc00 + (
static_cast<wchar>(codepoint) & 0x03ff)));
796 }
else if (codepoint < 0xd800 || codepoint >= 0xe000)
797 out.append(1,
static_cast<wchar>(codepoint));
803 void set_digits_params() {
804 int32_t offset_left = 0;
805 for (
auto& digit : digits_) {
807 dynamic_cast<control*
>(digit.get())->
left(offset_left);
809 digit->set_back_digit_opacity(back_digit_opacity_);
810 digit->set_show_back_digit(show_back_digit_);
811 digit->set_segment_style(segment_style_);
812 digit->set_dot_matrix_style(dot_matrix_style_);
813 if (thickness_.has_value()) digit->set_thickness(
thickness());
818 bool show_back_digit_ =
true;
819 std::optional<xtd::drawing::color> back_digit_color_;
820 double back_digit_opacity_ = 0.95;
821 std::optional<int32_t> digit_spacing_;
825 std::vector<std::shared_ptr<idigit>> digits_;
826 std::optional<int32_t> thickness_;
Contains xtd::argument_out_of_range_exception exception.
The exception that is thrown when one of the arguments provided to a method is not valid.
Definition: argument_exception.h:19
The exception that is thrown when one of the arguments provided to a method is out of range.
Definition: argument_out_of_range_exception.h:18
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:39
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
int32_t height() const
Gets he vertical component of this Size Class.
Definition: size.h:57
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
static const event_args empty
Provides a value to use with events that do not have event data.
Definition: event_args.h:31
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Contains xtd::forms::control control.
Contains xtd::forms::dot_matrix_display control.
Contains xtd::forms::fourteen_segment_display control.
virtual void on_click(const event_args &e)
Raises the control::click event.
virtual void on_back_color_changed(const event_args &e)
Raises the control::back_color_changed event.
virtual void on_size_changed(const event_args &e)
Raises the control::size_changed event.
virtual void on_mouse_up(const mouse_event_args &e)
Raises the control::mouse_up event.
virtual void on_handle_created(const event_args &e)
Raises the control::handle_created event.
event< control, event_handler > click
Occurs when the control is clicked.
Definition: control.h:1065
event< control, mouse_event_handler > mouse_down
Occurs when the mouse pointer is over the control and a mouse button is pressed.
Definition: control.h:1278
virtual void on_resize(const event_args &e)
Raises the control::resize event.
virtual void on_fore_color_changed(const event_args &e)
Raises the control::fore_color_changed event.
event< control, mouse_event_handler > mouse_move
Occurs when the mouse pointer is moved over the control.
Definition: control.h:1335
virtual void on_mouse_down(const mouse_event_args &e)
Raises the control::mouse_down event.
event< control, mouse_event_handler > mouse_up
Occurs when the mouse pointer is over the control and a mouse button is released.
Definition: control.h:1349
virtual void on_mouse_move(const mouse_event_args &e)
Raises the control::mouse_move event.
#define interface_
This keyword is use to represent an interface.
Definition: interface.h:55
#define current_stack_frame_
Provides information about the current stack frame.
Definition: stack_frame.h:201
wchar_t wchar
Represents a wide character.
Definition: types.h:251
int32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
Contains xtd::interface interface.
Contains xtd::forms::lcd_style enum class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::forms::nine_segment_display control.
Contains xtd::forms::seven_segment_display control.
Contains xtd::forms::sixteen_segment_display control.