BtnFlat

BtnFlat

Postby Otto » Wed May 02, 2012 3: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 }


Image

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 111 guests