Richtext

Richtext

Postby reinaldocrespo » Thu Jul 20, 2006 2:34 am

Antonio /Everyone;

Hi.

Does the method GetLineFromChar( nChar ) on the richtext class returns the position of the given nchar in centemeters or inches or what?

It does not seem to be working properly. Does anybody know?


Best,


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Richtext

Postby Enrico Maria Giordano » Thu Jul 20, 2006 7:47 am

From the MSDN:

This message returns the zero-based index of the line.


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby reinaldocrespo » Thu Aug 03, 2006 7:51 pm

Enrico;

Then what I need is to find out where on the page did that last line printed vertically. This is so that I can go on printing other stuff on the next line after that.

So if I print with:
Code: Select all  Expand view
   nFrom := REPrintBox( oRtf:hWnd, ::oPrn:hDCOut, .t., nTop, nLeft, nBottom, nRight, nFrom )


Then with:
Code: Select all  Expand view
   oRtf:GetLineFromChar( nFrom )


I know the last line from the richtext that printed. But how can I find out where in inches or centemeters on the page did it print?

RC.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Postby Enrico Maria Giordano » Thu Aug 03, 2006 8:14 pm

I don't know, sorry.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby reinaldocrespo » Fri Aug 04, 2006 4:20 pm

Enrico;

I sort of have a solution:
Code: Select all  Expand view
::nLastLine := ( ( aoRtf[i]:GetLineFromChar( nFrom ) - nTmp ) * ::oprn:Pix2Inch( aortf[i]:oFont:nHEIGHT, 0 )[1] ) + nTOPOffset

::nlastline += 0.32      //couple of blank lines


Where nTmp is the line index into the richtext that printed at the first line of the page.

It seems to be working...

RC.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 84 guests