PageRenderTime 4ms CodeModel.GetById 0ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/components/printers/design/printers4lazidetest/main.pas

http://github.com/graemeg/lazarus
Pascal | 71 lines | 31 code | 17 blank | 23 comment | 0 complexity | ce68b4456367e068b45cf805e7fb3f58 MD5 | raw file
 1{ Copyright (C) 2006 Darius Blaszijk
 2
 3  This source is free software; you can redistribute it and/or modify it under
 4  the terms of the GNU General Public License as published by the Free
 5  Software Foundation; either version 2 of the License, or (at your option)
 6  any later version.
 7
 8  This code is distributed in the hope that it will be useful, but WITHOUT ANY
 9  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
11  details.
12
13  A copy of the GNU General Public License is available on the World Wide Web
14  at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
15  to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16  MA 02111-1307, USA.
17}
18
19unit main;
20
21{$mode objfpc}{$H+}
22
23interface
24
25uses
26  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, SynEdit,
27  Buttons, ExtCtrls;
28
29type
30
31  { TForm1 }
32
33  TForm1 = class(TForm)
34    Button1: TButton;
35
36    SynEdit1: TSynEdit;
37    procedure Button1Click(Sender: TObject);
38    procedure FormCreate(Sender: TObject);
39  private
40    { private declarations }
41  public
42    { public declarations }
43  end; 
44
45var
46  Form1: TForm1; 
47
48implementation
49
50{$R main.lfm}
51
52uses SourcePrinter;
53
54{ TForm1 }
55
56procedure TForm1.FormCreate(Sender: TObject);
57begin
58  SynEdit1.Lines.LoadFromFile(UTF8ToSys('main.pas'));
59end;
60
61procedure TForm1.Button1Click(Sender: TObject);
62var
63  sp: TSourcePrinter;
64begin
65  sp := TSourcePrinter.Create;
66  sp.Execute(SynEdit1.Lines);
67  sp.Free;
68end;
69
70end.
71