New FWH 19.09

Re: New FWH 19.09

Postby nageswaragunupudi » Tue Oct 22, 2019 8:28 pm

In FWH1906, this is the syntax of RoundBox:
Code: Select all  Expand view

METHOD RoundBox( nRow, nCol, nBottom, nRight, nWidth, nHeight, oPen, nBGColor )
 


There was a serious bug in the method. Row was treated as Col and Col was treated as Row. Same way Bottom was treated as Right and Right was treated as Bottom. So the box was drawn at a place and shape different than what is specified.

Let us see an example:
Code: Select all  Expand view

#include "fivewin.ch"

function Main()

   local oPrn

   PRINT oPrn PREVIEW
   PAGE

   oPrn:Box(       500, 1000, 1500, 4000 )
   oPrn:RoundBox( 1600, 1000, 2600, 4000, 400, 400 )

   ENDPAGE
   ENDPRINT

return nil
 

What do we expect?
A wide rectangle on the top and a wide round rectangle of the same size at the bottom of the first rectangle. This is how we expect the boxes to be drawn and FWH1909 draws the boxes correctly like this as intended and expected:
Image

But FWH1906 draws it totally wrong like this:
Image

This was a serious bug that needs to be fixed sometime or other and is fixed in FWH1909.
In addition, the roundbox syntax is made consistent across windows, printer and pdf.

We regret the inconvenience caused to you in the process of fixing the bug. We request you to cooperate.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: New FWH 19.09

Postby Silvio.Falconi » Wed Oct 23, 2019 7:25 am

It is easy to box in this way but due to direct and personal experience when in the past I had to do the graphic part of the orders with lines and boxes I always had problems if the user changed printer because the lines moved: I have to set a box so that the same box is for all printers?
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: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: New FWH 19.09

Postby byte-one » Wed Oct 23, 2019 11:09 am

Mr. Rao, you are right! My last version was 1812. Now is the same for all operations.

The underlaying problem is function roundbox(..). There are still
Row was treated as Col and Col was treated as Row. Same way Bottom was treated as Right and Right was treated as Bottom.


But a other thing is the pen in oPrint:box() and oPrint:roundbox(). I make a pen with "DEFINE PEN oPen1 WIDTH max(1,(max(oPrn:nHorzRes(),oPrn:nVertRes())/1800))" with exact pixels. In the METHOD ParamPen(..) you use
Code: Select all  Expand view

  case cType == "O" .AND. anoPen:IsKindOf( "TPEN" )
      if anoPen:oDevice == nil .or. !anoPen:oDevice:IsKindOf( "TPRINTER" )
         aPen  := { anoPen:nColor, anoPen:nWidth }
      else
         hPen  := anoPen:hPen
      endif
...
...


hPen  := CreatePen( PS_SOLID, aPen[ 2 ] * ::nLogPixelX() / 72, aPen[ 1 ] )


and calculate a new pen-width bigger as in the DEFINE PEN...
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: New FWH 19.09

Postby nageswaragunupudi » Wed Oct 23, 2019 11:53 am

Mr. Günther,

Mr. Rao, you are right! My last version was 1812. Now is the same for all operations.

The underlaying problem is function roundbox(..). There are still

This is fixed in FWH1909. Now the syntax and functionality is consistent not only with the Box() method of TPrinter, but also is consistent with methods RoundBox() of Window and Pdf also. We required this consistent syntax and functionality across all devices for futher development of graphic functionality.

Thanks for understanding and we highly appreciate your cooperation.

I make a pen with "DEFINE PEN oPen1 WIDTH max(1,(max(oPrn:nHorzRes(),oPrn:nVertRes())/1800))"


Instead please use
Code: Select all  Expand view

DEFINE PEN oPen WIDTH nWidth OF oPrn  // FWH1909
 

This will accurately translate the width to the printer scale.

We will greatly appreciate you to cooperate and support these changes.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: New FWH 19.09

Postby byte-one » Wed Oct 23, 2019 12:16 pm

Mr. Rao, what is the "nWidth" to make a pen with for example 1mm thickness
DEFINE PEN oPen WIDTH ?? OF oPrn // FWH1909
Thank you!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: New FWH 19.09

Postby ukoenig » Wed Oct 23, 2019 12:49 pm

Günther,

the pen-calculation-factor ( GdiPlus )

//New( nTrans, nRed, nGreen, nBlue, nSize, lRound, lAlign )
//nRed := nRGBRed( nColor )
//nGreen := nRGBGreen( nColor )
//nBlue := nRGBBlue( nColor )

oPen := Pen():New( 255, 0, 0, 255 , 8, .T.) will show a 3 mm pen
1 mm = 2.834645669

regards
Uwe :D
Last edited by ukoenig on Wed Oct 23, 2019 2:46 pm, edited 5 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: New FWH 19.09

Postby byte-one » Wed Oct 23, 2019 12:59 pm

Uwe, thanks. For now in my actual programs i will change the parameter "oPen" in :box and :roundbox to "oPen:hPen"
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

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