67 VECTOR2I minSizeShort = m_textbox.GetMinSize();
69 m_textbox.SetText( wxT(
"Hello World\nSecond Line\nThird Line" ) );
70 m_textbox.ClearBoundingBoxCache();
71 m_textbox.ClearRenderCache();
72 VECTOR2I minSizeLong = m_textbox.GetMinSize();
74 BOOST_CHECK_GT( minSizeLong.
y, minSizeShort.
y );
83 m_textbox.SetText( wxT(
"A" ) );
84 m_textbox.SetMarginLeft( 0 );
85 m_textbox.SetMarginRight( 0 );
86 m_textbox.SetMarginTop( 0 );
87 m_textbox.SetMarginBottom( 0 );
88 m_textbox.ClearBoundingBoxCache();
89 m_textbox.ClearRenderCache();
91 VECTOR2I minSizeNoMargin = m_textbox.GetMinSize();
94 m_textbox.SetMarginTop( margin );
95 m_textbox.SetMarginBottom( margin );
96 m_textbox.ClearBoundingBoxCache();
97 m_textbox.ClearRenderCache();
99 VECTOR2I minSizeWithMargin = m_textbox.GetMinSize();
103 BOOST_CHECK_GT( minSizeWithMargin.
y, minSizeNoMargin.
y );
143 m_textbox.SetText( wxT(
"Wide Text" ) );
144 m_textbox.ClearBoundingBoxCache();
145 m_textbox.ClearRenderCache();
147 VECTOR2I minSize0 = m_textbox.GetMinSize();
150 m_textbox.ClearBoundingBoxCache();
151 m_textbox.ClearRenderCache();
153 VECTOR2I minSize90 = m_textbox.GetMinSize();
156 BOOST_CHECK_GT( minSize0.
y, 0 );
157 BOOST_CHECK_GT( minSize90.
x, 0 );
BOOST_AUTO_TEST_CASE(GetMinSizeReturnsHeightOnly)
Verify that GetMinSize() returns height-only constraint for non-empty text.
BOOST_CHECK_EQUAL(result, "25.4")