mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-21 21:47:55 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user