Changeset 829 for cprs/trunk/CPRS-Chart/Encounter/fPCEBaseMain.pas
- Timestamp:
- Jul 7, 2010, 4:31:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Encounter/fPCEBaseMain.pas
r456 r829 1 1 unit 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.} 2 4 3 5 interface … … 6 8 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 9 fPCEBaseGrid, ComCtrls, StdCtrls, ORCtrls, ExtCtrls, Buttons, rPCE, uPCE, 8 CheckLst, ORFn ;10 CheckLst, ORFn, VA508AccessibilityManager; 9 11 10 12 type … … 41 43 procedure splLeftMoved(Sender: TObject); 42 44 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); 43 50 private 44 51 FCommentItem: integer; 45 52 FCommentChanged: boolean; 46 53 FUpdateCount: integer; 54 FSectionPopulated: boolean; 47 55 //FUpdatingGrid: boolean; moved to 'protected' so frmDiagnoses can see it (RV) 48 56 protected … … 77 85 implementation 78 86 79 uses fPCELex, fPCEOther, fEncounterFrame, fHFSearch; 87 uses fPCELex, fPCEOther, fEncounterFrame, fHFSearch, VA508AccessibilityRouter, 88 ORCtrlsVA508Compatibility, fBase508Form; 80 89 81 90 {$R *.DFM} 91 92 type 93 TLBSectionManager = class(TORListBox508Manager) 94 public 95 function GetItemInstructions(Component: TWinControl): string; override; 96 function GetState(Component: TWinControl): string; override; 97 end; 82 98 83 99 procedure TfrmPCEBaseMain.lbSectionClick(Sender: TObject); … … 87 103 FPCEListCodesProc(lbxSection.Items, lbSection.ItemIEN); 88 104 CheckOffEntries; 105 FSectionPopulated := TRUE; 106 end; 107 108 procedure TfrmPCEBaseMain.lbSectionExit(Sender: TObject); 109 begin 110 inherited; 111 if TabIsPressed then 112 if lbxSection.CanFocus then 113 lbxSection.SetFocus; 89 114 end; 90 115 … … 102 127 try 103 128 SaveGridSelected; 104 tmpList.Assign(lbGrid.Items);129 FastAssign(lbGrid.Items, tmpList); 105 130 for i := 0 to lbGrid.Items.Count-1 do 106 131 begin … … 109 134 tmpList.Objects[i] := lbGrid.Items.Objects[i]; 110 135 end; 111 lbGrid.Items.Assign(tmpList); 136 //FastAssign(tmpList,lbGrid.Items); //cq: 13228 Causin a/v errors. 137 lbGrid.Items.Assign(tmpList); //cq: 13228 112 138 RestoreGridSelected; 113 139 SyncGridData; … … 155 181 end; 156 182 183 procedure TfrmPCEBaseMain.btnOtherExit(Sender: TObject); 184 begin 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; 193 end; 194 157 195 procedure TfrmPCEBaseMain.edtCommentExit(Sender: TObject); 158 196 begin … … 240 278 end; 241 279 280 procedure TfrmPCEBaseMain.lbGridExit(Sender: TObject); 281 begin 282 inherited; 283 if ShiftTabIsPressed then 284 if btnOther.CanFocus then 285 btnOther.SetFocus; 286 end; 287 242 288 procedure TfrmPCEBaseMain.lbGridSelect(Sender: TObject); 243 289 begin … … 245 291 // clbList.ItemIndex := -1; 246 292 UpdateControls; 293 end; 294 295 procedure TfrmPCEBaseMain.FormCreate(Sender: TObject); 296 begin 297 inherited FormCreate(Sender); 298 lbxSection.HideSelection := TRUE; 299 amgrMain.ComponentManager[lbSection] := TLBSectionManager.Create; 247 300 end; 248 301 … … 413 466 end; 414 467 468 procedure TfrmPCEBaseMain.lbxSectionExit(Sender: TObject); 469 begin 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; 478 end; 479 415 480 procedure TfrmPCEBaseMain.UpdateTabPos; 416 481 begin … … 503 568 end; 504 569 570 { TLBSectionManager } 571 572 function TLBSectionManager.GetItemInstructions(Component: TWinControl): string; 573 var 574 lb : TORListBox; 575 idx: integer; 576 begin 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); 584 end; 585 586 function TLBSectionManager.GetState(Component: TWinControl): string; 587 var 588 frm: TfrmPCEBaseMain; 589 begin 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; 598 end; 599 600 initialization 601 SpecifyFormIsNotADialog(TfrmPCEBaseMain); 602 505 603 end.
Note:
See TracChangeset
for help on using the changeset viewer.