[Lazarus] Patch win32callback

JoshyFun joshyfun at gmail.com
Wed Jun 11 18:32:20 CEST 2008


--- Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com>
escribió:

> > I'm a little confused, it seems there are two kinds of margins:
> > printer's physical limits (we call it here workable area) and
> user
> > artificial margis. I thought you were talking about first kind,
> but
> > now I think you are talking about second one.
> 
> I think we need both.
> 
> If WorkAre is the Physical limits, then what is
> Printer.PaperSize.PaperRect.PhysicalRect ?

That would be page width and height encoded in a TRect

> 
> > What do you expect a hypotethical margins feature to do?,
> 
> You can use it when drawing to the printer canvas. say:
> 
> Printer.Canvas.Draw(someImg, MarginX, MarginY);
> 

perhaps some code:

with Printer.PaperSize.PaperRect do begin
  MarginX := WorkRect.Left;
  MarginY := WorRect.Top;
  Printer.Canvas.Draw(someImg, MarginX, MarginY);
  // nothing stops us to define a user/application specific margin
  MarginX := 100;
  MarginY := 110;
  Printer.Canvas.Draw(someImg, MarginX, MarginY);
end;

Now, guess what? I completly forgot about the windows specific
dialog: TPageSetupDialog there one can select Paper, Orientation and
ta-da, Margins and also has a printer button. Margins here seems to
refer to adjust printable area, so say you set marginsX=100
MarginY=100 in dialog and when you do canvas.Draw(0,0,SomeImg) it
will print SomeImg at (100,100) mm, I'm not sure about this
interpretation maybe somebody else can help here. I never used this
dialog so I forgot it, sorry. 

I don't know if there is a specific api for setting and retrieving
this margins, but I guess if we have to have this feature we should
use Printer.PaperSize class as an interface to such api. 

TPageSetupDialog was a contribution, unfortunately it's not
crossplatform, I expect new contributions to be crossplaforms other
wise we end with problems.


> > Printer.PaperSize.DefaultPaper
> 
> Nice! But does it really honor the paper choosen by the user in the
> print dialog? I looked at the code but I can't find an answer.
> 

Printer.PaperSize.DefaultPaperName it's supposed to be the paper you
set in specific control panel OS dialogs so it's readonly,
PaperSize.PaperName it's the currently selected paper using dialogs
or code, available papers are in PaperSize.SupportedPapers list. 

If you select a paper in dialog or code and PaperName doesn't reflect
that selection, you have found a bug :D


> thanks,
> --
> Felipe Monteiro de Carvalho



      ____________________________________________________________________________________
Yahoo! Deportes Beta
¡No te pierdas lo último sobre el torneo clausura 2008! Entérate aquí http://deportes.yahoo.com



More information about the Lazarus mailing list