[Lazarus] TMemo doesn't have OnMouseWheelxxx events

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Jun 5 09:17:58 CEST 2008


Ok, thanks, that works nicely, but you have to guess the paper being used.

If we are using a TPrintDialog then the user should be able to select
the target paper and margins in the TPrintDialog.

So maybe some way to get the paper name is missing from TPrintDialog,
or even better, get all margins form there.

Here is my current code:

procedure TfrmPrint.btnPrintClick(Sender: TObject);
var
  PaperWorkRect: TRect;
  PrintDlg: TPrintDialog;
begin
  PrintDlg := TPrintDialog.Create(Self);
  try
    if PrintDlg.Execute then
    begin
      Printer.BeginDoc;
      Printer.papersize.papername := 'A4';
      PaperWorkRect := Printer.PaperSize.PaperRect.WorkRect;
      Printer.Canvas.TextOut(PaperWorkRect.Left, PaperWorkRect.Top, 'TextOut');
      Printer.EndDoc;
    end;
  finally
    PrintDlg.Free;
  end;
end;

thanks,
-- 
Felipe Monteiro de Carvalho



More information about the Lazarus mailing list