xtd 1.0.0
Loading...
Searching...
No Matches
light_button.hpp
Go to the documentation of this file.
1
4#pragma once
6#include "appearance.hpp"
7#include "button_base.hpp"
8#include "check_state.hpp"
9#include <xtd/drawing/system_colors>
10
12namespace xtd {
14 namespace forms {
46 struct data;
47
48 public:
50
56
58
66 [[nodiscard]] virtual auto auto_check() const noexcept -> bool;
70 virtual auto auto_check(bool value) -> light_button&;
71
78 [[nodiscard]] virtual auto checked() const noexcept -> bool;
82 virtual auto checked(bool value) -> light_button&;
83
96 [[nodiscard]] virtual auto check_state() const noexcept -> xtd::forms::check_state;
108 virtual auto check_state(xtd::forms::check_state value) -> light_button&;
109
112 [[nodiscard]] virtual auto default_light_off_color() const noexcept -> xtd::drawing::color;
113
116 [[nodiscard]] virtual auto default_light_on_color() const noexcept -> xtd::drawing::color;
117
120 [[nodiscard]] virtual auto light_align() const noexcept -> xtd::forms::content_alignment;
124
127 [[nodiscard]] virtual auto light_off_color() const noexcept -> xtd::drawing::color;
130 virtual auto light_off_color(const xtd::drawing::color& value) -> light_button&;
134
137 [[nodiscard]] virtual auto light_on_color() const noexcept -> xtd::drawing::color;
140 virtual auto light_on_color(const xtd::drawing::color& value) -> light_button&;
144
151 [[nodiscard]] virtual auto three_state() const noexcept -> bool;
155 virtual auto three_state(bool value) -> light_button&;
157
159
163 static auto create() -> light_button;
167 static auto create(const xtd::drawing::point& location) -> light_button;
172 static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> light_button;
178 static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> light_button;
182 static auto create(const xtd::string& text) -> light_button;
187 static auto create(const xtd::string& tex, const xtd::drawing::point& location) -> light_button;
193 static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> light_button;
200 static auto create(const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> light_button;
205 static auto create(const xtd::string& text, xtd::forms::check_state check_state) -> light_button;
211 static auto create(const xtd::string& text, xtd::forms::check_state check_state, const xtd::drawing::point& location) -> light_button;
218 static auto create(const xtd::string& text, xtd::forms::check_state check_state, const xtd::drawing::point& location, const xtd::drawing::size& size) -> light_button;
226 static auto create(const xtd::string& text, xtd::forms::check_state check_state, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> light_button;
232 static auto create(const xtd::string& text, bool three_state, xtd::forms::check_state check_state) -> light_button;
239 static auto create(const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const xtd::drawing::point& location) -> light_button;
247 static auto create(const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const xtd::drawing::point& location, const xtd::drawing::size& size) -> light_button;
256 static auto create(const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> light_button;
260 static auto create(const xtd::forms::control& parent) -> light_button;
265 static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> light_button;
271 static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> light_button;
278 static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> light_button;
283 static auto create(const xtd::forms::control& parent, const xtd::string& text) -> light_button;
289 static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location) -> light_button;
296 static auto create(const xtd::forms::control& parent, const xtd::string& text, const xtd::drawing::point& location, const xtd::drawing::size& size) -> light_button;
304 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) -> light_button;
310 static auto create(const xtd::forms::control& parent, const xtd::string& text, xtd::forms::check_state check_state) -> light_button;
317 static auto create(const xtd::forms::control& parent, const xtd::string& text, xtd::forms::check_state check_state, const xtd::drawing::point& location) -> light_button;
325 static auto create(const xtd::forms::control& parent, const xtd::string& text, xtd::forms::check_state check_state, const xtd::drawing::point& location, const xtd::drawing::size& size) -> light_button;
334 static auto create(const xtd::forms::control& parent, const xtd::string& text, xtd::forms::check_state check_state, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> light_button;
341 static auto create(const xtd::forms::control& parent, const xtd::string& text, bool three_state, xtd::forms::check_state check_state) -> light_button;
349 static auto create(const xtd::forms::control& parent, const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const xtd::drawing::point& location) -> light_button;
358 static auto create(const xtd::forms::control& parent, const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const xtd::drawing::point& location, const xtd::drawing::size& size) -> light_button;
368 static auto create(const xtd::forms::control& parent, const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> light_button;
370
372
377
382
383 protected:
385
387 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
388
391 [[nodiscard]] auto state() const noexcept -> xtd::forms::visual_styles::check_box_state;
393
395
397 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
398
403 virtual auto on_checked_changed(const event_args& e) -> void;
404
409 virtual auto on_check_state_changed(const event_args& e) -> void;
410
411 auto on_enabled_changed(const event_args& e) -> void override;
412 auto on_handle_created(const event_args& e) -> void override;
413 auto on_image_changed(const xtd::event_args& e) -> void override;
414 auto on_mouse_down(const mouse_event_args& e) -> void override;
415 auto on_mouse_enter(const event_args& e) -> void override;
416 auto on_mouse_leave(const event_args& e) -> void override;
417 auto on_mouse_up(const mouse_event_args& e) -> void override;
418 auto on_paint(paint_event_args& e) -> void override;
419 auto wnd_proc(message& message) -> void override;
421
422 private:
423 auto wm_mouse_double_click(message& message) -> void;
424 auto wm_mouse_down(message& message) -> void;
425 auto wm_mouse_up(message& message) -> void;
426
427 xtd::sptr<data> data_;
428 };
429 }
430}
Contains xtd::forms::appearance enum class.
Contains xtd::forms::button_base class.
Contains xtd::forms::visual_styles::check_box_state enum class.
Contains xtd::forms::check_state enum 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...
xtd::event< light_button, xtd::event_handler > check_state_changed
Occurs when the value of the check_state property changes.
Definition light_button.hpp:380
auto on_mouse_enter(const event_args &e) -> void override
Raises the xtd::forms::control::mouse_enter event.
virtual auto three_state() const noexcept -> bool
Gets a value indicating whether the light_button will allow three check states rather than two.
auto on_enabled_changed(const event_args &e) -> void override
Raises the xtd::forms::control::enabled_changed event.
virtual auto checked() const noexcept -> bool
Gets a value indicating whether the light_button is in the checked state.
auto on_paint(paint_event_args &e) -> void override
Raises the xtd::forms::control::paint event.
light_button()
Initializes a new instance of the light_button class.
virtual auto light_align() const noexcept -> xtd::forms::content_alignment
Gets the horizontal and vertical alignment of the check mark on a light_button control.
xtd::event< light_button, xtd::event_handler > checked_changed
Occurs when the value of the checked property changes.
Definition light_button.hpp:376
auto state() const noexcept -> xtd::forms::visual_styles::check_box_state
Gets state.
virtual auto check_state() const noexcept -> xtd::forms::check_state
Gets the state of the light_button.
auto on_image_changed(const xtd::event_args &e) -> void override
Raises the button_base::image_changed event.
virtual auto default_light_off_color() const noexcept -> xtd::drawing::color
Gets the default light off color of the light_button.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
virtual auto on_checked_changed(const event_args &e) -> void
Raises the light_button::checked_changed event.
virtual auto light_off_color() const noexcept -> xtd::drawing::color
Gets the light off color for the light_button.
auto on_handle_created(const event_args &e) -> void override
Raises the xtd::forms::control::handle_created event.
virtual auto auto_check() const noexcept -> bool
Gets a value indicating whether the checked or check_state values and the light_button's appearance a...
auto on_mouse_up(const mouse_event_args &e) -> void override
Raises the xtd::forms::control::mouse_up event.
virtual auto light_on_color() const noexcept -> xtd::drawing::color
Gets the light on color for the light_button.
auto wnd_proc(message &message) -> void override
Processes Windows messages.
auto measure_control() const noexcept -> xtd::drawing::size override
Measure this control.
auto on_mouse_leave(const event_args &e) -> void override
Raises the xtd::forms::control::mouse_leave event.
virtual auto on_check_state_changed(const event_args &e) -> void
Raises the light_button::check_state_changed event.
auto on_mouse_down(const mouse_event_args &e) -> void override
Raises the xtd::forms::control::mouse_down event.
static auto create() -> light_button
A factory to create an xtd::forms::light_button.
virtual auto default_light_on_color() const noexcept -> xtd::drawing::color
Gets the default light on color of the light_button.
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
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
std::nullptr_t null_ptr
Represents the null_opt alias on std::nullptr_t.
Definition null_ptr.hpp:19
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
Implements a Windows message.
Definition message.hpp:33