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/fEncnt.pas

    r456 r830  
    1313uses
    1414  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    15   StdCtrls, ORCtrls, ORDtTm, ORFn, ExtCtrls, ComCtrls, ORDtTmRng, fAutoSz, rOptions;
     15  StdCtrls, ORCtrls, ORDtTm, ORFn, ExtCtrls, ComCtrls, ORDtTmRng, fAutoSz, rOptions, fBase508Form,
     16  VA508AccessibilityManager, fFrame;
    1617
    1718type
    18   TfrmEncounter = class(TForm)
     19  TfrmEncounter = class(TfrmBase508Form)
    1920    cboPtProvider: TORComboBox;
    2021    lblProvider: TLabel;
     
    6263    procedure FormResize(Sender: TObject);
    6364    procedure FormShow(Sender: TObject);
     65    procedure pgeVisitMouseDown(Sender: TObject; Button: TMouseButton;
     66      Shift: TShiftState; X, Y: Integer);
    6467  private
    6568    CLINIC_TXT : String;
     
    8285                          var HintInfo: THintInfo);
    8386    procedure SetVisitCat;
     87    function AllowAutoFocusChange: Boolean;
    8488  public
    8589    { Public declarations }
     
    9498{$R *.DFM}
    9599
    96 uses rCore, uCore, uConst, fReview, uPCE, rPCE;
     100uses rCore, uCore, uConst, fReview, uPCE, rPCE, VA508AccessibilityRouter,
     101  VAUtils;
    97102
    98103const
     
    155160      begin
    156161        CanChange := True;
     162       // if (fframe.frmFrame.DoNotChangeEncWindow = true) and (encounter.Location <> frmEncounter.FLocation) then
     163       //    fframe.frmFrame.DoNotChangeEncWindow := false;
    157164        if (PersonFilter <> NPF_SUPPRESS) and
    158165           (((Encounter.Provider =  User.DUZ) and (FProvider <> User.DUZ)) or
     
    249256  begin
    250257    ListApptAll(lstClinic.Items, Patient.DFN, FFromDate, FThruDate);
    251     ActiveControl := lstClinic;
     258    if AllowAutoFocusChange then
     259      ActiveControl := lstClinic;
    252260  end;
    253261  if (pgeVisit.ActivePage = tabAdmit)    and (lstAdmit.Items.Count = 0) then
    254262  begin
    255263    ListAdmitAll(lstAdmit.Items, Patient.DFN);
    256     ActiveControl := lstAdmit;
     264    if AllowAutoFocusChange then
     265      ActiveControl := lstAdmit;
    257266  end;
    258267  if pgeVisit.ActivePage = tabNewVisit then
     
    276285        with calVisitDate do if FDateTime <> 0 then FMDateTime := FDateTime else Text := 'NOW';
    277286        FFromSelf := False;
    278         ActiveControl := cboNewVisit;
     287        if AllowAutoFocusChange then
     288          ActiveControl := cboNewVisit;
    279289      end
    280290      else if FVisitCategory = 'E' then
    281291      begin
    282292        ckbHistorical.Checked := True;
    283         ActiveControl := cboNewVisit;
     293        if AllowAutoFocusChange then
     294          ActiveControl := cboNewVisit;
    284295      end
    285296      else
    286297      begin
    287298        cboNewVisit.InitLongList('');
    288         //ActiveControl := cboPtProvider;
    289299      end;
    290       //ckbHistorical.Checked := FVisitCategory = 'E';
    291       //ActiveControl := cboNewVisit;
    292300    end; {if cboNewVisit}
    293301  end; {if pgeVisit.ActivePage}
     302  if ScreenReaderSystemActive then
     303    ActiveControl := pgeVisit;
     304end;
     305
     306procedure TfrmEncounter.pgeVisitMouseDown(Sender: TObject;
     307  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
     308begin
     309  inherited;
     310  if pgeVisit.ActivePage = tabNewVisit then
     311    if cboNewVisit.CanFocus then
     312      cboNewVisit.SetFocus;
    294313end;
    295314
     
    457476end;
    458477
     478function TfrmEncounter.AllowAutoFocusChange: Boolean;
     479begin
     480  if ScreenReaderSystemActive or
     481     Boolean(Hi(GetKeyState(VK_TAB))) or
     482     Boolean(Hi(GetKeyState(VK_LEFT))) or
     483     Boolean(Hi(GetKeyState(VK_RIGHT))) then
     484    Result := FALSE
     485  else
     486    Result := TRUE;
     487end;
     488
    459489procedure TfrmEncounter.FormClose(Sender: TObject;
    460490  var Action: TCloseAction);
     
    536566  cmdCancel.Top := cmdOK.Top + cmdOK.Height + 1;
    537567  //end CQ7118
     568  if Not User.IsProvider then
     569    if cboPtProvider.CanFocus then
     570      cboPtProvider.SetFocus;
    538571end;
    539572
Note: See TracChangeset for help on using the changeset viewer.