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 {
40 class lcd_label : public control {
41 class idigit;
42 struct data;
43 class dot_matrix_display_digit;
44 class fourteen_segment_display_digit;
45 class nine_segment_display_digit;
46 class seven_segment_display_digit;
47 class sixteen_segment_display_digit;
48
49 public:
51
56
58
68 lcd_label& back_digit_color(const xtd::drawing::color& value);
69
72 double back_digit_opacity() const noexcept;
78
81 bool show_back_digit() const noexcept;
86
89 int32 digit_spacing() const noexcept;
95
98 forms::lcd_style lcd_style() const noexcept;
103
111
119
122 int32 thickness() const noexcept;
127
128 using control::text;
132 control& text(const xtd::string& value) override;
133
137 std::vector<char32> valid_characters();
139
141
149 static lcd_label create(const drawing::point& location);
154 static lcd_label create(const drawing::point& location, const drawing::size& size);
160 static lcd_label create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
164 static lcd_label create(const xtd::string& text);
169 static lcd_label create(const xtd::string& text, const drawing::point& location);
175 static lcd_label create(const xtd::string& text, const drawing::point& location, const drawing::size& size);
182 static lcd_label create(const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
191 static lcd_label create(const control& parent, const drawing::point& location);
197 static lcd_label create(const control& parent, const drawing::point& location, const drawing::size& size);
204 static lcd_label create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
209 static lcd_label create(const control& parent, const xtd::string& text);
215 static lcd_label create(const control& parent, const xtd::string& text, const drawing::point& location);
222 static lcd_label create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size);
230 static lcd_label create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
232
233 protected:
235
237 drawing::size default_size() const noexcept override;
239
241
247 xtd::uptr<xtd::object> clone() const override;
248
249 drawing::size measure_control() const noexcept override;
250 void on_back_color_changed(const event_args& e) override;
251 void on_fore_color_changed(const event_args& e) override;
252 void on_handle_created(const event_args& e) override;
253 void on_size_changed(const event_args& e) override;
254 void on_resize(const event_args& e) override;
256
257 private:
258 void on_digit_click(object& sender, const event_args& e);
259 void on_digit_mouse_down(object& sender, const mouse_event_args& e);
260 void on_digit_mouse_move(object& sender, const mouse_event_args& e);
261 void on_digit_mouse_up(object& sender, const mouse_event_args& e);
262 void set_digits_params();
263
264 xtd::sptr<data> data_;
265 };
266 }
267}
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:81
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::string & 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:40
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.
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.
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
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.
virtual const xtd::string & text() const noexcept
Gets the text associated with this control.
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:34
Contains xtd::forms::dot_matrix_display control.
Contains xtd::forms::fourteen_segment_display control.
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.h:25
size_t size
Represents a size of any object in bytes.
Definition size.h:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.h:26
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
segment_style
Represent segment style used by seven_segment_display, fourteen_segment_display, nine_segment_display...
Definition segment_style.h:21
lcd_style
Represent lcd label style used by lcd_label control.
Definition lcd_style.h:21
dot_matrix_style
Represent dot matrix style used by dot_matrix_display control.
Definition dot_matrix_style.h:21
@ 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.