From b93422535d6e8340ef5f06e979c3329cc565fe36 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 9 Feb 2024 18:45:55 +0100 Subject: [PATCH] Show window enter/leave events in the widgets sample This allows to easily check if these events are generated correctly for all the controls shown in this sample. --- samples/widgets/widgets.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 9add0d857d..507295570e 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -741,6 +741,17 @@ void WidgetsFrame::ConnectToWidgetEvents() w->Bind(wxEVT_SET_FOCUS, &WidgetsFrame::OnWidgetFocus, this); w->Bind(wxEVT_KILL_FOCUS, &WidgetsFrame::OnWidgetFocus, this); + w->Bind(wxEVT_ENTER_WINDOW, [w](wxMouseEvent& event) + { + wxLogMessage("Mouse entered into '%s'", w->GetClassInfo()->GetClassName()); + event.Skip(); + }); + w->Bind(wxEVT_LEAVE_WINDOW, [w](wxMouseEvent& event) + { + wxLogMessage("Mouse left '%s'", w->GetClassInfo()->GetClassName()); + event.Skip(); + }); + w->Bind(wxEVT_CONTEXT_MENU, &WidgetsFrame::OnWidgetContextMenu, this); } }