xtd 0.2.0
Loading...
Searching...
No Matches
tool_bar.h
Go to the documentation of this file.
1
4#pragma once
5#include "border_style.h"
6#include "button.h"
7#include "context_menu.h"
8#include "image_list.h"
9#include "panel.h"
10#include "tool_bar_appearance.h"
11#include "tool_bar_button.h"
13#include "tool_bar_text_align.h"
14#include <memory>
15#include <vector>
16
18namespace xtd {
20 namespace forms {
22 class form;
24
51 struct data;
52 class tool_bar_button_control;
53
54 public:
56
61
63
69
71 tool_bar(tool_bar&& rhs);
72 tool_bar(const tool_bar&) = default;
73 tool_bar& operator =(const tool_bar&) = default;
75
77
88
91 virtual forms::border_sides border_sides() const noexcept;
96
100 virtual forms::border_style border_style() const noexcept;
110 virtual xtd::forms::tool_bar& border_style(std::nullptr_t value);
111
115 const tool_bar_button_collection& buttons() const noexcept;
120
124 virtual xtd::drawing::size button_size() const noexcept;
129 virtual tool_bar& button_size(const xtd::drawing::size& value);
134 virtual tool_bar& button_size(std::nullptr_t value);
135
140 virtual bool divider() const noexcept;
146 virtual tool_bar& divider(bool value);
147
148 dock_style dock() const noexcept override;
149 control& dock(dock_style dock) override;
150
154 virtual bool drop_down_arrows() const noexcept;
159 virtual tool_bar& drop_down_arrows(bool value);
160
164 const xtd::forms::image_list& image_list() const noexcept;
174
177 virtual xtd::drawing::size image_size() const noexcept;
178
181 virtual bool show_icon() const noexcept;
185 virtual tool_bar& show_icon(bool value);
186
189 virtual bool show_text() const noexcept;
193 virtual tool_bar& show_text(bool value);
194
198 virtual bool show_tool_tips() const noexcept;
203 virtual tool_bar& show_tool_tips(bool value);
204
208 virtual xtd::forms::tool_bar_text_align text_align() const noexcept;
213 virtual tool_bar& text_align(xtd::forms::tool_bar_text_align value);
214
218 virtual bool wrappable() const noexcept;
224 virtual tool_bar& wrappable(bool value);
226
228
233
238
240
247 static tool_bar create(const control& parent, xtd::forms::dock_style style, const xtd::forms::image_list::image_collection& image_collection, const xtd::ustring& name);
249
250 protected:
251 friend tool_bar_button;
252 friend form;
253
255
257 forms::create_params create_params() const noexcept override;
258 xtd::drawing::font default_font() const noexcept override;
259 drawing::size default_size() const noexcept override;
261
263
269 std::unique_ptr<xtd::object> clone() const override;
270
277 void on_button_click(const xtd::forms::tool_bar_button_click_event_args& e);
278
285 void on_button_drop_down(const xtd::forms::tool_bar_button_click_event_args& e);
286
287 void on_handle_created(const event_args& e) override;
288 void on_handle_destroyed(const event_args& e) override;
289 void on_paint(xtd::forms::paint_event_args& e) override;
290 void on_resize(const event_args& e) override;
291 void wnd_proc(message& message) override;
293
294 private:
295 void fill();
296
297 bool is_horizontal() const noexcept;
298 bool is_system_tool_bar() const noexcept;
299 tool_bar& is_system_tool_bar(bool value);
300
301 void on_item_added(size_t pos, tool_bar_button_ref item);
302 void on_item_updated(size_t pos, tool_bar_button_ref item);
303 void on_item_removed(size_t pos, tool_bar_button_ref item);
304
305 void resize_stretchable_separtors();
306 void update_toolbar_button_control(intptr handle, const xtd::ustring& text, const xtd::ustring& tool_tip_text, const xtd::drawing::image& image, bool pushed, bool enabled, bool visible);
307
308 void wm_click(const message& message);
309
310 std::shared_ptr<data> data_;
311 };
312 }
313}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Represents an event.
Definition event.h:21
Provides a collection of button objects for use by a Windows Forms application.
Definition buttons.h:22
Defines the base class for controls, which are components with visual representation.
Definition control.h:79
Encapsulates the information needed when creating a control.
Definition create_params.h:27
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:52
Provides methods to manage a collection of xtd::drawing::image objects. This class cannot be inherite...
Definition image_list.h:28
Represents a collection of objects.
Definition arranged_element_collection.h:32
Implements a Windows message.
Definition message.h:26
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.h:28
Provides data for the xtd::forms::tool_bar::button_click event.
Definition tool_bar_button_click_event_args.h:23
Represents a toolbar button.
Definition tool_bar_button.h:41
Represents a Windows toolbar.
Definition tool_bar.h:50
virtual xtd::forms::tool_bar_appearance appearance() const noexcept
Gets the value that determines the appearance of a toolbar control and its buttons.
tool_bar()
Initializes a new instance of the xtd::forms::tool_bar class.
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Contains xtd::forms::context_menu menu.
delegate< void(object &sender, const 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.h:24
#define forms_export_
Define shared library export.
Definition forms_export.h:13
xtd::forms::style_sheets::control form
The form data allows you to specify the box of a form control.
Definition form.h:21
size_t size
Represents a size of any object in bytes.
Definition types.h:197
intmax_t intptr
Represent a pointer or a handle.
Definition types.h:153
std::reference_wrapper< tool_bar_button > tool_bar_button_ref
Represents a xtd::forms::tool_bar_item reference.
Definition tool_bar_button_ref.h:23
tool_bar_text_align
Specifies the type of toolbar to display.
Definition tool_bar_text_align.h:21
border_sides
Specifies how a control anchors to the edges of its container.
Definition border_sides.h:21
tool_bar_appearance
Specifies the type of toolbar to display.
Definition tool_bar_appearance.h:21
border_style
Specifies the border style for a control.
Definition border_style.h:20
dock_style
Specifies the position and manner in which a control is docked.
Definition dock_style.h:21
appearance
Specifies the appearance of a control.
Definition appearance.h:20
Contains xtd::forms::image_list component.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::forms::style_sheets::border_style class.
Contains xtd::forms::style_sheets::button alias.
Contains xtd::forms::style_sheets::panel class.
Contains xtd::forms::tool_bar_appearance enum class.
Contains xtd::forms::tool_bar_button container.
Contains xtd::forms::tool_bar_button_click_event_handler event handler.
Contains xtd::forms::tool_bar_text_align enum class.