FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem using InchSay Centered, or Right Justified
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Problem using InchSay Centered, or Right Justified
Posted: Mon Apr 13, 2015 12:35 AM

Anybody know a fix for printing using inchSay, or Say from the printer object when using the Width parameter (pixels only), and using PAD_CENTER, or PAD_RIGHT? It does not seem to cut off correctly based on the width using these.

Thanks,

Byron

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Problem using InchSay Centered, or Right Justified
Posted: Tue Apr 14, 2015 02:44 PM

Byron,

Maybe you could show us a small program showing the problem. And maybe a screenshot of the output.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Problem using InchSay Centered, or Right Justified
Posted: Sat Apr 18, 2015 07:20 PM

Here is an example of the printout discussed earlier. I am using the method Say (Inchsay uses say it just converts Inches to Pixels before)

Source below:

Function TestAlign()
#Define PAD_LEFT 0
#Define PAD_RIGHT 1
#Define PAD_CENTER 2

Local oPrn
Local oBrush  := nil
Local oFont   := nil
Local oPen    := nil
Local nTop    := 200
Local nLeft   := 200
Local nBottom := 285
Local nRight  := 500
Local nCenter := nLeft + ( nRight - nLeft ) / 2
Local nWidth  := nRight - nLeft
Local cCode   := ""

Printer oPrn Preview
   Define Font oFont Name "Arial" Size 0, -10 of oPrn
   Define Pen oPen Width 05 Color CLR_BLACK   of oPrn
    Page
   oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
    oPrn:Say( nTop,nLeft,"WideText",oFont,,,,PAD_LEFT   )
    cCode := "oPrn:Say( nTop,nLeft,'WideText',oFont,,,,PAD_LEFT   )"
    oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT   )

    nTop    += 100
    nBottom += 100
    oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
    oPrn:Say( nTop,nRight,"WideText",oFont,,,,PAD_RIGHT  )
    oPrn:Say( nTop,nRight,"WideText",oFont,,,,PAD_RIGHT  )
    cCode := "oPrn:Say( nTop,nRight,'WideText',oFont,,,,PAD_RIGHT  )"
    oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT   )

    nTop    += 100
    nBottom += 100
    oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
    oPrn:Say( nTop,nCenter,'WideText',oFont,,,,PAD_CENTER )
    cCode := "oPrn:Say( nTop,nCenter,'WideText',oFont,,,,PAD_CENTER )"
    oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT   )

    nTop    += 150
    nBottom += 150
   oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
    oPrn:Say( nTop,nLeft,"WideText",oFont,nWidth,,,PAD_LEFT   )
    cCode := "oPrn:Say( nTop,nLeft,'WideText',oFont,nWidth,,,PAD_LEFT   )"
    oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT   )

    nTop    += 100
    nBottom += 100
    oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
    oPrn:Say( nTop,nRight,"WideText",oFont,nWidth,,,PAD_RIGHT  )
    cCode := "oPrn:Say( nTop,nRight,'WideText',oFont,nWidth,,,PAD_RIGHT  )"
    oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT   )

    nTop    += 100
    nBottom += 100
    oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
    oPrn:Say( nTop,nCenter,'WideText',oFont,nWidth,,,PAD_CENTER )
    cCode := "oPrn:Say( nTop,nCenter,'WideText',oFont,nWidth,,,PAD_CENTER )"
    oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT   )

   EndPage
EndPrint

Return nil

Thanks,

Byron Hopp

Matrix Computer Services

Continue the discussion