xtd 0.2.0
status_bar.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "panel.hpp"
9#include <memory>
10#include <vector>
11
13namespace xtd {
15 namespace forms {
17 class form;
19
49 struct data;
50 class status_bar_panel_control;
51 class sizing_grip_control;
52
53 public:
55
60
62
74
77 status_bar(const status_bar&) = default;
78 status_bar& operator =(const status_bar&) = default;
80
82
84 dock_style dock() const noexcept override;
86
90 const status_bar_panel_collection& panels() const noexcept;
95
99 virtual bool show_panels() const noexcept;
104 virtual status_bar& show_panels(bool value);
105
109 virtual bool show_tool_tips() const noexcept;
114 virtual status_bar& show_tool_tips(bool value);
115
119 virtual bool sizing_grip() const noexcept;
124 virtual status_bar& sizing_grip(bool value);
126
128
134
140
142
174 static status_bar create(const xtd::string& text);
179 static status_bar create(const xtd::string& text, const xtd::string& name);
184 static status_bar create(xtd::forms::dock_style style, const xtd::string& text);
190 static status_bar create(xtd::forms::dock_style style, const xtd::string& text, const xtd::string& name);
228 static status_bar create(const control& parent, const xtd::string& text);
234 static status_bar create(const control& parent, const xtd::string& text, const xtd::string& name);
240 static status_bar create(const control& parent, xtd::forms::dock_style style, const xtd::string& text);
247 static status_bar create(const control& parent, xtd::forms::dock_style style, const xtd::string& text, const xtd::string& name);
249
250 protected:
251 friend status_bar_panel;
252 friend form;
253
255
257 forms::create_params create_params() const noexcept override;
258 xtd::drawing::font default_font() const noexcept override;
259 drawing::size default_size() const noexcept override;
261
263
269 xtd::uptr<xtd::object> clone() const override;
270
279
288
289 void on_handle_created(const event_args& e) override;
290 void on_handle_destroyed(const event_args& e) override;
291
292 void on_main_panel_paint(object& sender, xtd::forms::paint_event_args& e);
293
294 void on_paint(xtd::forms::paint_event_args& e) override;
295 void on_resize(const event_args& e) override;
296 void wnd_proc(message& message) override;
298
299 private:
300 void fill();
301
302 bool is_horizontal() const noexcept;
303 bool is_system_status_bar() const noexcept;
304 status_bar& is_system_status_bar(bool value);
305
306 void on_control_appearance_changed(const xtd::event_args&) override;
307 void on_item_added(size_t pos, status_bar_panel_ref item);
308 void on_item_updated(size_t pos, status_bar_panel_ref item);
309 void on_item_removed(size_t pos, status_bar_panel_ref item);
310
311 void resize_spring_panels();
312 void update_status_bar_panel_control(intptr handle, const xtd::string& text, const xtd::string& 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);
313
314 xtd::sptr<data> data_;
315 };
316 }
317}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
Represents an event.
Definition event.hpp:21
virtual int32 width() const noexcept
Gets the width of the control.
intptr handle() const override
Gets the window handle that the control is bound to.
virtual drawing::font font() const noexcept
Gets the font of the text displayed by the control.
virtual const xtd::string & name() const noexcept
Gets the name of the control.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
virtual const xtd::string & text() const noexcept
Gets the text associated with this control.
virtual drawing::size size() const noexcept
Gets the height and width of the control.
virtual bool auto_size() const noexcept
Gets a value that indicates whether the control resizes based on its contents.
virtual std::optional< control_ref > parent() const noexcept
Gets the parent container of the control.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Represents a collection of objects.
Definition arranged_element_collection.hpp:35
Provides data for the xtd::forms::status_bar::draw_item event.
Definition status_bar_draw_item_event_args.hpp:25
Provides data for the xtd::forms::tool_bar::button_click event.
Definition status_bar_panel_click_event_args.hpp:25
void on_paint(xtd::forms::paint_event_args &e) override
Raises the xtd::forms::control::paint event.
status_bar()
Initializes a new instance of the xtd::forms::status_bar class.
void on_resize(const event_args &e) override
Raises the xtd::forms::control::region event.
virtual void on_draw_item(xtd::forms::status_bar_draw_item_event_args &e)
Raises the xtd::forms::status_bar::daw_item event.
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.hpp:133
dock_style dock() const noexcept override
Gets which control borders are docked to its parent control and determines how a control is resized w...
static status_bar create()
A factory to create an xtd::forms::status_bar.
drawing::size default_size() const noexcept override
Gets the default size of the control.
void on_handle_created(const event_args &e) override
Raises the xtd::forms::control::handle_created event.
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.hpp:138
void wnd_proc(message &message) override
Processes Windows messages.
forms::create_params create_params() const noexcept override
Gets the required creation parameters when the control handle is created.
virtual bool sizing_grip() const noexcept
Gets a value indicating whether a sizing grip is displayed in the lower-right corner of the control.
const status_bar_panel_collection & panels() const noexcept
Gets the collection of xtd::forms::status_bar panels contained within the control.
void on_handle_destroyed(const event_args &e) override
Raises the xtd::forms::control::handle_destroyed event.
virtual void on_panel_click(const xtd::forms::status_bar_panel_click_event_args &e)
Raises the xtd::forms::status_bar::panel_click event.
virtual bool show_tool_tips() const noexcept
Gets a value indicating whether the status bar displays a xtd::forms::tool_tip for each button.
xtd::forms::layout::arranged_element_collection< status_bar_panel_ref > status_bar_panel_collection
Represents the collection of panels in a xtd::forms::status_bar control.
Definition status_bar.hpp:58
virtual bool show_panels() const noexcept
Gets a value indicating whether any panels that have been added to the control are displayed.
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
xtd::drawing::font default_font() const noexcept override
Gets the default font of the control.
xtd::delegate< void(object &sender, const status_bar_panel_click_event_args &e)> status_bar_panel_click_event_handler
Represents the method that will handle the xtd::forms::tool_bar::button_click event of a xtd::forms::...
Definition status_bar_panel_click_event_handler.hpp:29
xtd::delegate< void(object &sender, const status_bar_draw_item_event_args &e)> status_bar_draw_item_event_handler
Represents the method that will handle the xtd::forms::status_bar::draw_item event of a xtd::forms::s...
Definition status_bar_draw_item_event_handler.hpp:29
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
std::reference_wrapper< status_bar_panel > status_bar_panel_ref
Represents a xtd::forms::status_bar_item reference.
Definition status_bar_panel.hpp:295
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.hpp:22
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.hpp:23
border_style
Specifies the border style for a control.
Definition border_style.hpp:22
dock_style
Specifies the position and manner in which a control is docked.
Definition dock_style.hpp:23
horizontal_alignment
Specifies how an object or text in a control is horizontally aligned relative to an element of the co...
Definition horizontal_alignment.hpp:22
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.hpp:22
@ e
The E key.
Definition keys.hpp:207
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Contains xtd::forms::panel container.
Contains xtd::forms::status_bar_draw_item_event_handler handler.
Contains xtd::forms::status_bar_panel container.
Contains xtd::forms::status_bar_panel_click_event_handler handler.
Implements a Windows message.
Definition message.hpp:33