33#include <xtd/drawing/color>
34#include <xtd/drawing/font>
35#include <xtd/drawing/point>
36#include <xtd/drawing/rectangle>
37#include <xtd/drawing/size>
39#include <xtd/async_result>
40#include <xtd/optional>
41#include <xtd/iclonable>
42#include <xtd/iequatable>
43#include <xtd/isynchronize_invoke>
86 enum class state :
int64 {
92 creating_handle = 0b10000,
94 parent_recreating = 0b1000000,
96 client_size_setted = 0b10000000,
98 top_level = 0b1000000000,
103 allow_drop = 0b100000000000000,
104 drop_target = 0b1000000000000000,
106 layout_deferred = 0b10000000000000000,
107 docked = 0b100000000000000000,
109 double_click_fired = 0b1000000000000000000,
112 mouse_enter_pending = 0b100000000000000000000,
113 tracking_mouse_event = 0b1000000000000000000000,
114 mouse_pressed = 0b10000000000000000000000,
117 is_accessible = 0b1000000000000000000000000,
118 no_zorder = 0b10000000000000000000000000,
119 size_locked_by_os = 0b10000000000000000000000000,
120 causes_validation = 0b100000000000000000000000000,
121 own_ctl_brush = 0b1000000000000000000000000000,
122 exception_while_painting = 0b10000000000000000000000000000,
123 layout_sis_dirty = 0b100000000000000000000000000000,
124 checked_host = 0b1000000000000000000000000000000,
125 hosted_in_dialog = 0b10000000000000000000000000000000,
126 validation_cancelled = 0b100000000000000000000000000000000,
127 mirrored = 0b1000000000000000000000000000000000,
136 bool completed_synchronously()
const noexcept override;
137 bool is_completed()
const noexcept override;
184 using base::operator [];
202 template<
class control_t>
203 void add(control_t& value) {
204 for (
auto it =
begin(); it !=
end(); ++it)
205 if (it->get() == value)
return;
206 if (!keep_cloned_controls_)
base::add(value);
210 controls_.add(std::move(control_ptr));
224 template<
class control_t,
class ...args_t>
228 controls_.add(std::move(control_ptr));
242 template<
class control_t,
class ...args_t>
246 controls_.add(std::move(control_ptr));
259 template<
class control_t,
class ...args_t>
263 controls_.add(std::move(control_ptr));
270 template<
class control_t>
271 void insert(
size_t index, control_t& value) {
272 for (
auto it =
begin(); it !=
end(); ++it)
273 if (it->get() == value)
return;
278 controls_.add(std::move(control_ptr));
287 using arranged_element_collection::push_back;
288 template<
class control_t>
289 [[deprecated(
"Replaced by xtd::forms::control::control_collection::add - Will be removed in version 0.4.0.")]]
290 void push_back(control_t& value) {
add(value);}
299 for (
auto i =
xtd::size {0};
i < controls_.count(); ++
i) {
300 if (controls_[
i].get() != &item.
get())
continue;
301 controls_.remove_at(
i);
311 bool keep_cloned_controls_ =
false;
504 virtual
control& context_menu(std::nullptr_t);
727 virtual const
xtd::
string&
name() const noexcept;
867 virtual const
xtd::
string&
text() const noexcept;
955 int32 compare_to(const
control& value) const noexcept override;
980 bool equals(const
xtd::
object& obj) const noexcept override;
1234 template<class control_t>
1236 auto result = control_t {};
1242 template<
class control_t>
1244 auto result = control_t {};
1252 template<
class control_t>
1254 auto result = control_t {};
1264 template<
class control_t>
1266 auto result = control_t {};
1275 template<
class control_t>
1277 auto result = control_t {};
1285 template<
class control_t>
1287 auto result = control_t {};
1297 template<
class control_t>
1299 auto result = control_t {};
1311 template<
class control_t>
1313 auto result = control_t {};
1323 template<
class control_t>
1325 auto result = control_t {};
1333 template<
class control_t>
1335 auto result = control_t {};
1345 template<
class control_t>
1347 auto result = control_t {};
1359 template<
class control_t>
1361 auto result = control_t {};
1372 template<
class control_t>
1374 auto result = control_t {};
1384 template<
class control_t>
1386 auto result = control_t {};
1398 template<
class control_t>
1400 auto result = control_t {};
1414 template<
class control_t>
1416 auto result = control_t {};
1863 friend class application;
1864 friend class context_menu;
1865 friend class horizontal_layout_panel;
1866 friend class paint_event_args;
1867 friend class screen;
1868 friend class vertical_layout_panel;
2162 void post_recreate_handle() noexcept;
2227 bool get_state(
control::state flag) const noexcept;
2228 void set_state(
control::state flag,
bool value);
2229 bool on_context_menu_item_click(
xtd::
forms::context_menu&
menu,
intptr menu_id) const;
2233 void do_layout_children_with_dock_style();
2234 void do_layout_with_auto_size_mode();
2235 void do_layout_with_anchor_styles();
2236 static
bool is_trace_form_or_control(const
string&
name);
2237 void on_controls_item_added(
size_t,
control_ref item);
2238 void on_controls_item_removed(
size_t,
control_ref item);
2239 void on_parent_size_changed(
object& sender, const
event_args&
e);
2276 static
bool check_for_illegal_cross_thread_calls_;
Contains xtd::forms::anchor_styles enum class.
Contains xtd::forms::layout::arranged_element_collection collection.
Contains xtd::forms::auto_size_mode enum class.
Contains xtd::forms::bounds_specified enum class.
Represent a polymorphic wrapper capable of holding any type.
Definition any_object.hpp:29
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:63
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:79
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:21
Represents the status of an asynchronous operation.
Definition iasync_result.hpp:25
Supports cloning, which creates a new instance of a class with the same value as an existing instance...
Definition iclonable.hpp:21
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Provides a way to synchronously or asynchronously execute a delegate.
Definition isynchronize_invoke.hpp:27
type & get() const
Gets the stored reference.
Definition reference_wrapper_object.hpp:190
Encapsulates operating system specific objects that wait for exclusive access to shared resources.
Definition wait_handle.hpp:52
Contains xtd::forms::component class.
Contains xtd::forms::const_control_ref typedef.
Contains xtd::forms::control_appearance enum class.
Contains xtd::forms::control_event_handler event handler.
Contains xtd::forms::control_ref typedef.
Contains xtd::forms::visual_styles::control_state enum class.
Contains xtd::forms::control_styles enum class.
Contains xtd::forms::create_params class.
Contains xtd::forms::cursors factory.
Contains xtd::forms::dock_style enum class.
#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
std::int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
xtd::reference_wrapper_object< type_t > ref
The xtd::ref object is a reference wrapper.
Definition ref.hpp:25
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:25
xtd::sptr< xtd::iasync_result > async_result
Represents the status of an asynchronous operation.
Definition async_result.hpp:19
uptr< type_t > new_uptr(args_t &&... args)
xtd::new_uptr operator. This operator creates a xtd::uptr object.
Definition new_uptr.hpp:24
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:59
xtd::ref< xtd::object > object_ref
Represents an object reference.
Definition object_ref.hpp:20
Contains xtd::forms::help_event_handler event handler.
Contains xtd::forms::image_layout enum class.
Contains xtd::forms::iwin32_window interface.
Contains xtd::forms::key_event_handler event handler.
Contains xtd::forms::key_press_event_handler event handler.
Contains xtd::forms::message class.
Contains xtd::forms::mouse_event_handler event handler.
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
const_iterator begin() const
Returns an iterator to the beginning.
Definition read_only_span.hpp:183
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Contains xtd::forms::padding class.
Contains xtd::forms::paint_event_handler event handler.
Contains xtd::forms::right_to_left enum class.
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:32
Contains xtd::forms::style_sheets::style_sheet class.