xtd 0.2.0
user_control.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "border_sides.hpp"
6#include "border_style.hpp"
8#include <xtd/optional>
9
11namespace xtd {
13 namespace forms {
28 struct data;
29
30 public:
32
37
39
43 virtual forms::auto_size_mode auto_size_mode() const noexcept;
48
51 virtual forms::border_sides border_sides() const noexcept;
55
59 virtual xtd::forms::border_style border_style() const noexcept;
69 virtual user_control& border_style(std::nullptr_t border_style);
71
73
81 static user_control create(const drawing::point& location);
86 static user_control create(const drawing::point& location, const drawing::size& size);
92 static user_control create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
101 static user_control create(const control& parent, const drawing::point& location);
107 static user_control create(const control& parent, const drawing::point& location, const drawing::size& size);
114 static user_control create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
116
117 protected:
119
121 forms::create_params create_params() const noexcept override;
123
125
131 xtd::uptr<xtd::object> clone() const override;
132
133 void on_layout(const event_args& e) override;
134 void on_paint(paint_event_args& e) override;
136
137 private:
138 xtd::sptr<data> data_;
139 };
140 }
141}
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
container_control()
Initializes a new instance of the container_control class.
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual const xtd::string & name() const noexcept
Gets the name of the control.
virtual std::optional< control_ref > parent() const noexcept
Gets the parent container of the control.
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.hpp:30
void on_layout(const event_args &e) override
Raises the xtd::forms::control::layout event.
user_control()
Initialises a new instance of user_control class.
static user_control create()
A factory to create an xtd::forms::user_control.
void on_paint(paint_event_args &e) override
Raises the xtd::forms::control::paint event.
virtual forms::auto_size_mode auto_size_mode() const noexcept
Gets the mode by which the user_control automatically resizes itself.
forms::create_params create_params() const noexcept override
Gets the required creation parameters when the control handle is created.
virtual forms::border_sides border_sides() const noexcept
Gets the border sides for the control.
virtual xtd::forms::border_style border_style() const noexcept
Gets the border style for the control.
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
Contains xtd::forms::container_control class.
#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
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
auto_size_mode
Specifies how a control will behave when its auto_size property is enabled.
Definition auto_size_mode.hpp:22
@ e
The E key.
Definition keys.hpp:207
@ location
Specifies that both the x and y coordinates of the control are defined.
Definition bounds_specified.hpp:30
@ size
Specifies that both the width and height property values of the control are defined.
Definition bounds_specified.hpp:36
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