source: cprs/trunk/CPRS-Chart/mCoPayDesc.pas@ 1531

Last change on this file since 1531 was 830, checked in by Kevin Toppenberg, 14 years ago

Upgrading to version 27

File size: 5.4 KB
Line 
1unit mCoPayDesc;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 ExtCtrls, StdCtrls, ORCtrls, UBAConst, VA508AccessibilityManager;
8
9type
10 TfraCoPayDesc = class(TFrame)
11 pnlRight: TPanel;
12 lblCaption: TStaticText;
13 pnlSCandRD: TPanel;
14 lblSCDisplay: TLabel;
15 memSCDisplay: TCaptionMemo;
16 Spacer2: TLabel;
17 pnlMain: TPanel;
18 spacer1: TLabel;
19 pnlHNC: TPanel;
20 lblHNC2: TVA508StaticText;
21 lblHNC: TVA508StaticText;
22 pnlMST: TPanel;
23 lblMST2: TVA508StaticText;
24 lblMST: TVA508StaticText;
25 pnlSWAC: TPanel;
26 lblSWAC2: TVA508StaticText;
27 lblSWAC: TVA508StaticText;
28 pnlIR: TPanel;
29 lblIR2: TVA508StaticText;
30 lblIR: TVA508StaticText;
31 pnlAO: TPanel;
32 lblAO2: TVA508StaticText;
33 lblAO: TVA508StaticText;
34 pnlSC: TPanel;
35 lblSC2: TVA508StaticText;
36 lblSC: TVA508StaticText;
37 pnlCV: TPanel;
38 lblCV2: TVA508StaticText;
39 lblCV: TVA508StaticText;
40 pnlSHD: TPanel;
41 lblSHAD: TVA508StaticText;
42 lblSHAD2: TVA508StaticText;
43 procedure lblEnter(Sender: TObject);
44 procedure lblExit(Sender: TObject);
45 private
46 { Private declarations }
47 procedure ConvertShortLabelsToLong;
48 public
49 procedure ShowTreatmentFactorHints(var pHintText: string; var pCompName: TVA508StaticText);
50 procedure LabelCaptionsOn(CaptionsOn : Boolean = true);
51 constructor Create(AOwner: TComponent); override;
52 end;
53
54implementation
55
56uses rPCE, UBAGlobals, VAUtils, VA508AccessibilityRouter;
57
58{$R *.DFM}
59var
60 FOSTFHintWndActive: boolean;
61 FOSTFhintWindow: THintWindow;
62
63
64{ TfraCoPayDesc }
65
66constructor TfraCoPayDesc.Create(AOwner: TComponent);
67begin
68 inherited Create(AOwner);
69 TabStop := FALSE;
70 ListSCDisabilities(memSCDisplay.Lines);
71 lblSC.Hint := BAFactorsRec.FBAFactorSC;
72 lblSC2.Hint := BAFactorsRec.FBAFactorSC;
73 lblCV.Hint := BAFactorsRec.FBAFactorCV;
74 lblCV2.Hint := BAFactorsRec.FBAFactorCV;
75 lblAO.Hint := BAFactorsRec.FBAFactorAO;
76 lblAO2.Hint := BAFactorsRec.FBAFactorAO;
77 lblIR.Hint := BAFactorsRec.FBAFactorIR;
78 lblIR2.Hint := BAFactorsRec.FBAFactorIR;
79 lblSWAC.Hint := BAFactorsRec.FBAFactorEC;
80 lblSWAC2.Hint := BAFactorsRec.FBAFactorEC;
81 lblMST.Hint := BAFactorsRec.FBAFactorMST;
82 lblMST2.Hint := BAFactorsRec.FBAFactorMST;
83 lblHNC.Hint := BAFactorsRec.FBAFactorHNC;
84 lblHNC2.Hint := BAFactorsRec.FBAFactorHNC;
85 lblSHAD.Hint := BAFactorsRec.FBAFactorSHAD;
86 lblSHAD2.Hint := BAFactorsRec.FBAFactorSHAD;
87 if ScreenReaderActive then
88 ConvertShortLabelsToLong;
89end;
90
91procedure TfraCoPayDesc.LabelCaptionsOn(CaptionsOn: Boolean);
92begin
93 //Abbreviated captions
94 lblSC.ShowHint := CaptionsOn;
95 lblCV.ShowHint := CaptionsOn;
96 lblAO.ShowHint := CaptionsOn;
97 lblIR.ShowHint := CaptionsOn;
98 lblSWAC.ShowHint := CaptionsOn;
99 lblMST.ShowHint := CaptionsOn;
100 lblHNC.ShowHint := CaptionsOn;
101 lblSHAD.ShowHint := CaptionsOn;
102 //Long captions
103 lblSC2.ShowHint := CaptionsOn;
104 lblCV2.ShowHint := CaptionsOn;
105 lblAO2.ShowHint := CaptionsOn;
106 lblIR2.ShowHint := CaptionsOn;
107 lblSWAC2.ShowHint := CaptionsOn;
108 lblMST2.ShowHint := CaptionsOn;
109 lblHNC2.ShowHint := CaptionsOn;
110 lblSHAD2.ShowHint := CaptionsOn;
111end;
112
113procedure TfraCoPayDesc.lblEnter(Sender: TObject);
114begin
115 (Sender as TVA508StaticText).Font.Style := [fsBold];
116end;
117
118procedure TfraCoPayDesc.lblExit(Sender: TObject);
119begin
120 (Sender as TVA508StaticText).Font.Style := [];
121end;
122
123procedure TfraCoPayDesc.ConvertShortLabelsToLong;
124begin
125 lblSC2.Caption := BAFactorsRec.FBAFactorSC;
126 lblCV2.Caption := BAFactorsRec.FBAFactorCV;
127 lblAO2.Caption := BAFactorsRec.FBAFactorAO;
128 lblIR2.Caption := BAFactorsRec.FBAFactorIR;
129 lblSWAC2.Caption := BAFactorsRec.FBAFactorEC;
130 lblSHAD2.Caption := BAFactorsRec.FBAFactorSHAD;
131 lblMST2.Caption := BAFactorsRec.FBAFactorMST;
132 lblHNC2.Caption := BAFactorsRec.FBAFactorHNC;
133end;
134
135procedure TfraCoPayDesc.ShowTreatmentFactorHints(var pHintText: string;
136 var pCompName: TVA508StaticText);
137var
138 HRect: TRect;
139 thisRect: TRect;
140 x,y: integer;
141
142begin
143 try
144 if FOSTFhintWndActive then
145 begin
146 FOSTFhintWindow.ReleaseHandle;
147 FOSTFhintWndActive := False;
148 end;
149 except
150 on E: Exception do
151 begin
152 {$ifdef debug}Show508Message('Unhandled exception in procedure TfrmSignOrders.ShowTreatmentFactorHints()');{$endif}
153 raise;
154 end;
155 end;
156
157 try
158 FOSTFhintWindow := THintWindow.Create(Self);
159 FOSTFhintWindow.Color := clInfoBk;
160 GetWindowRect(pCompName.Handle,thisRect);
161 x := thisRect.Left;
162 y := thisRect.Top;
163 hrect := FOSTFhintWindow.CalcHintRect(Screen.Width, pHintText,nil);
164 hrect.Left := hrect.Left + X;
165 hrect.Right := hrect.Right + X;
166 hrect.Top := hrect.Top + Y;
167 hrect.Bottom := hrect.Bottom + Y;
168
169 LabelCaptionsOn(not FOSTFHintWndActive);
170
171 FOSTFhintWindow.ActivateHint(hrect, pHintText);
172 FOSTFHintWndActive := True;
173 except
174 on E: Exception do
175 begin
176 {$ifdef debug}Show508Message('Unhandled exception in procedure TfrmSignOrders.ShowTreatmentFactorHints()');{$endif}
177 raise;
178 end;
179 end;
180end;
181
182initialization
183 SpecifyFormIsNotADialog(TfraCoPayDesc);
184
185end.
Note: See TracBrowser for help on using the repository browser.