We need some extra space otherwise the letters are cut off.
Best regards,
Otto
aRect := { ::nMargin, ::nMargin, ::nHeight - ::nMargin + 2 , ::nWidth - ::nMargin }
- Code: Select all Expand view
- METHOD DrawMultiLine( cText, oFont, nColor, nAlign ) CLASS TBtnFlat
local aRect, hOldFont, nTextHeight
SetTextColor( ::hDC, nColor )
SetBkMode( ::hDC, 1 )
hOldFont := SelectObject( ::hDC, oFont:hFont )
aRect := { ::nMargin, ::nMargin, ::nHeight - ::nMargin + 2 , ::nWidth - ::nMargin }
if lAnd( nAlign, nOr( DT_VCENTER, DT_BOTTOM ) )
nTextHeight := DrawTextEx( ::hDC, cText, aRect, nOr( DT_CALCRECT, DT_WORDBREAK ) )
if lAnd( nAlign, DT_BOTTOM )
aRect[ 1 ] := ::nHeight - ::nMargin - nTextHeight
else
aRect[ 1 ] := ( ::nHeight - nTextHeight ) / 2
endif
endif
DrawTextEx( ::hDC, cText, aRect, nAlign )
SelectObject( ::hDC, hOldFont )
return nil