Changeset 830 for cprs/trunk/CPRS-Chart/mCoPayDesc.pas
- Timestamp:
- Jul 7, 2010, 4:51:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/mCoPayDesc.pas
r456 r830 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 ExtCtrls, StdCtrls, ORCtrls, UBAConst ;7 ExtCtrls, StdCtrls, ORCtrls, UBAConst, VA508AccessibilityManager; 8 8 9 9 type … … 11 11 pnlRight: TPanel; 12 12 lblCaption: TStaticText; 13 pnlSC : TPanel;13 pnlSCandRD: TPanel; 14 14 lblSCDisplay: TLabel; 15 15 memSCDisplay: TCaptionMemo; … … 17 17 pnlMain: TPanel; 18 18 spacer1: TLabel; 19 Panel7: TPanel; 20 lblHNC2: TORStaticText; 21 lblHNC: TORStaticText; 22 Panel8: TPanel; 23 Label12: TORStaticText; 24 Label11: TORStaticText; 25 Panel9: TPanel; 26 Label14: TORStaticText; 27 Label13: TORStaticText; 28 Panel10: TPanel; 29 Label16: TORStaticText; 30 Label15: TORStaticText; 31 Panel11: TPanel; 32 Label18: TORStaticText; 33 Label17: TORStaticText; 34 Panel12: TPanel; 35 Label24: TORStaticText; 36 Label23: TORStaticText; 37 Panel1: TPanel; 38 StaticText4: TORStaticText; 39 StaticText1: TORStaticText; 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); 40 45 private 41 46 { Private declarations } 47 procedure ConvertShortLabelsToLong; 42 48 public 49 procedure ShowTreatmentFactorHints(var pHintText: string; var pCompName: TVA508StaticText); 50 procedure LabelCaptionsOn(CaptionsOn : Boolean = true); 43 51 constructor Create(AOwner: TComponent); override; 44 52 end; … … 46 54 implementation 47 55 48 uses rPCE, UBAGlobals ;56 uses rPCE, UBAGlobals, VAUtils, VA508AccessibilityRouter; 49 57 50 58 {$R *.DFM} 59 var 60 FOSTFHintWndActive: boolean; 61 FOSTFhintWindow: THintWindow; 62 51 63 52 64 { TfraCoPayDesc } … … 54 66 constructor TfraCoPayDesc.Create(AOwner: TComponent); 55 67 begin 56 inherited; 68 inherited Create(AOwner); 69 TabStop := FALSE; 57 70 ListSCDisabilities(memSCDisplay.Lines); 58 Label23.Hint := BAFactorsRec.FBAFactorSC; 59 Label24.Hint := BAFactorsRec.FBAFactorSC; 60 staticText1.Hint := BAFactorsRec.FBAFactorCV; 61 staticText4.Hint := BAFactorsRec.FBAFactorCV; 62 Label17.Hint := BAFactorsRec.FBAFactorAO; 63 Label18.Hint := BAFactorsRec.FBAFactorAO; 64 Label15.Hint := BAFactorsRec.FBAFactorIR; 65 Label16.Hint := BAFactorsRec.FBAFactorIR; 66 Label13.Hint := BAFactorsRec.FBAFactorEC; 67 Label14.Hint := BAFactorsRec.FBAFactorEC; 68 Label11.Hint := BAFactorsRec.FBAFactorMST; 69 Label12.Hint := BAFactorsRec.FBAFactorMST; 70 lblHNC.Hint := BAFactorsRec.FBAFactorHNC; 71 lblHNC2.Hint := BAFactorsRec.FBAFactorHNC; 72 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; 73 89 end; 74 90 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; 111 end; 112 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 75 185 end.
Note:
See TracChangeset
for help on using the changeset viewer.