Re: [Gambas-user] Paint.Begin() and printer.print

Wed, 09 Jan 2013 02:12:26 -0800

Am Dienstag, den 08.01.2013, 22:50 +0100 schrieb Benoît Minisini:
> Le 08/01/2013 22:46, Karl Reinl a écrit :
> > Salut,
> >
> > is that logical?
> > For Paint.Begin(<object>) I need a device object.
> > But if i start a printer with .print, Paint hijacks the printer as
> > device.
> > Had some day with blanc pages, while  setting Paint.Begin(<printer>) in
> > printer_Begin().
> > What worked when project is started as executable, but not when used as
> > library.
> >
> 
> Sorry, I don't understand a word. :-/
> 

Ok, so I'll try to explain it in a another way:

normally if you want to use Paint, you have to start with 
Paint.Begin(<Device>)

Paint.Begin() needs the Device, to which it should paint. 

Paint is also used by the printer.

The difference is : 
while for other devices you declare it in Paint.Begin(<Device>), 
the printer, becomes with  <printer>.print the painting device.

That is what I call 'Paint hijacks the printer as device'

And the problem is : if you call on <printer>_Begin() event a
Paint.Begin(<printer>) that will work standalone executables ,
but not in libraries.
The mixed up brought me always the number of pages, but all where
empty/blanc.

That is my code .

  ' ---- new printer starts here -----------------------------
  _SwitchNext.PrinterSet("FullPage", True)         ' set FullPage
  _SwitchNext.PrinterSet("Count", sbPage.MaxValue) ' set nbr. of pages
  _SwitchNext.PrinterPrint()                     ' calls <printer>.print
  ' ----- new printer ends here ------------------------------


'---------------------------------------
' Printer related events     
'---------------------------------------
Public Sub objPrinter_Begin()
  ' if printer.print is called, Paint took automatically the printer as
Device
  ' DrawBegin(objPrinter)
End

Public Sub objPrinter_Paginate()
  ' 
End

Public Sub objPrinter_Draw()
  DrawExecSetOnPage(objPrinter.Page)
End

Public Sub objPrinter_End()
  DrawEnd() ' 
End


-- 
Amicalement
Charlie


------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to