From c66ec7e0fda7be26e731b5f8b280c8a32d879e1f Mon Sep 17 00:00:00 2001 From: Fabien Bodard Date: Sun, 18 Dec 2011 21:10:28 +0000 Subject: [PATCH] git-svn-id: svn://localhost/gambas/trunk@4289 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.report/.src/Preview/CPrint.class | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 comp/src/gb.report/.src/Preview/CPrint.class diff --git a/comp/src/gb.report/.src/Preview/CPrint.class b/comp/src/gb.report/.src/Preview/CPrint.class new file mode 100644 index 000000000..3d6299a7b --- /dev/null +++ b/comp/src/gb.report/.src/Preview/CPrint.class @@ -0,0 +1,44 @@ +' Gambas class file + +Create Static +Private hPrinter As New Printer As "Printer" +Private $hPrint As Report + +Public Sub PrintReport(hReport As Report) + + Dim hSizeParse As TSizeParse + + $hPrint = hReport.Clone() + hPrinter.Paper = $hPrint.Paper + hPrinter.Orientation = $hPrint.Orientation + If $hPrint.Paper = Printer.Custom Then + hSizeParse = New TSizeParse($hPrint.Width) + hPrinter.PaperWidth = hSizeParse.ToCm() / 10 + hSizeParse = New TSizeParse($hPrint.Height) + hPrinter.PaperHeight = hSizeParse.ToCm() / 10 + Endif + If Not hPrinter.Configure() Then + hPrinter.Print + Endif + +End + +Public Sub Printer_Draw() + + $hPrint.Paint(hPrinter.Page) + +End + +Public Sub Printer_Begin() + + 'Debug Object.Type($hReport) + $hPrint.Layout + hPrinter.Count = $hPrint.PageCount + +End + +Public Sub Printer_End() + + $hPrint = Null + +End \ No newline at end of file