xtd 0.2.0
status_bar.h
Go to the documentation of this file.
1 #pragma once
5 #include "panel.h"
6 #include "status_bar_panel.h"
9 #include <memory>
10 #include <vector>
11 
13 namespace xtd {
15  namespace forms {
17  class form;
19 
46  class forms_export_ status_bar : public control {
47  struct data;
48  class status_bar_panel_control;
49  class sizing_grip_control;
50 
51  public:
53 
58 
60 
70  status_bar();
72 
74 
76  dock_style dock() const noexcept override;
77  control& dock(dock_style dock) override;
78 
82  const status_bar_panel_collection& panels() const noexcept;
87 
91  virtual bool show_panels() const noexcept;
96  virtual status_bar& show_panels(bool value);
97 
101  virtual bool show_tool_tips() const noexcept;
106  virtual status_bar& show_tool_tips(bool value);
107 
111  virtual bool sizing_grip() const noexcept;
116  virtual status_bar& sizing_grip(bool value);
118 
120 
122  //using control::create;
128  static status_bar create(const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
135  static status_bar create(const control& parent, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
137 
139 
145 
151 
152  protected:
153  friend status_bar_panel;
154  friend form;
155 
157 
159  forms::create_params create_params() const noexcept override;
160  xtd::drawing::font default_font() const noexcept override;
161  drawing::size default_size() const noexcept override;
163 
165 
174  virtual void on_draw_item(xtd::forms::status_bar_draw_item_event_args& e);
175 
183  virtual void on_panel_click(const xtd::forms::status_bar_panel_click_event_args& e);
184 
185  void on_handle_created(const event_args& e) override;
186  void on_handle_destroyed(const event_args& e) override;
187 
188  void on_main_panel_paint(object& sender, xtd::forms::paint_event_args& e);
189 
190  void on_paint(xtd::forms::paint_event_args& e) override;
191  void on_resize(const event_args& e) override;
192  void wnd_proc(message& message) override;
194 
195  private:
196  void fill();
197 
198  bool is_horizontal() const noexcept;
199  bool is_system_status_bar() const noexcept;
200  status_bar& is_system_status_bar(bool value);
201 
202  void on_control_appearance_changed(const xtd::event_args&) override;
203  void on_item_added(size_t pos, status_bar_panel_ref item);
204  void on_item_updated(size_t pos, status_bar_panel_ref item);
205  void on_item_removed(size_t pos, status_bar_panel_ref item);
206 
207  void resize_spring_panels();
208  void update_status_bar_panel_control(intptr handle, const xtd::ustring& text, const xtd::ustring& tool_tip_text, const xtd::drawing::image& image, xtd::forms::horizontal_alignment alignment, xtd::forms::status_bar_panel_auto_size auto_size, xtd::forms::status_bar_panel_border_style border_style, xtd::forms::status_bar_panel_style panel_style, int32 min_width, int32 width);
209 
210  std::shared_ptr<data> data_;
211  };
212  }
213 }
std::reference_wrapper< status_bar_panel > status_bar_panel_ref
Represents a xtd::forms::status_bar_item reference.
Definition: status_bar_panel.h:264
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:151
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
Contains xtd::forms::panel container.
xtd::event< status_bar, xtd::forms::status_bar_draw_item_event_handler > draw_item
Occurs when a visual aspect of an owner-drawn status bar control changes.
Definition: status_bar.h:144
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
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 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
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
All the control&#39;s edges are docked to the all edges of its containing control and sized appropriately...
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
Represents a collection of objects.
Definition: arranged_element_collection.h:31
xtd::forms::style_sheets::control status_bar_panel
The buttton data allows you to specify the box of a status_bar_panel control.
Definition: status_bar_panel.h:23
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
Represents an event.
Definition: event.h:21
Provides data for the xtd::forms::tool_bar::button_click event.
Definition: status_bar_panel_click_event_args.h:23
Provides data for the xtd::forms::control::paint event.
Definition: paint_event_args.h:28
Contains xtd::forms::status_bar_panel_click_event_handler event handler.
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
Specifies that the width of the control is defined.
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::status_bar_draw_item_event_handler event handler.
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
xtd::forms::style_sheets::control form
The form data allows you to specify the box of a form control.
Definition: form.h:21
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
dock_style
Specifies the position and manner in which a control is docked.
Definition: dock_style.h:21
xtd::event< status_bar, xtd::forms::status_bar_panel_click_event_handler > panel_click
Occurs when a xtd::forms::status_bar_panel object on a xtd::forms::status_bar control is clicked...
Definition: status_bar.h:149
Contains xtd::forms::status_bar_panel container.
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
Provides data for the xtd::forms::status_bar::draw_item event.
Definition: status_bar_draw_item_event_args.h:23
Specifies that both the x and y coordinates of the control are defined.
Represents a Windows status bar control.
Definition: status_bar.h:46
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