[456] | 1 | unit mCoPayDesc;
|
---|
| 2 |
|
---|
| 3 | interface
|
---|
| 4 |
|
---|
| 5 | uses
|
---|
| 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
[830] | 7 | ExtCtrls, StdCtrls, ORCtrls, UBAConst, VA508AccessibilityManager;
|
---|
[456] | 8 |
|
---|
| 9 | type
|
---|
| 10 | TfraCoPayDesc = class(TFrame)
|
---|
| 11 | pnlRight: TPanel;
|
---|
| 12 | lblCaption: TStaticText;
|
---|
[830] | 13 | pnlSCandRD: TPanel;
|
---|
[456] | 14 | lblSCDisplay: TLabel;
|
---|
| 15 | memSCDisplay: TCaptionMemo;
|
---|
| 16 | Spacer2: TLabel;
|
---|
| 17 | pnlMain: TPanel;
|
---|
| 18 | spacer1: TLabel;
|
---|
[830] | 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);
|
---|
[456] | 45 | private
|
---|
| 46 | { Private declarations }
|
---|
[830] | 47 | procedure ConvertShortLabelsToLong;
|
---|
[456] | 48 | public
|
---|
[830] | 49 | procedure ShowTreatmentFactorHints(var pHintText: string; var pCompName: TVA508StaticText);
|
---|
| 50 | procedure LabelCaptionsOn(CaptionsOn : Boolean = true);
|
---|
[456] | 51 | constructor Create(AOwner: TComponent); override;
|
---|
| 52 | end;
|
---|
| 53 |
|
---|
| 54 | implementation
|
---|
| 55 |
|
---|
[830] | 56 | uses rPCE, UBAGlobals, VAUtils, VA508AccessibilityRouter;
|
---|
[456] | 57 |
|
---|
| 58 | {$R *.DFM}
|
---|
[830] | 59 | var
|
---|
| 60 | FOSTFHintWndActive: boolean;
|
---|
| 61 | FOSTFhintWindow: THintWindow;
|
---|
[456] | 62 |
|
---|
[830] | 63 |
|
---|
[456] | 64 | { TfraCoPayDesc }
|
---|
| 65 |
|
---|
| 66 | constructor TfraCoPayDesc.Create(AOwner: TComponent);
|
---|
| 67 | begin
|
---|
[830] | 68 | inherited Create(AOwner);
|
---|
| 69 | TabStop := FALSE;
|
---|
[456] | 70 | ListSCDisabilities(memSCDisplay.Lines);
|
---|
[830] | 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;
|
---|
| 89 | end;
|
---|
[456] | 90 |
|
---|
[830] | 91 | procedure TfraCoPayDesc.LabelCaptionsOn(CaptionsOn: Boolean);
|
---|
| 92 | begin
|
---|
| 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;
|
---|
[456] | 111 | end;
|
---|
| 112 |
|
---|
[830] | 113 | procedure TfraCoPayDesc.lblEnter(Sender: TObject);
|
---|
| 114 | begin
|
---|
| 115 | (Sender as TVA508StaticText).Font.Style := [fsBold];
|
---|
| 116 | end;
|
---|
| 117 |
|
---|
| 118 | procedure TfraCoPayDesc.lblExit(Sender: TObject);
|
---|
| 119 | begin
|
---|
| 120 | (Sender as TVA508StaticText).Font.Style := [];
|
---|
| 121 | end;
|
---|
| 122 |
|
---|
| 123 | procedure TfraCoPayDesc.ConvertShortLabelsToLong;
|
---|
| 124 | begin
|
---|
| 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;
|
---|
| 133 | end;
|
---|
| 134 |
|
---|
| 135 | procedure TfraCoPayDesc.ShowTreatmentFactorHints(var pHintText: string;
|
---|
| 136 | var pCompName: TVA508StaticText);
|
---|
| 137 | var
|
---|
| 138 | HRect: TRect;
|
---|
| 139 | thisRect: TRect;
|
---|
| 140 | x,y: integer;
|
---|
| 141 |
|
---|
| 142 | begin
|
---|
| 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;
|
---|
| 180 | end;
|
---|
| 181 |
|
---|
| 182 | initialization
|
---|
| 183 | SpecifyFormIsNotADialog(TfraCoPayDesc);
|
---|
| 184 |
|
---|
[456] | 185 | end.
|
---|