xtd 0.2.0
radio_button.h
Go to the documentation of this file.
1 #pragma once
6 #include "appearance.h"
7 #include "button_base.h"
8 
10 namespace xtd {
12  namespace forms {
38  class forms_export_ radio_button : public xtd::forms::button_base {
39  struct data;
40 
41  public:
43 
47  radio_button();
49 
51 
56  virtual forms::appearance appearance() const noexcept;
62 
67  virtual bool auto_check() const noexcept;
73  virtual radio_button& auto_check(bool auto_check);
74 
77  virtual bool checked() const noexcept;
81  virtual radio_button& checked(bool checked);
82 
85  virtual content_alignment check_align() const noexcept;
89  virtual radio_button& check_align(content_alignment check_align);
91 
93 
95  using control::create;
103  static radio_button create(const xtd::ustring& text, bool checked = false, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
112  static radio_button create(const control& parent, const xtd::ustring& text, bool checked = false, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
113 
115  void perform_click();
116 
120  xtd::ustring to_string() const noexcept override;
122 
124 
129 
134 
135  protected:
137 
141  forms::create_params create_params() const noexcept override;
142 
145  xtd::forms::visual_styles::radio_button_state state() const noexcept;
147 
149 
154  drawing::size measure_control() const noexcept override;
155 
162  virtual void on_appearance_changed(const event_args& e);
163 
170  virtual void on_checked_changed(const event_args& e);
171 
172  void on_enabled_changed(const event_args& e) override;
173  void on_got_focus(const event_args& e) override;
174 
177  void on_handle_created(const event_args& e) override;
178 
179  void on_lost_focus(const event_args& e) override;
180  void on_mouse_down(const mouse_event_args& e) override;
181  void on_mouse_enter(const event_args& e) override;
182  void on_mouse_leave(const event_args& e) override;
183  void on_mouse_move(const mouse_event_args& e) override;
184  void on_mouse_up(const mouse_event_args& e) override;
185  void on_paint(paint_event_args& e) override;
186  void wnd_proc(message& message) override;
188 
190  void wm_mouse_double_click(message& message);
191  void wm_mouse_down(const message& message);
192  void wm_mouse_up(const message& message);
194 
195  private:
196  std::shared_ptr<data> data_;
197  };
198  }
199 }
Contains xtd::forms::appearance enum class.
radio_button_state
Specifies the visual state of a radio button that is drawn with visual styles.
Definition: radio_button_state.h:22
Contains xtd::forms::button_base class.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
The button has a checked or latched appearance. Use this appearance to show that a toggle button has ...
appearance
Specifies the appearance of a control.
Definition: appearance.h:20
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
event< radio_button, event_handler > checked_changed
Occurs when the value of the checked property changes.
Definition: radio_button.h:132
Contains xtd::forms::visual_styles::radio_button_state enum class.
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:31
Implements the basic functionality common to button controls.
Definition: button_base.h:35
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Enables the user to select a single option from a group of choices when paired with other xtd::forms:...
Definition: radio_button.h:38
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
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
static control 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.
event< radio_button, event_handler > appearance_changed
Occurs when the appearance property value changes.
Definition: radio_button.h:128
Represents an event.
Definition: event.h:21
Provides data for the xtd::forms::control::paint event.
Definition: paint_event_args.h:28
content_alignment
Specifies alignment of content on the drawing surface.
Definition: content_alignment.h:19
Implements a Windows message.
Definition: message.h:26
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
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
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
Specifies that both the x and y coordinates of the control are defined.
The xtd::forms::status_bar_panel displays text in the standard font.
size_t size
Represents a size of any object in bytes.
Definition: types.h:195