xtd 1.0.0
Loading...
Searching...
No Matches
radio_button.hpp
Go to the documentation of this file.
1
4#pragma once
6#include "appearance.hpp"
7#include "button_base.hpp"
8
10namespace xtd {
12 namespace forms {
41 struct data;
42
43 public:
45
51
53
58 [[nodiscard]] virtual auto appearance() const noexcept -> xtd::forms::appearance;
63 virtual auto appearance(xtd::forms::appearance value) -> radio_button&;
64
69 [[nodiscard]] virtual auto auto_check() const noexcept -> bool;
75 virtual auto auto_check(bool value) -> radio_button&;
76
79 [[nodiscard]] virtual auto checked() const noexcept -> bool;
83 virtual auto checked(bool value) -> radio_button&;
84
87 [[nodiscard]] virtual auto check_align() const noexcept -> xtd::forms::content_alignment;
93
95
98 auto perform_click() -> void;
99
103 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
105
107
111 [[nodiscard]] static auto create() -> radio_button;
115 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> radio_button;
120 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> radio_button;
126 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> radio_button;
130 [[nodiscard]] static auto create(const xtd::string& text) -> radio_button;
135 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location) -> radio_button;
141 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> radio_button;
148 [[nodiscard]] static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> radio_button;
153 [[nodiscard]] static auto create(const xtd::string& text, bool checked) -> radio_button;
159 [[nodiscard]] static auto create(const xtd::string& text, bool checked, const xtd::drawing::point& location) -> radio_button;
166 [[nodiscard]] static auto create(const xtd::string& text, bool checked, const xtd::drawing::point& location, const xtd::drawing::size& size) -> radio_button;
174 [[nodiscard]] static auto create(const xtd::string& text, bool checked, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> radio_button;
178 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> radio_button;
183 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> radio_button;
189 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> radio_button;
196 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> radio_button;
201 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text) -> radio_button;
207 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location) -> radio_button;
214 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> radio_button;
222 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> radio_button;
228 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, bool checked) -> radio_button;
235 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, bool checked, const xtd::drawing::point& location) -> radio_button;
243 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, bool checked, const xtd::drawing::point& location, const xtd::drawing::size& size) -> radio_button;
252 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::string& text, bool checked, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> radio_button;
254
256
261
266
267 protected:
269
273 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
274
277 [[nodiscard]] auto state() const noexcept -> xtd::forms::visual_styles::radio_button_state;
279
281
286 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
287
294 virtual auto on_appearance_changed(const event_args& e) -> void;
295
302 virtual auto on_checked_changed(const event_args& e) -> void;
303
304 auto on_enabled_changed(const event_args& e) -> void override;
305 auto on_got_focus(const event_args& e) -> void override;
306
309 auto on_handle_created(const event_args& e) -> void override;
310
311 auto on_lost_focus(const event_args& e) -> void override;
312 auto on_mouse_down(const mouse_event_args& e) -> void override;
313 auto on_mouse_enter(const event_args& e) -> void override;
314 auto on_mouse_leave(const event_args& e) -> void override;
315 auto on_mouse_move(const mouse_event_args& e) -> void override;
316 auto on_mouse_up(const mouse_event_args& e) -> void override;
317 auto on_paint(paint_event_args& e) -> void override;
318 auto wnd_proc(message& message) -> void override;
320
322 auto wm_mouse_double_click(message& message) -> void;
323 auto wm_mouse_down(const message& message) -> void;
324 auto wm_mouse_up(const message& message) -> void;
326
327 private:
328 xtd::sptr<data> data_;
329 };
330 }
331}
Contains xtd::forms::appearance enum class.
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.hpp:18
Represents an event.
Definition event.hpp:23
Implements the basic functionality common to button controls.
Definition button_base.hpp:37
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
virtual auto location() const noexcept -> xtd::drawing::point
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.hpp:34
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.hpp:26
auto on_enabled_changed(const event_args &e) -> void override
Raises the xtd::forms::control::enabled_changed event.
auto measure_control() const noexcept -> xtd::drawing::size override
Measure this control.
auto to_string() const noexcept -> xtd::string override
Returns a string that represents the progress_bar control.
virtual auto check_align() const noexcept -> xtd::forms::content_alignment
Gets the horizontal and vertical alignment of the check mark on a check_box control.
virtual auto on_checked_changed(const event_args &e) -> void
Raises the radio_button::radio_button::checked_changed event.
auto on_mouse_enter(const event_args &e) -> void override
Raises the xtd::forms::control::mouse_enter event.
auto on_got_focus(const event_args &e) -> void override
Raises the xtd::forms::control::got_focus event.
auto on_mouse_move(const mouse_event_args &e) -> void override
Raises the xtd::forms::control::mouse_move event.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
auto on_lost_focus(const event_args &e) -> void override
Raises the xtd::forms::control::lost_focus event.
auto on_mouse_up(const mouse_event_args &e) -> void override
Raises the xtd::forms::control::mouse_up event.
virtual auto appearance() const noexcept -> xtd::forms::appearance
Gets a value determining the appearance of the radio_button.
auto on_mouse_leave(const event_args &e) -> void override
Raises the xtd::forms::control::mouse_leave event.
xtd::event< radio_button, xtd::event_handler > checked_changed
Occurs when the value of the checked property changes.
Definition radio_button.hpp:264
xtd::event< radio_button, xtd::event_handler > appearance_changed
Occurs when the appearance property value changes.
Definition radio_button.hpp:260
radio_button()
Initializes a new instance of the radio_button class.
virtual auto checked() const noexcept -> bool
Gets a value indicating whether the control is checked.
auto wnd_proc(message &message) -> void override
Processes Windows messages.
auto on_mouse_down(const mouse_event_args &e) -> void override
Raises the xtd::forms::control::mouse_down event.
auto perform_click() -> void
Generates a click event for the control, simulating a click by a user.
auto on_paint(paint_event_args &e) -> void override
Raises the xtd::forms::control::paint event.
auto on_handle_created(const event_args &e) -> void override
Overrides the on_handle_created(const event_args&) method.
static auto create() -> radio_button
A factory to create an xtd::forms::radio_button.
virtual auto on_appearance_changed(const event_args &e) -> void
Raises the radio_button::appearance_changed event.
auto state() const noexcept -> xtd::forms::visual_styles::radio_button_state
Gets state.
virtual auto auto_check() const noexcept -> bool
Gets a value indicating whether the checked value and the appearance of the control automatically cha...
generic_event_handler< const xtd::event_args & > event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.hpp:24
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.hpp:21
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms::visual_styles namespace contains classes for rendering controls and other windows use...
Definition check_box_state.hpp:12
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Contains xtd::forms::visual_styles::radio_button_state enum class.
Implements a Windows message.
Definition message.hpp:33