xtd 1.0.0
Loading...
Searching...
No Matches
collapsible_panel.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "control.hpp"
6#include "border_sides.hpp"
7#include "border_style.hpp"
8
10namespace xtd {
12 namespace forms {
27 struct data;
28
29 public:
31
36
38
40 virtual auto auto_size() const noexcept -> bool override;
41
44 [[nodiscard]] virtual auto border_sides() const noexcept -> xtd::forms::border_sides;
48
52 [[nodiscard]] virtual auto border_style() const noexcept -> xtd::forms::border_style;
62
65 [[nodiscard]] auto expanded() const noexcept -> bool;
68 auto expanded(bool value) -> collapsible_panel&;
69
71 [[nodiscard]] auto client_size() const noexcept -> const xtd::drawing::size& override;
72 [[nodiscard]] auto size() const noexcept -> xtd::drawing::size override;
75
77
81 auto collapse() -> void;
82
85 auto expand() -> void;
87
89
93 [[nodiscard]] static auto create() -> collapsible_panel;
97 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> collapsible_panel;
102 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> collapsible_panel;
108 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> collapsible_panel;
112 [[nodiscard]] static auto create(const xtd::string& text) -> collapsible_panel;
117 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location) -> collapsible_panel;
123 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> collapsible_panel;
130 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> collapsible_panel;
135 [[nodiscard]] static auto create(const xtd::string& text, bool expanded) -> collapsible_panel;
141 [[nodiscard]] static auto create(const xtd::string& text, bool expanded, const xtd::drawing::point& location) -> collapsible_panel;
148 [[nodiscard]] static auto create(const xtd::string& text, bool expanded, const xtd::drawing::point& location, const xtd::drawing::size& size) -> collapsible_panel;
156 [[nodiscard]] static auto create(const xtd::string& text, bool expanded, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> collapsible_panel;
160 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> collapsible_panel;
165 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> collapsible_panel;
171 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> collapsible_panel;
178 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> collapsible_panel;
183 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text) -> collapsible_panel;
189 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location) -> collapsible_panel;
196 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> collapsible_panel;
204 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> collapsible_panel;
210 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, bool expanded) -> collapsible_panel;
217 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, bool expanded, const xtd::drawing::point& location) -> collapsible_panel;
225 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, bool expanded, const xtd::drawing::point& location, const xtd::drawing::size& size) -> collapsible_panel;
234 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, bool expanded, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> collapsible_panel;
236
238
244
245 protected:
247
249 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
251
253
255 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
256
257 auto on_control_added(const control_event_args& e) -> void override;
258 auto on_control_removed(const control_event_args& e) -> void override;
259
261 virtual auto on_expanded_changed(const xtd::event_args& e) -> void;
262
263 auto on_handle_created(const event_args& e) -> void override;
264
265 auto wnd_proc(message& message) -> void override;
267
268 private:
269 auto auto_size(bool auto_size) -> xtd::forms::control& override;
270 auto client_size(const xtd::drawing::size& client_size) -> xtd::forms::control& override;
271 auto size(const xtd::drawing::size& size) -> xtd::forms::control& override;
272 auto wm_command_control(message& message) -> void;
273
274 xtd::sptr<data> data_;
275 };
276 }
277}
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
Represents an event.
Definition event.hpp:23
auto measure_control() const noexcept -> xtd::drawing::size override
Measure this control.
virtual auto border_style() const noexcept -> xtd::forms::border_style
Gets the border style for the control.
virtual auto on_expanded_changed(const xtd::event_args &e) -> void
Raises the collapsible_panel::expanded_changed event.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
auto on_control_removed(const control_event_args &e) -> void override
Raises the xtd::forms::control::control_removed event.
static auto create() -> collapsible_panel
A factory to create an xtd::forms::collapsible_panel.
virtual auto border_sides() const noexcept -> xtd::forms::border_sides
Gets the border sides for the control.
auto on_control_added(const control_event_args &e) -> void override
Raises the xtd::forms::control::control_added event.
auto wnd_proc(message &message) -> void override
Processes Windows messages.
xtd::event< collapsible_panel, xtd::event_handler > expanded_changed
Occurs when the expanded property changes.
Definition collapsible_panel.hpp:242
collapsible_panel()
Initializes a new instance of the collapsible_panel class.
virtual auto auto_size() const noexcept -> bool override
Gets a value that indicates whether the control resizes based on its contents.
auto on_handle_created(const event_args &e) -> void override
Raises the xtd::forms::control::handle_created event.
auto expanded() const noexcept -> bool
Gets a value indicating whether the collapsible_panel is in the expanded.
auto collapse() -> void
Collapse the collapsible_panel.
auto expand() -> void
Expand the collapsible_panel.
Provides data for the xtd::forms::control::control_added and xtd::forms::control::control_removed eve...
Definition control_event_args.hpp:27
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
virtual auto location() const noexcept -> xtd::drawing::point
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
Contains xtd::forms::control control.
generic_event_handler< const xtd::event_args & > event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.hpp:24
#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
std::nullptr_t null_ptr
Represents the null_opt alias on std::nullptr_t.
Definition null_ptr.hpp:19
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 auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Implements a Windows message.
Definition message.hpp:33