Module

fODRadConShRes

Path

C:\CPRS\CPRS30\Orders\fODRadConShRes.pas

Last Modified

7/15/2014 3:26:42 PM

Units Used in Interface

Name Comments
fBase508Form -

Units Used in Implementation

Name Comments
rCore -
rODRad -
uCore -

Classes

Name Comments
TfrmODRadConShRes -

Procedures

Name Owner Declaration Scope Comments
cmdCancelClick TfrmODRadConShRes procedure cmdCancelClick(Sender: TObject); Public/Published -
cmdOKClick TfrmODRadConShRes procedure cmdOKClick(Sender: TObject); Public/Published -
SelectSource - procedure SelectSource(FontSize: Integer; SrcType: char; var Source: string) ; Interfaced Displays Source entry/selection form and returns a record of the selection

Constants

Name Declaration Scope Comments
TX_CS_CAP 'No Source' Global -
TX_CS_TEXT 'Select Source, or press Cancel.' Global -
TX_R_CAP 'No Source' Global -
TX_R_TEXT 'Enter Source (3-40 characters), or press Cancel.' Global -


Module Source

1     unit fODRadConShRes;
2     
3     interface
4     
5     uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
6       Buttons, ORCtrls, ORfn, ExtCtrls, fBase508Form, VA508AccessibilityManager;
7     
8     type
9       TfrmODRadConShRes = class(TfrmBase508Form)
10        cmdOK: TButton;
11        cmdCancel: TButton;
12        cboSource: TORComboBox;
13        SrcLabel: TLabel;
14        pnlBase: TORAutoPanel;
15        txtResearch: TCaptionEdit;
16        procedure cmdOKClick(Sender: TObject);
17        procedure cmdCancelClick(Sender: TObject);
18      private
19        FSource: string  ;
20        FChanged: Boolean;
21      end;
22    
23    procedure SelectSource(FontSize: Integer; SrcType: char; var Source: string) ;
24    
25    implementation
26    
27    {$R *.DFM}
28    
29    uses rODRad, rCore, uCore;
30    
31    const
32      TX_CS_TEXT = 'Select Source, or press Cancel.';
33      TX_CS_CAP = 'No Source';
34      TX_R_TEXT = 'Enter Source (3-40 characters), or press Cancel.';
35      TX_R_CAP = 'No Source';
36    
37    procedure SelectSource(FontSize: Integer; SrcType: char; var Source: string) ;
38    { displays Source entry/selection form and returns a record of the selection }
39    var
40      frmODRadConShRes: TfrmODRadConShRes;
41      W, H: Integer;
42    begin
43      frmODRadConShRes := TfrmODRadConShRes.Create(Application);
44      try
45        with frmODRadConShRes do
46        begin
47          Font.Size := FontSize;
48          W := ClientWidth;
49          H := ClientHeight;
50          ResizeToFont(FontSize, W, H);
51          ClientWidth  := W; pnlBase.Width  := W;
52          ClientHeight := H; pnlBase.Height := H;
53          FChanged := False;
54          if SrcType in ['C','S'] then with cboSource do
55             begin
56               FastAssign(SubsetOfRadSources(SrcType), cboSource.Items);
57               if Items.Count > 0 then
58                begin
59                 txtResearch.Enabled := False;
60                 Enabled := True;
61                 SelectByID(Piece(Source,U,1));
62                 cboSource.Visible := True;
63                 txtResearch.Visible := False;
64                 //BringToFront;
65                 ShowModal;
66                end
67               {else if Items.Count = 1 then
68                 FSource := Items[0]}
69               else
70                 FSource := '-1';
71             end
72          else if SrcType = 'R' then
73            begin
74              cboSource.Enabled := False;
75              cboSource.Visible := False;
76              srcLabel.Caption := 'Enter Source:';
77              txtResearch.Visible := True;
78              //txtResearch.BringToFront;
79              txtResearch.Text := Source;
80              ShowModal;
81              FSource := txtResearch.Text;
82            end;
83          Source:= FSource ;
84        end; {frmODRadConShRes}
85      finally
86        frmODRadConShRes.Release;
87      end;
88    end;
89    
90    procedure TfrmODRadConShRes.cmdCancelClick(Sender: TObject);
91    begin
92      FChanged := False ;
93      FSource := '';
94      Close;
95    end;
96    
97    procedure TfrmODRadConShRes.cmdOKClick(Sender: TObject);
98    begin
99     if cboSource.Enabled then with cboSource do
100     begin
101      if ItemIEN = 0 then
102       begin
103        InfoBox(TX_CS_TEXT, TX_CS_CAP, MB_OK or MB_ICONWARNING);
104        FChanged := False ;
105        FSource := '';
106        Exit;
107       end;
108      FChanged := True;
109      FSource := Items[ItemIndex];
110     end
111    else
112     begin
113      if (Length(txtResearch.Text)<3) or (Length(txtResearch.Text)> 40) then
114       begin
115        InfoBox(TX_R_TEXT, TX_R_CAP, MB_OK or MB_ICONWARNING);
116        FChanged := False ;
117        FSource := '';
118        Exit;
119       end ;
120      FChanged := True;
121      FSource := txtResearch.Text;
122     end;
123    Close;
124   end;
125   
126   end.

Module Calls (2 levels)


fODRadConShRes
 ├fBase508Form
 │ ├uConst
 │ └uHelpManager
 └rODRad

Module Called-By (2 levels)


fODRadConShRes
      fODRad┘ 
   uOrders┘