aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-11 01:09:49 +0800
committer杨宇千 <crupest@outlook.com>2019-08-11 01:09:49 +0800
commit0e35b2c022599bca2df61488945f07e4d6b4eb35 (patch)
tree71daef6f9725a250b9fcaf97fdecc9bdf46bd6e3 /src/ui/controls
parent9eed31954c14f2d60c906adb5b49b58fbee4ff7f (diff)
downloadcru-0e35b2c022599bca2df61488945f07e4d6b4eb35.tar.gz
cru-0e35b2c022599bca2df61488945f07e4d6b4eb35.tar.bz2
cru-0e35b2c022599bca2df61488945f07e4d6b4eb35.zip
...
Diffstat (limited to 'src/ui/controls')
-rw-r--r--src/ui/controls/button.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ui/controls/button.cpp b/src/ui/controls/button.cpp
index 0ac65d26..2228343c 100644
--- a/src/ui/controls/button.cpp
+++ b/src/ui/controls/button.cpp
@@ -23,4 +23,18 @@ void Button::OnChildChanged(Control* old_child, Control* new_child) {
if (new_child != nullptr)
render_object_->AddChild(new_child->GetRenderObject(), 0);
}
+
+void Button::OnMouseClickBegin(platform::native::MouseButton button) {
+ if (button & trigger_button_) {
+ SetState(ButtonState::Press);
+ //TODO!
+ }
+}
+
+void Button::OnMouseClickEnd(platform::native::MouseButton button) {
+ if (button & trigger_button_) {
+ SetState(ButtonState::Normal);
+ //TODO!
+ }
+}
} // namespace cru::ui::controls