xtd 0.2.0
nine_segment_display.h
Go to the documentation of this file.
1 #pragma once
6 
7 namespace xtd {
8  namespace forms {
26  struct data;
27 
28  public:
30 
35 
37 
42  int32 thickness() const noexcept override;
48 
50 
52  using control::create;
69  static nine_segment_display create(const control& parent, xtd::forms::segments segments, bool show_back_segment = true, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
71 
72  protected:
74 
76  void draw_back_digit(drawing::graphics& graphics) override;
77 
81  virtual void draw_segment_h(drawing::graphics& graphics, const drawing::color& color);
82 
86  virtual void draw_segment_i(drawing::graphics& graphics, const drawing::color& color);
87 
88  void on_paint(paint_event_args& e) override;
90 
91  private:
92  std::shared_ptr<data> data_;
93  };
94  }
95 }
96 
void draw_back_digit(drawing::graphics &graphics) override
Draw all background digit on specified graphics.
Contains xtd::forms::seven_segment_display control.
Represents a nine segment display class.
Definition: nine_segment_display.h:25
virtual void draw_segment_i(drawing::graphics &graphics, const drawing::color &color)
Draw segment ion specified graphics with specified color.
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
nine_segment_display()
Initialize a new instance of nine_segment_display class.
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:31
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
virtual const xtd::ustring & name() const noexcept
Gets the name of the control.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
segments
Specifies how a control anchors to the edges of its container.
Definition: segments.h:21
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.
virtual bool show_back_segment() const noexcept
Gets a value indicate if background segments are shown.
virtual forms::segments value() const noexcept
Gets seven_segment_display value.
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:45
Provides data for the xtd::forms::control::paint event.
Definition: paint_event_args.h:28
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...
static nine_segment_display create(xtd::forms::segments segments, bool show_back_segment=true, 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::nine_segment_display with specified color, location, size, and name.
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
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
Represents a seven segment display class.
Definition: seven_segment_display.h:30
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics.h:70
int32 thickness() const noexcept override
Sets thickness of segment.
virtual void draw_segment_h(drawing::graphics &graphics, const drawing::color &color)
Draw segment h on specified graphics with specified color.
void on_paint(paint_event_args &e) override
Raises the xtd::forms::control::paint event.
size_t size
Represents a size of any object in bytes.
Definition: types.h:195