From 1201f665ed2dbc2bc817f5fbf12bbf65e3073685 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 20 Oct 2025 16:22:40 +0200 Subject: [PATCH] Make it more visually clear where static text should wrap Create a window of 150px width to check that the text really wraps at 150px. --- samples/wrapsizer/wrapsizer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/samples/wrapsizer/wrapsizer.cpp b/samples/wrapsizer/wrapsizer.cpp index 0dd8c8dbf4..db856dba78 100644 --- a/samples/wrapsizer/wrapsizer.cpp +++ b/samples/wrapsizer/wrapsizer.cpp @@ -131,8 +131,16 @@ WrapSizerFrame::WrapSizerFrame() sizerRoot->Add( new wxStaticText( m_panel, -1, "This is long text that will not wrap. This is long text that will not wrap." )); + + // A window of 150px width for comparison. + auto* const ruler = new wxStaticText(m_panel, wxID_ANY, "150px", + wxDefaultPosition, wxSize(150, -1), + wxALIGN_CENTER); + ruler->SetBackgroundColour(*wxYELLOW); + sizerRoot->Add(ruler); + // A long wxStaticText that wraps at 150px - wxStaticText *stattext = new wxStaticText( m_panel, -1, "This is very long text that will wrap at 150x. This is very long text that will wrap at 150px." ); + wxStaticText *stattext = new wxStaticText( m_panel, -1, "This is very long text that will wrap at 150px. This is very long text that will wrap at 150px." ); stattext->Wrap( 150 ); sizerRoot->Add( stattext );