FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Richedit( ) function problems
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Richedit( ) function problems
Posted: Wed Jun 29, 2016 10:01 PM

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Richedit( ) function problems
Posted: Thu Jun 30, 2016 06:12 AM

Tim,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Richedit( ) function problems
Posted: Thu Jun 30, 2016 06:18 AM
Tim,

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

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

   ENDPRINT

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Richedit( ) function problems
Posted: Thu Jun 30, 2016 07:54 AM

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Richedit( ) function problems
Posted: Thu Jun 30, 2016 08:49 AM

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
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Richedit( ) function problems
Posted: Thu Jun 30, 2016 05:08 PM

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Richedit( ) function problems
Posted: Thu Jun 30, 2016 06:16 PM
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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Richedit( ) function problems
Posted: Sat Jul 02, 2016 08:40 AM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Richedit( ) function problems
Posted: Sat Jul 02, 2016 09:19 AM

> 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Richedit( ) function problems
Posted: Sat Jul 02, 2016 10:21 AM

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Richedit( ) function problems
Posted: Sat Jul 02, 2016 10:23 AM

metafiles are not editables as far as I know

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Richedit( ) function problems
Posted: Sat Jul 02, 2016 11:17 AM

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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Richedit( ) function problems
Posted: Sat Jul 02, 2016 05:11 PM
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

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

Continue the discussion