xtd 0.2.0
Loading...
Searching...
No Matches
check_box.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
11namespace xtd {
13 namespace forms {
44 struct data;
45
46 public:
48
57
59
67 virtual forms::appearance appearance() const noexcept;
72
79 virtual bool auto_check() const noexcept;
83 virtual check_box& auto_check(bool auto_check);
84
87 virtual content_alignment check_align() const noexcept;
90 virtual check_box& check_align(content_alignment check_align);
91
98 virtual bool checked() const noexcept;
102 virtual check_box& checked(bool checked);
103
116 virtual forms::check_state check_state() const noexcept;
129
136 virtual bool three_state() const noexcept;
140 virtual check_box& three_state(bool three_state);
142
144
148 static check_box create();
152 static check_box create(const drawing::point& location);
157 static check_box create(const drawing::point& location, const drawing::size& size);
163 static check_box create(const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
167 static check_box create(const xtd::ustring& text);
172 static check_box create(const xtd::ustring& text, const drawing::point& location);
178 static check_box create(const xtd::ustring& text, const drawing::point& location, const drawing::size& size);
185 static check_box create(const xtd::ustring& text, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
190 static check_box create(const xtd::ustring& text, xtd::forms::check_state check_state);
198 static check_box create(const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location);
204 static check_box create(const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
212 static check_box create(const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
217 static check_box create(const xtd::ustring& text, bool three_state);
223 static check_box create(const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state);
230 static check_box create(const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location);
238 static check_box create(const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
247 static check_box 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);
251 static check_box create(const control& parent);
256 static check_box create(const control& parent, const drawing::point& location);
262 static check_box create(const control& parent, const drawing::point& location, const drawing::size& size);
269 static check_box create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
274 static check_box create(const control& parent, const xtd::ustring& text);
280 static check_box create(const control& parent, const xtd::ustring& text, const drawing::point& location);
287 static check_box create(const control& parent, const xtd::ustring& text, const drawing::point& location, const drawing::size& size);
295 static check_box create(const control& parent, const xtd::ustring& text, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
301 static check_box create(const control& parent, const xtd::ustring& text, xtd::forms::check_state check_state);
308 static check_box create(const control& parent, const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location);
316 static check_box create(const control& parent, const xtd::ustring& text, xtd::forms::check_state check_state, const drawing::point& location, const drawing::size& size);
325 static check_box 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);
331 static check_box create(const control& parent, const xtd::ustring& text, bool three_state);
338 static check_box create(const control& parent, const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state);
346 static check_box create(const control& parent, const xtd::ustring& text, bool three_state, xtd::forms::check_state check_state, const drawing::point& location);
355 static check_box 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);
365 static check_box 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);
367
369
373 event<check_box, event_handler> appearance_changed;
374
377 event<check_box, event_handler> checked_changed;
378
381 event<check_box, event_handler> check_state_changed;
383
384 protected:
386
390 forms::create_params create_params() const noexcept override;
393 xtd::forms::visual_styles::check_box_state state() const noexcept;
395
397
403 std::unique_ptr<xtd::object> clone() const override;
404
408 drawing::size measure_control() const noexcept override;
409
414 virtual void on_appearance_changed(const event_args& e);
415
420 virtual void on_checked_changed(const event_args& e);
421
426 virtual void on_check_state_changed(const event_args& e);
427
428 void on_enabled_changed(const event_args& e) override;
429 void on_handle_created(const event_args& e) override;
430 void on_mouse_down(const mouse_event_args& e) override;
431 void on_mouse_enter(const event_args& e) override;
432 void on_mouse_leave(const event_args& e) override;
433 void on_mouse_up(const mouse_event_args& e) override;
434 void on_paint(paint_event_args& e) override;
435 void wnd_proc(message& message) override;
437
438 private:
439 void wm_mouse_double_click(message& message);
440 void wm_mouse_down(message& message);
441 void wm_mouse_up(message& message);
442
443 std::shared_ptr<data> data_;
444 };
445 }
446}
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
Represents a Windows check_box.
Definition check_box.h:43
virtual forms::appearance appearance() const noexcept
Gets the value that determines the appearance of a check_box control.
check_box()
Initializes a new instance of the CheckBox class.
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
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
appearance
Specifies the appearance of a control.
Definition appearance.h:20
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