xtd 0.2.0
Loading...
Searching...
No Matches
label.h
Go to the documentation of this file.
1
4#pragma once
5#include "control.h"
6#include "border_sides.h"
7#include "border_style.h"
8#include "content_alignment.h"
9#include "flat_style.h"
10#include "image_list.h"
11#include "shadows.h"
12
14namespace xtd {
16 namespace forms {
36 class forms_export_ label : public control {
37 struct data;
38
39 public:
41
46
48
54 virtual bool auto_ellipsis() const noexcept;
60 virtual label& auto_ellipsis(bool value);
61
64 virtual forms::border_sides border_sides() const noexcept;
69
73 virtual xtd::forms::border_style border_style() const noexcept;
83 virtual xtd::forms::label& border_style(std::nullptr_t border_style);
84
87
91 virtual xtd::forms::flat_style flat_style() const noexcept;
97
102 virtual const drawing::image& image() const noexcept;
108 virtual xtd::forms::label& image(const drawing::image& value);
109
112 virtual xtd::forms::content_alignment image_align() const noexcept;
116 virtual xtd::forms::label& image_align(content_alignment value);
117
123 virtual int32 image_index() const noexcept;
130 virtual xtd::forms::label& image_index(int32 value);
131
134 virtual const forms::image_list& image_list() const noexcept;
137 virtual forms::image_list& image_list() noexcept;
141 virtual xtd::forms::label& image_list(const forms::image_list& value);
142
145 virtual bool shadow() const noexcept;
149 virtual xtd::forms::label& shadow(bool value);
150
153 virtual const xtd::forms::shadows& shadows() const noexcept;
157 virtual xtd::forms::label& shadows(const xtd::forms::shadows& value);
158
162 virtual xtd::forms::content_alignment text_align() const noexcept;
167 virtual xtd::forms::label& text_align(xtd::forms::content_alignment text_align);
169
171
175 static label create();
179 static label create(const drawing::point& location);
184 static label create(const drawing::point& location, const drawing::size& size);
190 static label create(const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
194 static label create(const xtd::ustring& text);
199 static label create(const xtd::ustring& text, const drawing::point& location);
205 static label create(const xtd::ustring& text, const drawing::point& location, const drawing::size& size);
212 static label create(const xtd::ustring& text, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
216 static label create(const control& parent);
221 static label create(const control& parent, const drawing::point& location);
227 static label create(const control& parent, const drawing::point& location, const drawing::size& size);
234 static label create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
239 static label create(const control& parent, const xtd::ustring& text);
245 static label create(const control& parent, const xtd::ustring& text, const drawing::point& location);
252 static label create(const control& parent, const xtd::ustring& text, const drawing::point& location, const drawing::size& size);
260 static label create(const control& parent, const xtd::ustring& text, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
262
264
269 event<label, event_handler> image_changed;
272 event<label, event_handler> text_align_changed;
274
275 protected:
277
279 xtd::forms::create_params create_params() const noexcept override;
281
283
289 std::unique_ptr<xtd::object> clone() const override;
290
291 xtd::drawing::size measure_control() const noexcept override;
292 void on_font_changed(const xtd::event_args& e) override;
293
296 virtual void on_image_changed(const xtd::event_args& e);
297
298 void on_paint(xtd::forms::paint_event_args& e) override;
299 void on_resize(const xtd::event_args& e) override;
300
305 virtual void on_text_align_changed(const xtd::event_args& e);
306
307 void on_text_changed(const xtd::event_args& e) override;
309
310 private:
311 std::shared_ptr<data> data_;
312 };
313 }
314}
Contains xtd::forms::border_sides enum class.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Represents an event.
Definition event.h:21
Defines the base class for controls, which are components with visual representation.
Definition control.h:79
Encapsulates the information needed when creating a control.
Definition create_params.h:27
Provides methods to manage a collection of xtd::drawing::image objects. This class cannot be inherite...
Definition image_list.h:28
Represents a standard Windows label.
Definition label.h:36
label()
Initialize a new instance of label class.
virtual bool auto_ellipsis() const noexcept
Gets a value indicating whether the ellipsis character (...) appears at the right edge of the xtd::fo...
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.h:28
Represents a shadow within a xtd::forms::shadow_label control.
Definition shadow.h:27
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Contains xtd::forms::content_alignment enum class.
Contains xtd::forms::flat_style enum class.
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.h:32
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
size_t size
Represents a size of any object in bytes.
Definition types.h:197
border_sides
Specifies how a control anchors to the edges of its container.
Definition border_sides.h:21
control_appearance
Specifies the appearance of a control.
Definition control_appearance.h:19
border_style
Specifies the border style for a control.
Definition border_style.h:20
std::vector< xtd::forms::shadow > shadows
Represents an xtd::forms::shadow array.
Definition shadows.h:20
flat_style
Specifies the appearance of a control.
Definition flat_style.h:22
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.h:19
Contains xtd::forms::image_list component.
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
Contains xtd::forms::style_sheets::border_style class.
Contains xtd::forms::style_sheets::control class.
Contains xtd::forms::style_sheets::shadows typedef.