Richedit( ) function problems

Re: Richedit( ) function problems

Postby TimStone » 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
User avatar
TimStone
 
Posts: 2905
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Richedit( ) function problems

Postby Antonio Linares » Thu Jun 30, 2016 6:12 am

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: 41348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Richedit( ) function problems

Postby Antonio Linares » Thu Jun 30, 2016 6:18 am

Tim,

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

Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 41348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Richedit( ) function problems

Postby Silvio.Falconi » Thu Jun 30, 2016 7: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 November 2023 - January 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
Silvio.Falconi
 
Posts: 6821
Joined: Thu Oct 18, 2012 7:17 pm

Re: Richedit( ) function problems

Postby Antonio Linares » Thu Jun 30, 2016 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Richedit( ) function problems

Postby TimStone » Thu Jun 30, 2016 5: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
User avatar
TimStone
 
Posts: 2905
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Richedit( ) function problems

Postby Antonio Linares » Thu Jun 30, 2016 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Richedit( ) function problems

Postby Silvio.Falconi » Sat Jul 02, 2016 8: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 November 2023 - January 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
Silvio.Falconi
 
Posts: 6821
Joined: Thu Oct 18, 2012 7:17 pm

Re: Richedit( ) function problems

Postby Antonio Linares » Sat Jul 02, 2016 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Richedit( ) function problems

Postby Silvio.Falconi » 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 November 2023 - January 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
Silvio.Falconi
 
Posts: 6821
Joined: Thu Oct 18, 2012 7:17 pm

Re: Richedit( ) function problems

Postby Antonio Linares » Sat Jul 02, 2016 10:23 am

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Richedit( ) function problems

Postby Silvio.Falconi » 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 November 2023 - January 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
Silvio.Falconi
 
Posts: 6821
Joined: Thu Oct 18, 2012 7:17 pm

Re: Richedit( ) function problems

Postby cnavarro » Sat Jul 02, 2016 5: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

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
User avatar
cnavarro
 
Posts: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 34 guests