xtd 0.2.0
Loading...
Searching...
No Matches
button.h
Go to the documentation of this file.
1
4#pragma once
5#include "button_base.h"
6#include "dialog_result.h"
7#include "ibutton_control.h"
8#include "timer.h"
10#include <xtd/environment>
11
13namespace xtd {
15 namespace forms {
50 struct data;
51
52 public:
54
60
62 button(button&& rhs);
63 button(const button&) = default;
64 button& operator =(const button&) = default;
66
68
72 virtual bool auto_repeat() const noexcept;
76 virtual button& auto_repeat(bool auto_repeat);
77
80 virtual int32 auto_repeat_delay() const noexcept;
84 virtual button& auto_repeat_delay(int32 auto_repeat_delay);
85
88 virtual int32 auto_repeat_interval() const noexcept;
92 virtual button& auto_repeat_interval(int32 auto_repeat_interval);
93
96 virtual forms::auto_size_mode auto_size_mode() const noexcept;
100
101 forms::dialog_result dialog_result() const noexcept override;
104
106
108 void notify_default(bool value) override;
109
110 void perform_click() override;
112
114
118 static button create();
122 static button create(const drawing::point& location);
127 static button create(const drawing::point& location, const drawing::size& size);
133 static button create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
137 static button create(const xtd::string& text);
142 static button create(const xtd::string& text, const drawing::point& location);
148 static button create(const xtd::string& text, const drawing::point& location, const drawing::size& size);
155 static button create(const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
159 static button create(const control& parent);
164 static button create(const control& parent, const drawing::point& location);
170 static button create(const control& parent, const drawing::point& location, const drawing::size& size);
177 static button create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
182 static button create(const control& parent, const xtd::string& text);
188 static button create(const control& parent, const xtd::string& text, const drawing::point& location);
195 static button create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size);
203 static button create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
205
206 protected:
208
210 forms::create_params create_params() const noexcept override;
211
214 xtd::forms::visual_styles::push_button_state state() const noexcept;
216
218
224 xtd::uptr<xtd::object> clone() const override;
225
226 drawing::size measure_control() const noexcept override;
227
228 void on_click(const event_args& e) override;
229 void on_enabled_changed(const event_args& e) override;
230 void on_handle_created(const event_args& e) override;
231 void on_image_changed(const xtd::event_args& e) override;
232 void on_mouse_down(const mouse_event_args& e) override;
233 void on_mouse_enter(const event_args& e) override;
234 void on_mouse_leave(const event_args& e) override;
235 void on_mouse_up(const mouse_event_args& e) override;
236 void on_paint(paint_event_args& e) override;
238
239 private:
240 void auto_repeat_perform_click();
241 void on_auto_repeat_timer_tick(object& sender, const event_args& e);
242
243 xtd::sptr<data> data_;
244 };
245 }
246}
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.h:18
Implements the basic functionality common to button controls.
Definition button_base.h:37
Represents a Windows button control.
Definition button.h:49
button()
Initializes a new instance of the button class.
virtual bool auto_repeat() const noexcept
Gets if this button instance is auto repeat.
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
Allows a control to act like a button on a form.
Definition ibutton_control.h:26
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
Contains xtd::forms::dialog_result enum class.
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
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
dialog_result
Specifies identifiers to indicate the return value of a dialog box.
Definition dialog_result.h:43
auto_size_mode
Specifies how a control will behave when its auto_size property is enabled.
Definition auto_size_mode.h:22
Contains xtd::forms::ibutton_control interface.
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
Contains xtd::forms::visual_styles::push_button_state enum class.
Contains xtd::forms::timer component.