xtd 0.2.0
status_bar_panel.h
Go to the documentation of this file.
1 #pragma once
5 #include "component.h"
6 #include "const_control_ref.h"
7 #include "context_menu.h"
8 #include "control_ref.h"
9 #include "horizontal_alignment.h"
10 #include "image_list.h"
13 #include "status_bar_panel_style.h"
14 #include <xtd/event>
15 #include <xtd/event_handler>
16 #include <xtd/iequatable>
17 
19 namespace xtd {
21  namespace forms {
23  class control;
24  class status_bar;
26 
43  class status_bar_panel : public xtd::forms::component, public xtd::iequatable<status_bar_panel> {
44  struct data;
45 
46  public:
48 
65 
67  status_bar_panel(const status_bar_panel&) noexcept = default;
68  status_bar_panel(status_bar_panel&&) noexcept = default;
69  status_bar_panel& operator =(const status_bar_panel&) noexcept = default;
71 
73 
84 
96 
106 
110  std::optional<control_ref> control() const noexcept;
120  status_bar_panel& control(std::nullptr_t value);
121 
126  const xtd::drawing::image& image() const noexcept;
133 
137  int32 min_width() const noexcept;
143 
147  const xtd::ustring& name() const noexcept;
152  status_bar_panel& name(const xtd::ustring& value);
153 
156  std::optional<std::reference_wrapper<xtd::forms::status_bar>> parent() const noexcept;
157 
161  xtd::forms::status_bar_panel_style style() const noexcept;
167 
171  std::any tag() const noexcept;
176  status_bar_panel& tag(std::any value);
177 
181  const xtd::ustring& text() const noexcept;
186  status_bar_panel& text(const xtd::ustring& value);
187 
192  const xtd::ustring& tool_tip_text() const noexcept;
199 
203  int32 width() const noexcept;
208  status_bar_panel& width(int32 value);
210 
212 
216  void begin_init();
217 
222  static status_bar_panel create_control(const xtd::ustring& text, const xtd::forms::control& control);
226  static status_bar_panel create_control(const xtd::forms::control& control);
227 
231  static status_bar_panel create_panel(const xtd::ustring& text);
240  static status_bar_panel create_panel(const xtd::ustring& text, const xtd::drawing::image& image);
241 
242  bool equals(const status_bar_panel& other) const noexcept override;
243 
246  void end_init();
247 
251  xtd::ustring to_string() const noexcept override;
252 
253  private:
254  friend xtd::forms::status_bar;
255  std::shared_ptr<data> data_;
256  };
257 
264  using status_bar_panel_ref = std::reference_wrapper<status_bar_panel>;
265  }
266 }
int32 width() const noexcept
Gets the width of the status bar panel within the xtd::forms::status_bar control. ...
Contains xtd::forms::horizontal_alignment enum class.
std::reference_wrapper< status_bar_panel > status_bar_panel_ref
Represents a xtd::forms::status_bar_item reference.
Definition: status_bar_panel.h:264
xtd::forms::style_sheets::control status_bar
The status_bar data allows you to specify the box of a status_bar control.
Definition: status_bar.h:23
xtd::forms::status_bar_panel_auto_size auto_size() const noexcept
Gets a value indicating whether the status bar panel is automatically resized.
const xtd::ustring & name() const noexcept
Gets the name of the xtd::forms::status_bar_panel.
int32 min_width() const noexcept
Gets the minimum allowed width of the status bar panel within the xtd::forms::status_bar control...
horizontal_alignment
Specifies how an object or text in a control is horizontally aligned relative to an element of the co...
Definition: horizontal_alignment.h:20
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
const xtd::ustring & tool_tip_text() const noexcept
Gets ToolTip text associated with the status bar panel.
status_bar_panel_border_style
Specifies the appearance of the border for a xtd::forms::status_bar_panel on a xtd::forms::status_bar...
Definition: status_bar_panel_border_style.h:20
static status_bar_panel create_control(const xtd::ustring &text, const xtd::forms::control &control)
A factory to create a control status bar panel with specified text and control.
void end_init()
Ends the initialization of a xtd::forms::status_bar_panel.
const xtd::ustring & text() const noexcept
Gets the text of the status bar panel.
const xtd::drawing::image & image() const noexcept
Gets the image to display within the status bar panel.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
std::optional< std::reference_wrapper< xtd::forms::status_bar > > parent() const noexcept
Gets the xtd::forms::status_bar control that the status bar panel is assigned to. ...
Contains xtd::forms::status_bar_panel_style enum class.
status_bar_panel()
Initialises a new instance of xtd::forms::status_bar_panel class.
xtd::forms::status_bar_panel_border_style border_style() const noexcept
Gets the border style of the status bar panel.
Contains xtd::forms::control_ref typedef.
std::any tag() const noexcept
Gets an object that contains data about the xtd::forms::status_bar_panel.
status_bar_panel_style
Specifies whether a xtd::forms::status_bar_panel object on a xtd::forms::status_bar control is owner-...
Definition: status_bar_panel_style.h:21
xtd::forms::status_bar_panel_style style() const noexcept
Gets the style of the status bar panel.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:18
xtd::ustring to_string() const noexcept override
Returns a string that represents the xtd::forms::status_bar_panel control.
Contains xtd::forms::image_list component.
status_bar_panel_auto_size
Specifies how a xtd::forms::status_bar_panel on a xtd::forms::status_bar content behaves when the con...
Definition: status_bar_panel_auto_size.h:20
Contains xtd::forms::status_bar_panel_border_style enum class.
The operating system is other.
Indicates that all styles except allow_binary_specifier, allow_octal_specifier and allow_hex_specifie...
Contains xtd::forms::context_menu menu.
void begin_init()
Begins the initialization of a xtd::forms::status_bar_panel.
An abstract base class that provides functionality for the bitmap and metafile descended classes...
Definition: image.h:48
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
Contains xtd::forms::const_control_ref typedef.
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
Contains xtd::forms::status_bar_panel_auto_size enum class.
std::optional< control_ref > control() const noexcept
Gets the control to be displayed in the control status bar panel.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Contains xtd::forms::component class.
Represents a xtd::forms::status_bar panel.
Definition: status_bar_panel.h:43
Provides the base implementation and enables object sharing between applications. ...
Definition: component.h:23
static status_bar_panel create_panel(const xtd::ustring &text)
A factory to create a status bar panel with specified text.
The left or right CTRL modifier key.
xtd::forms::horizontal_alignment alignment() const noexcept
Gets the alignment of text and icons within the status bar panel.