Richedit( ) function problems

User avatar
TimStone
Posts: 2963
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Has thanked: 25 times
Been thanked: 2 times
Contact:

Re: Richedit( ) function problems

Post by TimStone »

So if I want to use the PRINTER class, what control would I use to send the output ?

Will it display properly in the Preview of a print document ?

What are the RichText controls for a resource file ?

Thank you.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: Richedit( ) function problems

Post by Antonio Linares »

Tim,

For your third question, please review FWH\samples\testrich.rc
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: Richedit( ) function problems

Post by Antonio Linares »

Tim,

In FWH\samples\testrtf.prg function PrintBox( lPreview ) you have an example to preview or print a richedit

Code: Select all | Expand

static function PrintBox( lPreview )   local oPrn   local aRTF := { 100, 1000 }  // { nFrom, nTop }   DEFAULT lPreview := .f.   if lPreview      PRINT oPrn NAME "FWH RICHEDIT FILE" PREVIEW   else      PRINT oPrn NAME "FWH RICHEDIT FILE"   endif      if Empty( oPrn:hDC )         MsgStop( "Printer not ready!" )         return nil      endif      PAGE         CursorWait()         oPrn:Box( aRTF[ 2 ], 500, aRTF[ 2 ] + 1000, 1500 )         aRTF := REPrintBox( oRTF:hWnd, If( lPreview, oPrn:hDCOut, oPrn:hDC ), ;                             oRTF:IsSelection(), ;                             aRTF[ 2 ] + 10, 510, 1490, aRTF[ 2 ] + 990, aRTF[ 1 ] )         oPrn:Box( aRTF[ 2 ], 500, aRTF[ 2 ] + 1000, 1500 )         aRTF := REPrintBox( oRTF:hWnd, If( lPreview, oPrn:hDCOut, oPrn:hDC ), ;                             oRTF:IsSelection(), ;                             aRTF[ 2 ] + 10, 510, 1490, aRTF[ 2 ] + 990, aRTF[ 1 ] )         oPrn:Box( aRTF[ 2 ], 500, aRTF[ 2 ] + 1000, 1500 )         aRTF := REPrintBox( oRTF:hWnd, If( lPreview, oPrn:hDCOut, oPrn:hDC ), ;                             oRTF:IsSelection(), ;                             aRTF[ 2 ] + 10, 510, 1490, aRTF[ 2 ] + 990, aRTF[ 1 ] )         CursorArrow()      ENDPAGE   ENDPRINTreturn nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 7187
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 9 times

Re: Richedit( ) function problems

Post by Silvio.Falconi »

Antonio,
How I can make to show with Lines dotted the margins of Rtf document on rPreview ?
Good can be the possibility to drag and drop this lines and move the margins directly on rpreview
Regards
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: Richedit( ) function problems

Post by Antonio Linares »

Silvio,

The preview uses metafiles. We can't interact with them.

A complete new preview engine would have to be built
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
TimStone
Posts: 2963
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Has thanked: 25 times
Been thanked: 2 times
Contact:

Re: Richedit( ) function problems

Post by TimStone »

Thank you. I will work with this. It is an enhancement so I don't need to have it working today.

Is there documentation somewhere that explains using RTF. I've looked at those samples, but I like to understand how something works and samples don't always explain that.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: Richedit( ) function problems

Post by Antonio Linares »

Tim,

FWH RichEdit is just a wrapper (more or less) to Windows RichEdit:

https://msdn.microsoft.com/en-us/library/windows/desktop/bb787873(v=vs.85).aspx
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 7187
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 9 times

Re: Richedit( ) function problems

Post by Silvio.Falconi »

Antonio Linares wrote:Silvio,

The preview uses metafiles. We can't interact with them.

A complete new preview engine would have to be built



Antonio,
I think it can be made adding commands to Tmetafile class
When I tried to make Vrd I used a class Tpaper it was Tmetafile with mousemove commands and then there was Items as lines and boxes
I not remember where I put the sources...


On Informes.prg (C5ide.zop) we can found :
CLASS TRptItem
CLASS TRptLineItem FROM TRptItem
CLASS TSoporte or Tbanda is as tmetafile class

perhaps we have all
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: Richedit( ) function problems

Post by Antonio Linares »

> there was Items as lines and boxes

on top of it ?

Or do you mean modifying the metafile at runtime ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 7187
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 9 times

Re: Richedit( ) function problems

Post by Silvio.Falconi »

I cannot search my source because I cannot open my pcPortable I'm waiting new power supply from Usa from 20days ( I'm usinf the pc at work :))
but I saw on delphi it make a line and with the mouse move this line and move the margins
but you say it is impossible ok
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: Richedit( ) function problems

Post by Antonio Linares »

metafiles are not editables as far as I know
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 7187
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 9 times

Re: Richedit( ) function problems

Post by Silvio.Falconi »

ok
but for a sample ...MyRpt use TPreview() class ( this class use hmetafile)

and u can insert a box into and move it ....with the mouse ...

I think it can be insert two vertical lines and two horizontal line to set the margins
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
cnavarro
Posts: 6572
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Has thanked: 4 times
Been thanked: 6 times

Re: Richedit( ) function problems

Post by cnavarro »

TimStone wrote:So if I want to use the PRINTER class, what control would I use to send the output ?

Will it display properly in the Preview of a print document ?

What are the RichText controls for a resource file ?

Thank you.


If you wants to create a report with the contents of the memo field with rich text, look at this example

Download Exe, prg, and database file in
https://bitbucket.org/fivetech/fivewin- ... eprich.zip

Image
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Post Reply