Trouble with the Print Functions

Windows specific forum
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

Trouble with the Print Functions

Post by PB&J Lover »

I am trying to print from a listicongadget and I am having trouble doing it. Here is the code:

Code: Select all

          Case #MenuBar_Editor_PRINT
            If PrintRequester()
              Select DataID$
                Case "D" : PrintTitle$ = "Distortion Chart"
                Case "R" : PrintTitle$ = "Rule Types Chart" 
              EndSelect
                 If StartPrinting(PrintTitle$)
                    If StartDrawing(PrinterOutput())
                       DrawingFont(LoadFont(0, "Courier New", 70, #PB_Font_Bold))  
                         For index = 0 To CountGadgetItems(#List1)
                           Locate(0,5+index) : DrawText(GetGadgetItemText(#List1,index,0))
                         Next index
                       StopDrawing()                         
                    EndIf
                    StopPrinting() 
                 EndIf
            EndIf
All I get is the last line printed. I think the lines are all strung together too. How do you use the print functions? :cry:
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Have you tried, column 1 instead of 0?
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

column 1

Post by PB&J Lover »

Yes, these are listgadgets...sorry. The data is there, but it is just not printing correctly.

EDIT: Ok, I figured it out!

Code: Select all

                 If StartPrinting(PrintTitle$)
                    If StartDrawing(PrinterOutput())
                       DrawingFont(LoadFont(0, "Courier New", 70, #PB_Font_Bold))  
                         For index = 0 To CountGadgetItems(#List1)
                          If index = 63 : NewPrinterPage() : EndIf
                          If index >=63 : comp.l = 6300    : Else : comp = 0 : EndIf
                           Locate(10,index*100-comp) : DrawText(GetGadgetItemText(#List1,index,0))
                         Next index
                       StopDrawing()                         
                    EndIf
                    StopPrinting() 
                 EndIf
            EndIf
This will only print 2 page documents, but it works for what I need. Can someone else add some printer pointers? :D
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
Post Reply