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 {
44 struct data;
45
46 public:
48
54
56
64 virtual bool auto_check() const noexcept;
68 virtual light_button& auto_check(bool auto_check);
69
76 virtual bool checked() const noexcept;
80 virtual light_button& checked(bool checked);
81
94 virtual forms::check_state check_state() const noexcept;
107
110 virtual drawing::color default_light_off_color() const noexcept;
111
114 virtual drawing::color default_light_on_color() const noexcept;
115
118 virtual content_alignment light_align() const noexcept;
121 virtual light_button& light_align(content_alignment light_align);
122
125 virtual drawing::color light_off_color() const noexcept;
128 virtual light_button& light_off_color(const drawing::color& value);
130 virtual light_button& light_off_color(std::nullptr_t);
132
135 virtual drawing::color light_on_color() const noexcept;
138 virtual light_button& light_on_color(const drawing::color& value);
140 virtual light_button& light_on_color(std::nullptr_t);
142
149 virtual bool three_state() const noexcept;
153 virtual light_button& three_state(bool three_state);
155
157
161 static light_button create();
165 static light_button create(const drawing::point& location);
170 static light_button create( const drawing::point& location, const drawing::size& size);
176 static light_button create(const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
180 static light_button create(const xtd::ustring& text);
185 static light_button create(const xtd::ustring& tex, const drawing::point& location);
191 static light_button create(const xtd::ustring& text, const drawing::point& location, const drawing::size& size);
198 static light_button create(const xtd::ustring& text, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
203 static light_button create(const xtd::ustring& text, xtd::forms::check_state check_state);
209 static light_button create(const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location);
216 static light_button create(const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
224 static light_button create(const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
230 static light_button create(const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state);
237 static light_button create(const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location);
245 static light_button create(const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
254 static light_button create(const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
258 static light_button create(const control& parent);
263 static light_button create(const control& parent, const drawing::point& location);
269 static light_button create(const control& parent, const drawing::point& location, const drawing::size& size);
276 static light_button create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
281 static light_button create(const control& parent, const xtd::ustring& text);
287 static light_button create(const control& parent, const xtd::ustring& text, const drawing::point& location);
294 static light_button create(const control& parent, const xtd::ustring& text, const drawing::point& location, const drawing::size& size);
302 static light_button create(const control& parent, const xtd::ustring& text, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
308 static light_button create(const control& parent, const xtd::ustring& text, xtd::forms::check_state check_state);
315 static light_button create(const control& parent, const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location);
323 static light_button create(const control& parent, const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
332 static light_button create(const control& parent, const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
339 static light_button create(const control& parent, const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state);
347 static light_button create(const control& parent, const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location);
356 static light_button create(const control& parent, const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
366 static light_button create(const control& parent, const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
368
370
375
378 event<light_button, event_handler> check_state_changed;
380
381 protected:
383
385 forms::create_params create_params() const noexcept override;
386
389 xtd::forms::visual_styles::check_box_state state() const noexcept;
391
393
399 std::unique_ptr<xtd::object> clone() const override;
400
401 drawing::size measure_control() const noexcept override;
402
407 virtual void on_checked_changed(const event_args& e);
408
413 virtual void on_check_state_changed(const event_args& e);
414
415 void on_enabled_changed(const event_args& e) override;
416 void on_handle_created(const event_args& e) override;
417 void on_image_changed(const xtd::event_args& e) override;
418 void on_mouse_down(const mouse_event_args& e) override;
419 void on_mouse_enter(const event_args& e) override;
420 void on_mouse_leave(const event_args& e) override;
421 void on_mouse_up(const mouse_event_args& e) override;
422 void on_paint(paint_event_args& e) override;
423 void wnd_proc(message& message) override;
425
426 private:
427 void wm_mouse_double_click(message& message);
428 void wm_mouse_down(message& message);
429 void wm_mouse_up(message& message);
430
431 std::shared_ptr<data> data_;
432 };
433 }
434}
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:35
Defines the base class for controls, which are components with visual representation.
Definition control.h:79
Encapsulates the information needed when creating a control.
Definition create_params.h:27
Represents a Windows light_button.
Definition light_button.h:43
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:26
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.h:32
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.h:28
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
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
size_t size
Represents a size of any object in bytes.
Definition types.h:197
check_state
Specifies the state of a control, such as a check box, that can be checked, unchecked,...
Definition check_state.h:21
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.h:19
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