aboutsummaryrefslogtreecommitdiff
path: root/src/ui/RoutedEventDispatch.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/RoutedEventDispatch.hpp')
-rw-r--r--src/ui/RoutedEventDispatch.hpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/ui/RoutedEventDispatch.hpp b/src/ui/RoutedEventDispatch.hpp
index 5ff21a74..9337e9ec 100644
--- a/src/ui/RoutedEventDispatch.hpp
+++ b/src/ui/RoutedEventDispatch.hpp
@@ -20,7 +20,7 @@ namespace cru::ui {
// "original_sender", which is unchanged. And "args" will be perfectly forwarded
// as the rest arguments.
template <typename EventArgs, typename... Args>
-void DispatchEvent(const std::string_view& event_name,
+void DispatchEvent(const std::u16string_view& event_name,
Control* const original_sender,
event::RoutedEvent<EventArgs>* (Control::*event_ptr)(),
Control* const last_receiver, Args&&... args) {
@@ -30,7 +30,7 @@ void DispatchEvent(const std::string_view& event_name,
#ifdef CRU_DEBUG
bool do_log = true;
- if (event_name == "MouseMove") do_log = false;
+ if (event_name == u"MouseMove") do_log = false;
#endif
if (original_sender == last_receiver) {
@@ -56,14 +56,14 @@ void DispatchEvent(const std::string_view& event_name,
#ifdef CRU_DEBUG
if (do_log) {
- std::string log = "Dispatch routed event ";
+ std::u16string log = u"Dispatch routed event ";
log += event_name;
- log += ". Path (parent first): ";
+ log += u". Path (parent first): ";
auto i = receive_list.crbegin();
const auto end = --receive_list.crend();
for (; i != end; ++i) {
log += (*i)->GetControlType();
- log += " -> ";
+ log += u" -> ";
}
log += (*i)->GetControlType();
log::Debug(log);
@@ -89,8 +89,8 @@ void DispatchEvent(const std::string_view& event_name,
#ifdef CRU_DEBUG
if (do_log)
log::Debug(
- "Routed event is short-circuit in TUNNEL at {}-st control (count "
- "from parent).",
+ u"Routed event is short-circuit in TUNNEL at {}-st control (count "
+ u"from parent).",
count);
#endif
break;
@@ -110,9 +110,8 @@ void DispatchEvent(const std::string_view& event_name,
#ifdef CRU_DEBUG
if (do_log)
log::Debug(
- "Routed event is short-circuit in BUBBLE at {}-st control "
- "(count "
- "from parent).",
+ u"Routed event is short-circuit in BUBBLE at {}-st control "
+ u"(count from parent).",
count);
#endif
break;
@@ -128,7 +127,7 @@ void DispatchEvent(const std::string_view& event_name,
}
#ifdef CRU_DEBUG
- if (do_log) log::Debug("Routed event dispatch finished.");
+ if (do_log) log::Debug(u"Routed event dispatch finished.");
#endif
}
} // namespace cru::ui