Module

fRename

Path

C:\CPRS\CPRS30\fRename.pas

Last Modified

7/15/2014 3:26:38 PM

Units Used in Interface

Name Comments
fAutoSz -

Classes

Name Comments
TfrmRename -

Procedures

Name Owner Declaration Scope Comments
cmdCancelClick TfrmRename procedure cmdCancelClick(Sender: TObject); Public/Published -
cmdOKClick TfrmRename procedure cmdOKClick(Sender: TObject); Public/Published -
FormCreate TfrmRename procedure FormCreate(Sender: TObject); Public/Published -

Functions

Name Owner Declaration Scope Comments
ExecuteRename - function ExecuteRename(var AName: string; const APrompt: string): Boolean; Interfaced -


Module Source

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

Module Calls (2 levels)


fRename
 └fAutoSz
   └fBase508Form

Module Called-By (2 levels)


          fRename
fOrderSaveQuick┘ 
      uOrders┘