FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BtnFlat
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
BtnFlat
Posted: Wed May 02, 2012 03:14 PM
Hello Antonio,

We need some extra space otherwise the letters are cut off.
Best regards,
Otto
aRect := { ::nMargin, ::nMargin, ::nHeight - ::nMargin + 2 , ::nWidth - ::nMargin }




Code (fw): Select all Collapse
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

Continue the discussion