xtd 1.0.0
Loading...
Searching...
No Matches
label.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "control.hpp"
6#include "border_sides.hpp"
7#include "border_style.hpp"
9#include "flat_style.hpp"
10#include "image_list.hpp"
11#include "shadows.hpp"
12
14namespace xtd {
16 namespace forms {
39 struct data;
40
41 public:
43
48
50
56 [[nodiscard]] virtual auto auto_ellipsis() const noexcept -> bool;
62 virtual auto auto_ellipsis(bool value) -> label&;
63
66 [[nodiscard]] virtual auto border_sides() const noexcept -> xtd::forms::border_sides;
70 virtual auto border_sides(xtd::forms::border_sides value) -> label&;
71
75 [[nodiscard]] virtual auto border_style() const noexcept -> xtd::forms::border_style;
80 virtual auto border_style(xtd::forms::border_style value) -> label&;
85 virtual auto border_style(xtd::null_ptr) -> label&;
86
89
93 [[nodiscard]] virtual auto flat_style() const noexcept -> xtd::forms::flat_style;
98 virtual auto flat_style(xtd::forms::flat_style value) -> label&;
99
104 [[nodiscard]] virtual auto image() const noexcept -> const xtd::drawing::image&;
110 virtual auto image(const xtd::drawing::image& value) -> label&;
111
114 [[nodiscard]] virtual auto image_align() const noexcept -> xtd::forms::content_alignment;
118 virtual auto image_align(xtd::forms::content_alignment value) -> label&;
119
125 [[nodiscard]] virtual auto image_index() const noexcept -> xtd::int32;
132 virtual auto image_index(xtd::int32 value) -> label&;
133
136 [[nodiscard]] virtual auto image_list() const noexcept -> const xtd::forms::image_list&;
139 [[nodiscard]] virtual auto image_list() noexcept -> xtd::forms::image_list&;
143 virtual auto image_list(const xtd::forms::image_list& value) -> label&;
144
147 [[nodiscard]] virtual auto shadow() const noexcept -> bool;
151 virtual auto shadow(bool value) -> label&;
152
155 [[nodiscard]] virtual auto shadows() const noexcept -> const xtd::forms::shadows&;
159 virtual auto shadows(const xtd::forms::shadows& value) -> label&;
160
164 [[nodiscard]] virtual auto text_align() const noexcept -> xtd::forms::content_alignment;
169 virtual auto text_align(xtd::forms::content_alignment value) -> label&;
171
173
177 [[nodiscard]] static auto create() -> label;
181 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> label;
186 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> label;
192 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> label;
196 [[nodiscard]] static auto create(const xtd::string& text) -> label;
201 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location) -> label;
207 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> label;
214 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> label;
218 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> label;
223 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> label;
229 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> label;
236 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> label;
241 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text) -> label;
247 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location) -> label;
254 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> label;
262 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> label;
264
266
276
277 protected:
279
281 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
283
285
287 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
288
289 auto on_font_changed(const xtd::event_args& e) -> void override;
290
293 virtual auto on_image_changed(const xtd::event_args& e) -> void;
294
295 auto on_paint(xtd::forms::paint_event_args& e) -> void override;
296 auto on_resize(const xtd::event_args& e) -> void override;
297
302 virtual auto on_text_align_changed(const xtd::event_args& e) -> void;
303
304 auto on_text_changed(const xtd::event_args& e) -> void override;
306
307 private:
308 xtd::sptr<data> data_;
309 };
310 }
311}
Contains xtd::forms::border_sides enum class.
Contains xtd::forms::border_style enum class.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
Represents an event.
Definition event.hpp:23
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
virtual auto location() const noexcept -> xtd::drawing::point
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
virtual auto shadow() const noexcept -> bool
Gets a value that allows to draw a drop shadow under the text.
virtual auto on_text_align_changed(const xtd::event_args &e) -> void
Raises the xtd::forms::label::text_align_changed event.
virtual auto image() const noexcept -> const xtd::drawing::image &
Gets the image that is displayed on a label control.
auto on_resize(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::region event.
virtual auto text_align() const noexcept -> xtd::forms::content_alignment
Gets the alignment of the text on the label control.
auto on_font_changed(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::font_changed event.
label()
Initialize a new instance of label class.
auto control_appearance(xtd::forms::control_appearance value) -> xtd::forms::control &override
Sets control appearance.
xtd::event< label, xtd::event_handler > text_align_changed
Occurs when the value of the xtd::forms::label::text_align property has changed.
Definition label.hpp:274
virtual auto on_image_changed(const xtd::event_args &e) -> void
Raises the image_changed event.
auto measure_control() const noexcept -> xtd::drawing::size override
Measure this control.
virtual auto image_align() const noexcept -> xtd::forms::content_alignment
Gets the alignment of the image on the label control.
virtual auto image_list() const noexcept -> const xtd::forms::image_list &
Gets the image_list that contains the image displayed on a label control.
virtual auto image_index() const noexcept -> xtd::int32
Gets the image list index value of the image displayed on the label control.
auto on_text_changed(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::text_changed event.
static auto create() -> label
A factory to create an xtd::forms::label.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
virtual auto flat_style() const noexcept -> xtd::forms::flat_style
Gets the flat style appearance of the label control.
xtd::event< label, xtd::event_handler > image_changed
Occurs when the value of the image property changes.
Definition label.hpp:271
virtual auto border_style() const noexcept -> xtd::forms::border_style
Gets the border style for the control.
virtual auto shadows() const noexcept -> const xtd::forms::shadows &
Gets an xtd::forms::shadow array used to draw shadows under the text.
virtual auto border_sides() const noexcept -> xtd::forms::border_sides
Gets the border sides for the control.
auto on_paint(xtd::forms::paint_event_args &e) -> void override
Raises the xtd::forms::control::paint event.
virtual auto auto_ellipsis() const noexcept -> bool
Gets a value indicating whether the ellipsis character (...) appears at the right edge of the xtd::fo...
Contains xtd::forms::content_alignment enum class.
Contains xtd::forms::control control.
Contains xtd::forms::flat_style enum class.
generic_event_handler< const xtd::event_args & > event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.hpp:24
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
std::nullptr_t null_ptr
Represents the null_opt alias on std::nullptr_t.
Definition null_ptr.hpp:19
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.hpp:21
Contains xtd::forms::image_list component.
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
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 data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Contains xtd::forms::shadows typedef.