xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
control_layout_style.h
Go to the documentation of this file.
1 #pragma once
5 #include <xtd/object.h>
6 #include <xtd/ustring.h>
7 #include "content_alignment.h"
8 #include "size_type.h"
9 
11 namespace xtd {
13  namespace forms {
20  class control_layout_style : public object {
21  protected:
23  control_layout_style() = default;
29  control_layout_style(bool expanded) : expanded_(expanded) {}
37  control_layout_style(xtd::forms::size_type size_type, bool expanded) : size_type_(size_type), expanded_(expanded) {}
46  control_layout_style(xtd::forms::size_type size_type, bool expanded, xtd::forms::content_alignment align) : size_type_(size_type), expanded_(expanded), align_(align) {}
50  control_layout_style(bool expanded, xtd::forms::content_alignment align) : expanded_(expanded), align_(align) {}
51 
52  public:
55  xtd::forms::size_type size_type() const {return size_type_;}
59  size_type_ = size_type;
60  return *this;
61  }
62 
65  bool expanded() const {return expanded_;}
69  expanded_ = expanded;
70  return *this;
71  }
72 
76  xtd::forms::content_alignment align() const {return align_;}
81  align_ = align;
82  return *this;
83  }
84 
87  xtd::ustring to_string() const noexcept override {return ustring::format("control_layout_style=[expanded={}, align={}, size_type={}]", expanded_, align_, size_type_);}
88 
90  bool operator==(const control_layout_style& value) const {return size_type_ == value.size_type_ && expanded_ == value.expanded_;}
91  bool operator!=(const control_layout_style& value) const {return !operator==(value);}
92  friend std::ostream& operator<<(std::ostream& os, const xtd::forms::control_layout_style& control_layout_style) noexcept {
93  return os << control_layout_style.to_string();
94  }
96 
97  private:
99  bool expanded_ = false;
101  };
102  }
103 }
Implements the basic functionality that represents the appearance and behavior of a control layout...
Definition: control_layout_style.h:20
control_layout_style & align(xtd::forms::content_alignment align)
Sets a flag indicating how a control should be align to its containing layout container.
Definition: control_layout_style.h:80
xtd::forms::size_type size_type() const
Gets a flag indicating how a control should be sized relative to its containing layout container...
Definition: control_layout_style.h:55
control_layout_style & size_type(xtd::forms::size_type size_type)
Sets a flag indicating how a control should be sized relative to its containing layout container...
Definition: control_layout_style.h:58
Contains xtd::forms::size_type enum class.
control_layout_style(xtd::forms::size_type size_type, bool expanded)
Initialises a new instance of control layout style class with specified size type and expanded...
Definition: control_layout_style.h:37
control_layout_style(xtd::forms::size_type size_type)
Initialises a new instance of control layout style class with specified size type.
Definition: control_layout_style.h:26
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
size_type
Specifies how rows or columns of user interface (UI) elements should be sized relative to their conta...
Definition: size_type.h:18
control_layout_style(xtd::forms::content_alignment align)
Initialises a new instance of control layout style class with specified content alignment.
Definition: control_layout_style.h:33
control_layout_style(xtd::forms::size_type size_type, bool expanded, xtd::forms::content_alignment align)
Initialises a new instance of control layout style class with specified size type, expanded and content alignment.
Definition: control_layout_style.h:46
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
control_layout_style(bool expanded, xtd::forms::content_alignment align)
Initialises a new instance of control layout style class with specified expanded and content alignmen...
Definition: control_layout_style.h:50
bool expanded() const
Gets a flag indicating if control is expanded to its containing layout container. ...
Definition: control_layout_style.h:65
xtd::forms::content_alignment align() const
Gets a flag indicating how a control should be align to its containing layout container.
Definition: control_layout_style.h:76
control_layout_style(bool expanded)
Initialises a new instance of control layout style class with specified expanded. ...
Definition: control_layout_style.h:29
content_alignment
Specifies alignment of content on the drawing surface.
Definition: content_alignment.h:17
Contains xtd::ustring class.
Contains xtd::forms::content_alignment enum class.
Starts at the upper-left corner of the screen.
Contains xtd::object class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:26
The control should be sized to an exact number of pixels.
static ustring format(const ustring &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition: ustring.h:689
control_layout_style(xtd::forms::size_type size_type, xtd::forms::content_alignment align)
Initialises a new instance of control layout style class with specified size type and content alignme...
Definition: control_layout_style.h:41
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
control_layout_style & expanded(bool expanded)
Sets a flag indicating if control is expanded to its containing layout container. ...
Definition: control_layout_style.h:68
control_layout_style()=default
Initialises a new instance of control layout style class.
xtd::ustring to_string() const noexcept override
Returns a string that represent xtd::forms::control_layout_style.
Definition: control_layout_style.h:87