aboutsummaryrefslogtreecommitdiff
path: root/CruUI/ui/events/ui_event.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-09-13 23:42:44 +0800
committercrupest <crupest@outlook.com>2018-09-13 23:42:44 +0800
commitda54cf6e1dd9ffbf1e57a8a3c19e41a8fcedf5b1 (patch)
tree59ab635a09bfb4fc219b243c920cd236dfa41010 /CruUI/ui/events/ui_event.h
parent42f9f6c0bce5b3bea05edf4e371539fe21ea1c5d (diff)
downloadcru-da54cf6e1dd9ffbf1e57a8a3c19e41a8fcedf5b1.tar.gz
cru-da54cf6e1dd9ffbf1e57a8a3c19e41a8fcedf5b1.tar.bz2
cru-da54cf6e1dd9ffbf1e57a8a3c19e41a8fcedf5b1.zip
...
Diffstat (limited to 'CruUI/ui/events/ui_event.h')
-rw-r--r--CruUI/ui/events/ui_event.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/CruUI/ui/events/ui_event.h b/CruUI/ui/events/ui_event.h
index efb0479b..ddf5f99f 100644
--- a/CruUI/ui/events/ui_event.h
+++ b/CruUI/ui/events/ui_event.h
@@ -168,6 +168,29 @@ namespace cru
Size new_size_;
};
+ class FocusChangeEventArgs : public UiEventArgs
+ {
+ public:
+ FocusChangeEventArgs(Object* sender, Object* original_sender, const bool is_window =false)
+ : UiEventArgs(sender, original_sender), is_window_(is_window)
+ {
+
+ }
+ FocusChangeEventArgs(const FocusChangeEventArgs& other) = default;
+ FocusChangeEventArgs(FocusChangeEventArgs&& other) = default;
+ FocusChangeEventArgs& operator=(const FocusChangeEventArgs& other) = default;
+ FocusChangeEventArgs& operator=(FocusChangeEventArgs&& other) = default;
+ ~FocusChangeEventArgs() override = default;
+
+ // Return whether the focus change is caused by the window-wide focus change.
+ bool IsWindow() const
+ {
+ return is_window_;
+ }
+
+ private:
+ bool is_window_;
+ };
using UiEvent = Event<UiEventArgs>;
using MouseEvent = Event<MouseEventArgs>;
@@ -175,6 +198,7 @@ namespace cru
using DrawEvent = Event<DrawEventArgs>;
using PositionChangedEvent = Event<PositionChangedEventArgs>;
using SizeChangedEvent = Event<SizeChangedEventArgs>;
+ using FocusChangeEvent = Event<FocusChangeEventArgs>;
}
}
}