xtd 0.2.0
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 {
38 class forms_export_ label : public control {
39 struct data;
40
41 public:
43
48
50
56 virtual bool auto_ellipsis() const noexcept;
62 virtual label& auto_ellipsis(bool value);
63
66 virtual forms::border_sides border_sides() const noexcept;
71
75 virtual xtd::forms::border_style border_style() const noexcept;
85 virtual xtd::forms::label& border_style(std::nullptr_t border_style);
86
89
93 virtual xtd::forms::flat_style flat_style() const noexcept;
99
104 virtual const drawing::image& image() const noexcept;
110 virtual xtd::forms::label& image(const drawing::image& value);
111
114 virtual xtd::forms::content_alignment image_align() const noexcept;
119
125 virtual int32 image_index() const noexcept;
132 virtual xtd::forms::label& image_index(int32 value);
133
136 virtual const forms::image_list& image_list() const noexcept;
139 virtual forms::image_list& image_list() noexcept;
143 virtual xtd::forms::label& image_list(const forms::image_list& value);
144
147 virtual bool shadow() const noexcept;
151 virtual xtd::forms::label& shadow(bool value);
152
155 virtual const xtd::forms::shadows& shadows() const noexcept;
159 virtual xtd::forms::label& shadows(const xtd::forms::shadows& value);
160
164 virtual xtd::forms::content_alignment text_align() const noexcept;
171
173
177 static label create();
181 static label create(const drawing::point& location);
186 static label create(const drawing::point& location, const drawing::size& size);
192 static label create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
196 static label create(const xtd::string& text);
201 static label create(const xtd::string& text, const drawing::point& location);
207 static label create(const xtd::string& text, const drawing::point& location, const drawing::size& size);
214 static label create(const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
218 static label create(const control& parent);
223 static label create(const control& parent, const drawing::point& location);
229 static label create(const control& parent, const drawing::point& location, const drawing::size& size);
236 static label create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
241 static label create(const control& parent, const xtd::string& text);
247 static label create(const control& parent, const xtd::string& text, const drawing::point& location);
254 static label create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size);
262 static label create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
264
266
276
277 protected:
279
281 xtd::forms::create_params create_params() const noexcept override;
283
285
291 xtd::uptr<xtd::object> clone() const override;
292
293 xtd::drawing::size measure_control() const noexcept override;
294 void on_font_changed(const xtd::event_args& e) override;
295
298 virtual void on_image_changed(const xtd::event_args& e);
299
300 void on_paint(xtd::forms::paint_event_args& e) override;
301 void on_resize(const xtd::event_args& e) override;
302
307 virtual void on_text_align_changed(const xtd::event_args& e);
308
309 void on_text_changed(const xtd::event_args& e) override;
311
312 private:
313 xtd::sptr<data> data_;
314 };
315 }
316}
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:21
virtual drawing::point location() const noexcept
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
virtual const xtd::string & name() const noexcept
Gets the name of the control.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
virtual const xtd::string & text() const noexcept
Gets the text associated with this control.
virtual drawing::size size() const noexcept
Gets the height and width of the control.
virtual std::optional< control_ref > parent() const noexcept
Gets the parent container of the control.
static label create()
A factory to create an xtd::forms::label.
void on_text_changed(const xtd::event_args &e) override
Raises the xtd::forms::control::text_changed event.
event< label, event_handler > text_align_changed
Occurs when the value of the xtd::forms::label::text_align property has changed.
Definition label.hpp:274
xtd::drawing::size measure_control() const noexcept override
Measure this control.
virtual xtd::forms::content_alignment image_align() const noexcept
Gets the alignment of the image on the label control.
control & control_appearance(forms::control_appearance value) override
Sets control appearance.
void on_font_changed(const xtd::event_args &e) override
Raises the xtd::forms::control::font_changed event.
virtual const forms::image_list & image_list() const noexcept
Gets the image_list that contains the image displayed on a label control.
virtual xtd::forms::border_style border_style() const noexcept
Gets the border style for the control.
label()
Initialize a new instance of label class.
void on_resize(const xtd::event_args &e) override
Raises the xtd::forms::control::region event.
virtual int32 image_index() const noexcept
Gets the image list index value of the image displayed on the label control.
virtual bool auto_ellipsis() const noexcept
Gets a value indicating whether the ellipsis character (...) appears at the right edge of the xtd::fo...
virtual bool shadow() const noexcept
Gets a value that allows to draw a drop shadow under the text.
event< label, event_handler > image_changed
Occurs when the value of the image property changes.
Definition label.hpp:271
xtd::forms::create_params create_params() const noexcept override
Gets the required creation parameters when the control handle is created.
virtual void on_image_changed(const xtd::event_args &e)
Raises the image_changed event.
virtual const drawing::image & image() const noexcept
Gets the image that is displayed on a label control.
virtual xtd::forms::content_alignment text_align() const noexcept
Gets the alignment of the text on the label control.
virtual void on_text_align_changed(const xtd::event_args &e)
Raises the xtd::forms::label::text_align_changed event.
virtual forms::border_sides border_sides() const noexcept
Gets the border sides for the control.
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
virtual xtd::forms::flat_style flat_style() const noexcept
Gets the flat style appearance of the label control.
void on_paint(xtd::forms::paint_event_args &e) override
Raises the xtd::forms::control::paint event.
virtual const xtd::forms::shadows & shadows() const noexcept
Gets an xtd::forms::shadow array used to draw shadows under the text.
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
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.hpp:21
@ e
The E key.
Definition keys.hpp:207
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 const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Contains xtd::forms::shadows typedef.