xtd 0.2.0
control.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "ibox_model.hpp"
6#include "iimage_model.hpp"
7#include "itext_model.hpp"
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;
74
75 const xtd::forms::style_sheets::border_color& border_color() const noexcept override;
81
82 xtd::forms::style_sheets::border_radius border_radius() const noexcept override;
88
89 xtd::forms::style_sheets::border_style border_style() const noexcept override;
95
96 xtd::forms::style_sheets::border_width border_width() const noexcept override;
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;
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;
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;
149
150 xtd::forms::style_sheets::outline_offset outline_offset() const noexcept override;
156
157 xtd::forms::style_sheets::outline_radius outline_radius() const noexcept override;
163
164 xtd::forms::style_sheets::outline_style outline_style() const noexcept override;
170
171 xtd::forms::style_sheets::outline_width outline_width() const noexcept override;
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;
199
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;
220
222
227 bool equals(const xtd::object& obj) const noexcept override;
231 bool equals(const control& other) const noexcept override;
232
235 xtd::size get_hash_code() const noexcept override;
236
242 xtd::drawing::rectangle get_border_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
245 xtd::drawing::rectangle get_fill_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
248 xtd::drawing::rectangle get_outline_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
251 xtd::drawing::rectangle get_content_rectangle(const xtd::drawing::rectangle& bounds) const noexcept override;
254 xtd::drawing::string_format make_string_format() const noexcept override;
256
258
262 static control create_control() {return control();}
264
265 private:
266 bool auto_ellipsis_ = false;
270 xtd::forms::style_sheets::border_style border_style_ {border_type::none};
275 xtd::forms::style_sheets::outline_style outline_style_ {border_type::none};
278 xtd::drawing::color background_color_ = xtd::drawing::color::transparent;
279 xtd::forms::style_sheets::background_image background_image_ ;
280 std::optional<xtd::forms::style_sheets::length> width_;
281 std::optional<xtd::forms::style_sheets::length> height_;
282 xtd::drawing::color color_ = xtd::drawing::color::black;
284 xtd::drawing::font font_ = xtd::drawing::system_fonts::default_font();
290 };
291 }
292 }
293}
static const xtd::drawing::color transparent
Gets a system-defined color that has an ARGB value of 0x00000000. This field is constant.
Definition color.hpp:56
static const xtd::drawing::color black
Gets a system-defined color that has an ARGB value of 0xFF000000. This field is constant.
Definition color.hpp:80
static xtd::drawing::font default_font()
Gets the default font that applications can use for dialog boxes and forms.
The xtd::forms::style_sheets::border_color is used to set the color of the borders.
Definition border_color.hpp:33
The radius is used to add rounded borders to an element.
Definition border_radius.hpp:33
The style specifies what kind of borders to display.
Definition border_style.hpp:33
const xtd::forms::style_sheets::margin & margin() const noexcept override
Gets the area outside the border.
xtd::forms::content_alignment image_alignment() const noexcept override
Gets the alignment of the image.
std::optional< xtd::forms::style_sheets::length > height() const noexcept override
Gets the height of the box.
xtd::drawing::rectangle get_content_rectangle(const xtd::drawing::rectangle &bounds) const noexcept override
Gets the content rectangle from the specified rectangle.
const xtd::drawing::font & font() const noexcept override
Gets the font of the text.
const xtd::drawing::color & background_color() const noexcept override
Gets the background color is used to add background effects to the box.
static control create_control()
A factory to create control.
Definition control.hpp:262
xtd::forms::style_sheets::outline_style outline_style() const noexcept override
Gets the style specifies what kind of outlines to display.
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
xtd::forms::style_sheets::outline_radius outline_radius() const noexcept override
Gets the radius is used to add rounded outline to an element.
std::optional< xtd::forms::style_sheets::length > width() const noexcept override
Gets the width of the box.
xtd::drawing::color get_solid_background_color() const noexcept
Gets solid background color.
xtd::forms::style_sheets::outline_width outline_width() const noexcept override
Gets the width specifies the width of the outlines.
xtd::forms::style_sheets::text_decoration decoration() const noexcept override
Gets the decoration of the text.
const xtd::forms::style_sheets::border_color & border_color() const noexcept override
Gets the color is used to set the color of the borders.
xtd::forms::style_sheets::border_style border_style() const noexcept override
Gets the style specifies what kind of borders to display.
xtd::drawing::rectangle get_outline_rectangle(const xtd::drawing::rectangle &bounds) const noexcept override
Gets the outline rectangle from the specified rectangle.
xtd::forms::content_alignment text_alignment() const noexcept override
Gets the alignment of the text.
const xtd::drawing::color & color() const noexcept override
Gets the color is used to add foreground effects to the text.
xtd::forms::style_sheets::border_width border_width() const noexcept override
Gets the width specifies the width of the borders.
xtd::forms::style_sheets::text_transformation transformation() const noexcept override
Gets the transformation of the text.
xtd::forms::style_sheets::outline_offset outline_offset() const noexcept override
Gets the ofset specifies the width of the outlines.
control()=default
Initializes a new instance of the xtd::forms::style_sheets::control class.
const xtd::forms::style_sheets::padding & padding() const noexcept override
Gets the area area around the content.
bool equals(const xtd::object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
xtd::drawing::string_format make_string_format() const noexcept override
Makes string format.
xtd::forms::style_sheets::shadows shadows() const noexcept override
Gets an xtd::forms::style_sheets::shadow array used to draw shadows under the text.
const xtd::forms::style_sheets::outline_color & outline_color() const noexcept override
Gets the color is used to set the color of the outlines.
xtd::forms::style_sheets::border_radius border_radius() const noexcept override
Gets the radius is used to add rounded borders to an element.
xtd::drawing::rectangle get_border_rectangle(const xtd::drawing::rectangle &bounds) const noexcept override
Gets the border rectangle from the specified rectangle.
bool auto_ellipsis() const noexcept override
Gets a value indicating whether the ellipsis character (...) appears at the right edge of the control...
xtd::drawing::rectangle get_fill_rectangle(const xtd::drawing::rectangle &bounds) const noexcept override
Gets the fill rectangle from the specified rectangle.
const xtd::forms::style_sheets::background_image & background_image() const noexcept override
Gets the background image is used to add background effects to the box.
xtd::forms::style_sheets::white_space white_space() const noexcept override
Gets how white-space inside an element is handled.
The box model allows you to specify the margin, borders, padding, background color,...
Definition ibox_model.hpp:45
The image model allows you to specify the alignment of an image.
Definition iimage_model.hpp:38
The text model allows you to specify the alignment, color, decoration, transformation,...
Definition itext_model.hpp:40
The xtd::forms::style_sheets::length specifies the legth and unit of many properties of the xtd::form...
Definition length.hpp:77
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::forms::style_sheets::lengths outline_width
The width specifies the width of the outlines.
Definition outline_width.hpp:26
xtd::forms::style_sheets::border_color outline_color
The xtd::forms::style_sheets::outline_color is used to set the color of the outlines.
Definition outline_color.hpp:26
xtd::forms::style_sheets::lengths padding
Padding is used to create space around an element's content, inside of any defined borders.
Definition padding.hpp:26
xtd::forms::style_sheets::border_radius outline_radius
The radius is used to add rounded outlines to an element.
Definition outline_radius.hpp:26
text_decoration
The xtd::forms::style_sheets::text_decoration enum class is used to set or remove decorations from te...
Definition text_decoration.hpp:25
white_space
The white_space enum class specifies how white-space inside an element is handled.
Definition white_space.hpp:23
xtd::forms::style_sheets::lengths outline_offset
The width specifies the width of the borders.
Definition outline_offset.hpp:26
xtd::forms::style_sheets::border_style outline_style
The style specifies what kind of outlines to display.
Definition outline_style.hpp:26
xtd::forms::style_sheets::lengths margin
Margins are used to create space around elements, outside of any defined borders.
Definition margin.hpp:26
xtd::forms::style_sheets::lengths border_width
The width specifies the width of the borders.
Definition border_width.hpp:26
text_transformation
The xtd::forms::style_sheets::text_transformation enum class is used to specify uppercase and lowerca...
Definition text_transformation.hpp:24
@ none
Defines none text decoration.
Definition text_decoration.hpp:27
@ normal
Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary....
Definition white_space.hpp:25
@ none
Defines none text transformation.
Definition text_transformation.hpp:26
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:25
@ other
The operating system is other.
Definition platform_id.hpp:58
xtd::collections::generic::list< xtd::forms::style_sheets::shadow > shadows
Represents an xtd::forms::style_sheets::shadow array.
Definition shadows.hpp:24
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.hpp:21
@ size
Specifies that both the width and height property values of the control are defined.
Definition bounds_specified.hpp:36
@ middle_center
Content is vertically aligned at the middle, and horizontally aligned at the center.
Definition content_alignment.hpp:31
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::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms::style_sheets namespace contains various properties, states, and subcontrols that make...
Definition background_image.hpp:21
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 size_type length() const noexcept
Returns the length of the current read_only_span.
Definition read_only_span.hpp:229