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.
collapsible_panel.h
Go to the documentation of this file.
1 #pragma once
5 #include "control.h"
6 #include "border_style.h"
7 
9 namespace xtd {
11  namespace forms {
21  class forms_export_ collapsible_panel : public control {
22  public:
24 
29 
31 
33  virtual bool auto_size() const override {return true;}
34 
38  virtual forms::border_style border_style() const {return border_style_;}
43 
44  drawing::size default_size() const override {return {0, 0};}
45 
48  bool expanded() const {return expanded_;}
52 
54  const xtd::drawing::size& client_size() const override {return control::client_size();}
55  const xtd::drawing::size& size() const override {return control::size();}
58 
60 
64  void collapse() {expanded(false);}
65 
68  void expand() {expanded(true);}
70 
72 
79 
80  protected:
82 
84  forms::create_params create_params() const override;
85 
86  drawing::size measure_control() const override;
87 
88  void on_control_added(const control_event_args& e) override;
89 
90  void on_control_removed(const control_event_args& e) override;
91 
93  virtual void on_expanded_changed(const xtd::event_args& e);
94 
95  void on_handle_created(const event_args& e) override;
96 
97  void wnd_proc(message& message) override;
99 
100  private:
101  control& auto_size(bool auto_size) override {return control::auto_size(auto_size);}
102  control& client_size(const xtd::drawing::size& client_size) override {return control::size(client_size);}
103  control& size(const xtd::drawing::size& size) override {return control::size(size);}
104  void wm_command(message& message);
105 
107  bool expanded_ = false;
108  };
109  }
110 }
virtual const drawing::size & size() const
Gets the height and width of the control.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
The picture_box is sized equal to the size of the image that it contains.
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
virtual forms::border_style border_style() const
Get the border style for the control.
Definition: collapsible_panel.h:38
void expand()
Expand the collapsible_panel.
Definition: collapsible_panel.h:68
virtual const drawing::size & client_size() const
Gets the height and width of the client area of the control.
virtual bool auto_size() const
Gets a value that indicates whether the control resizes based on its contents.
virtual bool auto_size() const override
Gets a value that indicates whether the control resizes based on its contents.
Definition: collapsible_panel.h:33
Represents an event.
Definition: event.h:21
Specifies that both the width and height property values of the control are defined.
Used to group collections of controls in a collapsible panel.
Definition: collapsible_panel.h:21
border_style
Specifies the border style for a control.
Definition: border_style.h:18
Implements a Windows message.
Definition: message.h:25
Defines the base class for controls, which are components with visual representation.
Definition: control.h:68
void collapse()
Collapse the collapsible_panel.
Definition: collapsible_panel.h:64
drawing::size default_size() const override
Gets the default size of the control.
Definition: collapsible_panel.h:44
Expanded segment style.
Contains xtd::forms::control control.
Provides data for the control_added and control_removed events.
Definition: control_event_args.h:23
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Contains xtd::forms::border_style enum class.
xtd::event< collapsible_panel, xtd::event_handler > expanded_changed
Occurs when the expanded property changes.
Definition: collapsible_panel.h:77
bool expanded() const
Gets a value indicating whether the collapsible_panel is in the expanded.
Definition: collapsible_panel.h:48
size_t size
Represents a size of any object in bytes.
Definition: types.h:171