Represents a toolbar button.
Public Constructors | |
| tool_bar_button () | |
| Initialises a new instance of xtd::forms::tool_bar_button class. | |
| tool_bar_button (const xtd::string &text) | |
| Initializes a new instance of the xtd::forms::tool_bar_button class and displays the assigned text on the button. | |
Public Properties | |
| std::optional< xtd::forms::control_ref > | control () const noexcept |
| Gets the control to be displayed in the control toolbar button. | |
| tool_bar_button & | control (const xtd::forms::control &value) |
| Sets the control to be displayed in the control toolbar button. | |
| tool_bar_button & | control (std::nullptr_t value) |
| Resets the control to be displayed in the control toolbar button. | |
| std::optional< xtd::ref< xtd::forms::context_menu > > | drop_down_menu () const noexcept |
| Gets the menu to be displayed in the drop-down toolbar button. | |
| tool_bar_button & | drop_down_menu (const xtd::forms::context_menu &value) |
| Sets the menu to be displayed in the drop-down toolbar button. | |
| tool_bar_button & | drop_down_menu (std::nullptr_t value) |
| Resets the menu to be displayed in the drop-down toolbar button. | |
| bool | enabled () const noexcept |
| Gets a value indicating whether the button is enabled. | |
| tool_bar_button & | enabled (bool value) |
| Sets a value indicating whether the button is enabled. | |
| size_t | image_index () const noexcept |
| Gets the index value of the image assigned to the button. | |
| tool_bar_button & | image_index (size_t value) |
| Sets the index value of the image assigned to the button. | |
| const xtd::string & | name () const noexcept |
| Gets the name of the button. | |
| tool_bar_button & | name (const xtd::string &value) |
| Sets the name of the button. | |
| std::optional< xtd::ref< xtd::forms::tool_bar > > | parent () const noexcept |
| Gets the toolbar control that the toolbar button is assigned to. | |
| bool | pushed () const noexcept |
| Gets a value indicating whether a toggle-style toolbar button is currently in the pushed state. | |
| tool_bar_button & | pushed (bool value) |
| Sets a value indicating whether a toggle-style toolbar button is currently in the pushed state. | |
| const xtd::drawing::rectangle & | rectangle () const noexcept |
| Gets the bounding rectangle for a toolbar button. | |
| xtd::forms::tool_bar_button_style | style () const noexcept |
| Gets the style of the toolbar button. | |
| tool_bar_button & | style (xtd::forms::tool_bar_button_style value) |
| Sets the style of the toolbar button. | |
| const xtd::any_object & | tag () const noexcept |
| Gets the object that contains data about the toolbar button. | |
| tool_bar_button & | tag (const xtd::any_object &value) |
| Sets the object that contains data about the toolbar button. | |
| const xtd::string & | text () const noexcept |
| Gets the text displayed on the toolbar button. | |
| tool_bar_button & | text (const xtd::string &value) |
| Sets the text displayed on the toolbar button. | |
| const xtd::string & | tool_tip_text () const noexcept |
| Gets the text that appears as a xtd::forms::tool_tip for the button. | |
| tool_bar_button & | tool_tip_text (const xtd::string &value) |
| Sets the text that appears as a xtd::forms::tool_tip for the button. | |
| bool | visible () const noexcept |
| Gets a value indicating whether the toolbar button is visible. | |
| tool_bar_button & | visible (bool value) |
| Sets a value indicating whether the toolbar button is visible. | |
Public Methods | |
| bool | equals (const xtd::object &obj) const noexcept override |
| Determines whether the specified object is equal to the current object. | |
| bool | equals (const tool_bar_button &other) const noexcept override |
| Determines whether the specified object is equal to the current object. | |
| xtd::size | get_hash_code () const noexcept override |
| Serves as a hash function for a particular type. | |
| xtd::string | to_string () const noexcept override |
| Returns a string that represents the xtd::forms::tool_bar_button control. | |
Public Static Methods | |
| static tool_bar_button | create_control (const xtd::string &text, const xtd::forms::control &control) |
| A factory to create a control toolbar button with specified text and control. | |
| static tool_bar_button | create_control (const xtd::forms::control &control) |
| A factory to create a control toolbar button with specified control. | |
| static tool_bar_button | create_drop_down_button (const xtd::string &text, const xtd::forms::context_menu &drop_down_menu) |
| A factory to create a drop-down toolbar button with specified text and context menu. | |
| static tool_bar_button | create_drop_down_button (size_t image_index, const xtd::forms::context_menu &drop_down_menu) |
| A factory to create a drop-down toolbar button with specified image index and context menu. | |
| static tool_bar_button | create_drop_down_button (const xtd::string &text, size_t image_index, const xtd::forms::context_menu &drop_down_menu) |
| A factory to create a drop-down toolbar button with specified text, image index and context menu. | |
| static tool_bar_button | create_push_button (const xtd::string &text) |
| A factory to create a toolbar button with specified text. | |
| static tool_bar_button | create_push_button (size_t image_index) |
| A factory to create a toolbar button with specified image index. | |
| static tool_bar_button | create_push_button (const xtd::string &text, size_t image_index) |
| A factory to create a toolbar button with specified text and image index. | |
| static tool_bar_button | create_separator () |
| A factory to create a toolbar separator. | |
| static tool_bar_button | create_stretchable_separator () |
| A factory to create a toolbar stretchable separator. | |
| static tool_bar_button | create_toggle_button (const xtd::string &text) |
| A factory to create a toolbar toggle button with specified text. | |
| static tool_bar_button | create_toggle_button (size_t image_index) |
| A factory to create a toolbar toggle button with specified image index. | |
| static tool_bar_button | create_toggle_button (const xtd::string &text, size_t image_index) |
| A factory to create a toolbar toggle button with specified text and image index. | |
Protected Methods | |
| xtd::uptr< xtd::object > | clone () const override |
| Creates a new object that is a copy of the current instance. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. | |
| template<class object_t> | |
| xtd::unique_ptr_object< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object. | |
| virtual bool | equals (const tool_bar_button &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type. | |
| template<class object_a_t, class 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<class object_a_t, class 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. | |
| 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. | |
| xtd::forms::tool_bar_button::tool_bar_button | ( | ) |
Initialises a new instance of xtd::forms::tool_bar_button class.
|
explicit |
Initializes a new instance of the xtd::forms::tool_bar_button class and displays the assigned text on the button.
| text | The text to display on the new xtd::forms::tool_bar_button. |
|
noexcept |
Gets the control to be displayed in the control toolbar button.
| tool_bar_button & xtd::forms::tool_bar_button::control | ( | const xtd::forms::control & | value | ) |
Sets the control to be displayed in the control toolbar button.
| value | A xtd::forms::control to be displayed in the control toolbar button. The default is std::nullopt. |
| tool_bar_button & xtd::forms::tool_bar_button::control | ( | std::nullptr_t | value | ) |
Resets the control to be displayed in the control toolbar button.
| value | nullptr. |
|
noexcept |
Gets the menu to be displayed in the drop-down toolbar button.
| tool_bar_button & xtd::forms::tool_bar_button::drop_down_menu | ( | const xtd::forms::context_menu & | value | ) |
Sets the menu to be displayed in the drop-down toolbar button.
| value | A xtd::forms::context_menu to be displayed in the drop-down toolbar button. The default is std::nullopt. |
| tool_bar_button & xtd::forms::tool_bar_button::drop_down_menu | ( | std::nullptr_t | value | ) |
Resets the menu to be displayed in the drop-down toolbar button.
| value | nullptr. |
|
noexcept |
Gets a value indicating whether the button is enabled.
true if the button is enabled; otherwise, false. The default is true. false, the toolbar button cannot be clicked, and the button's appearance changes. The xtd::drawing::image and xtd::forms::tool_bar_button::text assigned to the button appear grayed out. If the image or text has multiple colors, they display in a monochromatic gray. | tool_bar_button & xtd::forms::tool_bar_button::enabled | ( | bool | value | ) |
Sets a value indicating whether the button is enabled.
| value | true if the button is enabled; otherwise, false. The default is true. |
false, the toolbar button cannot be clicked, and the button's appearance changes. The xtd::drawing::image and xtd::forms::tool_bar_button::text assigned to the button appear grayed out. If the image or text has multiple colors, they display in a monochromatic gray.
|
noexcept |
Gets the index value of the image assigned to the button.
| tool_bar_button & xtd::forms::tool_bar_button::image_index | ( | size_t | value | ) |
Sets the index value of the image assigned to the button.
| value | The index value of the xtd::drawing::image assigned to the toolbar button. The default is xtd::forms::image_list::image_collection::npos. |
|
noexcept |
Gets the name of the button.
| tool_bar_button & xtd::forms::tool_bar_button::name | ( | const xtd::string & | value | ) |
Sets the name of the button.
| value | The name of the button. |
|
noexcept |
Gets the toolbar control that the toolbar button is assigned to.
|
noexcept |
Gets a value indicating whether a toggle-style toolbar button is currently in the pushed state.
false. The default is false. true, the toolbar button appears sunken or inset relative to the other buttons. This property has no effect unless the xtd::forms::tool_bar_button::style is set to xtd::forms::tool_bar_button_style::toggle_button. | tool_bar_button & xtd::forms::tool_bar_button::pushed | ( | bool | value | ) |
Sets a value indicating whether a toggle-style toolbar button is currently in the pushed state.
| value | rue if a toggle-style toolbar button is currently in the pushed state; otherwise, false. The default is false. |
true, the toolbar button appears sunken or inset relative to the other buttons. This property has no effect unless the xtd::forms::tool_bar_button::style is set to xtd::forms::tool_bar_button_style::toggle_button.
|
noexcept |
Gets the bounding rectangle for a toolbar button.
|
noexcept |
Gets the style of the toolbar button.
| tool_bar_button & xtd::forms::tool_bar_button::style | ( | xtd::forms::tool_bar_button_style | value | ) |
Sets the style of the toolbar button.
| value | One of the xtd::forms::tool_bar_button_style values. The default is xtd::forms::tool_bar_button_style::push_button. |
|
noexcept |
Gets the object that contains data about the toolbar button.
| tool_bar_button & xtd::forms::tool_bar_button::tag | ( | const xtd::any_object & | value | ) |
Sets the object that contains data about the toolbar button.
| value | An xtd::any_object that contains data about the toolbar button. The default is empty. |
|
noexcept |
Gets the text displayed on the toolbar button.
| tool_bar_button & xtd::forms::tool_bar_button::text | ( | const xtd::string & | value | ) |
Sets the text displayed on the toolbar button.
| value | The text displayed on the toolbar button. The default is an empty string (""). |
|
noexcept |
Gets the text that appears as a xtd::forms::tool_tip for the button.
true. | tool_bar_button & xtd::forms::tool_bar_button::tool_tip_text | ( | const xtd::string & | value | ) |
Sets the text that appears as a xtd::forms::tool_tip for the button.
| value | The text that is displayed when the mouse pointer moves over the toolbar button. The default is an empty string (""). |
true.
|
noexcept |
Gets a value indicating whether the toolbar button is visible.
true if the toolbar button is visible; otherwise, false. The default is true. | tool_bar_button & xtd::forms::tool_bar_button::visible | ( | bool | value | ) |
Sets a value indicating whether the toolbar button is visible.
| value | true if the toolbar button is visible; otherwise, false. The default is true. |
|
overridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
true if the specified object is equal to the current object. otherwise, false. Reimplemented from xtd::object.
|
overridenoexcept |
Determines whether the specified object is equal to the current object.
| other | The object to compare with the current object. |
true if the specified object is equal to the current object. otherwise, false.
|
overridevirtualnoexcept |
Serves as a hash function for a particular type.
Reimplemented from xtd::object.
|
overridevirtualnoexcept |
Returns a string that represents the xtd::forms::tool_bar_button control.
Reimplemented from xtd::object.
|
static |
A factory to create a control toolbar button with specified text and control.
| text | The text displayed on the toolbar button. |
| control | A xtd::forms::control to be displayed in the control toolbar button. |
|
static |
A factory to create a control toolbar button with specified control.
| control | A xtd::forms::control to be displayed in the control toolbar button. |
|
static |
A factory to create a drop-down toolbar button with specified text and context menu.
| text | The text displayed on the toolbar button. |
| drop_down_menu | A xtd::forms::context_menu to be displayed in the drop-down toolbar button. |
|
static |
A factory to create a drop-down toolbar button with specified image index and context menu.
| image_index | The index value of the xtd::drawing::image assigned to the toolbar button. |
| drop_down_menu | A xtd::forms::context_menu to be displayed in the drop-down toolbar button. |
|
static |
A factory to create a drop-down toolbar button with specified text, image index and context menu.
| text | The text displayed on the toolbar button. |
| image_index | The index value of the xtd::drawing::image assigned to the toolbar button. |
| drop_down_menu | A xtd::forms::context_menu to be displayed in the drop-down toolbar button. |
|
static |
A factory to create a toolbar button with specified text.
| text | The text displayed on the toolbar button. |
|
static |
A factory to create a toolbar button with specified image index.
| image_index | The index value of the xtd::drawing::image assigned to the toolbar button. |
|
static |
A factory to create a toolbar button with specified text and image index.
| text | The text displayed on the toolbar button. |
| image_index | The index value of the xtd::drawing::image assigned to the toolbar button. |
|
static |
A factory to create a toolbar separator.
|
static |
A factory to create a toolbar stretchable separator.
|
static |
A factory to create a toolbar toggle button with specified text.
| text | The text displayed on the toolbar button. |
|
static |
A factory to create a toolbar toggle button with specified image index.
| image_index | The index value of the xtd::drawing::image assigned to the toolbar button. |
|
static |
A factory to create a toolbar toggle button with specified text and image index.
| text | The text displayed on the toolbar button. |
| image_index | The index value of the xtd::drawing::image assigned to the toolbar button. |
|
overrideprotectedvirtual |
Creates a new object that is a copy of the current instance.
Implements xtd::iclonable.