xtd 0.2.0
label.h
Go to the documentation of this file.
1 #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 
14 namespace xtd {
16  namespace forms {
36  class forms_export_ label : public control {
37  struct data;
38 
39  public:
41 
44  label();
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 
173  using control::create;
180  static label create(const xtd::ustring& text, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
188  static label create(const control& parent, const xtd::ustring& text, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
190 
192 
202 
203  protected:
205 
207  xtd::forms::create_params create_params() const noexcept override;
209 
211 
213  xtd::drawing::size measure_control() const noexcept override;
214  void on_font_changed(const xtd::event_args& e) override;
215 
218  virtual void on_image_changed(const xtd::event_args& e);
219 
220  void on_paint(xtd::forms::paint_event_args& e) override;
221  void on_resize(const xtd::event_args& e) override;
222 
227  virtual void on_text_align_changed(const xtd::event_args& e);
228 
229  void on_text_changed(const xtd::event_args& e) override;
231 
232  private:
233  std::shared_ptr<data> data_;
234  };
235  }
236 }
xtd::forms::style_sheets::control label
The label data allows you to specify the box of a label control.
Definition: label.h:23
flat_style
Specifies the appearance of a control.
Definition: flat_style.h:22
Provides methods to manage a collection of xtd::drawing::image objects. This class cannot be inherite...
Definition: image_list.h:28
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 ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
Represents a standard Windows label.
Definition: label.h:36
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:31
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
control_appearance
Specifies the appearance of a control.
Definition: control_appearance.h:19
Encapsulates the information needed when creating a control.
Definition: create_params.h:27
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
static control create(const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified location, size, and name.
Represents an event.
Definition: event.h:21
Provides data for the xtd::forms::control::paint event.
Definition: paint_event_args.h:28
Contains xtd::forms::image_list component.
content_alignment
Specifies alignment of content on the drawing surface.
Definition: content_alignment.h:19
border_sides
Specifies how a control anchors to the edges of its container.
Definition: border_sides.h:21
virtual forms::control_appearance control_appearance() const noexcept
Gets control appearance.
border_style
Specifies the border style for a control.
Definition: border_style.h:20
An abstract base class that provides functionality for the bitmap and metafile descended classes...
Definition: image.h:48
Contains xtd::forms::content_alignment enum class.
event< label, event_handler > text_align_changed
Occurs when the value of the xtd::forms::label::text_align property has changed.
Definition: label.h:200
Contains xtd::forms::border_sides enum class.
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
Contains xtd::forms::flat_style enum class.
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
Represents a shadow within a xtd::forms::shadow_label control.
Definition: shadow.h:27
Contains xtd::forms::shadows typedef.
Contains xtd::forms::control control.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
static const ustring empty_string
Represents the empty string.
Definition: ustring.h:53
Specifies that both the x and y coordinates of the control are defined.
Contains xtd::forms::border_style enum class.
std::vector< xtd::forms::shadow > shadows
Represents an xtd::forms::shadow array.
Definition: shadows.h:20
The xtd::forms::status_bar_panel displays text in the standard font.
event< label, event_handler > image_changed
Occurs when the value of the image property changes.
Definition: label.h:197
size_t size
Represents a size of any object in bytes.
Definition: types.h:195