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.
This commit is contained in:
Vadim Zeitlin 2024-02-09 18:45:55 +01:00
parent f24b3d5483
commit b93422535d

View file

@ -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);
}
}