xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
collapsible_panel.h
Go to the documentation of this file.
1
4#pragma once
5#include "control.h"
6#include "border_style.h"
7
9namespace xtd {
11 namespace forms {
22 public:
25
27 virtual bool auto_size() const override {return true;}
29
33 virtual forms::border_style border_style() const {return border_style_;}
37 virtual collapsible_panel& border_style(forms::border_style border_style);
38
39 drawing::size default_size() const override {return {0, 0};}
40
43 bool expanded() const {return expanded_;}
46 collapsible_panel& expanded(bool expanded);
47
49 const xtd::drawing::size& client_size() const override {return control::client_size();}
50 const xtd::drawing::size& size() const override {return control::size();}
52
55 void collapse() {expanded(false);}
56
59 void expand() {expanded(true);}
60
64
65 protected:
66 forms::create_params create_params() const override;
67
69
70 void on_control_added(const control_event_args& e) override;
71
72 void on_control_removed(const control_event_args& e) override;
73
75 virtual void on_expanded_changed(const xtd::event_args& e);
76
77 void on_handle_created(const event_args& e) override;
78
79 void wnd_proc(message& message) override;
80
82 forms::border_style border_style_ = forms::border_style::none;
83 bool expanded_ = false;
85
86 private:
87 control& auto_size(bool auto_size) override {return control::auto_size(auto_size);}
88 control& client_size(const xtd::drawing::size& client_size) override {return control::size(client_size);}
89 control& size(const xtd::drawing::size& size) override {return control::size(size);}
90 void wm_command(message& message);
91 };
92 }
93}
Contains xtd::forms::border_style enum class.
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
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
Used to group collections of controls in a collapsible panel.
Definition: collapsible_panel.h:21
virtual void on_expanded_changed(const xtd::event_args &e)
Raises the collapsible_panel::expanded_changed event.
forms::create_params create_params() const override
Gets the required creation parameters when the control handle is created.
void on_handle_created(const event_args &e) override
Raises the control::handle_created event.
collapsible_panel()
Initializes a new instance of the collapsible_panel class.
void on_control_added(const control_event_args &e) override
Raises the control::control_added event.
void on_control_removed(const control_event_args &e) override
Raises the control::control_removed event.
void wnd_proc(message &message) override
Processes Windows messages.
void expand()
Expand the collapsible_panel.
Definition: collapsible_panel.h:59
void collapse()
Collapse the collapsible_panel.
Definition: collapsible_panel.h:55
drawing::size measure_control() const override
Measure this control.
Provides data for the control_added and control_removed events.
Definition: control_event_args.h:23
Defines the base class for controls, which are components with visual representation.
Definition: control.h:67
Implements a Windows message.
Definition: message.h:25
Contains xtd::forms::control control.
xtd::event< collapsible_panel, xtd::event_handler > expanded_changed
Occurs when the expanded property changes.
Definition: collapsible_panel.h:63
#define forms_export_
Define shared library export.
Definition: forms_export.h:13
size_t size
Represents a size of any object in bytes.
Definition: types.h:171
@ control
The left or right CTRL modifier key.
border_style
Specifies the border style for a control.
Definition: border_style.h:18
@ auto_size
The picture_box is sized equal to the size of the image that it contains.
@ expanded
Expanded segment style.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17