source: cprs/branches/tmg-cprs/CPRS-Chart/fRename.pas@ 1619

Last change on this file since 1619 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 1.5 KB
RevLine 
[453]1//kt -- Modified with SourceScanner on 8/4/2007
2unit fRename;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 fAutoSz, StdCtrls, ORFn, ORCtrls, DKLang;
9
10type
11 TfrmRename = class(TfrmAutoSz)
12 lblRename: TLabel;
13 txtName: TCaptionEdit;
14 cmdOK: TButton;
15 cmdCancel: TButton;
16 DKLanguageController2: TDKLanguageController;
17 procedure FormCreate(Sender: TObject);
18 procedure cmdOKClick(Sender: TObject);
19 procedure cmdCancelClick(Sender: TObject);
20 private
21 OKPressed: Boolean;
22 end;
23
24function ExecuteRename(var AName: string; const APrompt: string): Boolean;
25
26implementation
27
28{$R *.DFM}
29
30function ExecuteRename(var AName: string; const APrompt: string): Boolean;
31var
32 frmRename: TfrmRename;
33begin
34 Result := False;
35 frmRename := TfrmRename.Create(Application);
36 try
37 ResizeFormToFont(TForm(frmRename));
38 with frmRename do
39 begin
40 lblRename.Caption := APrompt;
41 txtName.Text := AName;
42 txtName.SelectAll;
43 ShowModal;
44 if OKPressed then
45 begin
46 AName := txtName.Text;
47 Result := True;
48 end;
49 end;
50 finally
51 frmRename.Release;
52 end;
53end;
54
55procedure TfrmRename.FormCreate(Sender: TObject);
56begin
57 inherited;
58 OKPressed := False;
59end;
60
61procedure TfrmRename.cmdOKClick(Sender: TObject);
62begin
63 inherited;
64 OKPressed := True;
65 Close;
66end;
67
68procedure TfrmRename.cmdCancelClick(Sender: TObject);
69begin
70 inherited;
71 Close;
72end;
73
74end.
Note: See TracBrowser for help on using the repository browser.