xtd 1.0.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 {
33 struct data;
34
35 public:
37
41
45
47
52
54
59 [[nodiscard]] virtual auto back_dot_color() const noexcept -> xtd::drawing::color;
64 virtual auto back_dot_color(const xtd::drawing::color& value) -> dot_matrix_display&;
65
68 [[nodiscard]] virtual auto back_dot_opacity() const noexcept -> double;
73 virtual auto back_dot_opacity(double value) -> dot_matrix_display&;
74
77 [[nodiscard]] virtual auto dot_matrix_style() const noexcept -> xtd::forms::dot_matrix_style;
82
85 [[nodiscard]] virtual auto dots() const noexcept -> const dots_collection&;
89 virtual auto dots(const dots_collection& value) -> dot_matrix_display&;
90
93 [[nodiscard]] virtual auto matrix_height() const noexcept -> xtd::int32;
97 virtual auto matrix_height(xtd::int32 value) -> dot_matrix_display&;
98
101 [[nodiscard]] virtual auto matrix_width() const noexcept -> xtd::int32;
105 virtual auto matrix_width(xtd::int32 value) -> dot_matrix_display&;
106
109 [[nodiscard]] virtual auto matrix_size() const noexcept -> const xtd::drawing::size&;
113 virtual auto matrix_size(const xtd::drawing::size& value) -> dot_matrix_display&;
114
117 [[nodiscard]] virtual auto show_back_dot() const noexcept -> bool;
121 virtual auto show_back_dot(bool value) -> dot_matrix_display&;
122
125 [[nodiscard]] virtual auto thickness() const noexcept -> xtd::int32;
129 virtual auto thickness(xtd::int32 value) -> dot_matrix_display&;
131
133
138 [[nodiscard]] virtual auto get_dot(const xtd::drawing::point& point) const noexcept -> bool;
139
142 virtual auto set_all_dots(bool on) -> void;
143
147 virtual auto set_dot(const xtd::drawing::point& point, bool on) -> void;
148
151 virtual auto set_dots(const points_collection& points) -> void;
155 virtual auto set_dots(const points_collection& points, bool on) -> void;
157
159
163 [[nodiscard]] static auto create() -> dot_matrix_display;
167 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> dot_matrix_display;
172 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> dot_matrix_display;
178 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> dot_matrix_display;
182 [[nodiscard]] static auto create(const dots_collection& dots) -> dot_matrix_display;
187 [[nodiscard]] static auto create(const dots_collection& dots, const xtd::drawing::point& location) -> dot_matrix_display;
193 [[nodiscard]] static auto create(const dots_collection& dots, const xtd::drawing::point& location, const xtd::drawing::size& size) -> dot_matrix_display;
200 [[nodiscard]] static auto create(const dots_collection& dots, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> dot_matrix_display;
205 [[nodiscard]] static auto create(const dots_collection& dots, bool show_back_dot) -> dot_matrix_display;
211 [[nodiscard]] static auto create(const dots_collection& dots, bool show_back_dot, const xtd::drawing::point& location) -> dot_matrix_display;
218 [[nodiscard]] static auto create(const dots_collection& dots, bool show_back_dot, const xtd::drawing::point& location, const xtd::drawing::size& size) -> dot_matrix_display;
226 [[nodiscard]] static auto create(const dots_collection& dots, bool show_back_dot, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> dot_matrix_display;
230 [[nodiscard]] static auto create(const control& parent) -> dot_matrix_display;
235 [[nodiscard]] static auto create(const control& parent, const xtd::drawing::point& location) -> dot_matrix_display;
241 [[nodiscard]] static auto create(const control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> dot_matrix_display;
248 [[nodiscard]] static auto create(const control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> dot_matrix_display;
253 [[nodiscard]] static auto create(const control& parent, const dots_collection& dots) -> dot_matrix_display;
259 [[nodiscard]] static auto create(const control& parent, const dots_collection& dots, const xtd::drawing::point& location) -> dot_matrix_display;
266 [[nodiscard]] static auto create(const control& parent, const dots_collection& dots, const xtd::drawing::point& location, const xtd::drawing::size& size) -> dot_matrix_display;
274 [[nodiscard]] static auto create(const control& parent, const dots_collection& dots, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> dot_matrix_display;
280 [[nodiscard]] static auto create(const control& parent, const dots_collection& dots, bool show_back_dot) -> dot_matrix_display;
287 [[nodiscard]] static auto create(const control& parent, const dots_collection& dots, bool show_back_dot, const xtd::drawing::point& location) -> dot_matrix_display;
295 [[nodiscard]] static auto create(const control& parent, const dots_collection& dots, bool show_back_dot, const xtd::drawing::point& location, const xtd::drawing::size& size) -> dot_matrix_display;
304 [[nodiscard]] static auto create(const control& parent, const dots_collection& dots, bool show_back_dot, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> dot_matrix_display;
306
307 protected:
309
311 [[nodiscard]] auto default_size() const noexcept -> xtd::drawing::size override;
313
315
317 auto on_back_color_changed(const event_args& e) -> void override;
318
319 auto on_fore_color_changed(const event_args& e) -> void override;
320
321 auto on_paint(paint_event_args& e) -> void override;
322
323 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
324
329 virtual auto draw_dot(drawing::graphics& graphics, const xtd::drawing::color& color, const xtd::drawing::point& point) -> void;
331
332 private:
333 xtd::sptr<data> data_;
334 };
335 }
336}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
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 auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
virtual auto location() const noexcept -> xtd::drawing::point
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
virtual auto matrix_size() const noexcept -> const xtd::drawing::size &
Gets the matrix size. Number of width and height dots.
virtual auto matrix_width() const noexcept -> xtd::int32
Gets the matrix size. Number height dots.
xtd::array< xtd::array< bool > > dots_collection
Represents a dots collection.
Definition dot_matrix_display.hpp:40
dot_matrix_display()
Initialize a new instance of dot_matrix_display class.
xtd::array< xtd::drawing::point > points_collection
Represents a point collection.
Definition dot_matrix_display.hpp:43
auto default_size() const noexcept -> xtd::drawing::size override
Gets the default size of the control.
virtual auto show_back_dot() const noexcept -> bool
Gets a value indicate if background dots are shown.
virtual auto thickness() const noexcept -> xtd::int32
Gets thickness of dot.
virtual auto dots() const noexcept -> const dots_collection &
Gets all dots status.
auto measure_control() const noexcept -> xtd::drawing::size override
Measure this control.
virtual auto back_dot_color() const noexcept -> xtd::drawing::color
Gets background dot color.
virtual auto set_dots(const points_collection &points) -> void
Sets specified dots to on.
auto on_paint(paint_event_args &e) -> void override
Raises the xtd::forms::control::paint event.
virtual auto dot_matrix_style() const noexcept -> xtd::forms::dot_matrix_style
Gets dot matrix style.
virtual auto set_dot(const xtd::drawing::point &point, bool on) -> void
Sets specified dot point status.
auto on_fore_color_changed(const event_args &e) -> void override
Raises the xtd::forms::control::fore_color_changed event.
virtual auto get_dot(const xtd::drawing::point &point) const noexcept -> bool
Gets specified dot point status.
static auto create() -> dot_matrix_display
A factory to create an xtd::forms::dot_matrix_display.
virtual auto set_all_dots(bool on) -> void
Sets all dots with specified boolean.
virtual auto draw_dot(drawing::graphics &graphics, const xtd::drawing::color &color, const xtd::drawing::point &point) -> void
Draw specified dot point with specified color on specified graphics.
virtual auto matrix_height() const noexcept -> xtd::int32
Gets the matrix size. Number of height dots.
virtual auto back_dot_opacity() const noexcept -> double
Gets the background dot opacity.
auto on_back_color_changed(const event_args &e) -> void override
Raises the xtd::forms::control::back_color_changed event.
Contains xtd::forms::control control.
Contains xtd::forms::dot_matrix_style enum class.
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
@ e
The E key.
Definition keys.hpp:207
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Contains xtd::forms::segments enum class.