xtd 1.0.0
Loading...
Searching...
No Matches
tool_bar.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "border_style.hpp"
6#include "button.hpp"
7#include "context_menu.hpp"
8#include "image_list.hpp"
9#include "panel.hpp"
11#include "tool_bar_button.hpp"
14#include <memory>
15#include <vector>
16
18namespace xtd {
20 namespace forms {
22 class form;
24
53 struct data;
54 class tool_bar_button_control;
55
56 public:
58
63
65
71
73
78 [[nodiscard]] virtual auto appearance() const noexcept -> xtd::forms::tool_bar_appearance;
83 virtual auto appearance(xtd::forms::tool_bar_appearance value) -> tool_bar&;
84
87 [[nodiscard]] virtual auto border_sides() const noexcept -> xtd::forms::border_sides;
91 virtual auto border_sides(xtd::forms::border_sides value) -> tool_bar&;
92
96 [[nodiscard]] virtual auto border_style() const noexcept -> xtd::forms::border_style;
101 virtual auto border_style(xtd::forms::border_style value) -> tool_bar&;
106 virtual auto border_style(xtd::null_ptr) -> tool_bar&;
107
111 [[nodiscard]] virtual auto buttons() const noexcept -> const tool_bar_button_collection&;
115 [[nodiscard]] virtual auto buttons() -> tool_bar_button_collection&;
116
120 [[nodiscard]] virtual auto button_size() const noexcept -> xtd::drawing::size;
125 virtual auto button_size(const xtd::drawing::size& value) -> tool_bar&;
130 virtual auto button_size(xtd::null_ptr) -> tool_bar&;
131
136 [[nodiscard]] virtual auto divider() const noexcept -> bool;
142 virtual auto divider(bool value) -> tool_bar&;
143
152 [[nodiscard]] auto dock() const noexcept -> xtd::forms::dock_style override;
162 auto dock(xtd::forms::dock_style value) -> xtd::forms::control& override;
163
167 [[nodiscard]] virtual auto drop_down_arrows() const noexcept -> bool;
172 virtual auto drop_down_arrows(bool value) -> tool_bar&;
173
177 [[nodiscard]] virtual auto image_list() const noexcept -> const xtd::forms::image_list&;
181 [[nodiscard]] virtual auto image_list() -> xtd::forms::image_list&;
186 virtual auto image_list(const xtd::forms::image_list& value) -> tool_bar&;
187
190 [[nodiscard]] virtual auto image_size() const noexcept -> xtd::drawing::size;
191
194 [[nodiscard]] virtual auto show_icon() const noexcept -> bool;
198 virtual auto show_icon(bool value) -> tool_bar&;
199
202 [[nodiscard]] virtual auto show_text() const noexcept -> bool;
206 virtual auto show_text(bool value) -> tool_bar&;
207
211 [[nodiscard]] virtual auto show_tool_tips() const noexcept -> bool;
216 virtual auto show_tool_tips(bool value) -> tool_bar&;
217
221 [[nodiscard]] virtual auto text_align() const noexcept -> xtd::forms::tool_bar_text_align;
227
231 [[nodiscard]] virtual auto wrappable() const noexcept -> bool;
237 virtual auto wrappable(bool value) -> tool_bar&;
239
241
246
251
253
258 [[nodiscard]] static auto create() -> tool_bar;
263 [[nodiscard]] static auto create(const xtd::forms::image_list::image_collection& image_collection) -> tool_bar;
269 [[nodiscard]] static auto create(const xtd::forms::image_list::image_collection& image_collection, const xtd::string& name) -> tool_bar;
274 [[nodiscard]] static auto create(xtd::forms::dock_style style) -> tool_bar;
280 [[nodiscard]] static auto create(xtd::forms::dock_style style, const xtd::forms::image_list::image_collection& image_collection) -> tool_bar;
287 [[nodiscard]] static auto create(xtd::forms::dock_style style, const xtd::forms::image_list::image_collection& image_collection, const xtd::string& name) -> tool_bar;
291 [[nodiscard]] static auto create(const tool_bar_button_collection& buttons) -> tool_bar;
296 [[nodiscard]] static auto create(const xtd::forms::image_list::image_collection& image_collection, const tool_bar_button_collection& buttons) -> tool_bar;
302 [[nodiscard]] static auto create(const xtd::forms::image_list::image_collection& image_collection, const tool_bar_button_collection& buttons, const xtd::string& name) -> tool_bar;
307 [[nodiscard]] static auto create(xtd::forms::dock_style style, const tool_bar_button_collection& buttons) -> tool_bar;
313 [[nodiscard]] static auto create(xtd::forms::dock_style style, const xtd::forms::image_list::image_collection& image_collection, const tool_bar_button_collection& buttons) -> tool_bar;
320 [[nodiscard]] static auto create(xtd::forms::dock_style style, const xtd::forms::image_list::image_collection& image_collection, const tool_bar_button_collection& buttons, const xtd::string& name) -> tool_bar;
324 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> tool_bar;
330 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::forms::image_list::image_collection& image_collection) -> tool_bar;
337 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::forms::image_list::image_collection& image_collection, const xtd::string& name) -> tool_bar;
342 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::forms::dock_style style) -> tool_bar;
348 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::forms::dock_style style, const xtd::forms::image_list::image_collection& image_collection) -> tool_bar;
355 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::forms::dock_style style, const xtd::forms::image_list::image_collection& image_collection, const xtd::string& name) -> tool_bar;
359 [[nodiscard]] static auto create(const xtd::forms::control& parent, const tool_bar_button_collection& buttons) -> tool_bar;
365 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::forms::image_list::image_collection& image_collection, const tool_bar_button_collection& buttons) -> tool_bar;
372 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::forms::image_list::image_collection& image_collection, const tool_bar_button_collection& buttons, const xtd::string& name) -> tool_bar;
377 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::forms::dock_style style, const tool_bar_button_collection& buttons) -> tool_bar;
383 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::forms::dock_style style, const xtd::forms::image_list::image_collection& image_collection, const tool_bar_button_collection& buttons) -> tool_bar;
390 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::forms::dock_style style, const xtd::forms::image_list::image_collection& image_collection, const tool_bar_button_collection& buttons, const xtd::string& name) -> tool_bar;
392
393 protected:
394 friend tool_bar_button;
395 friend form;
396
398
400 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
401 [[nodiscard]] auto default_font() const noexcept -> xtd::drawing::font override;
402 [[nodiscard]] auto default_size() const noexcept -> xtd::drawing::size override;
404
406
415
423
424 auto on_handle_created(const xtd::event_args& e) -> void override;
425 auto on_handle_destroyed(const xtd::event_args& e) -> void override;
426 auto on_paint(xtd::forms::paint_event_args& e) -> void override;
427 auto on_resize(const xtd::event_args& e) -> void override;
428 auto wnd_proc(xtd::forms::message& message) -> void override;
430
431 private:
432 auto fill() -> void;
433
434 [[nodiscard]] auto horizontal() const noexcept -> bool;
435 [[nodiscard]] auto system_tool_bar() const noexcept -> bool;
436 auto system_tool_bar(bool value) -> tool_bar&;
437
438 auto resize_stretchable_separtors() -> void;
439 auto update_toolbar_button_control(xtd::intptr handle, const xtd::string& text, const xtd::string& tool_tip_text, const xtd::drawing::image& image, bool pushed, bool enabled, bool visible) -> void;
440
441 auto wm_click(const xtd::forms::message& message) -> void;
442
443 xtd::sptr<data> data_;
444 };
445 }
446}
Contains xtd::forms::border_style enum class.
Contains xtd::forms::button control.
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:23
auto handle() const -> xtd::intptr override
Gets the window handle that the control is bound to.
virtual auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto enabled() const noexcept -> bool
Gets a value indicating whether the control can respond to user interaction.
virtual auto font() const noexcept -> xtd::drawing::font
Gets the font of the text displayed by the control.
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
virtual auto visible() const noexcept -> bool
Gets a value indicating whether the control and all its child controls are displayed.
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:41
Provides data for the xtd::forms::tool_bar::button_click event.
Definition tool_bar_button_click_event_args.hpp:25
xtd::event< tool_bar, xtd::forms::tool_bar_button_click_event_handler > button_drop_down
Occurs when a drop-down style xtd::forms::tool_bar_button or its down arrow is clicked.
Definition tool_bar.hpp:249
auto on_paint(xtd::forms::paint_event_args &e) -> void override
Raises the xtd::forms::control::paint event.
virtual auto show_text() const noexcept -> bool
Gets a value indicating whether the toolbar displays the text for each button.
virtual auto border_style() const noexcept -> xtd::forms::border_style
Gets the border style for the control.
virtual auto buttons() const noexcept -> const tool_bar_button_collection &
Gets the collection of xtd::forms::tool_bar_button controls assigned to the toolbar control.
virtual auto image_size() const noexcept -> xtd::drawing::size
Gets the size of the images in the image list assigned to the toolbar.
auto on_handle_destroyed(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::handle_destroyed event.
virtual auto wrappable() const noexcept -> bool
Gets a value indicating whether the toolbar buttons wrap to the next line if the toolbar becomes too ...
xtd::event< tool_bar, xtd::forms::tool_bar_button_click_event_handler > button_click
Occurs when a xtd::forms::tool_bar_button on the xtd::forms::tool_bar is clicked.
Definition tool_bar.hpp:245
auto on_handle_created(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::handle_created event.
virtual auto divider() const noexcept -> bool
Gets a value indicating whether the toolbar displays a divider.
virtual auto image_list() const noexcept -> const xtd::forms::image_list &
Gets the collection of images available to the toolbar button controls.
auto on_button_drop_down(const xtd::forms::tool_bar_button_click_event_args &e) -> void
Raises the xtd::forms::tool_bar::button_drop_down event.
static auto create() -> tool_bar
A factory to create an xtd::forms::tool_bar.
auto default_size() const noexcept -> xtd::drawing::size override
Gets the default size of the control.
virtual auto text_align() const noexcept -> xtd::forms::tool_bar_text_align
Gets the alignment of text in relation to each image displayed on the toolbar button controls.
virtual auto button_size() const noexcept -> xtd::drawing::size
Gets the size of the buttons on the toolbar control.
auto default_font() const noexcept -> xtd::drawing::font override
Gets the default font of the control.
virtual auto drop_down_arrows() const noexcept -> bool
Gets a value indicating whether drop-down buttons on a toolbar display down arrows.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
virtual auto border_sides() const noexcept -> xtd::forms::border_sides
Gets the border sides for the control.
auto dock() const noexcept -> xtd::forms::dock_style override
Gets which control borders are docked to its parent control and determines how a control is resized w...
tool_bar()
Initializes a new instance of the xtd::forms::tool_bar class.
xtd::forms::layout::arranged_element_collection< tool_bar_button_ref > tool_bar_button_collection
Represents the base type of the xtd::forms::tool_bar::buttons collection.
Definition tool_bar.hpp:61
virtual auto show_icon() const noexcept -> bool
Gets a value indicating whether the toolbar displays the image for each button.
virtual auto show_tool_tips() const noexcept -> bool
Gets a value indicating whether the toolbar displays a xtd::forms::tool_tip for each button.
virtual auto appearance() const noexcept -> xtd::forms::tool_bar_appearance
Gets the value that determines the appearance of a toolbar control and its buttons.
auto on_button_click(const xtd::forms::tool_bar_button_click_event_args &e) -> void
Raises the xtd::forms::tool_bar::button_click event.
auto wnd_proc(xtd::forms::message &message) -> void override
Processes Windows messages.
auto on_resize(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::region event.
Contains xtd::forms::context_menu menu.
xtd::delegate< void(xtd::object &sender, const xtd::forms::tool_bar_button_click_event_args &e)> tool_bar_button_click_event_handler
Represents the method that will handle the xtd::forms::tool_bar::button_click event of a xtd::forms::...
Definition tool_bar_button_click_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
std::nullptr_t null_ptr
Represents the null_opt alias on std::nullptr_t.
Definition null_ptr.hpp:19
std::intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
tool_bar_text_align
Specifies the type of toolbar to display.
Definition tool_bar_text_align.hpp:23
tool_bar_appearance
Specifies the type of toolbar to display.
Definition tool_bar_appearance.hpp:23
dock_style
Specifies the position and manner in which a control is docked.
Definition dock_style.hpp:23
Contains xtd::forms::image_list component.
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 auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Contains xtd::forms::panel container.
Implements a Windows message.
Definition message.hpp:33
Contains xtd::forms::tool_bar_appearance enum class.
Contains xtd::forms::tool_bar_button container.
Contains xtd::forms::tool_bar_button_click_event_handler handler.
Contains xtd::forms::tool_bar_text_align enum class.