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 {
34 public:
36
41 control() = default;
43
45 control(const control&) = default;
46 control(control&&) = default;
47 control& operator =(const control&) = default;
49
51
53 bool auto_ellipsis() const noexcept override;
57 control& auto_ellipsis(bool value) noexcept;
58
59 const xtd::drawing::color& background_color() const noexcept override;
64 control& background_color(const xtd::drawing::color& value) noexcept;
65
66 const xtd::forms::style_sheets::background_image& background_image() const noexcept override;
71 control& background_image(const xtd::forms::style_sheets::background_image& value) noexcept;
72
73 const xtd::forms::style_sheets::border_color& border_color() const noexcept override;
78 control& border_color(const xtd::forms::style_sheets::border_color& value) noexcept;
79
80 xtd::forms::style_sheets::border_radius border_radius() const noexcept override;
85 control& border_radius(const xtd::forms::style_sheets::border_radius& value) noexcept;
86
87 xtd::forms::style_sheets::border_style border_style() const noexcept override;
92 control& border_style(xtd::forms::style_sheets::border_style value) noexcept;
93
94 xtd::forms::style_sheets::border_width border_width() const noexcept override;
99 control& border_width(xtd::forms::style_sheets::border_width value) noexcept;
100
101 const xtd::drawing::color& color() const noexcept override;
104 control& color(const xtd::drawing::color& value) noexcept;
105
106 xtd::forms::style_sheets::text_decoration decoration() const noexcept override;
110 control& decoration(xtd::forms::style_sheets::text_decoration value) noexcept;
111
112 const xtd::drawing::font& font() const noexcept override;
116 control& font(const xtd::drawing::font& value) noexcept;
117
118 std::optional<xtd::forms::style_sheets::length> height() const noexcept override;
124 control& height(const std::optional<xtd::forms::style_sheets::length>& value) noexcept;
125
126 xtd::forms::content_alignment image_alignment() const noexcept override;
130 control& image_alignment(xtd::forms::content_alignment value) noexcept;
131
132 const xtd::forms::style_sheets::margin& margin() const noexcept override;
139 control& margin(const xtd::forms::style_sheets::margin& value) noexcept;
140
141 const xtd::forms::style_sheets::outline_color& outline_color() const noexcept override;
146 control& outline_color(const xtd::forms::style_sheets::outline_color& value) noexcept;
147
148 xtd::forms::style_sheets::outline_offset outline_offset() const noexcept override;
153 control& outline_offset(xtd::forms::style_sheets::outline_offset value) noexcept;
154
155 xtd::forms::style_sheets::outline_radius outline_radius() const noexcept override;
160 control& outline_radius(xtd::forms::style_sheets::outline_radius value) noexcept;
161
162 xtd::forms::style_sheets::outline_style outline_style() const noexcept override;
167 control& outline_style(xtd::forms::style_sheets::outline_style value) noexcept;
168
169 xtd::forms::style_sheets::outline_width outline_width() const noexcept override;
174 control& outline_width(xtd::forms::style_sheets::outline_width value) noexcept;
175
176 const xtd::forms::style_sheets::padding& padding() const noexcept override;
182 control& padding(const xtd::forms::style_sheets::padding& value) noexcept;
183
186 xtd::forms::style_sheets::shadows shadows() const noexcept override;
190 control& shadows(const xtd::forms::style_sheets::shadows& value) noexcept;
191
192 xtd::forms::content_alignment text_alignment() const noexcept override;
196 control& text_alignment(xtd::forms::content_alignment value) noexcept;
197
198 xtd::forms::style_sheets::text_transformation transformation() const noexcept override;
202 control& transformation(xtd::forms::style_sheets::text_transformation value) noexcept;
203
204 std::optional<xtd::forms::style_sheets::length> width() const noexcept override;
210 control& width(std::optional<xtd::forms::style_sheets::length> value) noexcept;
211
212 xtd::forms::style_sheets::white_space white_space() const noexcept override;
216 control& white_space(xtd::forms::style_sheets::white_space value) noexcept;
218
220
222 bool equals(const control& other) const noexcept override;
223
226 xtd::drawing::color get_solid_background_color() const noexcept;
229 xtd::drawing::rectangle get_border_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
232 xtd::drawing::rectangle get_fill_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
235 xtd::drawing::rectangle get_outline_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
238 xtd::drawing::rectangle get_content_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
241 xtd::drawing::string_format make_string_format() const noexcept override;
243
245
249 static control create_control() {return control();}
251
252 private:
253 bool auto_ellipsis_ = false;
256 xtd::forms::style_sheets::border_radius border_radius_ {length(0)};
257 xtd::forms::style_sheets::border_style border_style_ {border_type::none};
258 xtd::forms::style_sheets::border_width border_width_ {length(3)};
260 xtd::forms::style_sheets::outline_offset outline_offset_ {length(0)};
261 xtd::forms::style_sheets::outline_radius outline_radius_ {length(0)};
262 xtd::forms::style_sheets::outline_style outline_style_ {border_type::none};
263 xtd::forms::style_sheets::outline_width outline_width_ {length(1)};
264 xtd::forms::style_sheets::padding padding_ {length(0)};
267 std::optional<xtd::forms::style_sheets::length> width_;
268 std::optional<xtd::forms::style_sheets::length> height_;
277 };
278 }
279 }
280}
Represent background color output manipulator class.
Definition background_color.h:22
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:40
The xtd::forms::style_sheets::border_color is used to set the color of the borders.
Definition border_color.h:31
The radius is used to add rounded borders to an element.
Definition border_radius.h:31
The style specifies what kind of borders to display.
Definition border_style.h:31
The control selector allows you to specify the box and color of a control.
Definition control.h:33
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:43
The image model allows you to specify the alignment of an image.
Definition iimage_model.h:36
The text model allows you to specify the alignment, color, decoration, transformation,...
Definition itext_model.h:38
The xtd::forms::style_sheets::length specifies the legth and unit of many properties of the xtd::form...
Definition length.h:75
The length specifies the length of the borders.
Definition lengths.h:31
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:18
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
#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:23
white_space
The white_space enum class specifies how white-space inside an element is handled.
Definition white_space.h:21
text_transformation
The xtd::forms::style_sheets::text_transformation enum class is used to specify uppercase and lowerca...
Definition text_transformation.h:22
@ 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::vector< xtd::forms::style_sheets::shadow > shadows
Represents an xtd::forms::style_sheets::shadow array.
Definition shadows.h:22
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.h:19
@ 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