xtd 0.2.0
Loading...
Searching...
No Matches
light_button.h
Go to the documentation of this file.
1
4#pragma once
6#include "appearance.h"
7#include "button_base.h"
8#include "check_state.h"
9#include <xtd/drawing/system_colors>
10
12namespace xtd {
14 namespace forms {
46 struct data;
47
48 public:
50
56
58
66 virtual bool auto_check() const noexcept;
70 virtual light_button& auto_check(bool auto_check);
71
78 virtual bool checked() const noexcept;
82 virtual light_button& checked(bool checked);
83
96 virtual forms::check_state check_state() const noexcept;
109
112 virtual drawing::color default_light_off_color() const noexcept;
113
116 virtual drawing::color default_light_on_color() const noexcept;
117
120 virtual content_alignment light_align() const noexcept;
123 virtual light_button& light_align(content_alignment light_align);
124
127 virtual drawing::color light_off_color() const noexcept;
130 virtual light_button& light_off_color(const drawing::color& value);
132 virtual light_button& light_off_color(std::nullptr_t);
134
137 virtual drawing::color light_on_color() const noexcept;
140 virtual light_button& light_on_color(const drawing::color& value);
142 virtual light_button& light_on_color(std::nullptr_t);
144
151 virtual bool three_state() const noexcept;
155 virtual light_button& three_state(bool three_state);
157
159
163 static light_button create();
167 static light_button create(const drawing::point& location);
172 static light_button create( const drawing::point& location, const drawing::size& size);
178 static light_button create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
182 static light_button create(const xtd::string& text);
187 static light_button create(const xtd::string& tex, const drawing::point& location);
193 static light_button create(const xtd::string& text, const drawing::point& location, const drawing::size& size);
200 static light_button create(const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
205 static light_button create(const xtd::string& text, xtd::forms::check_state check_state);
211 static light_button create(const xtd::string& text, xtd::forms::check_state check_state, const drawing::point& location);
218 static light_button create(const xtd::string& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
226 static light_button create(const xtd::string& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size, const xtd::string& name);
232 static light_button create(const xtd::string& text, bool three_state, xtd::forms::check_state check_state);
239 static light_button create(const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location);
247 static light_button create(const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
256 static light_button create(const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size, const xtd::string& name);
260 static light_button create(const control& parent);
265 static light_button create(const control& parent, const drawing::point& location);
271 static light_button create(const control& parent, const drawing::point& location, const drawing::size& size);
278 static light_button create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
283 static light_button create(const control& parent, const xtd::string& text);
289 static light_button create(const control& parent, const xtd::string& text, const drawing::point& location);
296 static light_button create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size);
304 static light_button create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
310 static light_button create(const control& parent, const xtd::string& text, xtd::forms::check_state check_state);
317 static light_button create(const control& parent, const xtd::string& text, xtd::forms::check_state check_state, const drawing::point& location);
325 static light_button create(const control& parent, const xtd::string& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
334 static light_button create(const control& parent, const xtd::string& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size, const xtd::string& name);
341 static light_button create(const control& parent, const xtd::string& text, bool three_state, xtd::forms::check_state check_state);
349 static light_button create(const control& parent, const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location);
358 static light_button create(const control& parent, const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
368 static light_button create(const control& parent, const xtd::string& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size, const xtd::string& name);
370
372
377
380 event<light_button, event_handler> check_state_changed;
382
383 protected:
385
387 forms::create_params create_params() const noexcept override;
388
391 xtd::forms::visual_styles::check_box_state state() const noexcept;
393
395
401 xtd::uptr<xtd::object> clone() const override;
402
403 drawing::size measure_control() const noexcept override;
404
409 virtual void on_checked_changed(const event_args& e);
410
415 virtual void on_check_state_changed(const event_args& e);
416
417 void on_enabled_changed(const event_args& e) override;
418 void on_handle_created(const event_args& e) override;
419 void on_image_changed(const xtd::event_args& e) override;
420 void on_mouse_down(const mouse_event_args& e) override;
421 void on_mouse_enter(const event_args& e) override;
422 void on_mouse_leave(const event_args& e) override;
423 void on_mouse_up(const mouse_event_args& e) override;
424 void on_paint(paint_event_args& e) override;
425 void wnd_proc(message& message) override;
427
428 private:
429 void wm_mouse_double_click(message& message);
430 void wm_mouse_down(message& message);
431 void wm_mouse_up(message& message);
432
433 xtd::sptr<data> data_;
434 };
435 }
436}
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.h:18
Represents an event.
Definition event.h:21
Implements the basic functionality common to button controls.
Definition button_base.h:37
Defines the base class for controls, which are components with visual representation.
Definition control.h:81
Encapsulates the information needed when creating a control.
Definition create_params.h:29
Represents a Windows light_button.
Definition light_button.h:45
virtual bool auto_check() const noexcept
Gets a value indicating whether the checked or check_state values and the light_button's appearance a...
light_button()
Initializes a new instance of the light_button class.
Implements a Windows message.
Definition message.h:28
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.h:34
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.h:30
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.h:32
#define forms_export_
Define shared library export.
Definition forms_export.h:13
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.h:25
size_t size
Represents a size of any object in bytes.
Definition size.h:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
check_state
Specifies the state of a control, such as a check box, that can be checked, unchecked,...
Definition check_state.h:23
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.h:21
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10