xtd 1.0.0
Loading...
Searching...
No Matches
seven_segment_display.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "application.hpp"
6#include "control.hpp"
7#include "segments.hpp"
8#include "segment_style.hpp"
9#include <xtd/argument_out_of_range_exception>
10#include <xtd/drawing/system_colors>
11
12namespace xtd {
13 namespace forms {
33 struct data;
34
35 public:
37
42
44
49 virtual auto back_segment_color() const noexcept -> xtd::drawing::color;
54 virtual auto back_segment_color(const xtd::drawing::color& value) -> seven_segment_display&;
55
58 virtual auto back_segment_opacity() const noexcept -> double;
64
67 virtual auto show_back_segment() const noexcept -> bool;
72
75 virtual auto segment_style() const noexcept -> xtd::forms::segment_style;
80
83 virtual auto thickness() const noexcept -> xtd::int32;
88
91 virtual auto value() const noexcept -> xtd::forms::segments;
97
99
103 virtual auto get_segments(xtd::forms::segments segment) const noexcept -> bool;
107 virtual auto set_segments(xtd::forms::segments segment, bool value) -> void;
109
111
115 [[nodiscard]] static auto create() -> seven_segment_display;
119 [[nodiscard]] static auto create(const drawing::point& location) -> seven_segment_display;
124 [[nodiscard]] static auto create(const drawing::point& location, const drawing::size& size) -> seven_segment_display;
130 [[nodiscard]] static auto create(const drawing::point& location, const drawing::size& size, const xtd::string& name) -> seven_segment_display;
134 [[nodiscard]] static auto create(xtd::forms::segments segments) -> seven_segment_display;
139 [[nodiscard]] static auto create(xtd::forms::segments segments, const drawing::point& location) -> seven_segment_display;
145 [[nodiscard]] static auto create(xtd::forms::segments segments, const drawing::point& location, const drawing::size& size) -> seven_segment_display;
152 [[nodiscard]] static auto create(xtd::forms::segments segments, const drawing::point& location, const drawing::size& size, const xtd::string& name) -> seven_segment_display;
163 [[nodiscard]] static auto create(xtd::forms::segments segments, bool show_back_segment, const drawing::point& location) -> seven_segment_display;
170 [[nodiscard]] static auto create(xtd::forms::segments segments, bool show_back_segment, const drawing::point& location, const drawing::size& size) -> seven_segment_display;
178 [[nodiscard]] static auto create(xtd::forms::segments segments, bool show_back_segment, const drawing::point& location, const drawing::size& size, const xtd::string& name) -> seven_segment_display;
182 [[nodiscard]] static auto create(const control& parent) -> seven_segment_display;
187 [[nodiscard]] static auto create(const control& parent, const drawing::point& location) -> seven_segment_display;
193 [[nodiscard]] static auto create(const control& parent, const drawing::point& location, const drawing::size& size) -> seven_segment_display;
200 [[nodiscard]] static auto create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name) -> seven_segment_display;
205 [[nodiscard]] static auto create(const control& parent, xtd::forms::segments segments) -> seven_segment_display;
211 [[nodiscard]] static auto create(const control& parent, xtd::forms::segments segments, const drawing::point& location) -> seven_segment_display;
218 [[nodiscard]] static auto create(const control& parent, xtd::forms::segments segments, const drawing::point& location, const drawing::size& size) -> seven_segment_display;
226 [[nodiscard]] static auto create(const control& parent, xtd::forms::segments segments, const drawing::point& location, const drawing::size& size, const xtd::string& name) -> seven_segment_display;
239 [[nodiscard]] static auto create(const control& parent, xtd::forms::segments segments, bool show_back_segment, const drawing::point& location) -> seven_segment_display;
247 [[nodiscard]] static auto create(const control& parent, xtd::forms::segments segments, bool show_back_segment, const drawing::point& location, const drawing::size& size) -> seven_segment_display;
256 [[nodiscard]] static auto create(const control& parent, xtd::forms::segments segments, bool show_back_segment, const drawing::point& location, const drawing::size& size, const xtd::string& name) -> seven_segment_display;
258
259 protected:
261
263 [[nodiscard]] auto default_size() const noexcept -> xtd::drawing::size override;
265
267
271 virtual auto draw_back_digit(xtd::drawing::graphics& graphics) -> void;
272
276 virtual auto draw_segment_a(xtd::drawing::graphics& graphics, const xtd::drawing::color& color) -> void;
277
281 virtual auto draw_segment_b(xtd::drawing::graphics& graphics, const xtd::drawing::color& color) -> void;
282
286 virtual auto draw_segment_c(xtd::drawing::graphics& graphics, const xtd::drawing::color& color) -> void;
287
291 virtual auto draw_segment_d(xtd::drawing::graphics& graphics, const xtd::drawing::color& color) -> void;
292
296 virtual auto draw_segment_e(xtd::drawing::graphics& graphics, const xtd::drawing::color& color) -> void;
297
301 virtual auto draw_segment_f(xtd::drawing::graphics& graphics, const xtd::drawing::color& color) -> void;
302
306 virtual auto draw_segment_g(xtd::drawing::graphics& graphics, const xtd::drawing::color& color) -> void;
307
311 virtual auto draw_dp(xtd::drawing::graphics& graphics, const xtd::drawing::color& color) -> void;
312
316 virtual auto draw_pc(xtd::drawing::graphics& graphics, const xtd::drawing::color& color) -> void;
317
318 auto on_back_color_changed(const xtd::event_args& e) -> void override;
319
320 auto on_enabled_changed(const xtd::event_args& e) -> void override;
321
322 auto on_fore_color_changed(const xtd::event_args& e) -> void override;
323
324 auto on_paint(xtd::forms::paint_event_args& e) -> void override;
325
326 auto on_parent_enabled_changed(const xtd::event_args& e) -> void override;
327
328 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
329
330 auto set_bounds_core(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, xtd::forms::bounds_specified specified) -> void override;
331
332 auto set_client_size_core(xtd::int32 width, xtd::int32 height) -> void override;
334
335 private:
336 xtd::sptr<data> data_;
337 };
338 }
339}
Contains xtd::forms::application class.
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 width() const noexcept -> xtd::int32
Gets the 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 height() const noexcept -> xtd::int32
Gets the height of the control.
virtual auto draw_segment_c(xtd::drawing::graphics &graphics, const xtd::drawing::color &color) -> void
Draw segment c on specified graphics with specified color.
virtual auto draw_segment_b(xtd::drawing::graphics &graphics, const xtd::drawing::color &color) -> void
Draw segment b on specified graphics with specified color.
auto on_back_color_changed(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::back_color_changed event.
virtual auto draw_dp(xtd::drawing::graphics &graphics, const xtd::drawing::color &color) -> void
Draw segment dot point on specified graphics with specified color.
auto set_bounds_core(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, xtd::forms::bounds_specified specified) -> void override
Performs the work of setting the specified bounds of this control.
virtual auto draw_segment_g(xtd::drawing::graphics &graphics, const xtd::drawing::color &color) -> void
Draw segment g on specified graphics with specified color.
auto on_fore_color_changed(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::fore_color_changed event.
virtual auto show_back_segment() const noexcept -> bool
Gets a value indicate if background segments are shown.
virtual auto draw_segment_a(xtd::drawing::graphics &graphics, const xtd::drawing::color &color) -> void
Draw segment a on specified graphics with specified color.
static auto create() -> seven_segment_display
A factory to create an xtd::forms::seven_segment_display.
auto set_client_size_core(xtd::int32 width, xtd::int32 height) -> void override
Sets the size of the client area of the control.
auto measure_control() const noexcept -> xtd::drawing::size override
Measure this control.
virtual auto draw_segment_d(xtd::drawing::graphics &graphics, const xtd::drawing::color &color) -> void
Draw segment d on specified graphics with specified color.
virtual auto thickness() const noexcept -> xtd::int32
Gets thickness of segment.
virtual auto back_segment_color() const noexcept -> xtd::drawing::color
Gets background segment color.
virtual auto set_segments(xtd::forms::segments segment, bool value) -> void
Sets specified xtd::forms::segments combination to on.
auto on_parent_enabled_changed(const xtd::event_args &e) -> void override
Raises the xtd::control::enabled_changed event when the xtd::control::enabled property value of the c...
virtual auto get_segments(xtd::forms::segments segment) const noexcept -> bool
Gets if specified xtd::forms::segments combination is on.
auto default_size() const noexcept -> xtd::drawing::size override
Gets the default size of the control.
virtual auto draw_segment_e(xtd::drawing::graphics &graphics, const xtd::drawing::color &color) -> void
Draw segment e on specified graphics with specified color.
seven_segment_display()
Initialize a new instance of seven_segment_display class.
auto on_paint(xtd::forms::paint_event_args &e) -> void override
Raises the xtd::forms::control::paint event.
virtual auto value() const noexcept -> xtd::forms::segments
Gets seven_segment_display value.
virtual auto segment_style() const noexcept -> xtd::forms::segment_style
Gets segment style.
virtual auto draw_back_digit(xtd::drawing::graphics &graphics) -> void
Draw all background digit on specified graphics.
virtual auto back_segment_opacity() const noexcept -> double
Gets the background segment opacity.
virtual auto draw_segment_f(xtd::drawing::graphics &graphics, const xtd::drawing::color &color) -> void
Draw segment f on specified graphics with specified color.
auto on_enabled_changed(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::enabled_changed event.
virtual auto draw_pc(xtd::drawing::graphics &graphics, const xtd::drawing::color &color) -> void
Draw segment punctuation colon on specified graphics with specified color.
Contains xtd::forms::control control.
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
bounds_specified
Specifies the bounds of the control to use when defining a control's size and position....
Definition bounds_specified.hpp:22
segments
Specifies how a control anchors to the edges of its container.
Definition segments.hpp:23
@ e
The E key.
Definition keys.hpp:207
@ y
Specifies that the top edge of the control is defined.
Definition bounds_specified.hpp:28
@ x
Specifies that the left edge of the control is defined.
Definition bounds_specified.hpp:26
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::segment_style enum class.
Contains xtd::forms::segments enum class.