xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::status_bar_panel Class Reference
Inheritance diagram for xtd::forms::status_bar_panel:
xtd::forms::component xtd::iclonable xtd::iequatable< status_bar_panel > xtd::object xtd::interface xtd::interface xtd::equality_operators< type_t, equatable_t >

Definition

Represents a xtd::forms::status_bar panel.

Header
#include <xtd/forms/status_bar_panel>
Namespace
xtd::forms
Library
xtd.forms
Examples
The following code example demonstrates the use of xtd::forms::status_bar_panel control.
#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/progress_bar>
#include <xtd/forms/status_bar>
#include <xtd/forms/timer>
#include <xtd/drawing/pens>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace status_bar_example {
class form1 : public form {
public:
form1() {
text("Status bar example");
client_size({820, 500});
status_bar1.parent(*this);
status_bar1.panels().push_back_range({status_bar_panel1, status_bar_panel2, status_bar_panel3, status_bar_panel4});
status_bar1.show_panels(true);
status_bar_panel1.border_style(xtd::forms::status_bar_panel_border_style::sunken);
status_bar_panel1.tool_tip_text("Status one tool tip text");
status_bar_panel2.border_style(xtd::forms::status_bar_panel_border_style::sunken);
status_bar_panel3.auto_size(xtd::forms::status_bar_panel_auto_size::spring);
status_bar_panel3.border_style(xtd::forms::status_bar_panel_border_style::sunken);
status_bar_panel4.border_style(xtd::forms::status_bar_panel_border_style::sunken);
timer1.interval_milliseconds(50);
timer1.tick += [&] {
progress_bar1.value(progress_bar1.value() < progress_bar1.maximum() ? progress_bar1.value() + 1 : progress_bar1.minimum());
};
timer1.enabled(true);
}
private:
static auto image_from_color(const xtd::drawing::color& color)->image {
auto colored_bitmap = bitmap{16, 16};
auto g = graphics::from_image(colored_bitmap);
g.fill_ellipse(solid_brush(color), 0, 0, colored_bitmap.width(), colored_bitmap.height());
g.draw_ellipse(pens::black(), 0, 0, colored_bitmap.width() - 1, colored_bitmap.height() - 1);
return colored_bitmap;
}
forms::status_bar status_bar1;
status_bar_panel status_bar_panel1 = status_bar_panel::create_panel("Status one", image_from_color(color::light_green));
status_bar_panel status_bar_panel2 = status_bar_panel::create_panel("Status two");
status_bar_panel status_bar_panel3 = status_bar_panel::create_panel("Status three");
timer timer1;
progress_bar progress_bar1;
status_bar_panel status_bar_panel4 = status_bar_panel::create_control(progress_bar1);
};
}
auto main() -> int {
application::run(status_bar_example::form1 {});
}
Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes....
Definition bitmap.hpp:26
Represents an ARGB (alpha, red, green, blue) color.
Definition color.hpp:49
Defines a xtd::drawing::brush of a single color. Brushes are used to fill graphics shapes,...
Definition solid_brush.hpp:30
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Represents a Windows progress bar control.
Definition progress_bar.hpp:40
Represents a xtd::forms::status_bar panel.
Definition status_bar_panel.hpp:46
Represents a Windows status bar control.
Definition status_bar.hpp:48
Implements a timer that raises an event at user-defined intervals. This timer is optimized for use in...
Definition timer.hpp:38
@ g
The G key.
@ sunken
Defines a sunken border. Same as xtd::forms::status_bar_panel_border_style::inset.
@ text
The xtd::forms::status_bar_panel displays text in the standard font.
@ spring
The xtd::forms::status_bar_panel shares the available space on the xtd::forms::status_bar (the space ...
@ contents
The width of the xtd::forms::status_bar_panel is determined by its contents.
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:11
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Remarks
A xtd::forms::status_bar_panel represents an individual panel in the xtd::forms::status_bar::status_bar_panel_collection of a xtd::forms::status_bar control. A xtd::forms::status_bar_panel can contain text and/or an image that can be used to reflect the status of an application. Use the xtd::forms::status_bar::status_bar_panel_collection, accessible through the xtd::forms::status_bar::panels property of a xtd::forms::status_bar control, to retrieve, add, or remove an individual xtd::forms::status_bar_panel.
The xtd::forms::status_bar_panel provides properties that enable you to modify the display behavior of a panel within a xtd::forms::status_bar control. You can use the xtd::forms::status_bar_panel::image property to display an image within a panel. This property can be used to provide a graphical representation of state in an application. The xtd::forms::status_bar_panel::alignment property enables you to specify how text and/or an image is aligned within the panel. To ensure that your panel is sized properly to fit the text of the panel, you can use the xtd::forms::status_bar_panel::auto_size property to automatically resize the panel to fit the text of the panel or to fill the remaining space within the xtd::forms::status_bar control. The xtd::forms::status_bar_panel::min_width property enables you to specify a minimum width for the panel to ensure that it does not get smaller than the data it is intended to display.
The xtd::forms::status_bar control is typically used to display Help information or state information about your application. Often, it is important to display additional information about data that is presented in a panel. You can use the xtd::forms::status_bar_panel::tool_tip_text property to display information whenever the mouse pointer rests on a panel.
Although the xtd::forms::status_bar control is typically used to display textual information, you can also provide your own type of display to a xtd::forms::status_bar_panel. The xtd::forms::status_bar_panel::style property enables you to specify how the xtd::forms::status_bar_panel will be drawn. By default, the xtd::forms::status_bar_panel::style property is used to display the value of the xtd::forms::status_bar_panel_style::text property (and an image, if specified in the xtd::forms::status_bar_panel::image property). If the property is set to xtd::forms::status_bar_panel_style::owner_draw, you can draw your own information into the panel. You can use this feature to draw a progress bar or an animated image in the panel.
When you create an instance of the xtd::forms::status_bar_panel class, the read/write properties are set to initial values. For a list of these values, see the xtd::forms::status_bar_panel::status_bar_panel constructor.
Examples
status_bar.cpp.

Public Constructors

 status_bar_panel ()
 Initialises a new instance of xtd::forms::status_bar_panel class.
 

Public Properties

xtd::forms::horizontal_alignment alignment () const noexcept
 Gets the alignment of text and icons within the status bar panel.
 
status_bar_panelalignment (xtd::forms::horizontal_alignment value)
 Sets the alignment of text and icons within the status bar panel.
 
xtd::forms::status_bar_panel_auto_size auto_size () const noexcept
 Gets a value indicating whether the status bar panel is automatically resized.
 
status_bar_panelauto_size (xtd::forms::status_bar_panel_auto_size value)
 Sets a value indicating whether the status bar panel is automatically resized.
 
xtd::forms::status_bar_panel_border_style border_style () const noexcept
 Gets the border style of the status bar panel.
 
status_bar_panelborder_style (xtd::forms::status_bar_panel_border_style value)
 Sets the border style of the status bar panel.
 
std::optional< control_refcontrol () const noexcept
 Gets the control to be displayed in the control status bar panel.
 
status_bar_panelcontrol (const xtd::forms::control &value)
 Sets the control to be displayed in the control status bar panel.
 
status_bar_panelcontrol (std::nullptr_t value)
 Resets the control to be displayed in the control status bar panel.
 
const xtd::drawing::imageimage () const noexcept
 Gets the image to display within the status bar panel.
 
status_bar_panelimage (const xtd::drawing::image &value)
 Sets the image to display within the 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.
 
status_bar_panelmin_width (int32 value)
 Sets the minimum allowed width of the status bar panel within the xtd::forms::status_bar control.
 
const xtd::stringname () const noexcept
 Gets the name of the xtd::forms::status_bar_panel.
 
status_bar_panelname (const xtd::string &value)
 Sets the name of the xtd::forms::status_bar_panel.
 
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.
 
xtd::forms::status_bar_panel_style style () const noexcept
 Gets the style of the status bar panel.
 
status_bar_panelstyle (xtd::forms::status_bar_panel_style value)
 Sets the style of the status bar panel.
 
std::any tag () const noexcept
 Gets an object that contains data about the xtd::forms::status_bar_panel.
 
status_bar_paneltag (std::any value)
 Sets an object that contains data about the xtd::forms::status_bar_panel.
 
const xtd::stringtext () const noexcept
 Gets the text of the status bar panel.
 
status_bar_paneltext (const xtd::string &value)
 Sets the text of the status bar panel.
 
const xtd::stringtool_tip_text () const noexcept
 Gets ToolTip text associated with the status bar panel.
 
status_bar_paneltool_tip_text (const xtd::string &value)
 Sets ToolTip text associated with the status bar panel.
 
int32 width () const noexcept
 Gets the width of the status bar panel within the xtd::forms::status_bar control.
 
status_bar_panelwidth (int32 value)
 Sets the width of the status bar panel within the xtd::forms::status_bar control.
 

Public Methods

void begin_init ()
 Begins the initialization of a xtd::forms::status_bar_panel.
 
bool equals (const status_bar_panel &other) const noexcept override
 
void end_init ()
 Ends the initialization of a xtd::forms::status_bar_panel.
 
xtd::string to_string () const noexcept override
 Returns a string that represents the xtd::forms::status_bar_panel control.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 

Public Static Methods

static status_bar_panel create_control (const xtd::string &text, const xtd::forms::control &control)
 A factory to create a control status bar panel with specified text and control.
 
static status_bar_panel create_control (const xtd::forms::control &control)
 A factory to create a control status bar panel with specified control.
 
static status_bar_panel create_panel (const xtd::string &text)
 A factory to create a status bar panel with specified text.
 
static status_bar_panel create_panel (const xtd::drawing::image &image)
 A factory to create a status bar panel with specified image index.
 
static status_bar_panel create_panel (const xtd::string &text, const xtd::drawing::image &image)
 A factory to create a status bar panel with specified text and image index.
 

Protected Methods

xtd::uptr< xtd::objectclone () const override
 Creates a new object that is a copy of the current instance.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
- Public Member Functions inherited from xtd::iclonable
- Public Member Functions inherited from xtd::iequatable< status_bar_panel >
virtual bool equals (const status_bar_panel &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 
- Protected Member Functions inherited from xtd::forms::component
 component ()
 Initialises a new instance of the component class.
 
virtual bool can_raise_events () const noexcept
 Gets a value indicating whether the component can raise an event.
 
bool design_mode () const noexcept
 Gets a value that indicates whether the component is currently in design mode.
 

Constructor & Destructor Documentation

◆ status_bar_panel()

Member Function Documentation

◆ alignment() [1/2]

xtd::forms::horizontal_alignment xtd::forms::status_bar_panel::alignment ( ) const
noexcept

Gets the alignment of text and icons within the status bar panel.

Returns
One of the xtd::forms::horizontal_alignment values. The default is xtd::forms::horizontal_alignment::left.
Remarks
You can use this property to horizontally align the text and/or image assigned to the xtd::forms::status_bar_panel::image property within the borders of the panel. Text and im ge can be aligned to the left, right, or center of the xtd::forms::status_bar_panel. There is no way to independently position animage within the xtd::forms::status_bar_panel. For example, you cannot position an icon to the left side of the xtd::forms::status_bar_panel while aligning the text on the right side. The image is always positioned to the left side of the text regardless of how the text is aligned.

◆ alignment() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::alignment ( xtd::forms::horizontal_alignment  value)

Sets the alignment of text and icons within the status bar panel.

Parameters
valueOne of the xtd::forms::horizontal_alignment values. The default is xtd::forms::horizontal_alignment::left.
Returns
This current instance.
Remarks
You can use this property to horizontally align the text and/or image assigned to the xtd::forms::status_bar_panel::image property within the borders of the panel. Text and im ge can be aligned to the left, right, or center of the xtd::forms::status_bar_panel. There is no way to independently position animage within the xtd::forms::status_bar_panel. For example, you cannot position an icon to the left side of the xtd::forms::status_bar_panel while aligning the text on the right side. The image is always positioned to the left side of the text regardless of how the text is aligned.

◆ auto_size() [1/2]

xtd::forms::status_bar_panel_auto_size xtd::forms::status_bar_panel::auto_size ( ) const
noexcept

Gets a value indicating whether the status bar panel is automatically resized.

Returns
One of the xtd::forms::status_bar_panel_auto_size values. The default is xtd::forms::status_bar_panel_auto_size::none.
Remarks
xtd::forms::status_bar_panel objects set to xtd::forms::status_bar_panel_auto_size::contents have precedence over those panels set to the xtd::forms::status_bar_panel_auto_size::spring value. For example, a xtd::forms::status_bar_panel that has its xtd::forms::status_bar_panel::auto_size property set to xtd::forms::status_bar_panel_auto_size::spring is shortened if a xtd::forms::status_bar_panel with the xtd::forms::status_bar_panel::auto_size property set to xtd::forms::status_bar_panel_auto_size::contents requires that space.
You can use xtd::forms::status_bar_panel::auto_size to ensure that the contents of a xtd::forms::status_bar_panel are properly displayed in a xtd::forms::status_bar control that contains more than one panel. For example, you might want a panel that contains text to adjust automatically to the amount of text it is displaying (xtd::forms::status_bar_panel_auto_size::contents), while another panel on the xtd::forms::status_bar that displays an owner-drawn progress bar would need to be a fixed size (xtd::forms::status_bar_panel_auto_size::none).

◆ auto_size() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::auto_size ( xtd::forms::status_bar_panel_auto_size  value)

Sets a value indicating whether the status bar panel is automatically resized.

Parameters
valueOne of the xtd::forms::status_bar_panel_auto_size values. The default is xtd::forms::status_bar_panel_auto_size::none.
Returns
This current instance.
Remarks
xtd::forms::status_bar_panel objects set to xtd::forms::status_bar_panel_auto_size::contents have precedence over those panels set to the xtd::forms::status_bar_panel_auto_size::spring value. For example, a xtd::forms::status_bar_panel that has its xtd::forms::status_bar_panel::auto_size property set to xtd::forms::status_bar_panel_auto_size::spring is shortened if a xtd::forms::status_bar_panel with the xtd::forms::status_bar_panel::auto_size property set to xtd::forms::status_bar_panel_auto_size::contents requires that space.
You can use xtd::forms::status_bar_panel::auto_size to ensure that the contents of a xtd::forms::status_bar_panel are properly displayed in a xtd::forms::status_bar control that contains more than one panel. For example, you might want a panel that contains text to adjust automatically to the amount of text it is displaying (xtd::forms::status_bar_panel_auto_size::contents), while another panel on the xtd::forms::status_bar that displays an owner-drawn progress bar would need to be a fixed size (xtd::forms::status_bar_panel_auto_size::none).

◆ border_style() [1/2]

xtd::forms::status_bar_panel_border_style xtd::forms::status_bar_panel::border_style ( ) const
noexcept

Gets the border style of the status bar panel.

Returns
One of the xtd::forms::status_bar_panel_border_style values. The default is xtd::forms::status_bar_panel_border_style::sunken.
Remarks
You can use this property to differentiate a panel from other panels in a xtd::forms::status_bar control.

◆ border_style() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::border_style ( xtd::forms::status_bar_panel_border_style  value)

Sets the border style of the status bar panel.

Parameters
valueOne of the xtd::forms::status_bar_panel_border_style values. The default is xtd::forms::status_bar_panel_border_style::sunken.
Returns
This current instance.
Remarks
You can use this property to differentiate a panel from other panels in a xtd::forms::status_bar control.

◆ control() [1/3]

std::optional< control_ref > xtd::forms::status_bar_panel::control ( ) const
noexcept

Gets the control to be displayed in the control status bar panel.

Returns
A xtd::forms::control to be displayed in the control status bar panel. The default is std::nullopt.
Remarks
You can specify a xtd::forms::control to be displayed. This property is not used unless the xtd::forms::status_bar_panel::style property value is set to xtd::forms::status_bar_panel_style::control.

◆ control() [2/3]

status_bar_panel & xtd::forms::status_bar_panel::control ( const xtd::forms::control value)

Sets the control to be displayed in the control status bar panel.

Parameters
valueA xtd::forms::control to be displayed in the control status bar panel. The default is std::nullopt.
Returns
This current instance.
Remarks
You can specify a xtd::forms::control to be displayed. This property is not used unless the xtd::forms::status_bar_panel::style property value is set to xtd::forms::status_bar_panel_style::control.

◆ control() [3/3]

status_bar_panel & xtd::forms::status_bar_panel::control ( std::nullptr_t  value)

Resets the control to be displayed in the control status bar panel.

Parameters
valuenullptr.
Returns
This current instance.
Remarks
You can specify a xtd::forms::control to be displayed. This property is not used unless the xtd::forms::status_bar_panel::style property value is set to xtd::forms::status_bar_panel_style::control.

◆ image() [1/2]

const xtd::drawing::image & xtd::forms::status_bar_panel::image ( ) const
noexcept

Gets the image to display within the status bar panel.

Returns
An xtd::drawing::image that represents the image to display in the panel.
Remarks
You can use this property to display an image that represents the state of your application or a process within your application. For example, you can display an image in a xtd::forms::status_bar_panel to indicate whether a file save operation is in progress or complete.
Note
There is no way to independently position an image within the xtd::forms::status_bar_panel. For example, you cannot position an image to the left side of the xtd::forms::status_bar_panel while aligning the text on the right side using the xtd::forms::status_bar_panel::alignment property. The image is always positioned to the left side of the panel's text regardless of how the text is aligned.

◆ image() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::image ( const xtd::drawing::image value)

Sets the image to display within the status bar panel.

Parameters
valueAn xtd::drawing::image that represents the image to display in the panel.
Returns
This current instance.
Remarks
You can use this property to display an image that represents the state of your application or a process within your application. For example, you can display an image in a xtd::forms::status_bar_panel to indicate whether a file save operation is in progress or complete.
Note
There is no way to independently position an image within the xtd::forms::status_bar_panel. For example, you cannot position an image to the left side of the xtd::forms::status_bar_panel while aligning the text on the right side using the xtd::forms::status_bar_panel::alignment property. The image is always positioned to the left side of the panel's text regardless of how the text is aligned.

◆ min_width() [1/2]

int32 xtd::forms::status_bar_panel::min_width ( ) const
noexcept

Gets the minimum allowed width of the status bar panel within the xtd::forms::status_bar control.

Returns
The minimum width, in pixels, of the xtd::forms::status_bar_panel
Remarks
The xtd::forms::status_bar_panel::min_width property is used when the xtd::forms::status_bar_panel::auto_size property is set to xtd::forms::status_bar_panel_auto_size::contents or xtd::forms::status_bar_panel_auto_size::spring to prevent the xtd::forms::status_bar_panel from automatically resizing to a width that is too small. When the xtd::forms::status_bar_panel::auto_size property is set to xtd::forms::status_bar_panel_auto_size::none, the xtd::forms::status_bar_panel::min_width property is automatically set to the same value as the xtd::forms::status_bar_panel::width property.

◆ min_width() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::min_width ( int32  value)

Sets the minimum allowed width of the status bar panel within the xtd::forms::status_bar control.

Parameters
valueThe minimum width, in pixels, of the xtd::forms::status_bar_panel
Exceptions
xtd::argument_exceptionA value less than 0 is assigned to the property.
Remarks
The xtd::forms::status_bar_panel::min_width property is used when the xtd::forms::status_bar_panel::auto_size property is set to xtd::forms::status_bar_panel_auto_size::contents or xtd::forms::status_bar_panel_auto_size::spring to prevent the xtd::forms::status_bar_panel from automatically resizing to a width that is too small. When the xtd::forms::status_bar_panel::auto_size property is set to xtd::forms::status_bar_panel_auto_size::none, the xtd::forms::status_bar_panel::min_width property is automatically set to the same value as the xtd::forms::status_bar_panel::width property.

◆ name() [1/2]

const xtd::string & xtd::forms::status_bar_panel::name ( ) const
noexcept

◆ name() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::name ( const xtd::string value)

Sets the name of the xtd::forms::status_bar_panel.

Parameters
valueThe name of the xtd::forms::status_bar_panel.
Returns
This current instance.
Remarks
The xtd::forms::status_bar_panel::name property corresponds to the key for a xtd::forms::status_bar_panel in the xtd::forms::status_bar::status_bar_panel_collection.

◆ parent()

std::optional< std::reference_wrapper< xtd::forms::status_bar > > xtd::forms::status_bar_panel::parent ( ) const
noexcept

Gets the xtd::forms::status_bar control that the status bar panel is assigned to.

Returns
The xtd::forms::status_bar control that the xtd::forms::status_bar_panel is assigned to.

◆ style() [1/2]

xtd::forms::status_bar_panel_style xtd::forms::status_bar_panel::style ( ) const
noexcept

Gets the style of the status bar panel.

Returns
One of the xtd::forms::status_bar_panel_style values. The default is xtd::forms::status_bar_panel_style::text.
Remarks
You can use this property to indicate whether a xtd::forms::status_bar_panel displays text or whether the panel is managed as an owner-drawn xtd::forms::status_bar_panel. To determine when a xtd::forms::status_bar_panel needs to be drawn, create an event handler for the xtd::forms::status_bar::draw_item event of the xtd::forms::status_bar control. The xtd::forms::status_bar_draw_item_event_args passed as a parameter to an event handler of the xtd::forms::status_bar::draw_item event enables you to determine which panel needs to be drawn. The xtd::forms::status_bar_draw_item_event_args also provides a xtd::drawing::graphics object you can use to perform drawing tasks on the xtd::forms::status_bar_panel.

◆ style() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::style ( xtd::forms::status_bar_panel_style  value)

Sets the style of the status bar panel.

Parameters
valueOne of the xtd::forms::status_bar_panel_style values. The default is xtd::forms::status_bar_panel_style::text.
Returns
This current instance.
Remarks
You can use this property to indicate whether a xtd::forms::status_bar_panel displays text or whether the panel is managed as an owner-drawn xtd::forms::status_bar_panel. To determine when a xtd::forms::status_bar_panel needs to be drawn, create an event handler for the xtd::forms::status_bar::draw_item event of the xtd::forms::status_bar control. The xtd::forms::status_bar_draw_item_event_args passed as a parameter to an event handler of the xtd::forms::status_bar::draw_item event enables you to determine which panel needs to be drawn. The xtd::forms::status_bar_draw_item_event_args also provides a xtd::drawing::graphics object you can use to perform drawing tasks on the xtd::forms::status_bar_panel.

◆ tag() [1/2]

std::any xtd::forms::status_bar_panel::tag ( ) const
noexcept

Gets an object that contains data about the xtd::forms::status_bar_panel.

Returns
An std::any that contains data about the xtd::forms::status_bar_panel. The default is empty.
Remarks
Retrieves or assigns the data currently associated with the xtd::forms::status_bar_panel. Any std::any type can be assigned to this property.

◆ tag() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::tag ( std::any  value)

Sets an object that contains data about the xtd::forms::status_bar_panel.

Parameters
valueAn std::any that contains data about the xtd::forms::status_bar_panel. The default is empty.
Returns
This current instance.
Remarks
Retrieves or assigns the data currently associated with the xtd::forms::status_bar_panel. Any std::any type can be assigned to this property.

◆ text() [1/2]

const xtd::string & xtd::forms::status_bar_panel::text ( ) const
noexcept

Gets the text of the status bar panel.

Returns
The text displayed in the panel. The default is an empty string ("").
Remarks
This property represents the text that is displayed when the xtd::forms::status_bar_panel::style property is set to xtd::forms::status_bar_panel::text. You can use this property to display information about your application in a xtd::forms::status_bar control. For example, you can use the xtd::forms::status_bar_panel::text property to display Help information when the user moves the mouse over a menu or to display the name and location of a file that is opened in an application. To align the text within a xtd::forms::status_bar_panel, use the xtd::forms::status_bar_panel::alignment property.

◆ text() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::text ( const xtd::string value)

Sets the text of the status bar panel.

Parameters
valueThe text displayed in the panel. The default is an empty string ("").
Returns
This current instance.
Remarks
This property represents the text that is displayed when the xtd::forms::status_bar_panel::style property is set to xtd::forms::status_bar_panel::text. You can use this property to display information about your application in a xtd::forms::status_bar control. For example, you can use the xtd::forms::status_bar_panel::text property to display Help information when the user moves the mouse over a menu or to display the name and location of a file that is opened in an application. To align the text within a xtd::forms::status_bar_panel, use the xtd::forms::status_bar_panel::alignment property.

◆ tool_tip_text() [1/2]

const xtd::string & xtd::forms::status_bar_panel::tool_tip_text ( ) const
noexcept

Gets ToolTip text associated with the status bar panel.

Returns
The ToolTip text for the panel.
Remarks
You can use this property to display additional information in a ToolTip when the mouse pointer rests on a xtd::forms::status_bar_panel. For example, you can display a ToolTip that provides data transfer speed for a xtd::forms::status_bar_panel that displays the status of a file transfer.
To display ToolTips for other controls in your application, use the xtd::forms::tool_tip control.

◆ tool_tip_text() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::tool_tip_text ( const xtd::string value)

Sets ToolTip text associated with the status bar panel.

Parameters
valueThe ToolTip text for the panel.
Returns
This current instance.
Remarks
You can use this property to display additional information in a ToolTip when the mouse pointer rests on a xtd::forms::status_bar_panel. For example, you can display a ToolTip that provides data transfer speed for a xtd::forms::status_bar_panel that displays the status of a file transfer.
To display ToolTips for other controls in your application, use the xtd::forms::tool_tip control.

◆ width() [1/2]

int32 xtd::forms::status_bar_panel::width ( ) const
noexcept

Gets the width of the status bar panel within the xtd::forms::status_bar control.

Returns
The width, in pixels, of the xtd::forms::status_bar_panel.
Remarks
The xtd::forms::status_bar_panel::width property always reflects the actual width of a xtd::forms::status_bar_panel and cannot be smaller than the xtd::forms::status_bar_panel::min_width property. To automatically resize the width of the xtd::forms::status_bar_panel to the contents of the xtd::forms::status_bar_panel, you can use the xtd::forms::status_bar_panel::auto_size property.

◆ width() [2/2]

status_bar_panel & xtd::forms::status_bar_panel::width ( int32  value)

Sets the width of the status bar panel within the xtd::forms::status_bar control.

Parameters
valueThe width, in pixels, of the xtd::forms::status_bar_panel.
Returns
This current instance.
Remarks
The xtd::forms::status_bar_panel::width property always reflects the actual width of a xtd::forms::status_bar_panel and cannot be smaller than the xtd::forms::status_bar_panel::min_width property. To automatically resize the width of the xtd::forms::status_bar_panel to the contents of the xtd::forms::status_bar_panel, you can use the xtd::forms::status_bar_panel::auto_size property.

◆ begin_init()

void xtd::forms::status_bar_panel::begin_init ( )

Begins the initialization of a xtd::forms::status_bar_panel.

Remarks
This method is used to start the initialization of a component that is used on a form or used by another component. The xtd::forms::status_bar_panel::end_init method ends the initialization. Using the xtd::forms::status_bar_panel::begin_init and xtd::forms::status_bar_panel::end_init methods prevents the control from being used before it is fully initialized.

◆ end_init()

void xtd::forms::status_bar_panel::end_init ( )

Ends the initialization of a xtd::forms::status_bar_panel.

Remarks
This method is used to end the initialization of a component that is used on a form or used by another component. The xtd::forms::status_bar_panel::end_init method ends the initialization. Using the xtd::forms::status_bar_panel::begin_init and xtd::forms::status_bar_panel::end_init methods prevents the control from being used before it is fully initialized.

◆ to_string()

xtd::string xtd::forms::status_bar_panel::to_string ( ) const
overridevirtualnoexcept

Returns a string that represents the xtd::forms::status_bar_panel control.

Returns
A xtd::string that represents the current xtd::forms::status_bar_panel.
Remarks
The xtd::forms::status_bar_panel::to_string method returns a string that includes the type and the value of the xtd::forms::status_bar_panel::style and xtd::forms::status_bar_panel::text properties.

Reimplemented from xtd::object.

◆ create_control() [1/2]

static status_bar_panel xtd::forms::status_bar_panel::create_control ( const xtd::string text,
const xtd::forms::control control 
)
static

A factory to create a control status bar panel with specified text and control.

Parameters
textThe text displayed on the status bar panel.
controlA xtd::forms::control to be displayed in the control status bar panel.
Returns
New xtd::forms::status_bar_panel created.

◆ create_control() [2/2]

static status_bar_panel xtd::forms::status_bar_panel::create_control ( const xtd::forms::control control)
static

A factory to create a control status bar panel with specified control.

Parameters
controlA xtd::forms::control to be displayed in the control status bar panel.
Returns
New xtd::forms::status_bar_panel created.

◆ create_panel() [1/3]

static status_bar_panel xtd::forms::status_bar_panel::create_panel ( const xtd::string text)
static

A factory to create a status bar panel with specified text.

Parameters
textThe text displayed on the status bar panel.
Returns
New xtd::forms::status_bar_panel created.

◆ create_panel() [2/3]

static status_bar_panel xtd::forms::status_bar_panel::create_panel ( const xtd::drawing::image image)
static

A factory to create a status bar panel with specified image index.

Parameters
imageThe xtd::drawing::image assigned to the status bar panel.
Returns
New xtd::forms::status_bar_panel created.

◆ create_panel() [3/3]

static status_bar_panel xtd::forms::status_bar_panel::create_panel ( const xtd::string text,
const xtd::drawing::image image 
)
static

A factory to create a status bar panel with specified text and image index.

Parameters
textThe text displayed on the status bar panel.
imageThe xtd::drawing::image assigned to the status bar panel.
Returns
New xtd::forms::status_bar_panel created.

◆ clone()

xtd::uptr< xtd::object > xtd::forms::status_bar_panel::clone ( ) const
overrideprotectedvirtual

Creates a new object that is a copy of the current instance.

Returns
A new object that is a copy of this instance.
Notes to Implementers
All controls must be override the clone method.

Implements xtd::iclonable.

◆ equals() [1/2]

virtual bool xtd::object::equals ( const object obj) const
virtualnoexcept

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.
Examples
The following code example compares the current instance with another object.
#include <xtd/console>
using namespace xtd;
auto main() -> int {
auto object1 = new_ptr<object>();
auto object2 = new_ptr<object>();
auto object3 = object2;
console::write_line(object1->equals(*object3));
console::write_line(*object1 == *object3);
object3 = object1;
console::write_line(object1->equals(*object3));
console::write_line(*object1 == *object3);
}
// This code produces the following output :
//
// false
// false
// true
// true
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...

Reimplemented from xtd::object.

◆ equals() [2/2]

template<typename object_a_t , typename object_b_t >
static bool xtd::object::equals ( const object_a_t &  object_a,
const object_b_t &  object_b 
)
inlinestaticnoexcept

Determines whether the specified object instances are considered equal.

Parameters
object_aThe first object to compare.
object_bThe second object to compare.
Returns
true if object_a is the same instance as object_b or if both are null references or if object_a(object_b) returns true. otherwise, false.
Examples
The following code example compares different objects.
#include <xtd/console>
using namespace xtd;
auto main() -> int {
string s1 = "Tom";
string s2 = "Carol";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "Tom";
s2 = "Tom";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "";
s2 = "Tom";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "Carol";
s2 = "";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "";
s2 = "";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
}
// This code produces the following output :
//
// object::equals("Tom", "Carol") => false
// object::equals("Tom", "Tom") => true
// object::equals("", "Tom") => false
// object::equals("Carol", "") => false
// object::equals("", "") => true
virtual bool equals(const object &obj) const noexcept
Determines whether the specified object is equal to the current object.

The documentation for this class was generated from the following file: