FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour LEFT() and RIGHT() but in centimeters in stead of characters
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
LEFT() and RIGHT() but in centimeters in stead of characters
Posted: Wed Dec 02, 2009 09:28 PM

Hello,

I'm looking for a function which can take a left or a right part of a string in centimeters.

I want to use this string to put into a Word document but the space I have is limited.

Since proportional fonts are used, I cannot use the normal LEFT() or RIGHT().

I hope I did make myself clear.

Thanks a lot in advance for any help.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: LEFT() and RIGHT() but in centimeters in stead of characters
Posted: Wed Dec 02, 2009 10:03 PM
Hello Michael,
I use this code:

Code (fw): Select all Collapse
while oWnd:GetWidth(text,oFont) < nPX
         n := n + 1
         text := padr( (cChartCaption) ,n)
      end


Best regards,
Otto
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: LEFT() and RIGHT() but in centimeters in stead of characters
Posted: Thu Dec 24, 2009 10:15 AM
Hello Michel,
I think I found a better solution:
Code (fw): Select all Collapse
 DrawText( ::hDC, cCaption,{ nTxtTop, nTxtLeft, nTxtBottom, nTxtRight },nStyle  )
Best regards,
Otto
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: LEFT() and RIGHT() but in centimeters in stead of characters
Posted: Fri Dec 25, 2009 05:05 PM
Hello Michel,
drawText works fine for me:

Best regards,
Otto

Continue the discussion