diff options
-rw-r--r-- | CruUI-Generate/cru_ui.cpp | 13 | ||||
-rw-r--r-- | CruUI-Generate/cru_ui.hpp | 7 | ||||
-rw-r--r-- | src/cru_event.hpp | 7 | ||||
-rw-r--r-- | src/ui/window.cpp | 13 |
4 files changed, 10 insertions, 30 deletions
diff --git a/CruUI-Generate/cru_ui.cpp b/CruUI-Generate/cru_ui.cpp index 2a1d93e1..6db99a0e 100644 --- a/CruUI-Generate/cru_ui.cpp +++ b/CruUI-Generate/cru_ui.cpp @@ -2307,15 +2307,12 @@ namespace cru::ui bool Window::HandleWindowMessage(HWND hwnd, int msg, WPARAM w_param, LPARAM l_param, LRESULT & result) { - if (!native_message_event.IsNoHandler()) + events::WindowNativeMessageEventArgs args(this, this, {hwnd, msg, w_param, l_param}); + native_message_event.Raise(args); + if (args.GetResult().has_value()) { - events::WindowNativeMessageEventArgs args(this, this, {hwnd, msg, w_param, l_param}); - native_message_event.Raise(args); - if (args.GetResult().has_value()) - { - result = args.GetResult().value(); - return true; - } + result = args.GetResult().value(); + return true; } switch (msg) { diff --git a/CruUI-Generate/cru_ui.hpp b/CruUI-Generate/cru_ui.hpp index 1912e243..f662f4bd 100644 --- a/CruUI-Generate/cru_ui.hpp +++ b/CruUI-Generate/cru_ui.hpp @@ -1067,13 +1067,6 @@ namespace cru { (handler.second)(args); } - - //TODO: Remove this! - bool IsNoHandler() const - { - return handlers_.empty(); - } - private: std::map<EventHandlerToken, EventHandler> handlers_; diff --git a/src/cru_event.hpp b/src/cru_event.hpp index 63de7e76..fa41d646 100644 --- a/src/cru_event.hpp +++ b/src/cru_event.hpp @@ -76,13 +76,6 @@ namespace cru { (handler.second)(args); } - - //TODO: Remove this! - bool IsNoHandler() const - { - return handlers_.empty(); - } - private: std::map<EventHandlerToken, EventHandler> handlers_; diff --git a/src/ui/window.cpp b/src/ui/window.cpp index c757c4e1..ac79392b 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -322,15 +322,12 @@ namespace cru::ui bool Window::HandleWindowMessage(HWND hwnd, int msg, WPARAM w_param, LPARAM l_param, LRESULT & result) { - if (!native_message_event.IsNoHandler()) + events::WindowNativeMessageEventArgs args(this, this, {hwnd, msg, w_param, l_param}); + native_message_event.Raise(args); + if (args.GetResult().has_value()) { - events::WindowNativeMessageEventArgs args(this, this, {hwnd, msg, w_param, l_param}); - native_message_event.Raise(args); - if (args.GetResult().has_value()) - { - result = args.GetResult().value(); - return true; - } + result = args.GetResult().value(); + return true; } switch (msg) { |