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