Use sizers in the notebook sample for better DPI change handling

Even simple static texts need to be put inside sizers to allow them to
update their size when the DPI changes, as they remain too small for the
new (higher) DPI otherwise when the sample window is moved from a
standard to high DPI monitor.

See #23088.
This commit is contained in:
Vadim Zeitlin 2023-01-13 19:45:01 +01:00
parent 00c541934d
commit b1bdb95ee8

View file

@ -114,9 +114,11 @@ wxPanel *CreateVetoPage(wxBookCtrlBase *parent)
panel->SetHelpText("An empty panel");
#endif
(void) new wxStaticText( panel, wxID_ANY,
"This page intentionally left blank",
wxPoint(10, 10) );
wxSizer* const s = new wxBoxSizer(wxVERTICAL);
s->Add(new wxStaticText( panel, wxID_ANY,
"This page intentionally left blank" ),
wxSizerFlags().Expand().DoubleBorder());
panel->SetSizer(s);
return panel;
}
@ -143,9 +145,12 @@ wxPanel *CreateInsertPage(wxBookCtrlBase *parent)
#endif
panel->SetBackgroundColour( wxColour( "MAROON" ) );
(void) new wxStaticText( panel, wxID_ANY,
"This page has been inserted, not added.",
wxPoint(10, 10) );
wxSizer* const s = new wxBoxSizer(wxVERTICAL);
s->Add(new wxStaticText( panel, wxID_ANY,
"This page has been inserted, not added." ),
wxSizerFlags().Expand().DoubleBorder());
panel->SetSizer(s);
return panel;
}