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 {
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;
118 virtual xtd::forms::label& image_align(content_alignment value);
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;
169 virtual xtd::forms::label& text_align(xtd::forms::content_alignment text_align);
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
271 event<label, event_handler> image_changed;
274 event<label, event_handler> text_align_changed;
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.
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:81
Encapsulates the information needed when creating a control.
Definition create_params.h:29
Provides methods to manage a collection of xtd::drawing::image objects. This class cannot be inherite...
Definition image_list.h:30
Represents a standard Windows label.
Definition label.h:38
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:30
Represents a shadow within a xtd::forms::shadow_label control.
Definition shadow.h:29
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
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.h:25
size_t size
Represents a size of any object in bytes.
Definition size.h:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
border_sides
Specifies how a control anchors to the edges of its container.
Definition border_sides.h:23
control_appearance
Specifies the appearance of a control.
Definition control_appearance.h:21
border_style
Specifies the border style for a control.
Definition border_style.h:22
std::vector< xtd::forms::shadow > shadows
Represents an xtd::forms::shadow array.
Definition shadows.h:22
flat_style
Specifies the appearance of a control.
Definition flat_style.h:24
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.h:21
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::shadows typedef.
Contains xtd::forms::content_alignment enum class.
Contains xtd::forms::image_list component.
Contains xtd::forms::style_sheets::control class.