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

Upgrade to version 27

File:
1 edited

Legend:

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

    r456 r829  
    11unit fPCEBaseMain;
     2{Warning: The tab order has been changed in the OnExit event of several controls.
     3 To change the tab order of lbSection, lbxSection, and btnOther you must do it programatically.}
    24
    35interface
     
    68  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    79  fPCEBaseGrid, ComCtrls, StdCtrls, ORCtrls, ExtCtrls, Buttons, rPCE, uPCE,
    8   CheckLst, ORFn;
     10  CheckLst, ORFn, VA508AccessibilityManager;
    911
    1012type
     
    4143    procedure splLeftMoved(Sender: TObject);
    4244    procedure edtCommentKeyPress(Sender: TObject; var Key: Char);
     45    procedure lbSectionExit(Sender: TObject);
     46    procedure btnOtherExit(Sender: TObject);
     47    procedure lbxSectionExit(Sender: TObject);
     48    procedure lbGridExit(Sender: TObject);
     49    procedure FormCreate(Sender: TObject);
    4350  private
    4451    FCommentItem: integer;
    4552    FCommentChanged: boolean;
    4653    FUpdateCount: integer;
     54    FSectionPopulated: boolean;
    4755    //FUpdatingGrid: boolean;  moved to 'protected' so frmDiagnoses can see it  (RV)
    4856  protected
     
    7785implementation
    7886
    79 uses fPCELex, fPCEOther, fEncounterFrame, fHFSearch;
     87uses fPCELex, fPCEOther, fEncounterFrame, fHFSearch, VA508AccessibilityRouter,
     88  ORCtrlsVA508Compatibility, fBase508Form;
    8089
    8190{$R *.DFM}
     91
     92type
     93  TLBSectionManager = class(TORListBox508Manager)
     94  public
     95    function GetItemInstructions(Component: TWinControl): string; override;
     96    function GetState(Component: TWinControl): string; override;   
     97  end;
    8298
    8399procedure TfrmPCEBaseMain.lbSectionClick(Sender: TObject);
     
    87103  FPCEListCodesProc(lbxSection.Items, lbSection.ItemIEN);
    88104  CheckOffEntries;
     105  FSectionPopulated := TRUE;
     106end;
     107
     108procedure TfrmPCEBaseMain.lbSectionExit(Sender: TObject);
     109begin
     110  inherited;
     111  if TabIsPressed then
     112    if lbxSection.CanFocus then
     113      lbxSection.SetFocus;
    89114end;
    90115
     
    102127  try
    103128    SaveGridSelected;
    104     tmpList.Assign(lbGrid.Items);
     129    FastAssign(lbGrid.Items, tmpList);
    105130    for i := 0 to lbGrid.Items.Count-1 do
    106131    begin
     
    109134      tmpList.Objects[i] := lbGrid.Items.Objects[i];
    110135    end;
    111     lbGrid.Items.Assign(tmpList);
     136  //FastAssign(tmpList,lbGrid.Items); //cq: 13228  Causin a/v errors.
     137    lbGrid.Items.Assign(tmpList);    //cq: 13228
    112138    RestoreGridSelected;
    113139    SyncGridData;
     
    155181end;
    156182
     183procedure TfrmPCEBaseMain.btnOtherExit(Sender: TObject);
     184begin
     185  inherited;
     186  if TabIsPressed then begin
     187    if lbGrid.CanFocus then
     188      lbGrid.SetFocus
     189  end
     190  else if ShiftTabIsPressed then
     191    if lbxSection.CanFocus then
     192      lbxSection.SetFocus;
     193end;
     194
    157195procedure TfrmPCEBaseMain.edtCommentExit(Sender: TObject);
    158196begin
     
    240278end;
    241279
     280procedure TfrmPCEBaseMain.lbGridExit(Sender: TObject);
     281begin
     282  inherited;
     283  if ShiftTabIsPressed then
     284    if btnOther.CanFocus then
     285      btnOther.SetFocus;
     286end;
     287
    242288procedure TfrmPCEBaseMain.lbGridSelect(Sender: TObject);
    243289begin
     
    245291//  clbList.ItemIndex := -1;
    246292  UpdateControls;
     293end;
     294
     295procedure TfrmPCEBaseMain.FormCreate(Sender: TObject);
     296begin
     297  inherited FormCreate(Sender);
     298  lbxSection.HideSelection := TRUE;
     299  amgrMain.ComponentManager[lbSection] := TLBSectionManager.Create;
    247300end;
    248301
     
    413466end;
    414467
     468procedure TfrmPCEBaseMain.lbxSectionExit(Sender: TObject);
     469begin
     470  inherited;
     471  if TabIsPressed then begin
     472    if btnOther.CanFocus then
     473      btnOther.SetFocus
     474  end
     475  else if ShiftTabIsPressed then
     476    if lbSection.CanFocus then
     477      lbSection.SetFocus;
     478end;
     479
    415480procedure TfrmPCEBaseMain.UpdateTabPos;
    416481begin
     
    503568end;
    504569
     570{ TLBSectionManager }
     571
     572function TLBSectionManager.GetItemInstructions(Component: TWinControl): string;
     573var
     574  lb : TORListBox;
     575  idx: integer;
     576begin
     577  lb := TORListBox(Component);
     578  idx := lb.ItemIndex;
     579  if (idx >= 0) and lb.Selected[idx] then
     580    Result := 'Press space bar to populate ' +
     581        TfrmPCEBaseMain(Component.Owner).FTabName + ' section'
     582  else
     583    result := inherited GetItemInstructions(Component);
     584end;
     585
     586function TLBSectionManager.GetState(Component: TWinControl): string;
     587var
     588  frm: TfrmPCEBaseMain;
     589begin
     590  Result := '';
     591  frm := TfrmPCEBaseMain(Component.Owner);
     592  if frm.FSectionPopulated then
     593  begin
     594    frm.FSectionPopulated := FALSE;
     595    Result := frm.FTabName + ' section populated with ' +
     596        inttostr(frm.lbxSection.Count) + ' items';
     597  end;
     598end;
     599
     600initialization
     601  SpecifyFormIsNotADialog(TfrmPCEBaseMain);
     602
    505603end.
Note: See TracChangeset for help on using the changeset viewer.