Represents a toolbar button.
Constructors | |
| tool_bar_button () | |
| Initialises a new instance of xtd::forms::tool_bar_button class. More... | |
| tool_bar_button (const xtd::ustring &text) | |
| Initializes a new instance of the xtd::forms::tool_bar_button class and displays the assigned text on the button. More... | |
Properties | |
| std::optional< xtd::forms::control_ref > | control () const noexcept |
| Gets the control to be displayed in the control toolbar button. More... | |
| tool_bar_button & | control (const xtd::forms::control &value) |
| Sets the control to be displayed in the control toolbar button. More... | |
| tool_bar_button & | control (std::nullptr_t value) |
| Resets the control to be displayed in the control toolbar button. More... | |
| std::optional< std::reference_wrapper< xtd::forms::context_menu > > | drop_down_menu () const noexcept |
| Gets the menu to be displayed in the drop-down toolbar button. More... | |
| tool_bar_button & | drop_down_menu (const xtd::forms::context_menu &value) |
| Sets the menu to be displayed in the drop-down toolbar button. More... | |
| tool_bar_button & | drop_down_menu (std::nullptr_t value) |
| Resets the menu to be displayed in the drop-down toolbar button. More... | |
| bool | enabled () const noexcept |
| Gets a value indicating whether the button is enabled. More... | |
| tool_bar_button & | enabled (bool value) |
| Sets a value indicating whether the button is enabled. More... | |
| size_t | image_index () const noexcept |
| Gets the index value of the image assigned to the button. More... | |
| tool_bar_button & | image_index (size_t value) |
| Sets the index value of the image assigned to the button. More... | |
| const xtd::ustring & | name () const noexcept |
| Gets the name of the button. More... | |
| tool_bar_button & | name (const xtd::ustring &value) |
| Sets the name of the button. More... | |
| std::optional< std::reference_wrapper< xtd::forms::tool_bar > > | parent () const noexcept |
| Gets the toolbar control that the toolbar button is assigned to. More... | |
| bool | pushed () const noexcept |
| Gets a value indicating whether a toggle-style toolbar button is currently in the pushed state. More... | |
| tool_bar_button & | pushed (bool value) |
| Sets a value indicating whether a toggle-style toolbar button is currently in the pushed state. More... | |
| const xtd::drawing::rectangle & | rectangle () const noexcept |
| Gets the bounding rectangle for a toolbar button. More... | |
| xtd::forms::tool_bar_button_style | style () const noexcept |
| Gets the style of the toolbar button. More... | |
| tool_bar_button & | style (xtd::forms::tool_bar_button_style value) |
| Sets the style of the toolbar button. More... | |
| std::any | tag () const noexcept |
| Gets the object that contains data about the toolbar button. More... | |
| tool_bar_button & | tag (std::any value) |
| Sets the object that contains data about the toolbar button. More... | |
| const xtd::ustring & | text () const noexcept |
| Gets the text displayed on the toolbar button. More... | |
| tool_bar_button & | text (const xtd::ustring &value) |
| Sets the text displayed on the toolbar button. More... | |
| const xtd::ustring & | tool_tip_text () const noexcept |
| Gets the text that appears as a xtd::forms::tool_tip for the button. More... | |
| tool_bar_button & | tool_tip_text (const xtd::ustring &value) |
| Sets the text that appears as a xtd::forms::tool_tip for the button. More... | |
| bool | visible () const noexcept |
| Gets a value indicating whether the toolbar button is visible. More... | |
| tool_bar_button & | visible (bool value) |
| Sets a value indicating whether the toolbar button is visible. More... | |
Methods | |
| bool | equals (const tool_bar_button &other) const noexcept override |
| xtd::ustring | to_string () const noexcept override |
| Returns a string that represents the xtd::forms::tool_bar_button control. More... | |
| static tool_bar_button | create_control (const xtd::ustring &text, const xtd::forms::control &control) |
| A factory to create a control toolbar button with specified text and control. More... | |
| static tool_bar_button | create_control (const xtd::forms::control &control) |
| A factory to create a control toolbar button with specified control. More... | |
| static tool_bar_button | create_drop_down_button (const xtd::ustring &text, const xtd::forms::context_menu &drop_down_menu) |
| A factory to create a drop-down toolbar button with specified text and context menu. More... | |
| 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. More... | |
| static tool_bar_button | create_drop_down_button (const xtd::ustring &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. More... | |
| static tool_bar_button | create_push_button (const xtd::ustring &text) |
| A factory to create a toolbar button with specified text. More... | |
| static tool_bar_button | create_push_button (size_t image_index) |
| A factory to create a toolbar button with specified image index. More... | |
| static tool_bar_button | create_push_button (const xtd::ustring &text, size_t image_index) |
| A factory to create a toolbar button with specified text and image index. More... | |
| static tool_bar_button | create_separator () |
| A factory to create a toolbar separator. More... | |
| static tool_bar_button | create_stretchable_separator () |
| A factory to create a toolbar stretchable separator. More... | |
| static tool_bar_button | create_toggle_button (const xtd::ustring &text) |
| A factory to create a toolbar toggle button with specified text. More... | |
| static tool_bar_button | create_toggle_button (size_t image_index) |
| A factory to create a toolbar toggle button with specified image index. More... | |
| static tool_bar_button | create_toggle_button (const xtd::ustring &text, size_t image_index) |
| A factory to create a toolbar toggle button with specified text and image index. More... | |
Additional Inherited Members | |
Public Member Functions inherited from xtd::object | |
| object ()=default | |
| Create a new instance of the ultimate base class object. More... | |
| bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. More... | |
| virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. More... | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. More... | |
| template<typename object_t > | |
| std::unique_ptr< object_t > | memberwise_clone () const noexcept |
| Creates a shallow copy of the current object. More... | |
Public Member Functions inherited from xtd::iequatable< tool_bar_button > | |
| virtual bool | equals (const tool_bar_button &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type. More... | |
Static Public Member Functions inherited from xtd::object | |
| static bool | equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are considered equal. More... | |
| static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are the same instance. More... | |
Protected Member Functions inherited from xtd::forms::component | |
| component () | |
| Initialises a new instance of the component class. More... | |
| virtual bool | can_raise_events () const noexcept |
| Gets a value indicating whether the component can raise an event. More... | |
| bool | design_mode () const noexcept |
| Gets a value that indicates whether the component is currently in design mode. More... | |
| 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. |
|
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. |
|
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.
| 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. |
|
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::ustring & | 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.
| 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. |
|
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 |
| tool_bar_button& xtd::forms::tool_bar_button::tag | ( | std::any | value | ) |
Sets the object that contains data about the toolbar button.
| value | An std::any 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::ustring & | value | ) |
Sets the text displayed on the toolbar button.
| value | The text displayed on the toolbar button. The default is an empty string (""). |
|
overridevirtualnoexcept |
Returns a string that represents the xtd::forms::tool_bar_button control.
Reimplemented from xtd::object.
|
noexcept |
Gets the text that appears as a xtd::forms::tool_tip for the button.
| tool_bar_button& xtd::forms::tool_bar_button::tool_tip_text | ( | const xtd::ustring & | 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 (""). |
|
noexcept |
Gets a value indicating whether the toolbar button is visible.
| 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. |