xtd 0.2.0
Loading...
Searching...
No Matches
lcd_label.h
Go to the documentation of this file.
1
4#pragma once
5#include "control.h"
7#include "lcd_style.h"
12#include <xtd/argument_out_of_range_exception>
13#include <xtd/convert_string>
14#include <xtd/as>
15#include <xtd/interface>
16
17namespace xtd {
18 namespace forms {
38 class lcd_label : public control {
39 class idigit;
40 struct data;
41 class dot_matrix_display_digit;
42 class fourteen_segment_display_digit;
43 class nine_segment_display_digit;
44 class seven_segment_display_digit;
45 class sixteen_segment_display_digit;
46
47 public:
49
54
56
66 lcd_label& back_digit_color(const xtd::drawing::color& value);
67
70 double back_digit_opacity() const noexcept;
76
79 bool show_back_digit() const noexcept;
84
87 int32 digit_spacing() const noexcept;
93
96 forms::lcd_style lcd_style() const noexcept;
101
109
117
120 int32 thickness() const noexcept;
125
126 using control::text;
130 control& text(const xtd::ustring& value) override;
131
135 std::vector<char32> valid_characters();
137
139
147 static lcd_label create(const drawing::point& location);
152 static lcd_label create(const drawing::point& location, const drawing::size& size);
158 static lcd_label create(const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
162 static lcd_label create(const xtd::ustring& text);
167 static lcd_label create(const xtd::ustring& text, const drawing::point& location);
173 static lcd_label create(const xtd::ustring& text, const drawing::point& location, const drawing::size& size);
180 static lcd_label create(const xtd::ustring& text, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
189 static lcd_label create(const control& parent, const drawing::point& location);
195 static lcd_label create(const control& parent, const drawing::point& location, const drawing::size& size);
202 static lcd_label create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
207 static lcd_label create(const control& parent, const xtd::ustring& text);
213 static lcd_label create(const control& parent, const xtd::ustring& text, const drawing::point& location);
220 static lcd_label create(const control& parent, const xtd::ustring& text, const drawing::point& location, const drawing::size& size);
228 static lcd_label create(const control& parent, const xtd::ustring& text, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
230
231 protected:
233
235 drawing::size default_size() const noexcept override;
237
239
245 std::unique_ptr<xtd::object> clone() const override;
246
247 drawing::size measure_control() const noexcept override;
248 void on_back_color_changed(const event_args& e) override;
249 void on_fore_color_changed(const event_args& e) override;
250 void on_handle_created(const event_args& e) override;
251 void on_size_changed(const event_args& e) override;
252 void on_resize(const event_args& e) override;
254
255 private:
256 void on_digit_click(object& sender, const event_args& e);
257 void on_digit_mouse_down(object& sender, const mouse_event_args& e);
258 void on_digit_mouse_move(object& sender, const mouse_event_args& e);
259 void on_digit_mouse_up(object& sender, const mouse_event_args& e);
260 void set_digits_params();
261
262 std::shared_ptr<data> data_;
263 };
264 }
265}
Represents an ARGB (alpha, red, green, blue) color.
Definition color.h:49
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Defines the base class for controls, which are components with visual representation.
Definition control.h:79
virtual drawing::point location() const noexcept
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
virtual const xtd::ustring & name() const noexcept
Gets the name of the control.
virtual std::optional< control_ref > parent() const noexcept
Gets the parent container of the control.
Represents a lcd label.
Definition lcd_label.h:38
void on_size_changed(const event_args &e) override
Raises the xtd::forms::control::size_changed event.
double back_digit_opacity() const noexcept
Gets the background digit opacity.
std::unique_ptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
virtual const xtd::ustring & text() const noexcept
Gets the text associated with this control.
void on_handle_created(const event_args &e) override
Raises the xtd::forms::control::handle_created event.
drawing::size measure_control() const noexcept override
Measure this control.
xtd::drawing::color back_digit_color() const noexcept
Gets background digit color.
static lcd_label create()
A factory to create an xtd::forms::lcd_label.
bool show_back_digit() const noexcept
Gets a value indicate if background digits are shown.
int32 digit_spacing() const noexcept
Gets the digit spacing.
void on_back_color_changed(const event_args &e) override
Raises the xtd::forms::control::back_color_changed event.
lcd_label()
Initialise a new lcd_label class.
void on_fore_color_changed(const event_args &e) override
Raises the xtd::forms::control::fore_color_changed event.
int32 thickness() const noexcept
Gets thickness of lcd.
void on_resize(const event_args &e) override
Raises the xtd::forms::control::region event.
std::vector< char32 > valid_characters()
Gets valid characters.
drawing::size default_size() const noexcept override
Gets the default size of the control.
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Contains xtd::forms::dot_matrix_display control.
Contains xtd::forms::fourteen_segment_display control.
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
size_t size
Represents a size of any object in bytes.
Definition types.h:197
char32_t char32
Represents a 32-bit unicode character.
Definition types.h:87
segment_style
Represent segment style used by seven_segment_display, fourteen_segment_display, nine_segment_display...
Definition segment_style.h:19
lcd_style
Represent lcd label style used by lcd_label control.
Definition lcd_style.h:19
dot_matrix_style
Represent dot matrix style used by dot_matrix_display control.
Definition dot_matrix_style.h:19
@ e
The E key.
Contains xtd::forms::lcd_style enum class.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::forms::nine_segment_display control.
Contains xtd::forms::seven_segment_display control.
Contains xtd::forms::sixteen_segment_display control.
Contains xtd::forms::style_sheets::control class.