xtd 0.2.0
control.h
Go to the documentation of this file.
1 #pragma once
5 #include "../forms_export.h"
7 #include "anchor_styles.h"
8 #include "auto_size_mode.h"
9 #include "bounds_specified.h"
10 #include "component.h"
11 #include "const_control_ref.h"
12 #include "context_menu.h"
13 #include "control_appearance.h"
14 #include "control_event_handler.h"
15 #include "control_ref.h"
16 #include "control_styles.h"
17 #include "create_params.h"
18 #include "cursors.h"
19 #include "dock_style.h"
20 #include "help_event_handler.h"
21 #include "image_layout.h"
22 #include "iwin32_window.h"
23 #include "key_event_handler.h"
25 #include "mouse_event_handler.h"
26 #include "padding.h"
27 #include "paint_event_handler.h"
28 #include "message.h"
29 #include "timer.h"
32 #include <xtd/drawing/color>
33 #include <xtd/drawing/font>
34 #include <xtd/drawing/point>
35 #include <xtd/drawing/rectangle>
36 #include <xtd/drawing/size>
37 #include <xtd/forms/window_messages>
38 #include <xtd/any>
39 #include <xtd/async_result>
40 #include <xtd/optional>
41 #include <xtd/iequatable>
42 #include <xtd/isynchronize_invoke>
43 #include <cstdint>
44 #include <functional>
45 #include <map>
46 #include <memory>
47 #include <string>
48 #include <vector>
49 
51 namespace xtd {
53  namespace forms {
55  class application;
56  class context_menu;
57  class horizontal_layout_panel;
58  class screen;
59  class vertical_layout_panel;
60 
62 
78  class forms_export_ control : public component, public iwin32_window, public icomparable<control>, public xtd::iequatable<control>, public xtd::isynchronize_invoke {
79  struct data;
80 
81  protected:
83  enum class state : int64 {
84  empty = 0,
85  creating = 0b1,
86  created = 0b10,
87  destroying = 0b100,
88  destroyed = 0b1000,
89  creating_handle = 0b10000,
90  recreate = 0b100000,
91  parent_recreating = 0b1000000,
92 
93  client_size_setted = 0b10000000,
94  modal = 0b100000000,
95  top_level = 0b1000000000,
96  visible = 0b10000000000,
97  enabled = 0b100000000000,
98  auto_size = 0b1000000000000,
99  tab_stop = 0b10000000000000,
100  allow_drop = 0b100000000000000,
101  drop_target = 0b1000000000000000,
102 
103  layout_deferred = 0b10000000000000000,
104  docked = 0b100000000000000000,
105 
106  double_click_fired = 0b1000000000000000000,
107  double_buffered = 0b10000000000000000000,
108 
109  mouse_enter_pending = 0b100000000000000000000,
110  tracking_mouse_event = 0b1000000000000000000000,
111  mouse_pressed = 0b10000000000000000000000,
112  use_wait_cursor = 0b100000000000000000000000,
113 
114  is_accessible = 0b1000000000000000000000000,
115  no_zorder = 0b10000000000000000000000000,
116  size_locked_by_os = 0b10000000000000000000000000,
117  causes_validation = 0b100000000000000000000000000,
118  own_ctl_brush = 0b1000000000000000000000000000,
119  exception_while_painting = 0b10000000000000000000000000000,
120  layout_sis_dirty = 0b100000000000000000000000000000,
121  checked_host = 0b1000000000000000000000000000000,
122  hosted_in_dialog = 0b10000000000000000000000000000000,
123  validation_cancelled = 0b100000000000000000000000000000000,
124  mirrored = 0b1000000000000000000000000000000000,
125  };
126 
127  class async_result_invoke : public xtd::iasync_result {
128  struct data;
129  public:
130  explicit async_result_invoke(std::any async_state);
131  std::any async_state() const noexcept override;
132  xtd::threading::wait_handle& async_wait_handle() noexcept override;
133  bool completed_synchronously() const noexcept override;
134  bool is_completed() const noexcept override;
135 
136  std::shared_ptr<data> data_;
137  };
139 
140  public:
142 
145  using context_menu_ref = std::reference_wrapper<xtd::forms::context_menu>;
147 
150  public:
152 
157 
159 
164  explicit control_collection(const allocator_type& allocator = allocator_type());
166 
168  explicit control_collection(const base& collection);
169  control_collection(const control_collection& collection);
170  control_collection& operator =(const control_collection& collection);
173 
175 
177  using base::operator [];
182  std::optional<value_type> operator [](const xtd::ustring& name) const;
187  std::optional<value_type> operator [](const xtd::ustring& name);
189  };
190 
192 
196  control();
201  explicit control(const xtd::ustring& text);
207  control(const control& parent, const xtd::ustring& text);
226  control(const control& parent, const xtd::ustring& text, int32 left, int32 top, int32 width, int32 height);
228 
230  control(control&&) = default;
231  control(const control&) = delete;
232  ~control();
234 
236 
245  virtual anchor_styles anchor() const noexcept;
255  virtual control& anchor(anchor_styles anchor);
256 
259  virtual drawing::point auto_scroll_point() const noexcept;
260 
264  virtual bool auto_size() const noexcept;
269  virtual control& auto_size(bool auto_size);
270 
275  virtual drawing::color back_color() const noexcept;
283  virtual control& back_color(const drawing::color& color);
285  virtual control& back_color(std::nullptr_t);
287 
291  virtual const xtd::drawing::image& background_image() const noexcept;
296  virtual control& background_image(const xtd::drawing::image& background_image);
297 
302  virtual xtd::forms::image_layout background_image_layout() const noexcept;
303 
309  virtual control& background_image_layout(xtd::forms::image_layout background_image_layout);
310 
315  virtual int32 bottom() const noexcept;
316 
320  virtual drawing::rectangle bounds() const noexcept;
325  virtual control& bounds(const drawing::rectangle& bounds);
326 
330  virtual bool can_focus() const noexcept;
331 
343  virtual bool can_select() const noexcept;
344 
347  bool can_raise_events() const noexcept override;
348 
353  static bool check_for_illegal_cross_thread_calls() noexcept;
358  static void check_for_illegal_cross_thread_calls(bool value);
359 
364  virtual const drawing::rectangle& client_rectangle() const noexcept;
365 
369  virtual const drawing::size& client_size() const noexcept;
374  virtual control& client_size(const drawing::size& client_size);
375 
378  virtual xtd::ustring company_name() const noexcept;
379 
382  virtual std::optional<context_menu_ref> context_menu() const noexcept;
386  virtual control& context_menu(xtd::forms::context_menu& value);
390  virtual control& context_menu(std::nullptr_t);
391 
397  virtual forms::control_appearance control_appearance() const noexcept;
404 
411  virtual control_collection& controls() noexcept;
418  virtual const control_collection& controls() const noexcept;
419 
423  virtual bool created() const noexcept;
424 
427  virtual forms::cursor cursor() const noexcept;
431  virtual control& cursor(const forms::cursor& cursor);
433  virtual control& cursor(std::nullptr_t);
435 
438  virtual drawing::rectangle display_rectangle() const noexcept;
439 
448  virtual dock_style dock() const noexcept;
458  virtual control& dock(dock_style dock);
459 
462  virtual bool double_buffered() const noexcept;
466  virtual control& double_buffered(bool double_buffered);
467 
470  virtual bool enabled() const noexcept;
474  virtual control& enabled(bool enabled);
475 
478  virtual bool focused() const noexcept;
479 
482  virtual drawing::font font() const noexcept;
486  virtual control& font(const drawing::font& font);
488  virtual control& font(std::nullptr_t);
490 
493  virtual drawing::color fore_color() const noexcept;
497  virtual control& fore_color(const drawing::color& color);
499  virtual control& fore_color(std::nullptr_t);
501 
505  intptr handle() const override;
506 
509  virtual int32 height() const noexcept;
513  virtual control& height(int32 height);
514 
517  bool invoke_required() const noexcept override;
518 
522  bool is_handle_created() const noexcept;
523 
526  virtual int32 left() const noexcept;
530  virtual control& left(int32 left);
531 
534  virtual drawing::point location() const noexcept;
538  virtual control& location(const drawing::point& location);
539 
542  virtual forms::padding margin() const noexcept;
546  virtual control& margin(const forms::padding& margin);
547 
553  virtual const drawing::size& maximum_client_size() const noexcept;
559  virtual control& maximum_client_size(const drawing::size& size);
560 
566  virtual const drawing::size& maximum_size() const noexcept;
572  virtual control& maximum_size(const drawing::size& size);
573 
579  virtual const drawing::size& minimum_client_size() const noexcept;
585  virtual control& minimum_client_size(const drawing::size& size);
586 
592  virtual const drawing::size& minimum_size() const noexcept;
598  virtual control& minimum_size(const drawing::size& size);
599 
602  static forms::keys modifier_keys() noexcept;
603 
606  static forms::mouse_buttons mouse_buttons() noexcept;
607 
612  static xtd::drawing::point mouse_position() noexcept;
613 
617  intptr native_handle() const noexcept;
618 
621  virtual const xtd::ustring& name() const noexcept;
625  virtual control& name(const xtd::ustring& name);
626 
629  virtual forms::padding padding() const noexcept;
633  virtual control& padding(const forms::padding& padding);
634 
637  virtual std::optional<control_ref> parent() const noexcept;
641  virtual control& parent(const control& parent);
645  virtual control& parent(std::nullptr_t);
646 
649  virtual xtd::ustring product_name() const noexcept;
650 
653  bool recreating_handle() const noexcept;
654 
659  virtual const xtd::drawing::region& region() const noexcept;
665  virtual control& region(const xtd::drawing::region& value);
666 
669  virtual int32 right() const noexcept;
670 
673  virtual drawing::size size() const noexcept;
677  virtual control& size(const drawing::size& size);
678 
682  virtual style_sheets::style_sheet style_sheet() const noexcept;
686  virtual control& style_sheet(const style_sheets::style_sheet& value);
691  virtual control& style_sheet(const xtd::ustring& value);
696  virtual control& style_sheet(std::nullptr_t);
697 
702  virtual bool tab_stop() const noexcept;
708  virtual control& tab_stop(bool value);
709 
714  virtual std::any tag() const noexcept;
720  virtual control& tag(std::any tag);
721 
724  virtual const xtd::ustring& text() const noexcept;
728  virtual control& text(const xtd::ustring& text);
729 
733  intptr toolkit_handle() const noexcept;
734 
737  virtual int32 top() const noexcept;
741  virtual control& top(int32 top);
742 
745  virtual std::optional<control_ref> top_level_control() const noexcept;
746 
749  virtual bool visible() const noexcept;
753  virtual control& visible(bool visible);
754 
757  virtual int32 width() const noexcept;
761  virtual control& width(int32 width);
763 
765 
767  using isynchronize_invoke::begin_invoke;
771  xtd::async_result begin_invoke(delegate<void()> method) override;
772 
777  xtd::async_result begin_invoke(delegate<void(std::vector<std::any>)> method, const std::vector<std::any>& args) override;
778 
781  virtual void bring_to_front();
782 
783  int32 compare_to(const control& value) const noexcept override;
784 
790  static control create(const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
797  static control create(const control& parent, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
803  template<typename control_t>
804  static control_t create(const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string) {
805  control_t item;
806  if (location != drawing::point {-1, -1}) item.location(location);
807  if (size != drawing::size {-1, -1}) item.size(size);
808  item.name(name);
809  return item;
810  }
817  template<typename control_t>
818  static control_t create(const control& parent, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string) {
819  control_t item;
820  item.parent(parent);
821  if (location != drawing::point {-1, -1}) item.location(location);
822  if (size != drawing::size {-1, -1}) item.size(size);
823  item.name(name);
824  return item;
825  }
832  template<typename control_t>
833  static control_t create(const xtd::ustring& text, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string) {
834  control_t item;
835  item.text(text);
836  if (location != drawing::point {-1, -1}) item.location(location);
837  if (size != drawing::size {-1, -1}) item.size(size);
838  item.name(name);
839  return item;
840  }
848  template<typename control_t>
849  static control_t create(const control& parent, const xtd::ustring& text, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string) {
850  control_t item;
851  item.parent(parent);
852  item.text(text);
853  if (location != drawing::point {-1, -1}) item.location(location);
854  if (size != drawing::size {-1, -1}) item.size(size);
855  item.name(name);
856  return item;
857  }
858 
862  void create_control();
863 
868  drawing::graphics create_graphics() const;
869 
874  virtual void destroy_control();
875 
878  std::optional<object_ref> end_invoke(xtd::async_result async) override;
879 
880  bool equals(const control& value) const noexcept override;
881 
885  bool focus();
886 
891  static std::optional<control_ref> from_child_handle(intptr handle);
892 
896  static std::optional<control_ref> from_handle(intptr handle);
897 
900  auto_size_mode get_auto_size_mode() const;
901 
904  std::optional<xtd::drawing::color> get_back_color() const noexcept;
906 
909  std::optional<xtd::drawing::font> get_font() const noexcept;
911 
914  std::optional<xtd::drawing::color> get_fore_color() const noexcept;
916 
921  size_t get_child_index(intptr child) const;
922 
926  size_t get_child_index(intptr child, bool& throw_exception) const;
927 
930  virtual void hide();
931 
934  virtual void invalidate() const;
935 
939  virtual void invalidate(bool invalidate_children) const;
940 
944  virtual void invalidate(const drawing::rectangle& rect) const;
945 
950  virtual void invalidate(const drawing::rectangle& rect, bool invalidate_children) const;
951 
955  virtual void invalidate(const drawing::region& region) const;
956 
961  virtual void invalidate(const drawing::region& region, bool invalidate_children) const;
962 
966  std::optional<object_ref> invoke(delegate<void()> method) override;
970  std::optional<object_ref> invoke(delegate<void(std::vector<std::any>)> method, const std::vector<std::any>& args) override;
974  std::optional<object_ref> invoke(delegate<void(std::vector<std::any>)> method, std::any arg) override;
975 
978  void perform_layout();
979 
983  xtd::drawing::point point_to_client(const xtd::drawing::point& p) const;
984 
988  xtd::drawing::point point_to_screen(const xtd::drawing::point& p) const;
989 
994  virtual bool pre_process_message(xtd::forms::message& message);
995 
999  virtual void refresh() const;
1000 
1005  void resume_layout();
1006 
1013  void resume_layout(bool perform_layout);
1014 
1021  intptr send_message(intptr hwnd, int32 msg, intptr wparam, intptr lparam) const;
1022 
1025  void set_auto_size_mode(auto_size_mode auto_size_mode);
1026 
1032  void set_bounds(int32 x, int32 y, int32 width, int32 height);
1033 
1040  void set_bounds(int32 x, int32 y, int32 width, int32 height, bounds_specified specified);
1041 
1044  virtual void show();
1045 
1051  void suspend_layout();
1052 
1055  xtd::ustring to_string() const noexcept override;
1056 
1063  virtual void update() const;
1065 
1067 
1073  control& operator <<(control& child);
1074 
1079  control& operator >>(control& child);
1081 
1083 
1089 
1094 
1099 
1104 
1109 
1134 
1139 
1144 
1148 
1152 
1157 
1181 
1202 
1207 
1212 
1217 
1222 
1227 
1232 
1244 
1258 
1270 
1275 
1280 
1302 
1318 
1338 
1352 
1366 
1381 
1395 
1409 
1423 
1438 
1442 
1451 
1456 
1461 
1470 
1475 
1480 
1485 
1490 
1496 
1497  protected:
1498  friend class application;
1499  friend class context_menu;
1500  friend class horizontal_layout_panel;
1501  friend class paint_event_args;
1502  friend class screen;
1503  friend class vertical_layout_panel;
1504  friend class style_sheets::style_sheet;
1505 
1507 
1512 
1518  virtual forms::create_params create_params() const noexcept;
1519 
1523  virtual drawing::color default_back_color() const noexcept;
1524 
1527  virtual forms::cursor default_cursor() const noexcept;
1528 
1531  virtual drawing::font default_font() const noexcept;
1532 
1535  virtual drawing::color default_fore_color() const noexcept;
1536 
1539  virtual drawing::size default_size() const noexcept;
1541 
1543 
1549  virtual void create_handle();
1550 
1554  virtual void destroy_handle();
1555 
1558  virtual void def_wnd_proc(message& message);
1559 
1564  bool get_style(control_styles flag) const noexcept;
1565 
1568  virtual drawing::size measure_control() const noexcept;
1569 
1572  drawing::size measure_text() const noexcept;
1573 
1576  virtual void on_auto_size_changed(const event_args& e);
1577 
1580  virtual void on_back_color_changed(const event_args& e);
1581 
1584  virtual void on_background_image_changed(const event_args& e);
1585 
1588  virtual void on_background_image_layout_changed(const event_args& e);
1589 
1592  virtual void on_control_appearance_changed(const event_args& e);
1593 
1596  virtual void on_click(const event_args& e);
1597 
1600  virtual void on_client_size_changed(const event_args& e);
1601 
1604  virtual void on_control_added(const control_event_args& e);
1605 
1608  virtual void on_control_removed(const control_event_args& e);
1609 
1612  virtual void on_create_control();
1613 
1616  virtual void on_cursor_changed(const event_args& e);
1617 
1620  virtual void on_destroy_control();
1621 
1624  virtual void on_dock_changed(const event_args& e);
1625 
1628  virtual void on_double_click(const event_args& e);
1629 
1632  virtual void on_enabled_changed(const event_args& e);
1633 
1636  virtual void on_fore_color_changed(const event_args& e);
1637 
1640  virtual void on_font_changed(const event_args& e);
1641 
1644  virtual void on_got_focus(const event_args& e);
1645 
1648  virtual void on_handle_created(const event_args& e);
1649 
1652  virtual void on_handle_destroyed(const event_args& e);
1653 
1656  virtual void on_help_requested(help_event_args& e);
1657 
1660  virtual void on_key_down(key_event_args& e);
1661 
1664  virtual void on_key_press(key_press_event_args& e);
1665 
1668  virtual void on_key_up(key_event_args& e);
1669 
1672  virtual void on_layout(const event_args& e);
1673 
1676  virtual void on_location_changed(const event_args& e);
1677 
1680  virtual void on_lost_focus(const event_args& e);
1681 
1684  virtual void on_mouse_click(const mouse_event_args& e);
1685 
1688  virtual void on_mouse_double_click(const mouse_event_args& e);
1689 
1692  virtual void on_mouse_down(const mouse_event_args& e);
1693 
1696  virtual void on_mouse_enter(const event_args& e);
1697 
1700  virtual void on_mouse_horizontal_wheel(const mouse_event_args& e);
1701 
1704  virtual void on_mouse_leave(const event_args& e);
1705 
1708  virtual void on_mouse_move(const mouse_event_args& e);
1709 
1712  virtual void on_mouse_up(const mouse_event_args& e);
1713 
1716  virtual void on_mouse_wheel(const mouse_event_args& e);
1717 
1720  virtual void on_move(const event_args& e);
1721 
1724  virtual void on_paint(paint_event_args& e);
1725 
1729  virtual void on_paint_background(paint_event_args& e);
1730 
1733  virtual void on_parent_back_color_changed(const event_args& e);
1734 
1737  virtual void on_parent_cursor_changed(const event_args& e);
1738 
1741  virtual void on_parent_changed(const event_args& e);
1742 
1745  virtual void on_parent_enabled_changed(const event_args& e);
1746 
1749  virtual void on_parent_fore_color_changed(const event_args& e);
1750 
1753  virtual void on_parent_font_changed(const event_args& e);
1754 
1757  virtual void on_resize(const event_args& e);
1758 
1761  virtual void on_region_changed(const event_args& e);
1762 
1765  virtual void on_size_changed(const event_args& e);
1766 
1769  virtual void on_style_sheet_changed(const event_args& e);
1770 
1773  virtual void on_tab_stop_changed(const event_args& e);
1774 
1777  virtual void on_text_changed(const event_args& e);
1778 
1781  virtual void on_visible_changed(const event_args& e);
1782 
1783  void post_recreate_handle() noexcept;
1784 
1787  virtual void recreate_handle();
1788 
1799  virtual void set_bounds_core(int32 x, int32 y, int32 width, int32 height, bounds_specified specified);
1800 
1804  void set_can_focus(bool value);
1805 
1809  virtual void set_text(const xtd::ustring& text);
1810 
1818  virtual void set_client_size_core(int32 width, int32 height);
1819 
1822  static void set_mouse_buttons(forms::mouse_buttons value);
1823 
1826  void set_parent(intptr handle);
1827 
1833  void set_style(control_styles flag, bool value);
1834 
1840  virtual void wnd_proc(message& m);
1842 
1844  bool get_state(control::state flag) const noexcept;
1845  void set_state(control::state flag, bool value);
1846  bool on_context_menu_item_click(xtd::forms::context_menu& menu, intptr menu_id) const;
1848 
1849  private:
1850  void on_controls_item_added(size_t, control_ref item);
1851  void on_controls_item_removed(size_t, control_ref item);
1852  void on_parent_size_changed(object& sender, const event_args& e);
1853  void do_layout_children_with_dock_style();
1854  void do_layout_with_auto_size_mode();
1855  void do_layout_with_anchor_styles();
1856  void show_context_menu(xtd::forms::context_menu& menu, const xtd::drawing::point& pos) const;
1857  void reflect_message(intptr handle, message& message);
1858  intptr wnd_proc_(intptr hwnd, int32 msg, intptr wparam, intptr lparam, intptr handle);
1859  void wm_app_idle(message& message);
1860  void wm_child_activate(message& message);
1861  void wm_command(message& message);
1862  void wm_command_control(message& message);
1863  void wm_ctlcolor(message& message);
1864  void wm_ctlcolor_control(message& message);
1865  void wm_create(message& message);
1866  void wm_destroy(message& message);
1867  void wm_key_char(message& message);
1868  void wm_kill_focus(message& message);
1869  void wm_menu_command(message& message);
1870  void wm_mouse_down(message& message);
1871  void wm_mouse_double_click(message& message);
1872  void wm_mouse_enter(message& message);
1873  void wm_mouse_leave(message& message);
1874  void wm_mouse_up(message& message);
1875  void wm_mouse_move(message& message);
1876  void wm_move(message& message);
1877  void wm_mouse_wheel(message& message);
1878  void wm_notify(message& message);
1879  void wm_notify_control(message& message);
1880  void wm_paint(message& message);
1881  void wm_erase_background(message& message);
1882  void wm_help(message& message);
1883  void wm_scroll(message& message);
1884  void wm_scroll_control(message& message);
1885  void wm_set_focus(message& message);
1886  void wm_set_text(message& message);
1887  void wm_show(message& message);
1888  void wm_size(message& message);
1889  void wm_sizing(message& message);
1890  void wm_style_sheet_changed(message& message);
1891 
1892  static bool check_for_illegal_cross_thread_calls_;
1893  static forms::keys modifier_keys_;
1894  static forms::mouse_buttons mouse_buttons_;
1895  static std::map<intptr, control*> handles_;
1896  static control_collection top_level_controls_;
1897 
1898  std::shared_ptr<data> data_;
1899  };
1900  }
1901 }
event< control, event_handler > move
Occurs when the control is moved.
Definition: control.h:1441
event< control, key_press_event_handler > key_press
Occurs when a character. space or backspace key is pressed while the xtd::forms::control has focus...
Definition: control.h:1257
Represents a display device or multiple display devices on a single system.
Definition: screen.h:30
Contains xtd::forms::cursors factory.
event< control, help_event_handler > help_requested
Occurs when the user requests help for a xtd::forms::control.
Definition: control.h:1231
Represents a display device or multiple display devices on a single system.
Definition: padding.h:23
event< control, event_handler > background_image_layout_changed
Occurs when the value of the xtd::forms::control::background_image_layout property changes...
Definition: control.h:1103
event< control, event_handler > cursor_changed
Occurs when the value of the xtd::forms::control::cursor property changes.
Definition: control.h:1143
Contains xtd::forms::timer component.
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:151
event< control, event_handler > back_color_changed
Occurs when the value of the xtd::forms::control::back_color property changes.
Definition: control.h:1093
Bind control edges to the top of its container.
event< control, event_handler > double_click
Occurs when the xtd::forms::control is double-clicked.
Definition: control.h:1180
Represents the status of an asynchronous operation.
Definition: iasync_result.h:22
event< control, event_handler > mouse_leave
Occurs when the mouse pointer leaves the xtd::forms::control.
Definition: control.h:1394
mouse_buttons
Specifies constants that define which mouse button was pressed. This enumeration has a flag attribute...
Definition: mouse_buttons.h:20
event< control, event_handler > dock_changed
Occurs when the value of the xtd::forms::control::dock property changes.
Definition: control.h:1156
event< control, event_handler > parent_changed
Occurs when the value of the xtd::forms::control::parent property changes.
Definition: control.h:1455
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
Contains xtd::forms::key_event_handler event handler.
Contains xtd::forms::layout::arranged_element_collection collection.
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition: icomparable.h:17
Provides a way to synchronously or asynchronously execute a delegate.
Definition: isynchronize_invoke.h:26
event< control, event_handler > click
Occurs when the xtd::forms::control is clicked.
Definition: control.h:1133
Contains xtd::forms::style_sheets::style_sheet class.
event< control, event_handler > size_changed
Occurs when the value of the xtd::forms::control::size property changes.
Definition: control.h:1474
event< control, paint_event_handler > paint
Occurs when the xtd::forms::control is redrawn.
Definition: control.h:1450
virtual std::optional< object_ref > invoke(delegate< void()> value)=0
Synchronously executes the delegate on the thread that created this object and marshals the call to t...
The picture_box is sized equal to the size of the image that it contains.
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
Contains xtd::forms::paint_event_handler event handler.
event< control, mouse_event_handler > mouse_down
Occurs when the mouse pointer is over the xtd::forms::control and a mouse button is pressed...
Definition: control.h:1351
Represents a collection of controls.
Definition: control.h:149
event< control, event_handler > resize
Occurs when the xtd::forms::control is resized.
Definition: control.h:1469
std::reference_wrapper< xtd::forms::context_menu > context_menu_ref
Represent an xtd::forms::context_menu reference.
Definition: control.h:145
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:31
Used to group collections of vertically aligned controls.
Definition: vertical_layout_panel.h:29
Specifies that the top edge of the control is defined.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
xtd::forms::style_sheets::lengths margin
Margins are used to create space around elements, outside of any defined borders. ...
Definition: margin.h:24
std::shared_ptr< xtd::iasync_result > async_result
Represents the status of an asynchronous operation.
Definition: async_result.h:16
Contains xtd::forms::anchor_styles enum class.
auto_size_mode
Specifies how a control will behave when its auto_size property is enabled.
Definition: auto_size_mode.h:20
Contains xtd::forms::message class.
control_appearance
Specifies the appearance of a control.
Definition: control_appearance.h:19
Encapsulates the information needed when creating a control.
Definition: create_params.h:27
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
Specifies that the left edge of the control is defined.
Represents the image used to paint the mouse pointer.
Definition: cursor.h:38
Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inh...
Definition: region.h:32
event< control, event_handler > enabled_changed
Occurs when the value of the xtd::forms::control::enabled property changes.
Definition: control.h:1216
Represents a collection of objects.
Definition: arranged_element_collection.h:31
event< control, event_handler > client_size_changed
Occurs when the value of the xtd::forms::control::client_size property changes.
Definition: control.h:1138
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
Bind control edges to the bottom of its container.
Contains xtd::forms::control_appearance enum class.
Contains xtd::forms::control_styles enum class.
static control_t create(const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified location, size, and name.
Definition: control.h:804
control_state
Specifies the visual state of a control that is drawn with visual styles.
Definition: control_state.h:22
Contains xtd::forms::iwin32_window interface.
event< control, event_handler > got_focus
Occurs when the xtd::forms::control receives focus.
Definition: control.h:1201
Contains xtd::forms::control_ref typedef.
Contains xtd::forms::padding class.
event< control, control_event_handler > control_added
Occurs when a new xtd::forms::control::control is added to the xtd::forms::control::control_collectio...
Definition: control.h:1147
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:21
Contains xtd::forms::key_press_event_handler event handler.
event< control, key_event_handler > key_down
Occurs when a key is pressed while the xtd::forms::control has focus.
Definition: control.h:1243
Contains xtd::forms::image_layout enum class.
static control_t create(const control &parent, const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified parent, location, size, and name...
Definition: control.h:818
event< control, control_event_handler > control_removed
Occurs when a new xtd::forms::control:: is removed to the xtd::forms::control::control_collection.
Definition: control.h:1151
Specifies that the height of the control is defined.
The CTRL modifier key.
event< control, mouse_event_handler > mouse_move
Occurs when the mouse pointer is moved over the xtd::forms::control.
Definition: control.h:1408
event< control, event_handler > tab_stop_changed
Occurs when the xtd::forms::control::tab_stop property value changes.
Definition: control.h:1484
Represents an event.
Definition: event.h:21
event< control, event_handler > layout
Occurs when a xtd::forms::control should reposition its child controls.
Definition: control.h:1274
Bind control edges to the right of its container.
Provides data for the xtd::forms::control::paint event.
Definition: paint_event_args.h:28
event< control, event_handler > font_changed
Occurs when the value of the xtd::forms::control::font property changes.
Definition: control.h:1226
Provides static methods and properties to manage an application, such as methods to start and stop an...
Definition: application.h:50
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:18
event< control, event_handler > handle_destroyed
Occurs when the control&#39;s handle is in the process of being destroyed.
Definition: control.h:1211
control_styles
Specifies the style and behavior of a control.
Definition: control_styles.h:31
Contains xtd::forms::help_event_handler event handler.
event< control, event_handler > background_image_changed
Occurs when the value of the xtd::forms::control::background_image property changes.
Definition: control.h:1098
Contains xtd::forms::control_event_handler event handler.
Hides minimized windows by moving them off the visible area of the screen.
event< control, mouse_event_handler > mouse_up
Occurs when the mouse pointer is over the xtd::forms::control and a mouse button is released...
Definition: control.h:1422
Used to group collections of horizontally aligned controls.
Definition: horizontal_layout_panel.h:28
Specifies that the width of the control is defined.
Stores a set of four integers that represent the location and size of a rectangle.
Definition: rectangle.h:44
event< control, event_handler > fore_color_changed
Occurs when the value of the xtd::forms::control::fore_color property changes.
Definition: control.h:1221
Contains xtd::forms::visual_styles::control_state enum class.
event< control, event_handler > style_sheet_changed
Occurs when the value of the xtd::forms::control::style_sheet property changes or when xtd::applicati...
Definition: control.h:1479
event< control, event_handler > handle_created
Occurs when a handle is created for the xtd::forms::control.
Definition: control.h:1206
Indicates that all styles except allow_binary_specifier, allow_octal_specifier and allow_hex_specifie...
Contains xtd::forms::context_menu menu.
Implements a Windows message.
Definition: message.h:26
Represents the base functionality for all menus. Although tool_strip_drop_down and tool_strip_drop_do...
Definition: menu.h:35
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
event< control, key_event_handler > key_up
Occurs when a key is released while the xtd::forms::control has focus.
Definition: control.h:1269
event< control, event_handler > region_changed
Occurs when the value of the xtd::forms::control::region property changes.
Definition: control.h:1460
event< control, mouse_event_handler > mouse_wheel
Occurs when the mouse wheel moves while the xtd::forms::control has focus.
Definition: control.h:1437
Contains xtd::forms::const_control_ref typedef.
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
dock_style
Specifies the position and manner in which a control is docked.
Definition: dock_style.h:21
Contains xtd::forms::mouse_event_handler event handler.
keys
Specifies key codes and modifiers.
Definition: keys.h:74
event< control, event_handler > text_changed
Occurs when the value of the xtd::forms::control::text property changes.
Definition: control.h:1489
event< control, mouse_event_handler > mouse_click
Occurs when the xtd::forms::control is clicked by the mouse.
Definition: control.h:1317
Provides data for the xtd::forms::control::control_added and xtd::forms::control::control_removed eve...
Definition: help_event_args.h:24
Provides data for the xtd::forms::control::key_press event.
Definition: key_press_event_args.h:24
std::allocator< value_type > allocator_type
Represents the allocator type of the collection.
Definition: arranged_element_collection.h:68
event< control, event_handler > control_appearance_changed
Occurs when the value of the xtd::forms::control::control_appearance property changes.
Definition: control.h:1108
event< control, mouse_event_handler > mouse_double_click
Occurs when the xtd::forms::control is double clicked by the mouse.
Definition: control.h:1337
event< control, event_handler > mouse_enter
Occurs when the mouse pointer enters the xtd::forms::control.
Definition: control.h:1365
Contains xtd::forms::dock_style enum class.
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down, and xtd::forms::control::mouse_move events.
Definition: mouse_event_args.h:32
static control_t create(const xtd::ustring &text, const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified text, location ,size back_color and fore_color...
Definition: control.h:833
Represents a shortcut menu.
Definition: context_menu.h:33
Contains xtd::forms::auto_size_mode enum class.
Provides data for the xtd::forms::control::control_added and xtd::forms::control::control_removed eve...
Definition: control_event_args.h:25
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
static const ustring empty_string
Represents the empty string.
Definition: ustring.h:53
Contains xtd::forms::component class.
Creates a use wait cursor class.
Definition: use_wait_cursor.h:23
event< control, mouse_event_handler > mouse_horizontal_wheel
Occurs when the mouse horizontal wheel moves while the xtd::forms::control has focus.
Definition: control.h:1380
event< control, event_handler > location_changed
Occurs when the value of the xtd::forms::control::location property changes.
Definition: control.h:1279
std::reference_wrapper< control > control_ref
Represents a control reference.
Definition: control_ref.h:23
Specifies that both the x and y coordinates of the control are defined.
bounds_specified
Specifies the bounds of the control to use when defining a control&#39;s size and position. This enumeration has a flags attribute that allows a bitwise combination of its member values.
Definition: bounds_specified.h:20
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics.h:70
Contains xtd::forms::bounds_specified enum class.
static control_t create(const control &parent, const xtd::ustring &text, const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified parent, text, location, size, and name.
Definition: control.h:849
int_least64_t int64
Represents a 64-bit signed integer.
Definition: types.h:140
Provides data for the xtd::forms::control::key_down or xtd::forms::control::key_up event...
Definition: key_event_args.h:23
image_layout
Specifies the position of the image on the control.
Definition: image_layout.h:19
Bind control edges to the left of its container.
anchor_styles
Specifies how a control anchors to the edges of its container.
Definition: anchor_styles.h:19
event< control, event_handler > lost_focus
Occurs when the xtd::forms::control loses focus.
Definition: control.h:1301
Contains xtd::forms::create_params class.
The xtd::forms::status_bar_panel displays text in the standard font.
event< control, event_handler > visible_changed
Occurs when the value of the xtd::forms::control::visible property changes.
Definition: control.h:1494
The xtd::forms::style_sheets::style_sheet allows you to specify an xtd style sheet.
Definition: style_sheet.h:62
Provides the base implementation and enables object sharing between applications. ...
Definition: component.h:23
size_t size
Represents a size of any object in bytes.
Definition: types.h:195
event< control, event_handler > auto_size_changed
Occurs when the value of the xtd::forms::control::auto_size property changes.
Definition: control.h:1088
Encapsulates operating system specific objects that wait for exclusive access to shared resources...
Definition: wait_handle.h:48