xtd 1.0.0
Loading...
Searching...
No Matches
tab_control.hpp
Go to the documentation of this file.
1
4#pragma once
5
7#include "control.hpp"
8#include "image_list.hpp"
9#include "tab_alignment.hpp"
10#include "tab_page_ref.hpp"
11#include <xtd/usize_object>
12
14namespace xtd {
16 namespace forms {
18 class form;
20
40 struct data;
41
42 public:
45 public:
47
52
54
58 explicit tab_page_collection() = default;
60
62
67 auto add(const xtd::string& text) -> void;
71 auto add(const xtd::string& text, const string& name) -> void;
72
77 auto insert(xtd::usize index, const xtd::string& text) -> void;
82 auto insert(xtd::usize index, const xtd::string& text, const xtd::string& name) -> void;
84
86 auto add(const char* text) -> void;
87 auto add(const char8* text) -> void;
88 auto add(const char16* text) -> void;
89 auto add(const char32* text) -> void;
90 auto add(const wchar* text) -> void;
92
94
96 using base::operator [];
101 [[nodiscard]] auto operator [](const xtd::string& name) const -> std::optional<value_type>;
106 [[nodiscard]] auto operator [](const xtd::string& name) -> std::optional<value_type>;
108
110
116 [[deprecated("Replaced by xtd::forms::layout::tab_page_collection::insert - Will be removed in version 1.2.0.")]]
117 [[nodiscard]] auto insert(const_iterator pos, const xtd::string& text) -> iterator;
123 [[deprecated("Replaced by xtd::forms::layout::tab_page_collection::insert - Will be removed in version 1.2.0.")]]
124 [[nodiscard]] auto insert(const_iterator pos, const xtd::string& text, const xtd::string& name) -> iterator;
130 [[deprecated("Replaced by xtd::forms::layout::tab_page_collection::insert - Will be removed in version 1.2.0.")]]
131 auto insert_at(xtd::usize index, const xtd::string& text) -> void;
137 [[deprecated("Replaced by xtd::forms::layout::tab_page_collection::insert - Will be removed in version 1.2.0.")]]
138 auto insert_at(xtd::usize index, const xtd::string& text, const xtd::string& name) -> void;
139
144 [[deprecated("Replaced by xtd::forms::tab_control::tab_page_collection::add - Will be removed in version 1.2.0.")]]
145 auto push_back(const xtd::string& text) -> void;
150 [[deprecated("Replaced by xtd::forms::tab_control::tab_page_collection::add - Will be removed in version 1.2.0.")]]
151 auto push_back(const xtd::string& text, const string& name) -> void;
152
153 [[deprecated("Replaced by xtd::forms::tab_control::tab_page_collection::add - Will be removed in version 1.2.0.")]]
154 auto push_back(const char* text) -> void;
155 [[deprecated("Replaced by xtd::forms::tab_control::tab_page_collection::add - Will be removed in version 1.2.0.")]]
156 auto push_back(const char8* text) -> void;
157 [[deprecated("Replaced by xtd::forms::tab_control::tab_page_collection::add - Will be removed in version 1.2.0.")]]
158 auto push_back(const char16* text) -> void;
159 [[deprecated("Replaced by xtd::forms::tab_control::tab_page_collection::add - Will be removed in version 1.2.0.")]]
160 auto push_back(const char32* text) -> void;
161 [[deprecated("Replaced by xtd::forms::tab_control::tab_page_collection::add - Will be removed in version 1.2.0.")]]
162 auto push_back(const wchar* text) -> void;
164
165 private:
166 friend tab_control;
167 xtd::event<tab_page_collection, xtd::delegate<void(xtd::usize index, const xtd::string& text, const xtd::string& name)>> text_added;
168 xtd::event<tab_page_collection, xtd::delegate<iterator(const_iterator pos, const xtd::string& text, const xtd::string& name)>> text_inserted;
169 };
170
172
177
179
183 [[nodiscard]] virtual auto alignment() const noexcept -> xtd::forms::tab_alignment;
187 virtual auto alignment(xtd::forms::tab_alignment value) -> tab_control&;
188
192 [[nodiscard]] virtual auto image_list() const noexcept -> const xtd::forms::image_list&;
197 virtual auto image_list(const forms::image_list& value) -> tab_control&;
198
201 [[nodiscard]] virtual auto selected_index() const noexcept -> xtd::usize;
205 virtual auto selected_index(xtd::usize value) -> tab_control&;
206
210 [[nodiscard]] virtual auto tab_pages() noexcept -> tab_page_collection&;
214 [[nodiscard]] virtual auto tab_pages() const noexcept -> const tab_page_collection&;
216
218
222 [[nodiscard]] static auto create() -> tab_control;
226 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> tab_control;
231 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> tab_control;
237 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> tab_control;
241 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> tab_control;
246 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> tab_control;
252 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> tab_control;
259 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> tab_control;
261
263
269
270 protected:
272
274 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
276
278
280 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
281
282 auto on_control_added(const xtd::forms::control_event_args& e) -> void override;
283 auto on_control_removed(const xtd::forms::control_event_args& e) -> void override;
284
285 auto on_handle_created(const xtd::event_args& e) -> void override;
286
289 virtual auto on_selected_index_changed(const xtd::event_args& e) -> void;
290
291 auto wnd_proc(xtd::forms::message& message) -> void override;
293
295 friend class tab_page;
296 [[nodiscard]] auto get_child_index(xtd::intptr page) -> xtd::usize;
298
299 private:
300 friend class xtd::forms::form;
301 using control::controls;
302
303 auto wm_command_control(xtd::forms::message& message) -> void;
304
305 xtd::sptr<data> data_;
306 };
307 }
308}
typename xtd::collections::generic::extensions::enumerable_iterators< type_t, xtd::collections::generic::ienumerable< type_t > >::const_iterator const_iterator
Represents the const iterator of xtd::collections::generic::ienumerable value type.
Definition ienumerable.hpp:50
typename xtd::collections::generic::extensions::enumerable_iterators< type_t, xtd::collections::generic::ienumerable< type_t > >::iterator iterator
Represents the iterator of xtd::collections::generic::ienumerable value type.
Definition ienumerable.hpp:48
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
Provides data for the xtd::forms::control::control_added and xtd::forms::control::control_removed eve...
Definition control_event_args.hpp:27
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
auto get_child_index(xtd::intptr child) const -> xtd::usize
Retrieves the index of a control within the control collection.
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 location() const noexcept -> xtd::drawing::point
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
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
Represents a collection of controls.
Definition tab_control.hpp:44
auto insert_at(xtd::usize index, const xtd::string &text) -> void
Inserts specified element at specified index.
auto push_back(const xtd::string &text) -> void
Adds an element to the end.
auto add(const xtd::string &text, const string &name) -> void
Adds an element to the end.
auto insert_at(xtd::usize index, const xtd::string &text, const xtd::string &name) -> void
Inserts specified element at specified index.
tab_page_collection()=default
Creates a new object xtd::forms::control::tab_page_collection with specified allocator (optional).
auto insert(const_iterator pos, const xtd::string &text) -> iterator
Inserts specified element at specified position.
auto insert(const_iterator pos, const xtd::string &text, const xtd::string &name) -> iterator
Inserts specified element at specified position.
auto add(const xtd::string &text) -> void
Adds an element to the end.
auto insert(xtd::usize index, const xtd::string &text, const xtd::string &name) -> void
Inserts specified element at specified index.
xtd::forms::layout::arranged_element_collection< tab_page_ref > base
Represents the base type of the collection.
Definition tab_control.hpp:50
auto push_back(const xtd::string &text, const string &name) -> void
Adds an element to the end.
auto insert(xtd::usize index, const xtd::string &text) -> void
Inserts specified element at specified index.
static auto create() -> tab_control
A factory to create an xtd::forms::tab_control.
tab_control()
Initializes a new instance of the tab_control class.
auto on_control_added(const xtd::forms::control_event_args &e) -> void override
Raises the xtd::forms::control::control_added event.
virtual auto on_selected_index_changed(const xtd::event_args &e) -> void
Raises the tab_control::selected_index_changed event.
xtd::event< tab_control, xtd::event_handler > selected_index_changed
Occurs when the selected_index property has changed.
Definition tab_control.hpp:267
virtual auto alignment() const noexcept -> xtd::forms::tab_alignment
Gets the area of the control (for example, along the top) where the tabs are aligned.
auto on_control_removed(const xtd::forms::control_event_args &e) -> void override
Raises the xtd::forms::control::control_removed event.
auto on_handle_created(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::handle_created event.
auto wnd_proc(xtd::forms::message &message) -> void override
Processes Windows messages.
auto measure_control() const noexcept -> xtd::drawing::size override
Measure this control.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
virtual auto selected_index() const noexcept -> xtd::usize
Gets the index of the currently selected tab page.
virtual auto image_list() const noexcept -> const xtd::forms::image_list &
Gets the images to display on the control's tabs.
virtual auto tab_pages() noexcept -> tab_page_collection &
Gets the collection of tab pages in this tab control.
Represents a single tab page in a tab_control.
Definition tab_page.hpp:33
Contains xtd::forms::const_tab_page_ref typedef.
Contains xtd::forms::control control.
generic_event_handler< const xtd::event_args & > event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.hpp:24
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:26
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
std::intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:23
tab_alignment
Specifies the locations of the tabs in a tab control.
Definition tab_alignment.hpp:22
xtd::ref< xtd::forms::tab_page > tab_page_ref
Represents a tab_page reference.
Definition tab_page_ref.hpp:25
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
Implements a Windows message.
Definition message.hpp:33
Contains xtd::forms::tab_alignment enum class.
Contains xtd::forms::tab_page_ref typedef.