+ // add space for vertical scrollbar
+ if ( !(m_windowStyle & wxTE_NO_VSCROLL) )
+ wText += ::GetSystemMetrics(SM_CXVSCROLL);
+
+ if ( ylen <= 0 )
+ {
+ hText *= wxMax(wxMin(GetNumberOfLines(), 10), 2);
+ // add space for horizontal scrollbar
+ if ( m_windowStyle & wxHSCROLL )
+ hText += ::GetSystemMetrics(SM_CYHSCROLL);
+ }
+ }
+ // for single line control cy (height + external leading) is ok
+ else
+ {
+ // Add the margins we have previously set
+ wxPoint marg( GetMargins() );
+ wText += wxMax(0, marg.x);
+ hText += wxMax(0, marg.y);
+ }
+
+ // Text controls without border are special and have the same height as
+ // static labels (they also have the same appearance when they're disable
+ // and are often used as a sort of copyable to the clipboard label so it's
+ // important that they have the same height as the normal labels to not
+ // stand out).
+ if ( !HasFlag(wxBORDER_NONE) )
+ {
+ wText += 9; // borders and inner margins
+
+ // we have to add the adjustments for the control height only once, not
+ // once per line, so do it after multiplication above
+ hText += EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) - cy;