Last change
on this file since 1156 was 453, checked in by Kevin Toppenberg, 16 years ago |
Initial upload of TMG-CPRS 1.0.26.69
|
File size:
1.5 KB
|
Line | |
---|
1 | //kt -- Modified with SourceScanner on 8/4/2007
|
---|
2 | unit fRename;
|
---|
3 |
|
---|
4 | interface
|
---|
5 |
|
---|
6 | uses
|
---|
7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
8 | fAutoSz, StdCtrls, ORFn, ORCtrls, DKLang;
|
---|
9 |
|
---|
10 | type
|
---|
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 |
|
---|
24 | function ExecuteRename(var AName: string; const APrompt: string): Boolean;
|
---|
25 |
|
---|
26 | implementation
|
---|
27 |
|
---|
28 | {$R *.DFM}
|
---|
29 |
|
---|
30 | function ExecuteRename(var AName: string; const APrompt: string): Boolean;
|
---|
31 | var
|
---|
32 | frmRename: TfrmRename;
|
---|
33 | begin
|
---|
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;
|
---|
53 | end;
|
---|
54 |
|
---|
55 | procedure TfrmRename.FormCreate(Sender: TObject);
|
---|
56 | begin
|
---|
57 | inherited;
|
---|
58 | OKPressed := False;
|
---|
59 | end;
|
---|
60 |
|
---|
61 | procedure TfrmRename.cmdOKClick(Sender: TObject);
|
---|
62 | begin
|
---|
63 | inherited;
|
---|
64 | OKPressed := True;
|
---|
65 | Close;
|
---|
66 | end;
|
---|
67 |
|
---|
68 | procedure TfrmRename.cmdCancelClick(Sender: TObject);
|
---|
69 | begin
|
---|
70 | inherited;
|
---|
71 | Close;
|
---|
72 | end;
|
---|
73 |
|
---|
74 | end.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.