Fix unwanted message boxes in widgets sample once and for all

Add IsUsingLogWindow() that can be used to check if the log messages go
into the listbox instead of being shown in a message box, which was
annoying when starting or quitting the sample.

This is a bit more complicated than the hack previously used in
TextWidgetsPage::OnText(), but more general and can be easily reused for
the focus loss messages, for example.
This commit is contained in:
Vadim Zeitlin
2019-07-08 12:53:02 +02:00
parent 7206194d08
commit 3d9656395a
3 changed files with 50 additions and 10 deletions

View File

@@ -155,6 +155,10 @@ public:
// the default attributes for the widget
static WidgetAttributes& GetAttrs();
// return true if we're showing logs in the log window (always the case
// except during startup and shutdown)
static bool IsUsingLogWindow();
protected:
// several helper functions for page creation