xtd 1.0.0
Loading...
Searching...
No Matches
switch_button.hpp
Go to the documentation of this file.
1
4#include "button_base.hpp"
5#include <xtd/optional>
6
7namespace xtd {
8 namespace forms {
33 struct data;
34
35 public:
37
42
44
49 [[nodiscard]] virtual auto auto_check() const noexcept -> bool;
54 virtual auto auto_check(bool value) -> switch_button&;
55
58 [[nodiscard]] virtual auto checked_back_color() const noexcept -> xtd::drawing::color;
61 virtual auto checked_back_color(const xtd::drawing::color& value) -> switch_button&;
65
68 [[nodiscard]] virtual auto slider_color() const noexcept -> xtd::drawing::color;
71 virtual auto slider_color(const xtd::drawing::color& value) -> switch_button&;
75
78 [[nodiscard]] virtual auto rounded() const noexcept -> bool;
82 virtual auto rounded(bool value) -> switch_button&;
83
86 [[nodiscard]] virtual auto checked() const noexcept -> bool;
90 virtual auto checked(bool value) -> switch_button&;
91
94 [[nodiscard]] virtual auto show_text() const noexcept -> bool;
98 virtual auto show_text(bool value) -> switch_button&;
100
102
106 [[nodiscard]] static auto create() -> switch_button;
110 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> switch_button;
115 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> switch_button;
121 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> switch_button;
126 [[nodiscard]] static auto create(bool checked) -> switch_button;
132 [[nodiscard]] static auto create(bool checked, const xtd::drawing::point& location) -> switch_button;
139 [[nodiscard]] static auto create(bool checked, const xtd::drawing::point& location, const xtd::drawing::size& size) -> switch_button;
147 [[nodiscard]] static auto create(bool checked, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> switch_button;
151 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> switch_button;
156 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> switch_button;
162 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> switch_button;
169 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> switch_button;
175 [[nodiscard]] static auto create(const xtd::forms::control& parent, bool checked) -> switch_button;
182 [[nodiscard]] static auto create(const xtd::forms::control& parent, bool checked, const xtd::drawing::point& location) -> switch_button;
190 [[nodiscard]] static auto create(const xtd::forms::control& parent, bool checked, const xtd::drawing::point& location, const xtd::drawing::size& size) -> switch_button;
199 [[nodiscard]] static auto create(const xtd::forms::control& parent, bool checked, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> switch_button;
201
203
209
210 protected:
212
216 [[nodiscard]] auto default_size() const noexcept -> xtd::drawing::size override;
218
220
226 virtual auto on_checked_changed(const xtd::event_args& e) -> void;
227
228 auto on_mouse_down(const xtd::forms::mouse_event_args& e) -> void override;
229 auto on_handle_created(const xtd::event_args& e) -> void override;
230 auto on_paint(xtd::forms::paint_event_args& e) -> void override;
231 auto on_resize(const xtd::event_args& e) -> void override;
233
234 private:
235 xtd::sptr<data> data_;
236 };
237 }
238}
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 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
virtual auto checked() const noexcept -> bool
Gets a value indicating whether the switch_button is in the checked state.
xtd::event< switch_button, xtd::event_handler > checked_changed
Occurs when the value of the checked property changes.
Definition switch_button.hpp:207
virtual auto rounded() const noexcept -> bool
Gets a value indicating whether the switch_button is rounded appearance.
auto on_mouse_down(const xtd::forms::mouse_event_args &e) -> void override
Raises the xtd::forms::control::mouse_down event.
virtual auto auto_check() const noexcept -> bool
Gets a value indicating whether the checked and the switch_button's appearance are automatically chan...
auto on_resize(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::region event.
auto default_size() const noexcept -> xtd::drawing::size override
Gets the default size of the control.
static auto create() -> switch_button
A factory to create an xtd::forms::switch_button.
auto on_paint(xtd::forms::paint_event_args &e) -> void override
Raises the xtd::forms::control::paint event.
auto on_handle_created(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::handle_created event.
virtual auto on_checked_changed(const xtd::event_args &e) -> void
Raises the switch_button::checked_changed event.
virtual auto checked_back_color() const noexcept -> xtd::drawing::color
Gets the checked background color for the control.
virtual auto slider_color() const noexcept -> xtd::drawing::color
Gets the slider color for the control.
virtual auto show_text() const noexcept -> bool
Gets a value indicating whether the switch_button text is shown.
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
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
std::nullptr_t null_ptr
Represents the null_opt alias on std::nullptr_t.
Definition null_ptr.hpp:19
@ e
The E key.
Definition keys.hpp:207
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
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