xtd 0.2.0
lcd_label.h
Go to the documentation of this file.
1 #pragma once
5 #include "control.h"
6 #include "dot_matrix_display.h"
7 #include "lcd_style.h"
8 #include "nine_segment_display.h"
12 #include <xtd/argument_out_of_range_exception>
13 #include <xtd/convert_string>
14 #include <xtd/as>
15 #include <xtd/interface>
16 
17 namespace 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 
52  lcd_label();
54 
56 
61  xtd::drawing::color back_digit_color() const noexcept;
67 
70  double back_digit_opacity() const noexcept;
75  lcd_label& back_digit_opacity(double value);
76 
79  bool show_back_digit() const noexcept;
83  lcd_label& show_back_digit(bool value);
84 
87  int32 digit_spacing() const noexcept;
93 
96  forms::lcd_style lcd_style() const noexcept;
101 
104  forms::segment_style segment_style() const noexcept;
109 
112  forms::dot_matrix_style dot_matrix_style() const noexcept;
117 
120  int32 thickness() const noexcept;
124  lcd_label& thickness(int32 value);
125 
126  using control::text;
130  control& text(const xtd::ustring& value) override;
131 
135  std::vector<char32> valid_characters();
137 
139 
141  using control::create;
148  static lcd_label create(const xtd::ustring& text, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
156  static lcd_label create(const control& parent, const xtd::ustring& text, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
158 
159  protected:
161 
163  drawing::size default_size() const noexcept override;
165 
167 
169  drawing::size measure_control() const noexcept override;
170  void on_back_color_changed(const event_args& e) override;
171  void on_fore_color_changed(const event_args& e) override;
172  void on_handle_created(const event_args& e) override;
173  void on_size_changed(const event_args& e) override;
174  void on_resize(const event_args& e) override;
176 
177  private:
178  void on_digit_click(object& sender, const event_args& e);
179  void on_digit_mouse_down(object& sender, const mouse_event_args& e);
180  void on_digit_mouse_move(object& sender, const mouse_event_args& e);
181  void on_digit_mouse_up(object& sender, const mouse_event_args& e);
182  void set_digits_params();
183 
184  std::shared_ptr<data> data_;
185  };
186  }
187 }
lcd_label()
Initialise a new lcd_label class.
Contains xtd::forms::seven_segment_display control.
forms::lcd_style lcd_style() const noexcept
Gets lcd style.
void on_size_changed(const event_args &e) override
Raises the xtd::forms::control::size_changed event.
int32 thickness() const noexcept
Gets thickness of lcd.
drawing::size default_size() const noexcept override
Gets the default size of the control.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
segment_style
Represent segment style used by seven_segment_display, fourteen_segment_display, nine_segment_display...
Definition: segment_style.h:19
void on_handle_created(const event_args &e) override
Raises the xtd::forms::control::handle_created event.
int32 digit_spacing() const noexcept
Gets the digit spacing.
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:31
Represents a lcd label.
Definition: lcd_label.h:38
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
lcd_style
Represent lcd label style used by lcd_label control.
Definition: lcd_style.h:19
forms::dot_matrix_style dot_matrix_style() const noexcept
Gets dot matrix style.
virtual const xtd::ustring & name() const noexcept
Gets the name of the control.
void on_back_color_changed(const event_args &e) override
Raises the xtd::forms::control::back_color_changed event.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
static lcd_label create(const xtd::ustring &text, const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create an xtd::forms::lcd_label with specified text, location, size, and name...
static control create(const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified location, size, and name.
std::vector< char32 > valid_characters()
Gets valid characters.
Contains xtd::forms::lcd_style enum class.
Contains xtd::forms::fourteen_segment_display control.
forms::segment_style segment_style() const noexcept
Gets segment style.
dot_matrix_style
Represent dot matrix style used by dot_matrix_display control.
Definition: dot_matrix_style.h:19
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:45
double back_digit_opacity() const noexcept
Gets the background digit opacity.
Contains xtd::forms::dot_matrix_display control.
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...
xtd::drawing::color back_digit_color() const noexcept
Gets background digit color.
virtual const xtd::ustring & text() const noexcept
Gets the text associated with this control.
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
virtual std::optional< control_ref > parent() const noexcept
Gets the parent container of the control.
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
void on_resize(const event_args &e) override
Raises the xtd::forms::control::region event.
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down, and xtd::forms::control::mouse_move events.
Definition: mouse_event_args.h:32
Contains xtd::forms::control control.
Contains xtd::forms::nine_segment_display control.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
static const ustring empty_string
Represents the empty string.
Definition: ustring.h:53
Contains xtd::forms::sixteen_segment_display control.
bool show_back_digit() const noexcept
Gets a value indicate if background digits are shown.
void on_fore_color_changed(const event_args &e) override
Raises the xtd::forms::control::fore_color_changed event.
drawing::size measure_control() const noexcept override
Measure this control.
size_t size
Represents a size of any object in bytes.
Definition: types.h:195