xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
control.h
Go to the documentation of this file.
1 #pragma once
5 #include <any>
6 #include <condition_variable>
7 #include <cstdint>
8 #include <functional>
9 #include <map>
10 #include <memory>
11 #include <optional>
12 #include <string>
13 #include <thread>
14 #include <vector>
15 #include <xtd/iasync_result.h>
16 #include <xtd/drawing/color.h>
17 #include <xtd/drawing/font.h>
18 #include <xtd/drawing/point.h>
19 #include <xtd/drawing/rectangle.h>
20 #include <xtd/drawing/size.h>
21 #include <xtd/forms/create_params.h>
22 
23 #include "../forms_export.h"
25 #include "anchor_styles.h"
26 #include "auto_size_mode.h"
27 #include "bounds_specified.h"
28 #include "component.h"
29 #include "control_event_handler.h"
30 #include "control_ref.h"
31 #include "control_styles.h"
32 #include "cursors.h"
33 #include "dock_style.h"
34 #include "image_layout.h"
35 #include "iwin32_window.h"
36 #include "key_event_handler.h"
38 #include "mouse_event_handler.h"
39 #include "padding.h"
40 #include "paint_event_handler.h"
41 #include "message.h"
42 #include "theme_colors.h"
43 #include "timer.h"
44 
46 namespace xtd {
48  namespace forms {
50  class application;
51  class screen;
53 
67  class forms_export_ control : public component, public iwin32_window {
68  protected:
70  enum class state {
71  empty = 0,
72  creating = 0b1,
73  created = 0b10,
74  destroying = 0b100,
75  destroyed = 0b1000,
76  creating_handle = 0b10000,
77  recreate = 0b100000,
78  parent_recreating = 0b1000000,
79 
80  client_size_setted = 0b10000000,
81  modal = 0b100000000,
82  top_level = 0b1000000000,
83  visible = 0b10000000000,
84  enabled = 0b100000000000,
85  auto_size = 0b1000000000000,
86  tab_stop = 0b10000000000000,
87  allow_drop = 0b100000000000000,
88  drop_target = 0b1000000000000000,
89 
90  layout_deferred = 0b10000000000000000,
91  docked = 0b100000000000000000,
92 
93  double_click_fired = 0b1000000000000000000,
94  double_buffered = 0b10000000000000000000,
95  /*
96  mouse_enter_pending = 0,
97  tracking_mouse_event = 0,
98  mouse_pressed = 0,
99  use_wait_cursor = 0,
100  */
101 
102  /*
103  is_accessible = 0,
104  no_zorder = 0,
105  size_locked_by_os = 0,
106  causes_validation = 0,
107  own_ctl_brush = 0,
108  exception_while_painting = 0,
109  layout_sis_dirty = 0,
110  checked_host = 0,
111  hosted_in_dialog = 0,
112  validation_cancelled = 0,
113  mirrored = 0,
114  */
115  };
117 
119  public:
120  async_result_invoke(std::any async_state) : async_state_(async_state) {}
121  std::any async_state() const noexcept override {return async_state_;}
122  std::shared_mutex& async_mutex() override {return *async_mutex_;}
123  bool completed_synchronously() const noexcept override {return false;}
124  bool is_completed() const noexcept override {return *is_completed_;};
125 
126  std::any async_state_;
127  std::shared_ptr<bool> is_completed_ = std::make_shared<bool>(false);
128  std::shared_ptr<std::shared_mutex> async_mutex_ = std::make_shared<std::shared_mutex>();
129  };
130 
131  public:
134  public:
137 
141  explicit control_collection(const allocator_type& allocator = allocator_type());
143  control_collection(const base& collection);
144  control_collection(const control_collection& collection);
145  control_collection& operator=(const control_collection& collection);
148 
149  using base::operator[];
154  std::optional<value_type> operator[](const xtd::ustring& name) const;
159  std::optional<value_type> operator[](const xtd::ustring& name);
160  };
161 
169  explicit control(const xtd::ustring& text) : control() {
170  this->text(text);
171  }
177  explicit control(const control& parent, const xtd::ustring& text) : control() {
178  this->parent(parent);
179  this->text(text);
180  }
189  explicit control(const xtd::ustring& text, int32_t left, int32_t top, int32_t width, int32_t height) : control() {
190  this->text(text);
191  this->left(left);
192  this->top(top);
193  this->width(width);
194  this->height(height);
195  }
205  explicit control(const control& parent, const xtd::ustring& text, int32_t left, int32_t top, int32_t width, int32_t height) : control() {
206  this->parent(parent);
207  this->text(text);
208  this->left(left);
209  this->top(top);
210  this->width(width);
211  this->height(height);
212  }
213 
215  control(control&&) = delete;
216  control(const control&) = delete;
217  ~control();
219 
227  virtual anchor_styles anchor() const {return anchor_;}
236  virtual control& anchor(anchor_styles anchor);
237 
240  virtual drawing::point auto_scroll_point() const {return auto_scroll_point_;}
241 
245  virtual bool auto_size() const {return get_state(state::auto_size);}
250  virtual control& auto_size(bool auto_size);
251 
256  virtual drawing::color back_color() const;
264  virtual control& back_color(const drawing::color& color);
266  virtual control& back_color(nullptr_t);
268 
272  virtual const xtd::drawing::image& background_image() const {return background_image_;}
277  virtual control& background_image(const xtd::drawing::image& background_image);
278 
283  virtual xtd::forms::image_layout background_image_layout() const {return background_image_layout_;}
284 
290  virtual control& background_image_layout(xtd::forms::image_layout background_image_layout);
291 
296  virtual int32_t bottom() const {return top() + height();}
297 
301  virtual drawing::rectangle bounds() const {return {location_, size_};}
306  virtual control& bounds(const drawing::rectangle& bounds) {
307  set_bounds_core(bounds.x(), bounds.y(), bounds.width(), bounds.height(), bounds_specified::all);
308  return *this;
309  }
310 
314  virtual bool can_focus() const;
315 
327  virtual bool can_select() const {return enabled() && visible() && get_style(control_styles::selectable);}
328 
331  bool can_raise_events() const override {return can_raise_events_;}
332 
337  virtual const drawing::rectangle& client_rectangle() const {return client_rectangle_;}
338 
342  virtual const drawing::size& client_size() const {return client_size_;}
347  virtual control& client_size(const drawing::size& client_size) {
348  if (!get_state(state::client_size_setted) || client_size_ != client_size) {
349  set_state(state::client_size_setted, true);
350  set_client_size_core(client_size.width(), client_size.height());
351  }
352  return *this;
353  }
354 
357  virtual xtd::ustring company_name() const {return "Gammasoft";}
358 
365  virtual control_collection& controls() {return controls_;}
372  virtual const control_collection& controls() const {return controls_;}
373 
377  virtual bool created() {return get_state(state::created);}
378 
381  virtual forms::cursor cursor() const;
385  virtual control& cursor(const forms::cursor& cursor);
387  virtual control& cursor(nullptr_t);
389 
393  virtual drawing::color default_back_color() const {return xtd::forms::theme_colors::current_theme().control();}
394 
398 
401  virtual drawing::font default_font() const;
402 
405  virtual drawing::color default_fore_color() const {return xtd::forms::theme_colors::current_theme().control_text();}
406 
409  virtual drawing::size default_size() const {return {0, 0};}
410 
413  virtual drawing::rectangle display_rectangle() const {return client_rectangle_;}
414 
423  virtual dock_style dock() const {return dock_;}
433  virtual control& dock(dock_style dock);
434 
437  virtual bool double_buffered() const {return get_state(state::double_buffered);}
441  virtual control& double_buffered(bool double_buffered) {
442  set_state(state::double_buffered, double_buffered);
443  return *this;
444  }
445 
448  virtual bool enabled() const {return get_state(state::enabled);}
452  virtual control& enabled(bool enabled);
453 
456  virtual bool focused() const {return focused_;}
457 
460  virtual drawing::color fore_color() const;
464  virtual control& fore_color(const drawing::color& color);
466  virtual control& fore_color(nullptr_t);
468 
471  virtual drawing::font font() const;
475  virtual control& font(const drawing::font& font);
477  virtual control& font(nullptr_t);
479 
482  intptr_t handle() const override;
483 
486  virtual int32_t height() const {return size_.height();}
490  virtual control& height(int32_t height) {
491  if (size_.height() != height)
492  set_bounds_core(0, 0, 0, height, bounds_specified::height);
493  return *this;
494  }
495 
499  bool is_handle_created() const;
500 
503  virtual int32_t left() const {return location_.x();}
507  virtual control& left(int32_t left) {
508  if (location_.x() != left)
509  set_bounds_core(left, 0, 0, 0, bounds_specified::x);
510  return *this;
511  }
512 
515  virtual drawing::point location() const {return location_;}
519  virtual control& location(const drawing::point& location) {
520  if (location_ != location)
521  set_bounds_core(location.x(), location.y(), 0, 0, bounds_specified::location);
522  return *this;
523  }
524 
527  virtual forms::padding margin() const {return margin_;}
531  virtual control& margin(const forms::padding& margin) {
532  if (margin_ != margin)
533  margin_ = margin;
534  return *this;
535  }
536 
542  virtual const drawing::size& maximum_size() const;
549 
555  virtual const drawing::size& minimum_size() const;
562 
565  static forms::keys modifier_keys() {return modifier_keys_;}
566 
569  static forms::mouse_buttons mouse_buttons() {return mouse_buttons_;}
570 
573  virtual const xtd::ustring& name() const {return name_;}
577  virtual control& name(const xtd::ustring& name) {
578  name_ = name;
579  return*this;
580  }
581 
584  virtual forms::padding padding() const {return padding_;}
589  if (padding_ != padding)
590  padding_ = padding;
591  return *this;
592  }
593 
596  virtual std::optional<control_ref> parent() const {return from_handle(parent_);}
600  virtual control& parent(const control& parent);
604  virtual control& parent(std::nullptr_t);
605 
608  virtual xtd::ustring product_name() const {return "xtd";}
609 
612  bool recreating_handle() const {return get_state(state::recreate);}
613 
616  virtual int32_t right() const {return left() + width();}
617 
620  virtual const drawing::size& size() const {return size_;}
624  virtual control& size(const drawing::size& size) {
625  if (get_state(state::client_size_setted) || size_ != size) {
626  set_state(state::client_size_setted, false);
627  set_bounds_core(0, 0, size.width(), size.height(), bounds_specified::size);
628  }
629  return *this;
630  }
631 
636  virtual std::any tag() const {return tag_;}
637 
643  virtual control& tag(std::any tag) {
644  tag_ = tag;
645  return*this;
646  }
647 
650  virtual const xtd::ustring& text() const {return text_;}
654  virtual control& text(const xtd::ustring& text);
655 
658  virtual int32_t top() const {return location_.y();}
662  virtual control& top(int32_t top) {
663  if (location_.y() != top)
664  set_bounds_core(0, top, 0, 0, bounds_specified::y);
665  return *this;
666  }
667 
670  virtual std::optional<control_ref> top_level_control() const;
671 
674  virtual bool visible() const {return get_state(state::visible);}
678  virtual control& visible(bool visible);
679 
682  virtual int32_t width() const {return size_.width();}
686  virtual control& width(int32_t width) {
687  if (size_.width() != width)
688  set_bounds_core(0, 0, width, 0, bounds_specified::width);
689  return *this;
690  }
691 
696  friend control& operator<<(control& parent, control& child) {
697  child.parent(parent);
698  return parent;
699  }
700 
705  friend control& operator>>(control& parent, control& child) {
706  if (child.parent().has_value() && &child.parent().value().get() == &parent)
707  child.parent(nullptr);
708  return parent;
709  }
710 
714  std::shared_ptr<xtd::iasync_result> begin_invoke(delegate<void()> value) {return begin_invoke(delegate<void(std::vector<std::any>)>(value), {});}
715 
720  std::shared_ptr<xtd::iasync_result> begin_invoke(delegate<void(std::vector<std::any>)> value, const std::vector<std::any>& args);
721 
723  template<typename delegate_t>
724  std::shared_ptr<xtd::iasync_result> begin_invoke(delegate_t value, const std::vector<std::any>& args) {return begin_invoke(delegate<void(std::vector<std::any>)>(value), args);}
725 
726  template<typename delegate_t>
727  std::shared_ptr<xtd::iasync_result> begin_invoke(delegate_t value) {return begin_invoke(delegate<void(std::vector<std::any>)>(value), {});}
729 
732  virtual void bring_to_front();
733 
740  template<typename control_t>
741  static std::unique_ptr<control_t> create(const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const drawing::color& back_color = drawing::color::empty, const drawing::color& fore_color = drawing::color::empty) {
742  std::unique_ptr<control_t> item = std::make_unique<control_t>();
743  if (location != drawing::point {-1, -1}) item->location(location);
744  if (size != drawing::size {-1, -1}) item->size(size);
745  if (back_color != drawing::color::empty) item->back_color(back_color);
746  if (fore_color != drawing::color::empty) item->fore_color(fore_color);
747  return item;
748  }
749 
757  template<typename control_t>
758  static std::unique_ptr<control_t> create(const control& parent, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const drawing::color& back_color = drawing::color::empty, const drawing::color& fore_color = drawing::color::empty) {
759  std::unique_ptr<control_t> item = std::make_unique<control_t>();
760  item->parent(parent);
761  if (location != drawing::point {-1, -1}) item->location(location);
762  if (size != drawing::size {-1, -1}) item->size(size);
763  if (back_color != drawing::color::empty) item->back_color(back_color);
764  if (fore_color != drawing::color::empty) item->fore_color(fore_color);
765  return item;
766  }
767 
775  template<typename control_t>
776  static std::unique_ptr<control_t> create(const xtd::ustring& text, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const drawing::color& back_color = drawing::color::empty, const drawing::color& fore_color = drawing::color::empty) {
777  std::unique_ptr<control_t> item = std::make_unique<control_t>();
778  item->text(text);
779  if (location != drawing::point {-1, -1}) item->location(location);
780  if (size != drawing::size {-1, -1}) item->size(size);
781  if (back_color != drawing::color::empty) item->back_color(back_color);
782  if (fore_color != drawing::color::empty) item->fore_color(fore_color);
783  return item;
784  }
785 
794  template<typename control_t>
795  static std::unique_ptr<control_t> create(const control& parent, const xtd::ustring& text, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const drawing::color& back_color = drawing::color::empty, const drawing::color& fore_color = drawing::color::empty) {
796  std::unique_ptr<control_t> item = std::make_unique<control_t>();
797  item->parent(parent);
798  item->text(text);
799  if (location != drawing::point {-1, -1}) item->location(location);
800  if (size != drawing::size {-1, -1}) item->size(size);
801  if (back_color != drawing::color::empty) item->back_color(back_color);
802  if (fore_color != drawing::color::empty) item->fore_color(fore_color);
803  return item;
804  }
805 
810 
816 
821  virtual void create_handle();
822 
827  virtual void destroy_control();
828 
832  virtual void destroy_handle();
833 
836  void end_invoke(std::shared_ptr<xtd::iasync_result> async);
837 
841  bool focus();
842 
847  static std::optional<control_ref> from_child_handle(intptr_t handle);
848 
852  static std::optional<control_ref> from_handle(intptr_t handle);
853 
858  size_t get_child_index(intptr_t child) const {
859  for (size_t index = 0;index < controls().size(); ++index)
860  if (controls()[index].get().handle() == child) return index;
862  }
863 
867  size_t get_child_index(intptr_t child, bool& throw_exception) const {
868  throw_exception = false;
869  try {
870  return get_child_index(child);
871  } catch(...) {
872  throw_exception = true;
873  return control_collection::npos;
874  }
875  }
876 
879  virtual void hide() {visible(false);}
880 
883  virtual void invalidate() const {invalidate({{0, 0}, client_size()}, false);}
884 
888  virtual void invalidate(bool invalidate_children) const {invalidate({{0, 0}, client_size()}, invalidate_children);}
889 
893  virtual void invalidate(const drawing::rectangle& rect) const {invalidate(rect, false);}
894 
899  virtual void invalidate(const drawing::rectangle& rect, bool invalidate_children) const;
900 
903  void invoke(delegate<void()> value) {invoke(delegate<void(std::vector<std::any>)>(value), {});}
904 
908  void invoke(delegate<void(std::vector<std::any>)> value, const std::vector<std::any>& args) {end_invoke(begin_invoke(value, args));}
909 
911  template<typename delegate_t>
912  void invoke(delegate_t value, const std::vector<std::any>& args) {invoke(delegate<void(std::vector<std::any>)>(value), args);}
913 
914  template<typename delegate_t>
915  void invoke(delegate_t value) {invoke(delegate<void(std::vector<std::any>)>(value), {});}
917 
921 
926 
931 
937 
941  virtual void refresh() const;
942 
947  void resume_layout() {resume_layout(true);}
948 
955  void resume_layout(bool perform_layout) {
956  set_state(state::layout_deferred, false);
957  if (perform_layout) this->perform_layout();
958  }
959 
966  intptr_t send_message(intptr_t hwnd, int32_t msg, intptr_t wparam, intptr_t lparam) const;
967 
971 
977  void set_bounds(int32_t x, int32_t y, int32_t width, int32_t height) {set_bounds(x, y, width, height, bounds_specified::all);}
978 
985  void set_bounds(int32_t x, int32_t y, int32_t width, int32_t height, bounds_specified specified) {set_bounds_core(x, y, width, height, specified);}
986 
989  virtual void show() {visible(true);}
990 
996  void suspend_layout() {
997  set_state(state::layout_deferred, true);
998  }
999 
1002  xtd::ustring to_string() const noexcept override;
1003 
1010  virtual void update() const;
1011 
1013  friend std::ostream& operator<<(std::ostream& os, const xtd::forms::control& control) noexcept {
1014  return os << control.to_string();
1015  }
1016 
1017  bool operator==(const control& value) const {return this == &value;}
1018  bool operator!=(const control& value) const {return !operator==(value);}
1019  bool operator<(const control& value) const {return this < &value;}
1021 
1026 
1031 
1036 
1041 
1066 
1071 
1076 
1080 
1084 
1089 
1113 
1134 
1139 
1144 
1149 
1154 
1159 
1171 
1185 
1197 
1202 
1207 
1229 
1245 
1265 
1279 
1293 
1308 
1322 
1336 
1350 
1365 
1374 
1379 
1388 
1393 
1398 
1403 
1404  protected:
1405  friend class application;
1406  friend class paint_event_args;
1407  friend class screen;
1408 
1414  virtual forms::create_params create_params() const;
1415 
1418  virtual void def_wnd_proc(message& message);
1419 
1424  bool get_style(control_styles flag) const {return ((int32_t)style_ & (int32_t)flag) == (int32_t)flag;}
1425 
1429 
1433 
1437  virtual void on_auto_size_changed(const event_args& e);
1438 
1442  virtual void on_back_color_changed(const event_args& e);
1443 
1447  virtual void on_background_image_changed(const event_args& e);
1448 
1453 
1457  virtual void on_click(const event_args& e);
1458 
1462  virtual void on_client_size_changed(const event_args& e);
1463 
1467  virtual void on_control_added(const control_event_args& e);
1468 
1472  virtual void on_control_removed(const control_event_args& e);
1473 
1477  virtual void on_create_control();
1478 
1482  virtual void on_cursor_changed(const event_args& e);
1483 
1487  virtual void on_dock_changed(const event_args& e);
1488 
1492  virtual void on_double_click(const event_args& e);
1493 
1497  virtual void on_enabled_changed(const event_args& e);
1498 
1502  virtual void on_fore_color_changed(const event_args& e);
1503 
1507  virtual void on_font_changed(const event_args& e);
1508 
1512  virtual void on_got_focus(const event_args& e);
1513 
1517  virtual void on_handle_created(const event_args& e);
1518 
1522  virtual void on_handle_destroyed(const event_args& e);
1523 
1527  virtual void on_key_down(key_event_args& e);
1528 
1533 
1537  virtual void on_key_up(key_event_args& e);
1538 
1542  virtual void on_layout(const event_args& e);
1543 
1547  virtual void on_location_changed(const event_args& e);
1548 
1552  virtual void on_lost_focus(const event_args& e);
1553 
1557  virtual void on_mouse_click(const mouse_event_args& e);
1558 
1562  virtual void on_mouse_double_click(const mouse_event_args& e);
1563 
1567  virtual void on_mouse_down(const mouse_event_args& e);
1568 
1572  virtual void on_mouse_enter(const event_args& e);
1573 
1578 
1582  virtual void on_mouse_leave(const event_args& e);
1583 
1587  virtual void on_mouse_move(const mouse_event_args& e);
1588 
1592  virtual void on_mouse_up(const mouse_event_args& e);
1593 
1597  virtual void on_mouse_wheel(const mouse_event_args& e);
1598 
1602  virtual void on_paint(paint_event_args& e);
1603 
1608 
1612  virtual void on_parent_cursor_changed(const event_args& e);
1613 
1617  virtual void on_parent_changed(const event_args& e);
1618 
1622  virtual void on_parent_enabled_changed(const event_args& e);
1623 
1628 
1632  virtual void on_parent_font_changed(const event_args& e);
1633 
1637  virtual void on_resize(const event_args& e);
1638 
1642  virtual void on_size_changed(const event_args& e);
1643 
1647  virtual void on_text_changed(const event_args& e);
1648 
1652  virtual void on_visible_changed(const event_args& e);
1653 
1656  virtual void recreate_handle();
1657 
1668  virtual void set_bounds_core(int32_t x, int32_t y, int32_t width, int32_t height, bounds_specified specified);
1669 
1677  virtual void set_client_size_core(int32_t width, int32_t height);
1678 
1684  void set_style(control_styles flag, bool value) {style_ = value ? (control_styles)((int32_t)style_ | (int32_t)flag) : (control_styles)((int32_t)style_ & ~(int32_t)flag);}
1685 
1691  virtual void wnd_proc(message& m);
1692 
1694  bool get_state(control::state flag) const {return ((int32_t)state_ & (int32_t)flag) == (int32_t)flag;}
1695  void set_state(control::state flag, bool value) { state_ = value ? (control::state)((int32_t)state_ | (int32_t)flag) : (control::state)((int32_t)state_ & ~(int32_t)flag); }
1696 
1698  drawing::point auto_scroll_point_;
1700  std::optional<drawing::color> back_color_;
1701  xtd::drawing::image background_image_ = xtd::drawing::image::empty;
1702  xtd::forms::image_layout background_image_layout_ = xtd::forms::image_layout::tile;
1703  bool can_focus_ = true;
1704  bool can_raise_events_ = true;
1705  drawing::rectangle client_rectangle_;
1706  drawing::size client_size_;
1707  control_collection controls_;
1708  std::optional<forms::cursor> cursor_;
1709  dock_style dock_ = dock_style::none;
1710  bool focused_ = false;
1711  std::optional<drawing::color> fore_color_;
1712  std::optional<drawing::font> font_;
1713  intptr_t handle_ = 0;
1714  drawing::point location_;
1715  forms::padding margin_ {3};
1716  drawing::size maximum_size_;
1717  drawing::size minimum_size_;
1718  forms::padding padding_;
1719  static forms::keys modifier_keys_;
1720  static forms::mouse_buttons mouse_buttons_;
1721  bool mouse_in_ = false;
1722  xtd::ustring name_;
1723  intptr_t parent_ = 0;
1724  drawing::size parent_size_;
1725  drawing::size size_;
1726  control::state state_ = state::empty;
1728  std::any tag_;
1729  xtd::ustring text_;
1730  static std::map<intptr_t, control*> handles_;
1731  static control_collection top_level_controls_;
1733 
1734  private:
1735  void on_parent_size_changed(object& sender, const event_args& e);
1736  void do_layout_children_with_dock_style();
1737  void do_layout_with_auto_size_mode();
1738  void do_layout_with_anchor_styles();
1739  control(const xtd::ustring& name, bool) {name_ = name;}
1740  intptr_t wnd_proc_(intptr_t hwnd, int32_t msg, intptr_t wparam, intptr_t lparam, intptr_t handle);
1741  void wm_child_activate(message& message);
1742  void wm_create(message& message);
1743  void wm_command(message& message);
1744  void wm_key_char(message& message);
1745  void wm_kill_focus(message& message);
1746  void wm_mouse_down(message& message);
1747  void wm_mouse_double_click(message& message);
1748  void wm_mouse_enter(message& message);
1749  void wm_mouse_leave(message& message);
1750  void wm_mouse_up(message& message);
1751  void wm_mouse_move(message& message);
1752  void wm_move(message& message);
1753  void wm_mouse_wheel(message& message);
1754  void wm_paint(message& message);
1755  void wm_scroll(message& message);
1756  void wm_set_focus(message& message);
1757  void wm_set_text(message& message);
1758  void wm_size(message& message);
1759  };
1760  }
1761 }
Contains xtd::forms::anchor_styles enum class.
Contains xtd::forms::arranged_element_collection collection.
Contains xtd::forms::auto_size_mode enum class.
Contains xtd::forms::bounds_specified enum class.
The exception that is thrown when one of the arguments provided to a method is not valid.
Definition: argument_exception.h:19
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:39
static const xtd::drawing::color empty
Represents a color that is null.
Definition: color.h:42
Defines a particular format for text, including font face, size, and style attributes....
Definition: font.h:39
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics.h:48
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition: image.h:34
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:48
Stores a set of four integers that represent the location and size of a rectangle.
Definition: rectangle.h:25
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
int32_t width() const
Gets the horizontal component of this Size class.
Definition: size.h:67
int32_t height() const
Gets he vertical component of this Size Class.
Definition: size.h:57
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 static methods and properties to manage an application, such as methods to start and stop an...
Definition: application.h:54
Provides the base implementation and enables object sharing between applications.
Definition: component.h:21
bool is_completed() const noexcept override
Gets a value that indicates whether the asynchronous operation has completed.
Definition: control.h:124
std::shared_mutex & async_mutex() override
Gets a std::mutex that is used to wait for an asynchronous operation to complete.
Definition: control.h:122
bool completed_synchronously() const noexcept override
Gets a value that indicates whether the asynchronous operation completed synchronously.
Definition: control.h:123
std::any async_state() const noexcept override
Gets a user-defined object that qualifies or contains information about an asynchronous operation.
Definition: control.h:121
Represents a collection of controls.
Definition: control.h:133
control_collection(const allocator_type &allocator=allocator_type())
Creates a new object xtd::forms::control::control_collection with specified allocator (optional).
std::optional< value_type > operator[](const xtd::ustring &name)
Gets the first xtd::forms::control::control_collection in the list with the specified name.
std::optional< value_type > operator[](const xtd::ustring &name) const
Gets the first xtd::forms::control::control_collection in the list with the specified name.
Provides data for the control_added and control_removed events.
Definition: control_event_args.h:23
Defines the base class for controls, which are components with visual representation.
Definition: control.h:67
std::shared_ptr< xtd::iasync_result > begin_invoke(delegate< void()> value)
Executes the specified delegate asynchronously on the thread that the control's underlying handle was...
Definition: control.h:714
virtual void bring_to_front()
Brings the control to the front of the z-order.
virtual int32_t bottom() const
Gets the distance, in pixels, between the bottom edge of the control and the top edge of its containe...
Definition: control.h:296
intptr_t send_message(intptr_t hwnd, int32_t msg, intptr_t wparam, intptr_t lparam) const
Send a message with specified hwnd, message, wparam and lparam.
virtual const control_collection & controls() const
Gets the collection of controls contained within the control.
Definition: control.h:372
virtual void destroy_handle()
Destroys the handle associated with the control.
virtual std::optional< control_ref > parent() const
Gets the parent container of the control.
Definition: control.h:596
virtual const drawing::size & client_size() const
Gets the height and width of the client area of the control.
Definition: control.h:342
control(const xtd::ustring &text, int32_t left, int32_t top, int32_t width, int32_t height)
Initializes a new instance of the control class with specific text, size, and location.
Definition: control.h:189
virtual void invalidate(bool invalidate_children) const
Invalidates a specific region of the control and causes a paint message to be sent to the control....
Definition: control.h:888
virtual std::any tag() const
Gets the object that contains data about the control.
Definition: control.h:636
void end_invoke(std::shared_ptr< xtd::iasync_result > async)
Retrieves the return value of the asynchronous operation represented by the async_result_invoke passe...
virtual drawing::color default_fore_color() const
Gets the default foreground color of the control.
Definition: control.h:405
virtual control_collection & controls()
Gets the collection of controls contained within the control.
Definition: control.h:365
virtual forms::padding margin() const
Gets the space between controls.
Definition: control.h:527
void invoke(delegate< void()> value)
Executes the specified delegate on the thread that owns the control's underlying window handle.
Definition: control.h:903
virtual void def_wnd_proc(message &message)
Sends the specified message to the default window procedure.
virtual control & left(int32_t left)
Sets the distance, in pixels, between the left edge of the control and the left edge of its container...
Definition: control.h:507
virtual control & padding(const forms::padding &padding)
Sets padding within the control.
Definition: control.h:588
control(const xtd::ustring &text)
Initializes a new instance of the control class with specific text.
Definition: control.h:169
virtual forms::padding padding() const
Gets padding within the control.
Definition: control.h:584
virtual drawing::color default_back_color() const
Gets the default background color of the control.
Definition: control.h:393
friend control & operator>>(control &parent, control &child)
Remove child control.
Definition: control.h:705
xtd::ustring to_string() const noexcept override
Returns a string containing the name of the control, if any.
virtual control & size(const drawing::size &size)
Sets the height and width of the control.
Definition: control.h:624
virtual bool enabled() const
Gets a value indicating whether the control can respond to user interaction.
Definition: control.h:448
virtual void invalidate(const drawing::rectangle &rect) const
Invalidates the specified region of the control (adds it to the control's update region,...
Definition: control.h:893
void suspend_layout()
Temporarily suspends the layout logic for the control.
Definition: control.h:996
virtual control & minimum_size(const drawing::size &size)
Sets the size that is the lower limit that xtd::forms::control::get_preferred_size can specify.
intptr_t handle() const override
Gets the window handle that the control is bound to.
xtd::drawing::point point_to_client(const xtd::drawing::point &p)
Computes the location of the specified screen point into client coordinates.
static std::unique_ptr< control_t > create(const control &parent, const xtd::ustring &text, const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const drawing::color &back_color=drawing::color::empty, const drawing::color &fore_color=drawing::color::empty)
A factory to create a specified control with specified parent, text, location ,size back_color and fo...
Definition: control.h:795
virtual xtd::forms::image_layout background_image_layout() const
Gets the background image layout as defined in the xtd::forms::image_layout enumeration.
Definition: control.h:283
virtual bool can_focus() const
Gets a value indicating whether the control can receive focus.
virtual control & maximum_size(const drawing::size &size)
Sets the size that is the upper limit that xtd::forms::control::get_preferred_size can specify.
virtual control & anchor(anchor_styles anchor)
Gets the edges of the container to which a control is bound and determines how a control is resized w...
virtual control & text(const xtd::ustring &text)
Sets the text associated with this control.
virtual const drawing::size & maximum_size() const
Gets the size that is the upper limit that xtd::forms::control::get_preferred_size can specify.
virtual forms::cursor default_cursor() const
Gets the default cursor for the control.
Definition: control.h:397
virtual drawing::font font() const
Gets the font of the text displayed by the control.
static std::unique_ptr< control_t > create(const xtd::ustring &text, const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const drawing::color &back_color=drawing::color::empty, const drawing::color &fore_color=drawing::color::empty)
A factory to create a specified control with specified text, location ,size back_color and fore_color...
Definition: control.h:776
virtual control & name(const xtd::ustring &name)
Sets the name of the control.
Definition: control.h:577
virtual void refresh() const
Forces the control to invalidate its client area and immediately redraw itself and any child controls...
virtual const xtd::ustring & text() const
Gets the text associated with this control.
Definition: control.h:650
virtual control & height(int32_t height)
Sets the height of the control.
Definition: control.h:490
friend control & operator<<(control &parent, control &child)
Add child control.
Definition: control.h:696
virtual bool auto_size() const
Gets a value that indicates whether the control resizes based on its contents.
Definition: control.h:245
virtual drawing::point auto_scroll_point() const
Gets where this control is scrolled to in scroll_control_into_view(control).
Definition: control.h:240
static std::unique_ptr< control_t > create(const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const drawing::color &back_color=drawing::color::empty, const drawing::color &fore_color=drawing::color::empty)
A factory to create a specified control with specified location ,size back_color and fore_color.
Definition: control.h:741
virtual drawing::color fore_color() const
Gets the foreground color of the control.
bool recreating_handle() const
Gets a value indicating whether the control is currently re-creating its handle.
Definition: control.h:612
virtual void set_bounds_core(int32_t x, int32_t y, int32_t width, int32_t height, bounds_specified specified)
Performs the work of setting the specified bounds of this control.
virtual control & top(int32_t top)
Sets the distance, in pixels, between the top edge of the control and the top edge of its container's...
Definition: control.h:662
virtual control & enabled(bool enabled)
Sets a value indicating whether the control can respond to user interaction.
virtual control & double_buffered(bool double_buffered)
Sets a value indicating whether this control should redraw its surface using a secondary buffer to re...
Definition: control.h:441
virtual int32_t left() const
Gets the distance, in pixels, between the left edge of the control and the left edge of its container...
Definition: control.h:503
virtual bool created()
Gets a value indicating whether the control has been created.
Definition: control.h:377
std::shared_ptr< xtd::iasync_result > begin_invoke(delegate< void(std::vector< std::any >)> value, const std::vector< std::any > &args)
Executes the specified delegate asynchronously with the specified arguments, on the thread that the c...
virtual control & location(const drawing::point &location)
Sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
Definition: control.h:519
virtual bool can_select() const
Gets a value indicating whether the control can be selected.
Definition: control.h:327
bool can_raise_events() const override
Determines if events can be raised on the control.
Definition: control.h:331
virtual control & background_image(const xtd::drawing::image &background_image)
Sets the background image displayed in the control.
virtual void set_client_size_core(int32_t width, int32_t height)
Sets the size of the client area of the control.
virtual control & cursor(const forms::cursor &cursor)
Sets the cursor that is displayed when the mouse pointer is over the control.
virtual bool focused() const
Gets a value indicating whether the control has input focus.
Definition: control.h:456
virtual forms::create_params create_params() const
Gets the required creation parameters when the control handle is created.
virtual const xtd::drawing::image & background_image() const
Gets the background image displayed in the control.
Definition: control.h:272
virtual int32_t top() const
Gets the distance, in pixels, between the top edge of the control and the top edge of its container's...
Definition: control.h:658
control()
Initializes a new instance of the control class with default settings.
virtual void hide()
Conceals the control from the user.
Definition: control.h:879
void set_auto_size_mode(auto_size_mode auto_size_mode)
Sets a value indicating how a control will behave when its auto_size property is enabled.
virtual void invalidate(const drawing::rectangle &rect, bool invalidate_children) const
Invalidates the specified region of the control (adds it to the control's update region,...
virtual control & background_image_layout(xtd::forms::image_layout background_image_layout)
Sets the background image layout as defined in the xtd::forms::image_layout enumeration.
virtual control & fore_color(const drawing::color &color)
Sets the foreground color of the control.
virtual control & font(const drawing::font &font)
Sets the font of the text displayed by the control.
void resume_layout()
Resumes usual layout logic.
Definition: control.h:947
virtual control & parent(std::nullptr_t)
Resets the parent container of the control.
static forms::keys modifier_keys()
Gets a value indicating which of the modifier keys (SHIFT, CTRL, and ALT) is in a pressed state.
Definition: control.h:565
virtual dock_style dock() const
Gets or sets which control borders are docked to its parent control and determines how a control is r...
Definition: control.h:423
bool is_handle_created() const
Gets a value indicating whether the control has a handle associated with it.
virtual const drawing::size & size() const
Gets the height and width of the control.
Definition: control.h:620
void set_bounds(int32_t x, int32_t y, int32_t width, int32_t height)
Sets the bounds of the control to the specified location and size.
Definition: control.h:977
virtual drawing::font default_font() const
Gets the default font of the control.
static std::optional< control_ref > from_child_handle(intptr_t handle)
Retrieves the control that contains the specified handle.
virtual xtd::ustring product_name() const
Gets the product name of the assembly containing the control.
Definition: control.h:608
virtual void invalidate() const
Invalidates the entire surface of the control and causes the control to be redrawn.
Definition: control.h:883
void resume_layout(bool perform_layout)
Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests.
Definition: control.h:955
virtual anchor_styles anchor() const
Gets the edges of the container to which a control is bound and determines how a control is resized w...
Definition: control.h:227
virtual bool double_buffered() const
Gets a value indicating whether this control should redraw its surface using a secondary buffer to re...
Definition: control.h:437
virtual int32_t height() const
Gets the height of the control.
Definition: control.h:486
virtual drawing::color back_color() const
Gets the background color for the control.
virtual control & margin(const forms::padding &margin)
Sets the space between controls.
Definition: control.h:531
virtual control & tag(std::any tag)
Sets the object that contains data about the control.
Definition: control.h:643
void create_control()
Forces the creation of the visible control, including the creation of the handle and any visible chil...
virtual control & bounds(const drawing::rectangle &bounds)
Sets the size and location of the control including its nonclient elements, in pixels,...
Definition: control.h:306
virtual bool pre_process_message(xtd::forms::message &message)
Preprocesses keyboard or input messages within the message loop before they are dispatched.
virtual bool visible() const
Gets a value indicating whether the control and all its child controls are displayed.
Definition: control.h:674
virtual drawing::point location() const
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
Definition: control.h:515
control(const control &parent, const xtd::ustring &text, int32_t left, int32_t top, int32_t width, int32_t height)
Initializes a new instance of the control class as a child control, with specific text,...
Definition: control.h:205
void invoke(delegate< void(std::vector< std::any >)> value, const std::vector< std::any > &args)
Executes the specified delegate, on the thread that owns the control's underlying window handle,...
Definition: control.h:908
virtual const drawing::rectangle & client_rectangle() const
Gets the rectangle that represents the client area of the control.
Definition: control.h:337
virtual void wnd_proc(message &m)
Processes Windows messages.
virtual const xtd::ustring & name() const
Gets the name of the control.
Definition: control.h:573
static forms::mouse_buttons mouse_buttons()
Gets a value indicating which of the mouse buttons is in a pressed state.
Definition: control.h:569
virtual control & visible(bool visible)
Sets a value indicating whether the control and all its child controls are displayed.
virtual xtd::ustring company_name() const
Gets the name of the company or creator of the application containing the control.
Definition: control.h:357
virtual control & width(int32_t width)
Sets the width of the control.
Definition: control.h:686
xtd::drawing::point point_to_screen(const xtd::drawing::point &p)
Computes the location of the specified client point into screen coordinates.
bool focus()
Sets input focus to the control.
virtual int32_t width() const
Gets the width of the control.
Definition: control.h:682
virtual void destroy_control()
Forces the destruction of the visible control, including the destruction of the handle and any visibl...
void perform_layout()
Forces the control to apply layout logic to all its child controls.
virtual drawing::rectangle bounds() const
Gets the size and location of the control including its nonclient elements, in pixels,...
Definition: control.h:301
drawing::size measure_text() const
Measure this control text.
virtual control & auto_size(bool auto_size)
Sets a value that indicates whether the control resizes based on its contents.
virtual drawing::rectangle display_rectangle() const
Gets the rectangle that represents the display area of the control.
Definition: control.h:413
size_t get_child_index(intptr_t child) const
Retrieves the index of a control within the control collection.
Definition: control.h:858
virtual control & dock(dock_style dock)
Sets or sets which control borders are docked to its parent control and determines how a control is r...
virtual std::optional< control_ref > top_level_control() const
Gets the parent control that is not parented by another Windows Forms control. Typically,...
void set_style(control_styles flag, bool value)
Sets a specified control_styles flag to either true or false.
Definition: control.h:1684
size_t get_child_index(intptr_t child, bool &throw_exception) const
Retrieves the index of the specified child control within the control collection, and optionally rais...
Definition: control.h:867
virtual control & parent(const control &parent)
Sets the parent container of the control.
virtual int32_t right() const
Gets the distance, in pixels, between the right edge of the control and the left edge of its containe...
Definition: control.h:616
void set_bounds(int32_t x, int32_t y, int32_t width, int32_t height, bounds_specified specified)
Sets the specified bounds of the control to the specified location and size.
Definition: control.h:985
virtual control & client_size(const drawing::size &client_size)
Sets the height and width of the client area of the control.
Definition: control.h:347
virtual void create_handle()
Creates a handle for the control.
virtual const drawing::size & minimum_size() const
Gets the size that is the lower limit that xtd::forms::control::get_preferred_size can specify.
static std::unique_ptr< control_t > create(const control &parent, const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const drawing::color &back_color=drawing::color::empty, const drawing::color &fore_color=drawing::color::empty)
A factory to create a specified control with specified parent, location ,size back_color and fore_col...
Definition: control.h:758
virtual void show()
Displays the control to the user.
Definition: control.h:989
static std::optional< control_ref > from_handle(intptr_t handle)
Returns the control that is currently associated with the specified handle.
control(const control &parent, const xtd::ustring &text)
Initializes a new instance of the control class as a child control, with specific text.
Definition: control.h:177
virtual void recreate_handle()
Forces the re-creation of the handle for the control.
virtual forms::cursor cursor() const
Gets the cursor that is displayed when the mouse pointer is over the control.
virtual drawing::size measure_control() const
Measure this control.
virtual control & back_color(const drawing::color &color)
Sets the background color for the control.
bool get_style(control_styles flag) const
Retrieves the value of the specified control style bit for the control.
Definition: control.h:1424
virtual drawing::size default_size() const
Gets the default size of the control.
Definition: control.h:409
Represents the image used to paint the mouse pointer.
Definition: cursor.h:35
static cursor default_cursor()
Gets the default cursor, which is usually an arrow cursor.
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:19
Provides data for the key_down or key_up event.
Definition: key_event_args.h:22
Provides data for the key_press event.
Definition: key_press_event_args.h:23
Represents a collection of objects.
Definition: arranged_element_collection.h:28
std::allocator< value_type > allocator_type
Represents the allocator type of the collection.
Definition: arranged_element_collection.h:62
Implements a Windows message.
Definition: message.h:25
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition: mouse_event_args.h:29
Represents a display device or multiple display devices on a single system.
Definition: padding.h:20
Provides data for the paint event.
Definition: paint_event_args.h:26
Represents a display device or multiple display devices on a single system.
Definition: screen.h:29
Represents the status of an asynchronous operation.
Definition: iasync_result.h:21
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Contains xtd::drawing::color class.
Contains xtd::forms::component class.
Contains xtd::forms::control_event_handler event handler.
Contains xtd::forms::control_ref typedef.
Contains xtd::forms::control_styles enum class.
Contains xtd::forms::cursors factory.
Contains xtd::forms::dock_style enum class.
Contains xtd::drawing::font class.
drawing::graphics create_graphics() const
Creates the xtd::drawing::graphics for the control.
virtual void on_click(const event_args &e)
Raises the control::click event.
virtual void on_back_color_changed(const event_args &e)
Raises the control::back_color_changed event.
virtual void on_auto_size_changed(const event_args &e)
Raises the control::auto_size_changed event.
event< control, event_handler > parent_changed
Occurs when the value of the parent property changes.
Definition: control.h:1378
virtual void on_size_changed(const event_args &e)
Raises the control::size_changed event.
event< control, event_handler > dock_changed
Occurs when the value of the dock property changes.
Definition: control.h:1088
virtual void on_parent_back_color_changed(const event_args &e)
Raises the control::parent_back_color_changed event.
event< control, event_handler > background_image_changed
Occurs when the value of the background_image property changes.
Definition: control.h:1035
virtual void on_got_focus(const event_args &e)
Raises the control::got_focus event.
virtual void on_mouse_up(const mouse_event_args &e)
Raises the control::mouse_up event.
virtual void on_layout(const event_args &e)
Raises the control::layout event.
event< control, event_handler > client_size_changed
Occurs when the value of the client_size property changes.
Definition: control.h:1070
virtual void on_parent_fore_color_changed(const event_args &e)
Raises the control::parent_fore_color_changed event.
event< control, key_event_handler > key_up
Occurs when a key is released while the control has focus.
Definition: control.h:1196
virtual void on_key_up(key_event_args &e)
Raises the control::key_up event.
virtual void on_handle_created(const event_args &e)
Raises the control::handle_created event.
event< control, event_handler > enabled_changed
Occurs when the value of the enabled property changes.
Definition: control.h:1148
virtual void on_parent_changed(const event_args &e)
Raises the control::parent_changed event.
virtual void on_parent_cursor_changed(const event_args &e)
Raises the control::parent_cursor_changed event.
virtual void on_key_down(key_event_args &e)
Raises the control::key_down event.
event< control, event_handler > visible_changed
Occurs when the value of the visible property changes.
Definition: control.h:1402
virtual void on_background_image_changed(const event_args &e)
Raises the control::background_image_changed event.
virtual void on_handle_destroyed(const event_args &e)
Raises the control::handle_destroyed event.
virtual void on_cursor_changed(const event_args &e)
Raises the control::cursor_changed event.
event< control, event_handler > text_changed
Occurs when the value of the text property changes.
Definition: control.h:1397
virtual void on_dock_changed(const event_args &e)
Raises the control::dock_changed event.
event< control, event_handler > layout
Occurs when a control should reposition its child controls.
Definition: control.h:1201
event< control, event_handler > font_changed
Occurs when the value of the font property changes.
Definition: control.h:1158
virtual void on_font_changed(const event_args &e)
Raises the control::font_changed event.
virtual void on_lost_focus(const event_args &e)
Raises the control::lost_focus event.
event< control, event_handler > double_click
Occurs when the control is double-clicked.
Definition: control.h:1112
event< control, event_handler > click
Occurs when the control is clicked.
Definition: control.h:1065
virtual void on_mouse_double_click(const mouse_event_args &e)
Raises the control::mouse_double_click event.
virtual void on_background_image_layout_changed(const event_args &e)
Raises the control::background_image_layout_changed event.
event< control, key_press_event_handler > key_press
Occurs when a character. space or backspace key is pressed while the control has focus.
Definition: control.h:1184
virtual void on_paint(paint_event_args &e)
Raises the control::paint event.
event< control, event_handler > handle_created
Occurs when a handle is created for the control.
Definition: control.h:1138
event< control, event_handler > handle_destroyed
Occurs when the control's handle is in the process of being destroyed.
Definition: control.h:1143
virtual void on_create_control()
Raises the control::create_control event.
virtual void on_control_added(const control_event_args &e)
Raises the control::control_added event.
event< control, control_event_handler > control_removed
Occurs when a new control is removed to the control::control_collection.
Definition: control.h:1083
event< control, mouse_event_handler > mouse_down
Occurs when the mouse pointer is over the control and a mouse button is pressed.
Definition: control.h:1278
virtual void on_double_click(const event_args &e)
Raises the double_click event.
virtual void on_control_removed(const control_event_args &e)
Raises the control::control_removed event.
event< control, event_handler > mouse_enter
Occurs when the mouse pointer enters the control.
Definition: control.h:1292
event< control, event_handler > auto_size_changed
Occurs when the value of the auto_size property changes.
Definition: control.h:1025
event< control, mouse_event_handler > mouse_double_click
Occurs when the control is double clicked by the mouse.
Definition: control.h:1264
virtual void on_resize(const event_args &e)
Raises the control::resize event.
event< control, paint_event_handler > paint
Occurs when the control is redrawn.
Definition: control.h:1373
event< control, event_handler > lost_focus
Occurs when the control loses focus.
Definition: control.h:1228
event< control, event_handler > background_image_layout_changed
Occurs when the value of the background_image_layout property changes.
Definition: control.h:1040
virtual void on_enabled_changed(const event_args &e)
Raises the control::enabled_changed event.
virtual void on_fore_color_changed(const event_args &e)
Raises the control::fore_color_changed event.
virtual void on_location_changed(const event_args &e)
Raises the control::location_changed event.
event< control, event_handler > mouse_leave
Occurs when the mouse pointer leaves the control.
Definition: control.h:1321
event< control, mouse_event_handler > mouse_move
Occurs when the mouse pointer is moved over the control.
Definition: control.h:1335
virtual void on_visible_changed(const event_args &e)
Raises the control::visible_changed event.
virtual void on_mouse_down(const mouse_event_args &e)
Raises the control::mouse_down event.
virtual void on_client_size_changed(const event_args &e)
Raises the control::client_size_changed event.
virtual void on_parent_font_changed(const event_args &e)
Raises the control::parent_font_changed event.
virtual void on_key_press(key_press_event_args &e)
Raises the control::key_press event.
virtual void on_mouse_wheel(const mouse_event_args &e)
Raises the control::mouse_wheel event.
event< control, key_event_handler > key_down
Occurs when a key is pressed while the control has focus.
Definition: control.h:1170
event< control, event_handler > got_focus
Occurs when the control receives focus.
Definition: control.h:1133
event< control, event_handler > location_changed
Occurs when the value of the location property changes.
Definition: control.h:1206
virtual void on_text_changed(const event_args &e)
Raises the control::text_changed event.
event< control, mouse_event_handler > mouse_up
Occurs when the mouse pointer is over the control and a mouse button is released.
Definition: control.h:1349
event< control, mouse_event_handler > mouse_horizontal_wheel
Occurs when the mouse horizontal wheel moves while the control has focus.
Definition: control.h:1307
event< control, mouse_event_handler > mouse_wheel
Occurs when the mouse wheel moves while the control has focus.
Definition: control.h:1364
event< control, event_handler > back_color_changed
Occurs when the value of the back_color property changes.
Definition: control.h:1030
event< control, control_event_handler > control_added
Occurs when a new control is added to the control::control_collection.
Definition: control.h:1079
virtual void on_mouse_horizontal_wheel(const mouse_event_args &e)
Raises the control::mouse_horizontal_wheel event.
event< control, event_handler > fore_color_changed
Occurs when the value of the fore_color property changes.
Definition: control.h:1153
event< control, event_handler > resize
Occurs when the control is resized.
Definition: control.h:1387
virtual void on_mouse_enter(const event_args &e)
Raises the control::mouse_enter event.
event< control, event_handler > cursor_changed
Occurs when the value of the cursor property changes.
Definition: control.h:1075
virtual void on_mouse_leave(const event_args &e)
Raises the control::mouse_leave event.
virtual void on_parent_enabled_changed(const event_args &e)
Raises the xtd::control::enabled_changed event when the xtd::control::enabled property value of the c...
virtual void on_mouse_move(const mouse_event_args &e)
Raises the control::mouse_move event.
event< control, mouse_event_handler > mouse_click
Occurs when the control is clicked by the mouse.
Definition: control.h:1244
virtual void on_mouse_click(const mouse_event_args &e)
Raises the control::mouse_click event.
event< control, event_handler > size_changed
Occurs when the value of the size property changes.
Definition: control.h:1392
#define forms_export_
Define shared library export.
Definition: forms_export.h:13
#define current_stack_frame_
Provides information about the current stack frame.
Definition: stack_frame.h:201
size_t size
Represents a size of any object in bytes.
Definition: types.h:171
@ y
The Y key.
@ x
The X key.
keys
Specifies key codes and modifiers.
Definition: keys.h:73
bounds_specified
Specifies the bounds of the control to use when defining a control's size and position....
Definition: bounds_specified.h:18
image_layout
Specifies the position of the image on the control.
Definition: image_layout.h:17
control_styles
Specifies the style and behavior of a control.
Definition: control_styles.h:29
auto_size_mode
Specifies how a control will behave when its auto_size property is enabled.
Definition: auto_size_mode.h:18
dock_style
Specifies the position and manner in which a control is docked.
Definition: dock_style.h:19
anchor_styles
Specifies how a control anchors to the edges of its container.
Definition: anchor_styles.h:19
mouse_buttons
Specifies constants that define which mouse button was pressed. This enumeration has a flag attribute...
Definition: mouse_buttons.h:18
@ auto_size
The picture_box is sized equal to the size of the image that it contains.
@ y
Specifies that the top edge of the control is defined.
@ x
Specifies that the left edge of the control is defined.
@ all
Specifies that both the location and size property values are defined.
@ height
Specifies that the height of the control is defined.
@ location
Specifies that both the x and y coordinates of the control are defined.
@ width
Specifies that the width of the control is defined.
@ size
Specifies that both the width and height property values of the control are defined.
@ tile
The image is tiled across the control's client rectangle.
@ none
No control style..
@ selectable
If true, the control can receive focus.
@ grow_and_shrink
The control grows or shrinks to fit its contents. The control cannot be resized manually.
@ none
The control is not docked.
@ left
The user is closing the form through the user interface (UI), for example by clicking the Close butto...
@ top
The operating system is closing all applications before shutting down.
Contains xtd::iasync_result interface.
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::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::forms::padding class.
Contains xtd::forms::paint_event_handler event handler.
Contains xtd::drawing::point class.
Contains xtd::drawing::rectangle class.
Contains xtd::drawing::size class.
Contains xtd::forms::theme_colors class.
Contains xtd::forms::timer component.