xtd 1.0.0
Loading...
Searching...
No Matches
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
49 [[nodiscard]] auto auto_ellipsis() const noexcept -> bool override;
53 auto auto_ellipsis(bool value) noexcept -> control&;
54
55 [[nodiscard]] auto background_color() const noexcept -> const xtd::drawing::color& override;
60 auto background_color(const xtd::drawing::color& value) noexcept -> control&;
61
62 [[nodiscard]] auto background_image() const noexcept -> const xtd::forms::style_sheets::background_image& override;
67 auto background_image(const xtd::forms::style_sheets::background_image& value) noexcept -> control&;
68
69 [[nodiscard]] auto border_color() const noexcept -> const xtd::forms::style_sheets::border_color& override;
74 auto border_color(const xtd::forms::style_sheets::border_color& value) noexcept -> control&;
75
76 [[nodiscard]] auto border_radius() const noexcept -> xtd::forms::style_sheets::border_radius override;
81 auto border_radius(const xtd::forms::style_sheets::border_radius& value) noexcept -> control&;
82
83 [[nodiscard]] auto border_style() const noexcept -> xtd::forms::style_sheets::border_style override;
89
90 [[nodiscard]] auto border_width() const noexcept -> xtd::forms::style_sheets::border_width override;
96
97 [[nodiscard]] auto color() const noexcept -> const xtd::drawing::color& override;
100 auto color(const xtd::drawing::color& value) noexcept -> control&;
101
102 [[nodiscard]] auto decoration() const noexcept -> xtd::forms::style_sheets::text_decoration override;
107
108 [[nodiscard]] auto font() const noexcept -> const xtd::drawing::font& override;
112 auto font(const xtd::drawing::font& value) noexcept -> control&;
113
114 [[nodiscard]] auto height() const noexcept -> std::optional<xtd::forms::style_sheets::length> override;
120 auto height(const std::optional<xtd::forms::style_sheets::length>& value) noexcept -> control&;
121
122 [[nodiscard]] auto image_alignment() const noexcept -> xtd::forms::content_alignment override;
127
128 [[nodiscard]] auto margin() const noexcept -> const xtd::forms::style_sheets::margin& override;
135 auto margin(const xtd::forms::style_sheets::margin& value) noexcept -> control&;
136
137 [[nodiscard]] auto outline_color() const noexcept -> const xtd::forms::style_sheets::outline_color& override;
142 auto outline_color(const xtd::forms::style_sheets::outline_color& value) noexcept -> control&;
143
144 [[nodiscard]] auto outline_offset() const noexcept -> xtd::forms::style_sheets::outline_offset override;
150
151 [[nodiscard]] auto outline_radius() const noexcept -> xtd::forms::style_sheets::outline_radius override;
157
158 [[nodiscard]] auto outline_style() const noexcept -> xtd::forms::style_sheets::outline_style override;
164
165 [[nodiscard]] auto outline_width() const noexcept -> xtd::forms::style_sheets::outline_width override;
171
172 [[nodiscard]] auto padding() const noexcept -> const xtd::forms::style_sheets::padding& override;
178 auto padding(const xtd::forms::style_sheets::padding& value) noexcept -> control&;
179
182 [[nodiscard]] auto shadows() const noexcept -> xtd::forms::style_sheets::shadows override;
186 auto shadows(const xtd::forms::style_sheets::shadows& value) noexcept -> control&;
187
188 [[nodiscard]] auto text_alignment() const noexcept -> xtd::forms::content_alignment override;
193
194 [[nodiscard]] auto transformation() const noexcept -> xtd::forms::style_sheets::text_transformation override;
199
200 [[nodiscard]] auto width() const noexcept -> std::optional<xtd::forms::style_sheets::length> override;
206 auto width(std::optional<xtd::forms::style_sheets::length> value) noexcept -> control&;
207
208 [[nodiscard]] auto white_space() const noexcept -> xtd::forms::style_sheets::white_space override;
214
216
221 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
225 [[nodiscard]] auto equals(const control& other) const noexcept -> bool override;
226
229 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::usize override;
230
233 [[nodiscard]] auto get_solid_background_color() const noexcept -> xtd::drawing::color;
236 [[nodiscard]] auto get_border_rectangle(const xtd::drawing::rectangle& bounds) const noexcept -> xtd::drawing::rectangle override;
239 [[nodiscard]] auto get_fill_rectangle(const xtd::drawing::rectangle& bounds) const noexcept -> xtd::drawing::rectangle override;
242 [[nodiscard]] auto get_outline_rectangle(const xtd::drawing::rectangle& bounds) const noexcept -> xtd::drawing::rectangle override;
245 [[nodiscard]] auto get_content_rectangle(const xtd::drawing::rectangle& bounds) const noexcept -> xtd::drawing::rectangle override;
248 [[nodiscard]] auto make_string_format() const noexcept -> xtd::drawing::string_format override;
250
252
256 [[nodiscard]] static auto create_control() -> control {return control();}
258
259 private:
260 bool auto_ellipsis_ = false;
264 xtd::forms::style_sheets::border_style border_style_ {border_type::none};
269 xtd::forms::style_sheets::outline_style outline_style_ {border_type::none};
272 xtd::drawing::color background_color_ = xtd::drawing::color::transparent;
273 xtd::forms::style_sheets::background_image background_image_ ;
274 std::optional<xtd::forms::style_sheets::length> width_;
275 std::optional<xtd::forms::style_sheets::length> height_;
276 xtd::drawing::color color_ = xtd::drawing::color::black;
278 xtd::drawing::font font_ = xtd::drawing::system_fonts::default_font();
284 };
285 }
286 }
287}
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:62
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:86
static auto default_font() -> xtd::drawing::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
auto outline_radius() const noexcept -> xtd::forms::style_sheets::outline_radius override
Gets the radius is used to add rounded outline to an element.
auto transformation() const noexcept -> xtd::forms::style_sheets::text_transformation override
Gets the transformation of the text.
auto get_outline_rectangle(const xtd::drawing::rectangle &bounds) const noexcept -> xtd::drawing::rectangle override
Gets the outline rectangle from the specified rectangle.
auto outline_color() const noexcept -> const xtd::forms::style_sheets::outline_color &override
Gets the color is used to set the color of the outlines.
auto white_space() const noexcept -> xtd::forms::style_sheets::white_space override
Gets how white-space inside an element is handled.
auto get_hash_code() const noexcept -> xtd::usize override
Serves as a hash function for a particular type.
auto auto_ellipsis() const noexcept -> bool override
Gets a value indicating whether the ellipsis character (...) appears at the right edge of the control...
auto get_border_rectangle(const xtd::drawing::rectangle &bounds) const noexcept -> xtd::drawing::rectangle override
Gets the border rectangle from the specified rectangle.
auto padding() const noexcept -> const xtd::forms::style_sheets::padding &override
Gets the area area around the content.
auto color() const noexcept -> const xtd::drawing::color &override
Gets the color is used to add foreground effects to the text.
auto border_width() const noexcept -> xtd::forms::style_sheets::border_width override
Gets the width specifies the width of the borders.
auto text_alignment() const noexcept -> xtd::forms::content_alignment override
Gets the alignment of the text.
auto shadows() const noexcept -> xtd::forms::style_sheets::shadows override
Gets an xtd::forms::style_sheets::shadow array used to draw shadows under the text.
auto border_style() const noexcept -> xtd::forms::style_sheets::border_style override
Gets the style specifies what kind of borders to display.
auto height() const noexcept -> std::optional< xtd::forms::style_sheets::length > override
Gets the height of the box.
auto margin() const noexcept -> const xtd::forms::style_sheets::margin &override
Gets the area outside the border.
auto outline_offset() const noexcept -> xtd::forms::style_sheets::outline_offset override
Gets the ofset specifies the width of the outlines.
static auto create_control() -> control
A factory to create control.
Definition control.hpp:256
auto border_radius() const noexcept -> xtd::forms::style_sheets::border_radius override
Gets the radius is used to add rounded borders to an element.
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
auto make_string_format() const noexcept -> xtd::drawing::string_format override
Makes string format.
auto image_alignment() const noexcept -> xtd::forms::content_alignment override
Gets the alignment of the image.
control()=default
Initializes a new instance of the xtd::forms::style_sheets::control class.
auto decoration() const noexcept -> xtd::forms::style_sheets::text_decoration override
Gets the decoration of the text.
auto get_solid_background_color() const noexcept -> xtd::drawing::color
Gets solid background color.
auto border_color() const noexcept -> const xtd::forms::style_sheets::border_color &override
Gets the color is used to set the color of the borders.
auto background_image() const noexcept -> const xtd::forms::style_sheets::background_image &override
Gets the background image is used to add background effects to the box.
auto background_color() const noexcept -> const xtd::drawing::color &override
Gets the background color is used to add background effects to the box.
auto get_content_rectangle(const xtd::drawing::rectangle &bounds) const noexcept -> xtd::drawing::rectangle override
Gets the content rectangle from the specified rectangle.
auto outline_style() const noexcept -> xtd::forms::style_sheets::outline_style override
Gets the style specifies what kind of outlines to display.
auto font() const noexcept -> const xtd::drawing::font &override
Gets the font of the text.
auto get_fill_rectangle(const xtd::drawing::rectangle &bounds) const noexcept -> xtd::drawing::rectangle override
Gets the fill rectangle from the specified rectangle.
auto width() const noexcept -> std::optional< xtd::forms::style_sheets::length > override
Gets the width of the box.
auto outline_width() const noexcept -> xtd::forms::style_sheets::outline_width override
Gets the width specifies the width of the outlines.
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:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
#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:26
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
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
@ 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 auto length() const noexcept -> size_type
Returns the length of the current read_only_span.
Definition read_only_span.hpp:213