From b97bf311e0cf3607286e1cfb889506cedb09ffea Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 24 Oct 2019 20:43:45 +0200 Subject: [PATCH] Log widget class name for focus events in widgets sample This shows better what is going on with focus and makes troubleshooting easier. --- samples/widgets/widgets.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 06bc4a7ac5..40eedbda7b 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -1236,7 +1236,8 @@ void WidgetsFrame::OnWidgetFocus(wxFocusEvent& event) // only log these events in our own logger. if ( wxGetApp().IsUsingLogWindow() ) { - wxLogMessage("Widgets %s focus", + wxWindow* win = (wxWindow*)event.GetEventObject(); + wxLogMessage("Widget '%s' %s focus", win->GetClassInfo()->GetClassName(), event.GetEventType() == wxEVT_SET_FOCUS ? "got" : "lost"); }