Ignore:
Timestamp:
Jul 7, 2010, 4:51:54 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Upgrading to version 27

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/trunk/CPRS-Chart/mCoPayDesc.pas

    r456 r830  
    55uses
    66  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    7   ExtCtrls, StdCtrls, ORCtrls, UBAConst;
     7  ExtCtrls, StdCtrls, ORCtrls, UBAConst, VA508AccessibilityManager;
    88
    99type
     
    1111    pnlRight: TPanel;
    1212    lblCaption: TStaticText;
    13     pnlSC: TPanel;
     13    pnlSCandRD: TPanel;
    1414    lblSCDisplay: TLabel;
    1515    memSCDisplay: TCaptionMemo;
     
    1717    pnlMain: TPanel;
    1818    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);
    4045  private
    4146    { Private declarations }
     47    procedure ConvertShortLabelsToLong;
    4248  public
     49    procedure ShowTreatmentFactorHints(var pHintText: string; var pCompName: TVA508StaticText);
     50    procedure LabelCaptionsOn(CaptionsOn : Boolean = true);
    4351    constructor Create(AOwner: TComponent); override;
    4452  end;
     
    4654implementation
    4755
    48 uses rPCE, UBAGlobals;
     56uses rPCE, UBAGlobals, VAUtils, VA508AccessibilityRouter;
    4957
    5058{$R *.DFM}
     59var
     60    FOSTFHintWndActive: boolean;
     61    FOSTFhintWindow: THintWindow;
     62
    5163
    5264{ TfraCoPayDesc }
     
    5466constructor TfraCoPayDesc.Create(AOwner: TComponent);
    5567begin
    56   inherited;
     68  inherited Create(AOwner);
     69  TabStop := FALSE;
    5770  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;
    7389end;
    7490
     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
    75185end.
Note: See TracChangeset for help on using the changeset viewer.