xtd 0.2.0
Loading...
Searching...
No Matches
control.h
Go to the documentation of this file.
1
4#pragma once
5#include "ibox_model.h"
6#include "iimage_model.h"
7#include "itext_model.h"
8#include <xtd/iequatable>
9
11namespace xtd {
13 namespace forms {
15 namespace style_sheets {
36 public:
38
43 control() = default;
45
47 control(const control&) = default;
48 control(control&&) = default;
49 control& operator =(const control&) = default;
51
53
55 bool auto_ellipsis() const noexcept override;
59 control& auto_ellipsis(bool value) noexcept;
60
61 const xtd::drawing::color& background_color() const noexcept override;
66 control& background_color(const xtd::drawing::color& value) noexcept;
67
68 const xtd::forms::style_sheets::background_image& background_image() const noexcept override;
73 control& background_image(const xtd::forms::style_sheets::background_image& value) noexcept;
74
75 const xtd::forms::style_sheets::border_color& border_color() const noexcept override;
80 control& border_color(const xtd::forms::style_sheets::border_color& value) noexcept;
81
82 xtd::forms::style_sheets::border_radius border_radius() const noexcept override;
87 control& border_radius(const xtd::forms::style_sheets::border_radius& value) noexcept;
88
89 xtd::forms::style_sheets::border_style border_style() const noexcept override;
94 control& border_style(xtd::forms::style_sheets::border_style value) noexcept;
95
96 xtd::forms::style_sheets::border_width border_width() const noexcept override;
101 control& border_width(xtd::forms::style_sheets::border_width value) noexcept;
102
103 const xtd::drawing::color& color() const noexcept override;
106 control& color(const xtd::drawing::color& value) noexcept;
107
108 xtd::forms::style_sheets::text_decoration decoration() const noexcept override;
112 control& decoration(xtd::forms::style_sheets::text_decoration value) noexcept;
113
114 const xtd::drawing::font& font() const noexcept override;
118 control& font(const xtd::drawing::font& value) noexcept;
119
120 std::optional<xtd::forms::style_sheets::length> height() const noexcept override;
126 control& height(const std::optional<xtd::forms::style_sheets::length>& value) noexcept;
127
128 xtd::forms::content_alignment image_alignment() const noexcept override;
132 control& image_alignment(xtd::forms::content_alignment value) noexcept;
133
134 const xtd::forms::style_sheets::margin& margin() const noexcept override;
141 control& margin(const xtd::forms::style_sheets::margin& value) noexcept;
142
143 const xtd::forms::style_sheets::outline_color& outline_color() const noexcept override;
148 control& outline_color(const xtd::forms::style_sheets::outline_color& value) noexcept;
149
150 xtd::forms::style_sheets::outline_offset outline_offset() const noexcept override;
155 control& outline_offset(xtd::forms::style_sheets::outline_offset value) noexcept;
156
157 xtd::forms::style_sheets::outline_radius outline_radius() const noexcept override;
162 control& outline_radius(xtd::forms::style_sheets::outline_radius value) noexcept;
163
164 xtd::forms::style_sheets::outline_style outline_style() const noexcept override;
169 control& outline_style(xtd::forms::style_sheets::outline_style value) noexcept;
170
171 xtd::forms::style_sheets::outline_width outline_width() const noexcept override;
176 control& outline_width(xtd::forms::style_sheets::outline_width value) noexcept;
177
178 const xtd::forms::style_sheets::padding& padding() const noexcept override;
184 control& padding(const xtd::forms::style_sheets::padding& value) noexcept;
185
188 xtd::forms::style_sheets::shadows shadows() const noexcept override;
192 control& shadows(const xtd::forms::style_sheets::shadows& value) noexcept;
193
194 xtd::forms::content_alignment text_alignment() const noexcept override;
198 control& text_alignment(xtd::forms::content_alignment value) noexcept;
199
200 xtd::forms::style_sheets::text_transformation transformation() const noexcept override;
204 control& transformation(xtd::forms::style_sheets::text_transformation value) noexcept;
205
206 std::optional<xtd::forms::style_sheets::length> width() const noexcept override;
212 control& width(std::optional<xtd::forms::style_sheets::length> value) noexcept;
213
214 xtd::forms::style_sheets::white_space white_space() const noexcept override;
218 control& white_space(xtd::forms::style_sheets::white_space value) noexcept;
220
222
224 using object::equals;
225 bool equals(const control& other) const noexcept override;
226
229 xtd::drawing::color get_solid_background_color() const noexcept;
232 xtd::drawing::rectangle get_border_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
235 xtd::drawing::rectangle get_fill_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
238 xtd::drawing::rectangle get_outline_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
241 xtd::drawing::rectangle get_content_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
244 xtd::drawing::string_format make_string_format() const noexcept override;
246
248
252 static control create_control() {return control();}
254
255 private:
256 bool auto_ellipsis_ = false;
259 xtd::forms::style_sheets::border_radius border_radius_ {length(0)};
260 xtd::forms::style_sheets::border_style border_style_ {border_type::none};
261 xtd::forms::style_sheets::border_width border_width_ {length(3)};
263 xtd::forms::style_sheets::outline_offset outline_offset_ {length(0)};
264 xtd::forms::style_sheets::outline_radius outline_radius_ {length(0)};
265 xtd::forms::style_sheets::outline_style outline_style_ {border_type::none};
266 xtd::forms::style_sheets::outline_width outline_width_ {length(1)};
267 xtd::forms::style_sheets::padding padding_ {length(0)};
270 std::optional<xtd::forms::style_sheets::length> width_;
271 std::optional<xtd::forms::style_sheets::length> height_;
280 };
281 }
282 }
283}
Represent background color output manipulator class.
Definition background_color.h:24
Represents an ARGB (alpha, red, green, blue) color.
Definition color.h:49
static const xtd::drawing::color transparent
Gets a system-defined color that has an ARGB value of 0x00000000. This field is constant.
Definition color.h:59
static const xtd::drawing::color black
Gets a system-defined color that has an ARGB value of 0xFF000000. This field is constant.
Definition color.h:83
Defines a particular format for text, including font face, size, and style attributes....
Definition font.h:45
static xtd::drawing::font default_font()
Gets the default font that applications can use for dialog boxes and forms.
The image data allows you to specify the url or gradient mode.
Definition background_image.h:42
The xtd::forms::style_sheets::border_color is used to set the color of the borders.
Definition border_color.h:33
The radius is used to add rounded borders to an element.
Definition border_radius.h:33
The style specifies what kind of borders to display.
Definition border_style.h:33
The control selector allows you to specify the box and color of a control.
Definition control.h:35
control()=default
Initializes a new instance of the xtd::forms::style_sheets::control class.
bool auto_ellipsis() const noexcept override
Gets a value indicating whether the ellipsis character (...) appears at the right edge of the control...
The box model allows you to specify the margin, borders, padding, background color,...
Definition ibox_model.h:45
The image model allows you to specify the alignment of an image.
Definition iimage_model.h:38
The text model allows you to specify the alignment, color, decoration, transformation,...
Definition itext_model.h:40
The xtd::forms::style_sheets::length specifies the legth and unit of many properties of the xtd::form...
Definition length.h:77
The length specifies the length of the borders.
Definition lengths.h:33
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
#define forms_export_
Define shared library export.
Definition forms_export.h:13
text_decoration
The xtd::forms::style_sheets::text_decoration enum class is used to set or remove decorations from te...
Definition text_decoration.h:25
white_space
The white_space enum class specifies how white-space inside an element is handled.
Definition white_space.h:23
text_transformation
The xtd::forms::style_sheets::text_transformation enum class is used to specify uppercase and lowerca...
Definition text_transformation.h:24
@ none
Defines none text decoration.
@ normal
Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary....
@ none
Defines none text transformation.
std::optional< type_t > optional
Represents the null_opt alias on std::nullopt_t.
Definition optional.h:181
std::vector< xtd::forms::style_sheets::shadow > shadows
Represents an xtd::forms::style_sheets::shadow array.
Definition shadows.h:24
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.h:21
@ middle_center
Content is vertically aligned at the middle, and horizontally aligned at the center.
Contains xtd::forms::style_sheets::ibox_model class.
Contains xtd::forms::style_sheets::iimage_model class.
Contains xtd::forms::style_sheets::itext_model class.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10