Page 1 of 1

Trouble with the Print Functions

Posted: Mon Sep 19, 2005 6:53 pm
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:

Posted: Mon Sep 19, 2005 6:56 pm
by dracflamloc
Have you tried, column 1 instead of 0?

column 1

Posted: Mon Sep 19, 2005 6:58 pm
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