xtd 0.2.0
Loading...
Searching...
No Matches
dot_matrix_display.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "control.hpp"
6#include "segments.hpp"
8#include <xtd/drawing/solid_brush>
9#include <xtd/argument_out_of_range_exception>
10#include <array>
11
12namespace xtd {
13 namespace forms {
32 class dot_matrix_display : public control {
33 struct data;
34
35 public:
37
40 using dots_collection = std::vector<std::vector<bool>>;
41
43 using points_collection = std::vector<xtd::drawing::point>;
45
47
52
54
59 virtual drawing::color back_dot_color() const noexcept;
64 virtual dot_matrix_display& back_dot_color(const drawing::color& value);
65
68 virtual double back_dot_opacity() const noexcept;
73 virtual dot_matrix_display& back_dot_opacity(double value);
74
77 virtual forms::dot_matrix_style dot_matrix_style() const noexcept;
82
85 virtual const dots_collection& dots() const noexcept;
90
93 virtual int32 matrix_height() const noexcept;
98
101 virtual int32 matrix_width() const noexcept;
106
109 virtual const drawing::size& matrix_size() const noexcept;
113 virtual dot_matrix_display& matrix_size(const drawing::size& value);
114
117 virtual bool show_back_dot() const noexcept;
121 virtual dot_matrix_display& show_back_dot(bool value);
122
125 virtual int32 thickness() const noexcept;
131
133
138 virtual bool get_dot(const drawing::point& point) const noexcept;
139
142 virtual void set_all_dots(bool on);
143
147 virtual void set_dot(const drawing::point& point, bool on);
148
151 virtual void set_dots(const points_collection& points);
155 virtual void set_dots(const points_collection& points, bool on);
157
159
167 static dot_matrix_display create(const drawing::point& location);
172 static dot_matrix_display create(const drawing::point& location, const drawing::size& size);
178 static dot_matrix_display create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
187 static dot_matrix_display create(const dots_collection& dots, const drawing::point& location);
193 static dot_matrix_display create(const dots_collection& dots, const drawing::point& location, const drawing::size& size);
200 static dot_matrix_display create(const dots_collection& dots, const drawing::point& location, const drawing::size& size, const xtd::string& name);
211 static dot_matrix_display create(const dots_collection& dots, bool show_back_dot, const drawing::point& location);
218 static dot_matrix_display create(const dots_collection& dots, bool show_back_dot, const drawing::point& location, const drawing::size& size);
226 static dot_matrix_display create(const dots_collection& dots, bool show_back_dot, const drawing::point& location, const drawing::size& size, const xtd::string& name);
235 static dot_matrix_display create(const control& parent, const drawing::point& location);
241 static dot_matrix_display create(const control& parent, const drawing::point& location, const drawing::size& size);
248 static dot_matrix_display create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
259 static dot_matrix_display create(const control& parent, const dots_collection& dots, const drawing::point& location);
266 static dot_matrix_display create(const control& parent, const dots_collection& dots, const drawing::point& location, const drawing::size& size);
274 static dot_matrix_display create(const control& parent, const dots_collection& dots, const drawing::point& location, const drawing::size& size, const xtd::string& name);
287 static dot_matrix_display create(const control& parent, const dots_collection& dots, bool show_back_dot, const drawing::point& location);
295 static dot_matrix_display create(const control& parent, const dots_collection& dots, bool show_back_dot, const drawing::point& location, const drawing::size& size);
304 static dot_matrix_display create(const control& parent, const dots_collection& dots, bool show_back_dot, const drawing::point& location, const drawing::size& size, const xtd::string& name);
306
307 protected:
309
311 xtd::drawing::size default_size() const noexcept override;
313
315
321 xtd::uptr<xtd::object> clone() const override;
322
323 void on_back_color_changed(const event_args& e) override;
324
325 void on_fore_color_changed(const event_args& e) override;
326
327 void on_paint(paint_event_args& e) override;
328
329 drawing::size measure_control() const noexcept override;
330
335 virtual void draw_dot(drawing::graphics& graphics, const drawing::color& color, const drawing::point& point);
337
338 private:
339 xtd::sptr<data> data_;
340 };
341 }
342}
Represents an ARGB (alpha, red, green, blue) color.
Definition color.hpp:49
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
Defines the base class for controls, which are components with visual representation.
Definition control.hpp: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 dot matrix display class.
Definition dot_matrix_display.hpp:32
dot_matrix_display()
Initialize a new instance of dot_matrix_display class.
virtual int32 matrix_width() const noexcept
Gets the matrix size. Number height dots.
virtual bool show_back_dot() const noexcept
Gets a value indicate if background dots are shown.
static dot_matrix_display create()
A factory to create an xtd::forms::dot_matrix_display.
std::vector< std::vector< bool > > dots_collection
Represents a dots collection.
Definition dot_matrix_display.hpp:40
drawing::size measure_control() const noexcept override
Measure this control.
void on_fore_color_changed(const event_args &e) override
Raises the xtd::forms::control::fore_color_changed event.
virtual void set_dots(const points_collection &points)
Sets specified dots to on.
virtual void set_dot(const drawing::point &point, bool on)
Sets specified dot point status.
virtual drawing::color back_dot_color() const noexcept
Gets background dot color.
void on_back_color_changed(const event_args &e) override
Raises the xtd::forms::control::back_color_changed event.
std::vector< xtd::drawing::point > points_collection
Represents a point collection.
Definition dot_matrix_display.hpp:43
virtual double back_dot_opacity() const noexcept
Gets the background dot opacity.
virtual int32 matrix_height() const noexcept
Gets the matrix size. Number of height dots.
virtual void set_all_dots(bool on)
Sets all dots with specified boolean.
virtual void draw_dot(drawing::graphics &graphics, const drawing::color &color, const drawing::point &point)
Draw specified dot point with specified color on specified graphics.
virtual bool get_dot(const drawing::point &point) const noexcept
Gets specified dot point status.
void on_paint(paint_event_args &e) override
Raises the xtd::forms::control::paint event.
xtd::drawing::size default_size() const noexcept override
Gets the default size of the control.
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
virtual int32 thickness() const noexcept
Gets thickness of dot.
virtual const dots_collection & dots() const noexcept
Gets all dots status.
virtual const drawing::size & matrix_size() const noexcept
Gets the matrix size. Number of width and height dots.
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.hpp:30
Contains xtd::forms::dot_matrix_style enum class.
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
dot_matrix_style
Represent dot matrix style used by dot_matrix_display control.
Definition dot_matrix_style.hpp:21
@ e
The E key.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::forms::segments enum class.
Contains xtd::forms::style_sheets::control class.