PageRenderTime 53ms CodeModel.GetById 46ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/Source/FR_GEDIT.PAS

http://github.com/FastReports/FreeReport
Pascal | 94 lines | 62 code | 17 blank | 15 comment | 1 complexity | c6092b00b10487be153dd5692c4570d9 MD5 | raw file
 1
 2{*****************************************}
 3{                                         }
 4{             FastReport v2.3             }
 5{              Picture editor             }
 6{                                         }
 7{  Copyright (c) 1998-99 by Tzyganenko A. }
 8{                                         }
 9{*****************************************}
10
11unit FR_GEdit;
12
13interface
14
15{$I FR.inc}
16
17uses
18  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
19  Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, FR_Const;
20
21type
22  TfrGEditorForm = class(TForm)
23    Image1: TImage;
24    Bevel1: TBevel;
25    OpenDlg: TOpenDialog;
26    CB1: TCheckBox;
27    Button1: TButton;
28    Button2: TButton;
29    Button3: TButton;
30    Button4: TButton;
31    Button5: TButton;
32    procedure BitBtn1Click(Sender: TObject);
33    procedure CB1Click(Sender: TObject);
34    procedure Button4Click(Sender: TObject);
35    procedure FormCreate(Sender: TObject);
36    procedure Button5Click(Sender: TObject);
37  private
38    { Private declarations }
39  public
40    { Public declarations }
41  end;
42
43var
44  frGEditorForm: TfrGEditorForm;
45
46implementation
47
48{$R *.DFM}
49
50uses FR_Class, FR_Desgn;
51
52procedure TfrGEditorForm.BitBtn1Click(Sender: TObject);
53begin
54{$IFDEF JPEG}
55  OpenDlg.Filter := LoadStr(SPictFile) +
56    ' (*.bmp *.jpg *.ico *.wmf *.emf)|*.bmp;*.jpg;*.ico;*.wmf;*.emf|' +
57    LoadStr(SAllFiles) + '|*.*';
58{$ELSE}
59  OpenDlg.Filter := LoadStr(SPictFile) +
60    ' (*.bmp *.ico *.wmf *.emf)|*.bmp;*.ico;*.wmf;*.emf|' +
61    LoadStr(SAllFiles) + '|*.*';
62{$ENDIF}
63  if OpenDlg.Execute then
64    Image1.Picture.LoadFromFile(OpenDlg.FileName);
65end;
66
67procedure TfrGEditorForm.CB1Click(Sender: TObject);
68begin
69  Image1.Stretch := CB1.Checked;
70end;
71
72procedure TfrGEditorForm.Button4Click(Sender: TObject);
73begin
74  Image1.Picture.Assign(nil);
75end;
76
77procedure TfrGEditorForm.FormCreate(Sender: TObject);
78begin
79  Caption := LoadStr(frRes + 460);
80  CB1.Caption := LoadStr(frRes + 461);
81  Button3.Caption := LoadStr(frRes + 462);
82  Button4.Caption := LoadStr(frRes + 463);
83  Button5.Caption := LoadStr(frRes + 464);
84  Button1.Caption := LoadStr(SOk);
85  Button2.Caption := LoadStr(SCancel);
86end;
87
88procedure TfrGEditorForm.Button5Click(Sender: TObject);
89begin
90  TfrDesignerForm(frDesigner).ShowMemoEditor;
91end;
92
93end.
94