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 | |
| auto | control () const noexcept -> std::optional< xtd::forms::control_ref > |
| Gets the control to be displayed in the control toolbar button. | |
| auto | control (const xtd::forms::control &value) -> tool_bar_button & |
| Sets the control to be displayed in the control toolbar button. | |
| auto | control (xtd::null_ptr) -> tool_bar_button & |
| Resets the control to be displayed in the control toolbar button. | |
| auto | drop_down_menu () const noexcept -> std::optional< xtd::ref< xtd::forms::context_menu > > |
| Gets the menu to be displayed in the drop-down toolbar button. | |
| auto | drop_down_menu (const xtd::forms::context_menu &value) -> tool_bar_button & |
| Sets the menu to be displayed in the drop-down toolbar button. | |
| auto | drop_down_menu (xtd::null_ptr) -> tool_bar_button & |
| Resets the menu to be displayed in the drop-down toolbar button. | |
| auto | enabled () const noexcept -> bool |
| Gets a value indicating whether the button is enabled. | |
| auto | enabled (bool value) -> tool_bar_button & |
| Sets a value indicating whether the button is enabled. | |
| auto | image_index () const noexcept -> xtd::usize |
| Gets the index value of the image assigned to the button. | |
| auto | image_index (xtd::usize value) -> tool_bar_button & |
| Sets the index value of the image assigned to the button. | |
| auto | name () const noexcept -> const xtd::string & |
| Gets the name of the button. | |
| auto | name (const xtd::string &value) -> tool_bar_button & |
| Sets the name of the button. | |
| auto | parent () const noexcept -> std::optional< xtd::ref< xtd::forms::tool_bar > > |
| Gets the toolbar control that the toolbar button is assigned to. | |
| auto | pushed () const noexcept -> bool |
| Gets a value indicating whether a toggle-style toolbar button is currently in the pushed state. | |
| auto | pushed (bool value) -> tool_bar_button & |
| Sets a value indicating whether a toggle-style toolbar button is currently in the pushed state. | |
| auto | rectangle () const noexcept -> const xtd::drawing::rectangle & |
| Gets the bounding rectangle for a toolbar button. | |
| auto | style () const noexcept -> xtd::forms::tool_bar_button_style |
| Gets the style of the toolbar button. | |
| auto | style (xtd::forms::tool_bar_button_style value) -> tool_bar_button & |
| Sets the style of the toolbar button. | |
| auto | tag () const noexcept -> const xtd::any_object & |
| Gets the object that contains data about the toolbar button. | |
| auto | tag (const xtd::any_object &value) -> tool_bar_button & |
| Sets the object that contains data about the toolbar button. | |
| auto | text () const noexcept -> const xtd::string & |
| Gets the text displayed on the toolbar button. | |
| auto | text (const xtd::string &value) -> tool_bar_button & |
| Sets the text displayed on the toolbar button. | |
| auto | tool_tip_text () const noexcept -> const xtd::string & |
| Gets the text that appears as a xtd::forms::tool_tip for the button. | |
| auto | tool_tip_text (const xtd::string &value) -> tool_bar_button & |
| Sets the text that appears as a xtd::forms::tool_tip for the button. | |
| auto | visible () const noexcept -> bool |
| Gets a value indicating whether the toolbar button is visible. | |
| auto | visible (bool value) -> tool_bar_button & |
| Sets a value indicating whether the toolbar button is visible. | |
Public Methods | |
| auto | equals (const xtd::object &obj) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | equals (const tool_bar_button &other) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | get_hash_code () const noexcept -> xtd::usize override |
| Serves as a hash function for a particular type. | |
| auto | to_string () const noexcept -> xtd::string override |
| Returns a string that represents the xtd::forms::tool_bar_button control. | |
Public Static Methods | |
| static auto | create_control (const xtd::string &text, const xtd::forms::control &control) -> tool_bar_button |
| A factory to create a control toolbar button with specified text and control. | |
| static auto | create_control (const xtd::forms::control &control) -> tool_bar_button |
| A factory to create a control toolbar button with specified control. | |
| static auto | create_drop_down_button (const xtd::string &text, const xtd::forms::context_menu &drop_down_menu) -> tool_bar_button |
| A factory to create a drop-down toolbar button with specified text and context menu. | |
| static auto | create_drop_down_button (xtd::usize image_index, const xtd::forms::context_menu &drop_down_menu) -> tool_bar_button |
| A factory to create a drop-down toolbar button with specified image index and context menu. | |
| static auto | create_drop_down_button (const xtd::string &text, xtd::usize image_index, const xtd::forms::context_menu &drop_down_menu) -> tool_bar_button |
| A factory to create a drop-down toolbar button with specified text, image index and context menu. | |
| static auto | create_push_button (const xtd::string &text) -> tool_bar_button |
| A factory to create a toolbar button with specified text. | |
| static auto | create_push_button (xtd::usize image_index) -> tool_bar_button |
| A factory to create a toolbar button with specified image index. | |
| static auto | create_push_button (const xtd::string &text, xtd::usize image_index) -> tool_bar_button |
| A factory to create a toolbar button with specified text and image index. | |
| static auto | create_separator () -> tool_bar_button |
| A factory to create a toolbar separator. | |
| static auto | create_stretchable_separator () -> tool_bar_button |
| A factory to create a toolbar stretchable separator. | |
| static auto | create_toggle_button (const xtd::string &text) -> tool_bar_button |
| A factory to create a toolbar toggle button with specified text. | |
| static auto | create_toggle_button (xtd::usize image_index) -> tool_bar_button |
| A factory to create a toolbar toggle button with specified image index. | |
| static auto | create_toggle_button (const xtd::string &text, xtd::usize image_index) -> tool_bar_button |
| A factory to create a toolbar toggle button with specified text and image index. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| virtual auto | equals (const tool_bar_button &) const noexcept -> bool=0 |
| Indicates whether the current object is equal to another object of the same type. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are the same instance. | |
| component () | |
| Initialises a new instance of the component class. | |
| virtual auto | can_raise_events () const noexcept -> bool |
| Gets a value indicating whether the component can raise an event. | |
| auto | design_mode () const noexcept -> bool |
| 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. |
|
nodiscardnoexcept |
Gets the control to be displayed in the control toolbar button.
| auto xtd::forms::tool_bar_button::control | ( | const xtd::forms::control & | value | ) | -> tool_bar_button & |
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. |
| auto xtd::forms::tool_bar_button::control | ( | xtd::null_ptr | ) | -> tool_bar_button & |
Resets the control to be displayed in the control toolbar button.
| xtd::null. |
|
nodiscardnoexcept |
Gets the menu to be displayed in the drop-down toolbar button.
| auto xtd::forms::tool_bar_button::drop_down_menu | ( | const xtd::forms::context_menu & | value | ) | -> tool_bar_button & |
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. |
| auto xtd::forms::tool_bar_button::drop_down_menu | ( | xtd::null_ptr | ) | -> tool_bar_button & |
Resets the menu to be displayed in the drop-down toolbar button.
| xtd::null. |
|
nodiscardnoexcept |
Gets a value indicating whether the button is enabled.
| auto xtd::forms::tool_bar_button::enabled | ( | bool | value | ) | -> tool_bar_button & |
Sets a value indicating whether the button is enabled.
| value | true if the button is enabled; otherwise, false. The default is true. |
|
nodiscardnoexcept |
Gets the index value of the image assigned to the button.
| auto xtd::forms::tool_bar_button::image_index | ( | xtd::usize | value | ) | -> tool_bar_button & |
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. |
|
nodiscardnoexcept |
Gets the name of the button.
| auto xtd::forms::tool_bar_button::name | ( | const xtd::string & | value | ) | -> tool_bar_button & |
Sets the name of the button.
| value | The name of the button. |
|
nodiscardnoexcept |
Gets the toolbar control that the toolbar button is assigned to.
|
nodiscardnoexcept |
Gets a value indicating whether a toggle-style toolbar button is currently in the pushed state.
| auto xtd::forms::tool_bar_button::pushed | ( | bool | value | ) | -> tool_bar_button & |
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. |
|
nodiscardnoexcept |
Gets the bounding rectangle for a toolbar button.
|
nodiscardnoexcept |
Gets the style of the toolbar button.
| auto xtd::forms::tool_bar_button::style | ( | xtd::forms::tool_bar_button_style | value | ) | -> tool_bar_button & |
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. |
|
nodiscardnoexcept |
Gets the object that contains data about the toolbar button.
| auto xtd::forms::tool_bar_button::tag | ( | const xtd::any_object & | value | ) | -> tool_bar_button & |
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. |
|
nodiscardnoexcept |
Gets the text displayed on the toolbar button.
| auto xtd::forms::tool_bar_button::text | ( | const xtd::string & | value | ) | -> tool_bar_button & |
Sets the text displayed on the toolbar button.
| value | The text displayed on the toolbar button. The default is an empty string (""). |
|
nodiscardnoexcept |
Gets the text that appears as a xtd::forms::tool_tip for the button.
| auto xtd::forms::tool_bar_button::tool_tip_text | ( | const xtd::string & | value | ) | -> tool_bar_button & |
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 (""). |
|
nodiscardnoexcept |
Gets a value indicating whether the toolbar button is visible.
| auto xtd::forms::tool_bar_button::visible | ( | bool | value | ) | -> tool_bar_button & |
Sets a value indicating whether the toolbar button is visible.
| value | true if the toolbar button is visible; otherwise, false. The default is true. |
|
nodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
nodiscardoverridenoexcept |
Determines whether the specified object is equal to the current object.
| other | The object to compare with the current object. |
|
nodiscardoverridevirtualnoexcept |
Serves as a hash function for a particular type.
Reimplemented from xtd::object.
|
nodiscardoverridevirtualnoexcept |
Returns a string that represents the xtd::forms::tool_bar_button control.
Reimplemented from xtd::object.
|
staticnodiscard |
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. |
|
staticnodiscard |
A factory to create a control toolbar button with specified control.
| control | A xtd::forms::control to be displayed in the control toolbar button. |
|
staticnodiscard |
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. |
|
staticnodiscard |
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. |
|
staticnodiscard |
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. |
|
staticnodiscard |
A factory to create a toolbar button with specified text.
| text | The text displayed on the toolbar button. |
|
staticnodiscard |
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. |
|
staticnodiscard |
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. |
|
staticnodiscard |
A factory to create a toolbar separator.
|
staticnodiscard |
A factory to create a toolbar stretchable separator.
|
staticnodiscard |
A factory to create a toolbar toggle button with specified text.
| text | The text displayed on the toolbar button. |
|
staticnodiscard |
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. |
|
staticnodiscard |
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. |