xtd 0.2.0
collapsible_panel.h
Go to the documentation of this file.
1 #pragma once
5 #include "control.h"
6 #include "border_sides.h"
7 #include "border_style.h"
8 
10 namespace xtd {
12  namespace forms {
24  class forms_export_ collapsible_panel : public control {
25  struct data;
26 
27  public:
29 
34 
36 
38  virtual bool auto_size() const noexcept override;
39 
42  virtual forms::border_sides border_sides() const noexcept;
46 
50  virtual forms::border_style border_style() const noexcept;
55 
58  bool expanded() const noexcept;
62 
64  const xtd::drawing::size& client_size() const noexcept override;
65  xtd::drawing::size size() const noexcept override;
68 
70 
74  void collapse();
75 
76  using control::create;
83  static collapsible_panel create(const xtd::ustring& text, bool expanded = false, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
91  static collapsible_panel create(const control& parent, const xtd::ustring& text, bool expanded = false, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
92 
95  void expand();
97 
99 
105 
106  protected:
108 
110  forms::create_params create_params() const noexcept override;
112 
114 
116  drawing::size measure_control() const noexcept override;
117 
118  void on_control_added(const control_event_args& e) override;
119  void on_control_removed(const control_event_args& e) override;
120 
122  virtual void on_expanded_changed(const xtd::event_args& e);
123 
124  void on_handle_created(const event_args& e) override;
125 
126  void wnd_proc(message& message) override;
128 
129  private:
130  control& auto_size(bool auto_size) override;
131  control& client_size(const xtd::drawing::size& client_size) override;
132  control& size(const xtd::drawing::size& size) override;
133  void wm_command_control(message& message);
134 
135  std::shared_ptr<data> data_;
136  };
137  }
138 }
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.
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:31
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Encapsulates the information needed when creating a control.
Definition: create_params.h:27
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
static control create(const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified location, size, and name.
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:24
border_sides
Specifies how a control anchors to the edges of its container.
Definition: border_sides.h:21
border_style
Specifies the border style for a control.
Definition: border_style.h:20
Implements a Windows message.
Definition: message.h:26
Contains xtd::forms::border_sides enum class.
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
xtd::event< collapsible_panel, xtd::event_handler > expanded_changed
Occurs when the expanded property changes.
Definition: collapsible_panel.h:103
Expanded segment style.
Contains xtd::forms::control control.
Provides data for the xtd::forms::control::control_added and xtd::forms::control::control_removed eve...
Definition: control_event_args.h:25
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
static const ustring empty_string
Represents the empty string.
Definition: ustring.h:53
Specifies that both the x and y coordinates of the control are defined.
Contains xtd::forms::border_style enum class.
The xtd::forms::status_bar_panel displays text in the standard font.
size_t size
Represents a size of any object in bytes.
Definition: types.h:195