Changeset 829 for cprs/trunk/CPRS-Chart/Templates
- Timestamp:
- Jul 7, 2010, 4:31:10 PM (14 years ago)
- Location:
- cprs/trunk/CPRS-Chart/Templates
- Files:
-
- 2 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Templates/fTemplateAutoGen.dfm
r456 r829 1 objectfrmTemplateAutoGen: TfrmTemplateAutoGen1 inherited frmTemplateAutoGen: TfrmTemplateAutoGen 2 2 Left = 361 3 3 Top = 230 … … 8 8 ClientHeight = 213 9 9 ClientWidth = 415 10 Color = clBtnFace11 Font.Charset = DEFAULT_CHARSET12 Font.Color = clWindowText13 Font.Height = -1114 Font.Name = 'MS Sans Serif'15 Font.Style = []16 OldCreateOrder = False17 10 Position = poScreenCenter 18 11 OnShow = FormShow 19 12 PixelsPerInch = 96 20 13 TextHeight = 13 21 object lblTop: TMemo 14 object lblTop: TMemo [0] 22 15 Left = 256 23 16 Top = 8 … … 35 28 TabOrder = 5 36 29 end 37 object lblSelect: TStaticText 30 object lblSelect: TStaticText [1] 38 31 Left = 0 39 32 Top = 0 … … 46 39 TabOrder = 6 47 40 end 48 object rgSource: TKeyClickRadioGroup 41 object rgSource: TKeyClickRadioGroup [2] 49 42 Left = 256 50 43 Top = 88 … … 59 52 OnClick = rgSourceClick 60 53 end 61 object cbxObjects: TORComboBox 54 object cbxObjects: TORComboBox [3] 62 55 Left = 0 63 56 Top = 0 … … 74 67 ListItemsOnly = False 75 68 LongList = False 69 LookupPiece = 0 76 70 MaxLength = 0 77 71 Pieces = '1' … … 81 75 Visible = False 82 76 OnDblClick = cbxObjectsDblClick 77 CharsNeedMatch = 1 83 78 end 84 object btnOK: TButton 79 object btnOK: TButton [4] 85 80 Left = 257 86 81 Top = 190 … … 92 87 TabOrder = 3 93 88 end 94 object btnCancel: TButton 89 object btnCancel: TButton [5] 95 90 Left = 337 96 91 Top = 190 … … 102 97 TabOrder = 4 103 98 end 104 object cbxTitles: TORComboBox 99 object cbxTitles: TORComboBox [6] 105 100 Left = 0 106 101 Top = 0 … … 117 112 ListItemsOnly = True 118 113 LongList = True 114 LookupPiece = 0 119 115 MaxLength = 0 120 116 Pieces = '2' … … 125 121 OnDblClick = cbxTitlesDblClick 126 122 OnNeedData = cbxTitlesNeedData 123 CharsNeedMatch = 1 124 end 125 inherited amgrMain: TVA508AccessibilityManager 126 Data = ( 127 ( 128 'Component = lblTop' 129 'Status = stsDefault') 130 ( 131 'Component = lblSelect' 132 'Status = stsDefault') 133 ( 134 'Component = rgSource' 135 'Status = stsDefault') 136 ( 137 'Component = cbxObjects' 138 'Status = stsDefault') 139 ( 140 'Component = btnOK' 141 'Status = stsDefault') 142 ( 143 'Component = btnCancel' 144 'Status = stsDefault') 145 ( 146 'Component = cbxTitles' 147 'Status = stsDefault') 148 ( 149 'Component = frmTemplateAutoGen' 150 'Status = stsDefault')) 127 151 end 128 152 end -
cprs/trunk/CPRS-Chart/Templates/fTemplateAutoGen.pas
r456 r829 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 StdCtrls, ORCtrls, ExtCtrls, ORFn ;7 StdCtrls, ORCtrls, ExtCtrls, ORFn, fBase508Form, VA508AccessibilityManager; 8 8 9 9 type 10 TfrmTemplateAutoGen = class(T Form)10 TfrmTemplateAutoGen = class(TfrmBase508Form) 11 11 rgSource: TKeyClickRadioGroup; 12 12 cbxObjects: TORComboBox; … … 121 121 end; 122 122 if DoIt then 123 cbxObjects.Items.Assign(dmodShared.TIUObjects);123 FastAssign(dmodShared.TIUObjects, cbxObjects.Items); 124 124 FObjectsDone := TRUE; 125 125 end; -
cprs/trunk/CPRS-Chart/Templates/fTemplateDialog.dfm
r456 r829 1 objectfrmTemplateDialog: TfrmTemplateDialog1 inherited frmTemplateDialog: TfrmTemplateDialog 2 2 Left = 268 3 3 Top = 155 4 Width = 6405 Height = 4406 4 BorderIcons = [biSystemMenu, biMaximize] 7 5 Caption = 'Text Dialog' 8 Color = clBtnFace 9 Font.Charset = DEFAULT_CHARSET 10 Font.Color = clWindowText 11 Font.Height = -11 12 Font.Name = 'MS Sans Serif' 13 Font.Style = [] 14 OldCreateOrder = False 6 ClientHeight = 413 7 ClientWidth = 632 15 8 Position = poScreenCenter 16 9 OnClose = FormClose … … 19 12 OnDestroy = FormDestroy 20 13 OnPaint = FormPaint 14 OnShow = FormShow 15 ExplicitWidth = 640 16 ExplicitHeight = 440 21 17 PixelsPerInch = 96 22 18 TextHeight = 13 23 object sbMain: TScrollBox 19 object sbMain: TScrollBox [0] 24 20 Left = 0 25 21 Top = 0 … … 36 32 TabOrder = 0 37 33 end 38 object pnlBottom: TScrollBox 34 object pnlBottom: TScrollBox [1] 39 35 Left = 0 40 36 Top = 375 … … 100 96 end 101 97 end 98 inherited amgrMain: TVA508AccessibilityManager 99 Data = ( 100 ( 101 'Component = sbMain' 102 'Status = stsDefault') 103 ( 104 'Component = pnlBottom' 105 'Status = stsDefault') 106 ( 107 'Component = lblFootnote' 108 'Status = stsDefault') 109 ( 110 'Component = btnCancel' 111 'Status = stsDefault') 112 ( 113 'Component = btnOK' 114 'Status = stsDefault') 115 ( 116 'Component = btnAll' 117 'Status = stsDefault') 118 ( 119 'Component = btnNone' 120 'Status = stsDefault') 121 ( 122 'Component = btnPreview' 123 'Status = stsDefault') 124 ( 125 'Component = frmTemplateDialog' 126 'Status = stsDefault')) 127 end 102 128 end -
cprs/trunk/CPRS-Chart/Templates/fTemplateDialog.pas
r456 r829 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 StdCtrls, ExtCtrls, ORCtrls, ORFn, AppEvnts, uTemplates; 7 StdCtrls, ExtCtrls, ORCtrls, ORFn, AppEvnts, uTemplates, fBase508Form, uConst, 8 VA508AccessibilityManager; 8 9 9 10 type 10 TfrmTemplateDialog = class(T Form)11 TfrmTemplateDialog = class(TfrmBase508Form) 11 12 sbMain: TScrollBox; 12 13 pnlBottom: TScrollBox; … … 26 27 procedure btnPreviewClick(Sender: TObject); 27 28 procedure FormClose(Sender: TObject; var Action: TCloseAction); 29 procedure FormShow(Sender: TObject); 28 30 private 31 FFirstBuild: boolean; 29 32 SL: TStrings; 30 33 BuildIdx: TStringList; … … 57 60 procedure ParentCBEnter(Sender: TObject); 58 61 procedure ParentCBExit(Sender: TObject); 62 procedure UMScreenReaderInit(var Message: TMessage); message UM_MISC; 63 procedure InitScreenReaderSetup; 59 64 public 60 65 property Silent: boolean read FSilent write FSilent ; … … 72 77 implementation 73 78 74 uses dShared, uConst, uTemplateFields, fRptBox, uInit, rMisc; 79 uses dShared, uTemplateFields, fRptBox, uInit, rMisc, uDlgComponents, 80 VA508AccessibilityRouter, VAUtils; 75 81 76 82 {$R *.DFM} … … 187 193 Result := FALSE; 188 194 CancelDlg := FALSE; 195 SetTemplateDialogCanceled(FALSE); 189 196 frmTemplateDialog := TfrmTemplateDialog.Create(Application); 190 197 try … … 272 279 end; 273 280 274 if not Result then 281 if Result then 282 SetTemplateDialogCanceled(TRUE) 283 else 284 begin 285 SetTemplateDialogCanceled(FALSE); 275 286 CheckBoilerplate4Fields(SL, CaptionText, PreviewMode); 276 287 end; 288 277 289 end; 278 290 … … 289 301 SL.Clear; 290 302 end; 303 StripScreenReaderCodes(SL); 291 304 end; 292 305 … … 380 393 end; 381 394 395 procedure TfrmTemplateDialog.InitScreenReaderSetup; 396 var 397 ctrl: TWinControl; 398 list: TList; 399 begin 400 if ScreenReaderSystemActive then 401 begin 402 list := TList.Create; 403 try 404 sbMain.GetTabOrderList(list); 405 if list.Count > 0 then 406 begin 407 ctrl := TWinControl(list[0]); 408 PostMessage(Handle, UM_MISC, WParam(ctrl), 0); 409 end; 410 finally 411 list.free; 412 end; 413 end; 414 end; 415 382 416 function TfrmTemplateDialog.IsAncestor( OldID: string; NewID: string): boolean; 383 417 begin … … 398 432 KillCtrl, doHint, dsp, noTextParent: boolean; 399 433 Entry: TTemplateDialogEntry; 400 StringIn, StringOut: string; 434 // StringIn, StringOut: string; 435 cb: TCPRSDialogParentCheckBox; 401 436 402 437 procedure NextTabCtrl(ACtrl: TControl); … … 511 546 Entry := TTemplateDialogEntry(Entries.Objects[idx]); 512 547 513 pnl := Entry.GetPanel(FMaxPnlWidth, sbMain); 548 if(dsp or OneOnly) then 549 cb := nil 550 else 551 cb := TCPRSDialogParentCheckBox.Create(Self); 552 553 pnl := Entry.GetPanel(FMaxPnlWidth, sbMain, cb); 514 554 pnl.Show; 515 555 if(doHint and (not pnl.ShowHint)) then … … 521 561 Entry.OnChange := FieldChanged; 522 562 end; 523 if (dsp or OneOnly) then563 if not assigned(cb) then 524 564 ctrl := pnl 525 565 else 526 566 begin 527 ctrl := TORCheckBox.Create(Self);567 ctrl := cb; 528 568 ctrl.Parent := sbMain; 529 569 … … 539 579 TORCheckBox(ctrl).AutoSize := false; 540 580 TORCheckBox(ctrl).Associate := pnl; 581 pnl.Tag := Integer(ctrl); 541 582 tmpID := copy(ID, 1, (pos('.', ID) - 1)); {copy the ID without the decimal place} 542 if Templates.IndexOf(tmpID) > -1 then 543 StringIn := 'Sub-Template: ' + TTemplate(Templates.Objects[Templates.IndexOf(tmpID)]).PrintName 544 else 545 StringIn := 'Sub-Template:'; 546 StringOut := StringReplace(StringIn, '&', '&&', [rfReplaceAll]); 547 TORCheckBox(ctrl).Caption := StringOut; 583 // if Templates.IndexOf(tmpID) > -1 then 584 // StringIn := 'Sub-Template: ' + TTemplate(Templates.Objects[Templates.IndexOf(tmpID)]).PrintName 585 // else 586 // StringIn := 'Sub-Template:'; 587 // StringOut := StringReplace(StringIn, '&', '&&', [rfReplaceAll]); 588 // TORCheckBox(ctrl).Caption := StringOut; 589 UpdateColorsFor508Compliance(ctrl); 548 590 549 591 end; … … 615 657 for i := 1 to Count do 616 658 BuildCB(i, Y, FirstTime); 659 if ScreenReaderSystemActive then 660 begin 661 amgrMain.RefreshComponents; 662 Application.ProcessMessages; 663 end; 617 664 finally 618 665 FBuilding := FALSE; … … 626 673 RepaintBuild := FALSE; 627 674 BuildAllControls; 675 InitScreenReaderSetup; 676 end; 677 end; 678 679 procedure TfrmTemplateDialog.FormShow(Sender: TObject); 680 begin 681 inherited; 682 if FFirstBuild then 683 begin 684 FFirstBuild := FALSE; 685 InitScreenReaderSetup; 628 686 end; 629 687 end; … … 631 689 procedure TfrmTemplateDialog.FormCreate(Sender: TObject); 632 690 begin 691 FFirstBuild := TRUE; 633 692 BuildIdx := TStringList.Create; 634 693 Entries := TStringList.Create; … … 700 759 if not CanClose then 701 760 begin 702 ShowM essage(MissingFieldsTxt);761 ShowMsg(MissingFieldsTxt); 703 762 break; 704 763 end; … … 719 778 TmpSL := TStringList.Create; 720 779 try 721 TmpSL.Assign(SL);780 FastAssign(SL, TmpSL); 722 781 GetText(TmpSL, FALSE); {FALSE = Do not include embedded fields} 782 StripScreenReaderCodes(TmpSL); 723 783 ReportBox(TmpSL, 'Dialog Preview', FALSE); 724 784 finally … … 755 815 end; 756 816 817 procedure TfrmTemplateDialog.UMScreenReaderInit(var Message: TMessage); 818 var 819 ctrl: TWinControl; 820 item: TVA508AccessibilityItem; 821 begin 822 ctrl := TWinControl(Message.WParam); 823 // Refresh the accessibility manager entry - 824 // fixes bug where first focusable check boxes weren't working correctly 825 if ctrl is TCPRSDialogParentCheckBox then 826 begin 827 item := amgrMain.AccessData.FindItem(ctrl, FALSE); 828 if assigned(item) then 829 item.free; 830 amgrMain.AccessData.EnsureItemExists(ctrl); 831 end; 832 end; 833 757 834 end. 758 835 -
cprs/trunk/CPRS-Chart/Templates/fTemplateEditor.dfm
r456 r829 1 object frmTemplateEditor: TfrmTemplateEditor 2 Left = 135 3 Top = 239 4 Width = 748 5 Height = 470 1 inherited frmTemplateEditor: TfrmTemplateEditor 2 Left = 321 3 Top = 119 6 4 HelpContext = 10000 7 5 ActiveControl = tvPersonal 8 6 BorderIcons = [biSystemMenu, biMaximize] 9 7 Caption = 'Template Editor' 10 Color = clBtnFace 11 Font.Charset = DEFAULT_CHARSET 12 Font.Color = clWindowText 13 Font.Height = -11 14 Font.Name = 'MS Sans Serif' 15 Font.Style = [] 16 OldCreateOrder = False 8 ClientHeight = 450 9 ClientWidth = 740 17 10 Position = poScreenCenter 18 11 Scaled = False 12 OnClose = FormClose 19 13 OnCloseQuery = FormCloseQuery 20 14 OnCreate = FormCreate 21 15 OnDestroy = FormDestroy 22 16 OnShow = FormShow 17 ExplicitWidth = 748 18 ExplicitHeight = 477 23 19 PixelsPerInch = 96 24 20 TextHeight = 13 25 object splMain: TSplitter 21 object splMain: TSplitter [0] 26 22 Left = 0 27 23 Top = 239 … … 35 31 OnMoved = splMainMoved 36 32 end 37 object splNotes: TSplitter 33 object splNotes: TSplitter [1] 38 34 Left = 0 39 Top = 37 135 Top = 377 40 36 Width = 740 41 37 Height = 3 … … 46 42 Visible = False 47 43 OnMoved = splBoilMoved 44 ExplicitTop = 371 48 45 end 49 object pnlBottom: T ORAutoPanel46 object pnlBottom: TPanel [2] 50 47 Left = 0 51 Top = 4 1648 Top = 423 52 49 Width = 740 53 50 Height = 27 … … 55 52 BevelOuter = bvNone 56 53 TabOrder = 4 54 ExplicitTop = 416 57 55 DesignSize = ( 58 56 740 … … 130 128 end 131 129 end 132 object pnlBoilerplate: TPanel 130 object pnlBoilerplate: TPanel [3] 133 131 Left = 0 134 132 Top = 284 135 133 Width = 740 136 Height = 87134 Height = 93 137 135 Align = alClient 138 136 BevelOuter = bvNone … … 142 140 object splBoil: TSplitter 143 141 Left = 0 144 Top = 43142 Top = 14 145 143 Width = 740 146 144 Height = 3 147 145 Cursor = crVSplit 148 Align = al Bottom146 Align = alTop 149 147 AutoSnap = False 150 148 Beveled = True 151 149 Visible = False 152 150 OnMoved = splBoilMoved 151 ExplicitTop = 43 153 152 end 154 153 object reBoil: TRichEdit 155 154 Left = 0 156 Top = 1 4155 Top = 17 157 156 Width = 740 158 Height = 29157 Height = 30 159 158 Align = alClient 160 159 Font.Charset = ANSI_CHARSET … … 163 162 Font.Name = 'Courier New' 164 163 Font.Style = [] 164 Constraints.MinHeight = 30 165 165 ParentFont = False 166 166 PlainText = True … … 175 175 OnResizeRequest = reResizeRequest 176 176 OnSelectionChange = reBoilSelectionChange 177 ExplicitTop = 14 177 178 end 178 179 object pnlGroupBP: TPanel 179 180 Left = 0 180 Top = 4 6181 Top = 47 181 182 Width = 740 182 Height = 4 1183 Height = 46 183 184 Align = alBottom 184 185 BevelOuter = bvNone … … 192 193 Align = alTop 193 194 Caption = 'Group Boilerplate' 195 ExplicitWidth = 81 194 196 end 195 197 object lblGroupRow: TLabel … … 211 213 Top = 16 212 214 Width = 740 213 Height = 25215 Height = 30 214 216 Align = alClient 215 217 Color = clCream … … 219 221 Font.Name = 'Courier New' 220 222 Font.Style = [] 223 Constraints.MinHeight = 30 221 224 ParentFont = False 222 225 PlainText = True … … 281 284 end 282 285 end 283 object pnlTop: TPanel 286 object pnlTop: TPanel [4] 284 287 Left = 0 285 288 Top = 0 … … 293 296 Left = 297 294 297 Top = 24 295 Width = 3296 298 Height = 215 297 Cursor = crHSplit298 299 Align = alRight 299 300 AutoSnap = False … … 319 320 Left = 216 320 321 Top = 0 321 Width = 3322 322 Height = 215 323 Cursor = crHSplit324 323 Align = alRight 325 324 AutoSnap = False … … 428 427 FocusControl = tvPersonal 429 428 PopupMenu = popTemplates 429 ExplicitWidth = 93 430 430 end 431 431 object tvPersonal: TORTreeView … … 716 716 ShowHint = True 717 717 TabOrder = 5 718 WordWrap = True 718 719 OnClick = cbExcludeClick 719 WordWrap = True720 720 AutoSize = True 721 721 end … … 760 760 'erplate, between each item'#39's boilerplate.' 761 761 Associate = edtGap 762 Min = 0763 762 Max = 3 764 763 ParentShowHint = False 765 Position = 0766 764 ShowHint = True 767 765 TabOrder = 8 768 Wrap = False769 766 end 770 767 object edtName: TCaptionEdit … … 871 868 ShowHint = True 872 869 TabOrder = 4 870 WordWrap = True 873 871 OnClick = cbHideItemsClick 874 WordWrap = True875 872 AutoSize = True 876 873 end … … 913 910 TabOrder = 2 914 911 OnChange = cbxRemDlgsChange 912 CharsNeedMatch = 1 915 913 end 916 914 object cbLock: TORCheckBox … … 943 941 FocusControl = tvShared 944 942 PopupMenu = popTemplates 943 ExplicitWidth = 86 945 944 end 946 945 object tvShared: TORTreeView … … 1188 1187 OnChange = cboOwnerChange 1189 1188 OnNeedData = cboOwnerNeedData 1189 CharsNeedMatch = 1 1190 1190 end 1191 1191 object btnNew: TORAlignButton … … 1194 1194 Width = 182 1195 1195 Height = 22 1196 Align = alRight 1196 1197 Caption = '&New Template' 1197 1198 TabOrder = 2 1198 1199 OnClick = btnNewClick 1199 Align = alRight1200 1200 end 1201 1201 object pnlMenu: TPanel … … 1212 1212 Left = 1 1213 1213 Top = 1 1214 Width = 691214 Width = 107 1215 1215 Height = 20 1216 1216 Align = alLeft … … 1219 1219 ButtonWidth = 43 1220 1220 Caption = 'mbMain' 1221 Flat = True1222 1221 Menu = mnuMain 1223 1222 ShowCaptions = True … … 1228 1227 end 1229 1228 end 1230 object pnlNotes: TPanel 1229 object pnlNotes: TPanel [5] 1231 1230 Left = 0 1232 Top = 3 741231 Top = 380 1233 1232 Width = 740 1234 Height = 4 21233 Height = 43 1235 1234 Align = alBottom 1236 1235 BevelOuter = bvNone … … 1244 1243 Align = alTop 1245 1244 Caption = 'Template Notes:' 1245 ExplicitWidth = 78 1246 1246 end 1247 1247 object reNotes: TRichEdit … … 1249 1249 Top = 13 1250 1250 Width = 740 1251 Height = 291251 Height = 30 1252 1252 Align = alClient 1253 1253 Font.Charset = ANSI_CHARSET … … 1256 1256 Font.Name = 'Courier New' 1257 1257 Font.Style = [] 1258 Constraints.MinHeight = 30 1258 1259 ParentFont = False 1259 1260 PlainText = True … … 1269 1270 end 1270 1271 end 1271 object pnlCOM: TPanel 1272 object pnlCOM: TPanel [6] 1272 1273 Left = 0 1273 1274 Top = 263 … … 1286 1287 Caption = ' Passed Value: ' 1287 1288 Layout = tlCenter 1289 ExplicitHeight = 13 1288 1290 end 1289 1291 object lblCOMObj: TLabel … … 1295 1297 Caption = ' COM Object: ' 1296 1298 Layout = tlCenter 1299 ExplicitHeight = 13 1297 1300 end 1298 1301 object edtCOMParam: TCaptionEdit … … 1301 1304 Width = 380 1302 1305 Height = 21 1306 Align = alClient 1303 1307 TabOrder = 0 1304 1308 OnChange = edtCOMParamChange 1305 Align = alClient1306 1309 Caption = 'Passed Value' 1307 1310 end … … 1329 1332 TabOrder = 1 1330 1333 OnChange = cbxCOMObjChange 1334 CharsNeedMatch = 1 1331 1335 end 1332 1336 end 1333 object pnlLink: TPanel 1337 object pnlLink: TPanel [7] 1334 1338 Left = 0 1335 1339 Top = 242 … … 1348 1352 Caption = ' Associated Consult Service: ' 1349 1353 Layout = tlCenter 1354 ExplicitHeight = 13 1350 1355 end 1351 1356 object cbxLink: TORComboBox … … 1367 1372 LookupPiece = 0 1368 1373 MaxLength = 0 1369 Pieces = '2 ,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,1'1374 Pieces = '2' 1370 1375 HideSynonyms = True 1371 1376 Sorted = False … … 1376 1381 OnChange = cbxLinkChange 1377 1382 OnNeedData = cbxLinkNeedData 1378 OnSynonymCheck = cbxLinkSynonymCheck 1379 end 1383 CharsNeedMatch = 1 1384 end 1385 end 1386 inherited amgrMain: TVA508AccessibilityManager 1387 Data = ( 1388 ( 1389 'Component = pnlBottom' 1390 'Status = stsDefault') 1391 ( 1392 'Component = btnApply' 1393 'Status = stsDefault') 1394 ( 1395 'Component = btnCancel' 1396 'Status = stsDefault') 1397 ( 1398 'Component = btnOK' 1399 'Status = stsDefault') 1400 ( 1401 'Component = cbEditShared' 1402 'Status = stsDefault') 1403 ( 1404 'Component = cbNotes' 1405 'Status = stsDefault') 1406 ( 1407 'Component = cbEditUser' 1408 'Status = stsDefault') 1409 ( 1410 'Component = pnlBoilerplate' 1411 'Status = stsDefault') 1412 ( 1413 'Component = reBoil' 1414 'Label = lblBoilerplate' 1415 'Status = stsOK') 1416 ( 1417 'Component = pnlGroupBP' 1418 'Status = stsDefault') 1419 ( 1420 'Component = reGroupBP' 1421 'Label = lblGroupBP' 1422 'Status = stsOK') 1423 ( 1424 'Component = pnlGroupBPGap' 1425 'Status = stsDefault') 1426 ( 1427 'Component = pnlBP' 1428 'Status = stsDefault') 1429 ( 1430 'Component = cbLongLines' 1431 'Status = stsDefault') 1432 ( 1433 'Component = pnlTop' 1434 'Status = stsDefault') 1435 ( 1436 'Component = pnlRightTop' 1437 'Status = stsDefault') 1438 ( 1439 'Component = pnlCopyBtns' 1440 'Status = stsDefault') 1441 ( 1442 'Component = sbCopyRight' 1443 'Property = Hint' 1444 'Status = stsOK') 1445 ( 1446 'Component = sbCopyLeft' 1447 'Property = Hint' 1448 'Status = stsOK') 1449 ( 1450 'Component = pnlPersonal' 1451 'Status = stsDefault') 1452 ( 1453 'Component = tvPersonal' 1454 'Status = stsDefault') 1455 ( 1456 'Component = pnlPersonalBottom' 1457 'Status = stsDefault') 1458 ( 1459 'Component = sbPerUp' 1460 'Property = Hint' 1461 'Status = stsOK') 1462 ( 1463 'Component = sbPerDown' 1464 'Property = Hint' 1465 'Status = stsOK') 1466 ( 1467 'Component = sbPerDelete' 1468 'Property = Hint' 1469 'Status = stsOK') 1470 ( 1471 'Component = cbPerHide' 1472 'Property = Hint' 1473 'Status = stsOK') 1474 ( 1475 'Component = pnlPersonalGap' 1476 'Status = stsDefault') 1477 ( 1478 'Component = pnlPerSearch' 1479 'Status = stsDefault') 1480 ( 1481 'Component = btnPerFind' 1482 'Text = Find Personal Template' 1483 'Status = stsOK') 1484 ( 1485 'Component = edtPerSearch' 1486 'Status = stsDefault') 1487 ( 1488 'Component = cbPerMatchCase' 1489 'Status = stsDefault') 1490 ( 1491 'Component = cbPerWholeWords' 1492 'Status = stsDefault') 1493 ( 1494 'Component = pnlProperties' 1495 'Status = stsDefault') 1496 ( 1497 'Component = gbProperties' 1498 'Status = stsDefault') 1499 ( 1500 'Component = cbExclude' 1501 'Status = stsDefault') 1502 ( 1503 'Component = cbActive' 1504 'Status = stsDefault') 1505 ( 1506 'Component = edtGap' 1507 'Status = stsDefault') 1508 ( 1509 'Component = udGap' 1510 'Status = stsDefault') 1511 ( 1512 'Component = edtName' 1513 'Status = stsDefault') 1514 ( 1515 'Component = gbDialogProps' 1516 'Status = stsDefault') 1517 ( 1518 'Component = cbDisplayOnly' 1519 'Status = stsDefault') 1520 ( 1521 'Component = cbOneItemOnly' 1522 'Status = stsDefault') 1523 ( 1524 'Component = cbFirstLine' 1525 'Status = stsDefault') 1526 ( 1527 'Component = cbHideDlgItems' 1528 'Status = stsDefault') 1529 ( 1530 'Component = cbIndent' 1531 'Status = stsDefault') 1532 ( 1533 'Component = cbHideItems' 1534 'Status = stsDefault') 1535 ( 1536 'Component = cbxType' 1537 'Status = stsDefault') 1538 ( 1539 'Component = cbxRemDlgs' 1540 'Status = stsDefault') 1541 ( 1542 'Component = cbLock' 1543 'Status = stsDefault') 1544 ( 1545 'Component = pnlShared' 1546 'Status = stsDefault') 1547 ( 1548 'Component = tvShared' 1549 'Status = stsDefault') 1550 ( 1551 'Component = pnlSharedBottom' 1552 'Status = stsDefault') 1553 ( 1554 'Component = sbShUp' 1555 'Property = Hint' 1556 'Status = stsOK') 1557 ( 1558 'Component = sbShDown' 1559 'Property = Hint' 1560 'Status = stsOK') 1561 ( 1562 'Component = sbShDelete' 1563 'Property = Hint' 1564 'Status = stsOK') 1565 ( 1566 'Component = cbShHide' 1567 'Property = Hint' 1568 'Status = stsOK') 1569 ( 1570 'Component = pnlSharedGap' 1571 'Status = stsDefault') 1572 ( 1573 'Component = pnlShSearch' 1574 'Status = stsDefault') 1575 ( 1576 'Component = btnShFind' 1577 'Text = Find Shared Template' 1578 'Status = stsOK') 1579 ( 1580 'Component = edtShSearch' 1581 'Status = stsDefault') 1582 ( 1583 'Component = cbShMatchCase' 1584 'Status = stsDefault') 1585 ( 1586 'Component = cbShWholeWords' 1587 'Status = stsDefault') 1588 ( 1589 'Component = pnlMenuBar' 1590 'Status = stsDefault') 1591 ( 1592 'Component = cboOwner' 1593 'Status = stsDefault') 1594 ( 1595 'Component = btnNew' 1596 'Status = stsDefault') 1597 ( 1598 'Component = pnlMenu' 1599 'Status = stsDefault') 1600 ( 1601 'Component = mbMain' 1602 'Status = stsDefault') 1603 ( 1604 'Component = pnlNotes' 1605 'Status = stsDefault') 1606 ( 1607 'Component = reNotes' 1608 'Label = lblNotes' 1609 'Status = stsOK') 1610 ( 1611 'Component = pnlCOM' 1612 'Status = stsDefault') 1613 ( 1614 'Component = edtCOMParam' 1615 'Label = lblCOMParam' 1616 'Status = stsOK') 1617 ( 1618 'Component = cbxCOMObj' 1619 'Property = Caption' 1620 'Status = stsOK') 1621 ( 1622 'Component = pnlLink' 1623 'Status = stsDefault') 1624 ( 1625 'Component = cbxLink' 1626 'Label = lblLink' 1627 'Status = stsOK') 1628 ( 1629 'Component = frmTemplateEditor' 1630 'Status = stsDefault')) 1380 1631 end 1381 1632 object popTemplates: TPopupMenu … … 1750 2001 Top = 136 1751 2002 end 2003 object imgLblTemplates: TVA508ImageListLabeler 2004 Components = < 2005 item 2006 Component = tvPersonal 2007 end 2008 item 2009 Component = tvShared 2010 end> 2011 Labels = <> 2012 RemoteLabeler = dmodShared.imgLblHealthFactorLabels 2013 Left = 104 2014 Top = 144 2015 end 1752 2016 end -
cprs/trunk/CPRS-Chart/Templates/fTemplateEditor.pas
r456 r829 18 18 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 19 19 ExtCtrls, StdCtrls, ComCtrls, ORCtrls, Buttons, Mask, ORFn, ORNet, 20 uTemplates, Menus, ImgList, Clipbrd, ToolWin, MenuBar, TypInfo, MSXML_TLB; 20 uTemplates, Menus, ImgList, Clipbrd, ToolWin, MenuBar, TypInfo, MSXML_TLB, fBase508Form, 21 VA508AccessibilityManager, VA508ImageListLabeler; 21 22 22 23 type … … 24 25 TTemplateTreeType = (ttShared, ttPersonal); 25 26 26 TfrmTemplateEditor = class(T Form)27 TfrmTemplateEditor = class(TfrmBase508Form) 27 28 splMain: TSplitter; 28 pnlBottom: T ORAutoPanel;29 pnlBottom: TPanel; 29 30 btnApply: TButton; 30 31 btnCancel: TButton; … … 209 210 cbxLink: TORComboBox; 210 211 lblLink: TLabel; 212 imgLblTemplates: TVA508ImageListLabeler; 211 213 procedure btnNewClick(Sender: TObject); 212 214 procedure btnApplyClick(Sender: TObject); … … 339 341 Direction, InsertAt: Integer); 340 342 procedure cbxLinkChange(Sender: TObject); 341 procedure cbxLinkSynonymCheck(Sender: TObject; const Text: String;342 var IsSynonym: Boolean);343 343 procedure reBoilKeyUp(Sender: TObject; var Key: Word; 344 344 Shift: TShiftState); … … 346 346 procedure reBoilKeyDown(Sender: TObject; var Key: Word; 347 347 Shift: TShiftState); 348 procedure FormClose(Sender: TObject; var Action: TCloseAction); 348 349 private 349 350 FLastRect: TRect; … … 386 387 FCanDoReminders: boolean; 387 388 FCanDoCOMObjects: boolean; 388 FPersonalObjects: TStringList;389 //FPersonalObjects: TStringList; 389 390 FShowingTemplate: TTemplate; 390 391 FConsultServices: TStringList; … … 416 417 procedure UpdateInsertsDialogs; 417 418 procedure AutoLongLines(Sender: TObject); 418 procedure UpdatePersonalObjects;419 //procedure UpdatePersonalObjects; 419 420 procedure UpdateApply(Template: TTemplate); 420 421 procedure TemplateLocked(Sender: TObject); 421 422 procedure InitTrees; 423 procedure AdjustControls4FontChange; 424 procedure ShowGroupBoilerplate(Visible: boolean); 422 425 function GetLinkType(const ANode: TTreeNode): TTemplateLinkType; 423 426 end; 424 427 425 428 procedure EditTemplates(Form: TForm; NewTemplate: boolean = FALSE; CopiedText: string = ''; Shared: boolean = FALSE); 429 430 const 431 TemplateEditorSplitters = 'frmTempEditSplitters'; 432 TemplateEditorSplitters2 = 'frmTempEditSplitters2'; 433 434 var 435 tmplEditorSplitterMiddle: integer = 0; 436 tmplEditorSplitterProperties: integer = 0; 437 tmplEditorSplitterMain: integer = 0; 438 tmplEditorSplitterBoil: integer = 0; 439 tmplEditorSplitterNotes: integer = 0; 426 440 427 441 implementation … … 431 445 uses dShared, uCore, rTemplates, fTemplateObjects, uSpell, fTemplateView, 432 446 fTemplateAutoGen, fDrawers, fTemplateFieldEditor, fTemplateFields, XMLUtils, 433 fIconLegend, uReminders, uConst, rCore, rEventHooks, rConsults; 447 fIconLegend, uReminders, uConst, rCore, rEventHooks, rConsults, VAUtils, 448 rMisc, fFindingTemplates; 434 449 435 450 const … … 499 514 Drawers := TFrmDrawers(Form) 500 515 else 501 if IsPublishedProp(Form, 'Drawers') then502 Drawers := TFrmDrawers(GetOrdProp(Form, 'Drawers'));516 if IsPublishedProp(Form, DrawersProperty) then 517 Drawers := TFrmDrawers(GetOrdProp(Form, DrawersProperty)); 503 518 end; 504 519 … … 724 739 725 740 BtnApply.Enabled := BackupDiffers; 741 SetFormPosition(Self); 726 742 end; 727 743 … … 873 889 end; 874 890 lblNotes.Enabled := (not reNotes.ReadOnly); 875 if(reNotes.ReadOnly) then 876 reNotes.Color := ReadOnlyColor 877 else 878 reNotes.Color := clWindow; 891 UpdateReadOnlyColorScheme(reNotes, reNotes.ReadOnly); 879 892 cbxType.Enabled := ok; 880 893 lblType.Enabled := ok; … … 894 907 lblLines.Enabled := ok; 895 908 reBoil.ReadOnly := not ok; 896 if(ok) then 897 reBoil.Color := clWindow 898 else 899 reBoil.Color := ReadOnlyColor; 909 UpdateReadOnlyColorScheme(reBoil, not ok); 900 910 lblLink.Enabled := ok; 901 911 cbxLink.Enabled := ok; … … 937 947 end; 938 948 949 procedure TfrmTemplateEditor.ShowGroupBoilerplate(Visible: boolean); 950 begin 951 pnlGroupBP.Visible := Visible; 952 splBoil.Visible := Visible; 953 if Visible then 954 begin 955 reBoil.Align := alTop; 956 pnlGroupBP.Align := alClient; 957 reBoil.Height := tmplEditorSplitterBoil; 958 splBoil.Top := pnlGroupBP.Top - splBoil.Height; 959 end 960 else 961 begin 962 pnlGroupBP.Align := alBottom; 963 reBoil.Align := alClient; 964 end; 965 end; 966 939 967 procedure TfrmTemplateEditor.ShowInfo(Node: TTreeNode); 940 968 var … … 942 970 Idx: TTypeIndex; 943 971 CanDoCOM: boolean; 944 LinkTemplate: TTemplate;945 972 lt: TTemplateLinkType; 946 973 lts: string; 947 i: integer;948 974 949 975 begin … … 980 1006 begin 981 1007 FConsultServices := TStringList.Create; 982 F ConsultServices.Assign(LoadServiceListWithSynonyms(1));1008 FastAssign(LoadServiceListWithSynonyms(1), FConsultServices); 983 1009 SortByPiece(FConsultServices, U, 2); 984 1010 end; 985 for i := 0 to FConsultServices.Count-1 do 986 begin 987 LinkTemplate := GetLinkedTemplate(piece(FConsultServices[i],U,1), ltConsult); 988 if (not assigned(LinkTemplate)) or (LinkTemplate = FShowingTemplate) then 989 cbxLink.Items.Add(FConsultServices[i]); 990 end; 1011 FastAssign(FConsultServices, cbxLink.Items); 991 1012 end 992 1013 else … … 1171 1192 edtGap.Text := '0'; 1172 1193 reBoil.Clear; 1173 pnlGroupBP.Visible := FALSE; 1174 splBoil.Visible := FALSE; 1194 ShowGroupBoilerplate(False); 1175 1195 pnlBoilerplateResize(Self); 1176 1196 pnlCOM.Visible := FALSE; … … 1196 1216 begin 1197 1217 if(pnlGroupBP.Visible) and (pnlGroupBP.Height > (pnlBoilerplate.Height-29)) then 1218 begin 1198 1219 pnlGroupBP.Height := pnlBoilerplate.Height-29; 1220 end; 1199 1221 if cbLongLines.checked then 1200 1222 Max := 240 … … 1449 1471 begin 1450 1472 reBoil.ReadOnly := TRUE; 1451 reBoil.Color := ReadOnlyColor;1473 UpdateReadOnlyColorScheme(reBoil, TRUE); 1452 1474 UpdateInsertsDialogs; 1453 1475 end; 1454 pnlGroupBP.Visible := ItemOK; 1455 splBoil.Visible := ItemOK; 1476 ShowGroupBoilerplate(ItemOK); 1456 1477 if(not ItemOK) and (IsReminderDialog or IsCOMObject) then 1457 1478 BPOK := FALSE; 1458 if(ItemOK) then1459 splBoil.Top := pnlGroupBP.Top - splBoil.Height;1460 1479 pnlBoilerplateResize(Self); 1461 1480 pnlBoilerplate.Visible := BPOK; … … 1482 1501 frmTemplateFields := nil; 1483 1502 end; 1484 KillObj(@FPersonalObjects); 1503 //---------- CQ #8665 - RV -------- 1504 //KillObj(@FPersonalObjects); 1505 if (assigned(uPersonalObjects)) then 1506 begin 1507 KillObj(@uPersonalObjects); 1508 uPersonalObjects.Free; 1509 uPersonalObjects := nil; 1510 end; 1511 // ---- end CQ #8665 ------------- 1485 1512 dmodShared.OnTemplateLock := nil; 1486 1513 dmodShared.InEditor := FALSE; … … 2040 2067 end; 2041 2068 2069 procedure TfrmTemplateEditor.AdjustControls4FontChange; 2070 var 2071 x: integer; 2072 2073 procedure Adjust(Control: TWinControl); 2074 begin 2075 x := x - Control.Width - 2; 2076 Control.Left := x; 2077 end; 2078 2079 begin 2080 if FCanEditShared then 2081 begin 2082 x := pnlSharedBottom.Width; 2083 Adjust(sbSHDelete); 2084 Adjust(sbSHDown); 2085 Adjust(sbSHUp); 2086 cbSHHide.Width := x; 2087 end; 2088 x := pnlBottom.Width; 2089 Adjust(btnApply); 2090 Adjust(btnCancel); 2091 Adjust(btnOK); 2092 cbEditShared.Width := TextWidthByFont(cbEditShared.Font.Handle, cbEditShared.Caption) + 25; 2093 cbNotes.Left := cbEditShared.Left + cbEditShared.Width + 60; 2094 cbNotes.Width := TextWidthByFont(cbNotes.Font.Handle, cbNotes.Caption) + 25; 2095 end; 2096 2042 2097 function TfrmTemplateEditor.AllowMove(ADropNode, ADragNode: TTreeNode): boolean; 2043 2098 var … … 2205 2260 MoveCopyButtons; 2206 2261 tvTreeChange(FCurTree, FCurTree.Selected); 2262 if FCanEditShared then 2263 AdjustControls4FontChange; 2207 2264 end; 2208 2265 … … 2327 2384 procedure TfrmTemplateEditor.btnFindClick(Sender: TObject); 2328 2385 var 2329 Found: boolean;2386 Found: TTreeNode; 2330 2387 edtSearch: TEdit; 2388 IsNext: boolean; 2331 2389 FindNext: boolean; 2332 2390 FindWholeWords: boolean; … … 2334 2392 Tree: TTreeView; 2335 2393 LastFoundNode, TmpNode: TTreeNode; 2336 S1,S2: string;2394 // S1,S2: string; 2337 2395 2338 2396 begin … … 2345 2403 FindCase := cbShMatchCase.Checked; 2346 2404 LastFoundNode := FLastFoundShNode; 2347 if(FSharedEmptyNodeCount > 0) then2348 begin2349 FInternalHiddenExpand := TRUE;2350 try2351 tvShared.Items.GetFirstNode.Expand(TRUE);2352 finally2353 FInternalHiddenExpand := FALSE;2354 end;2355 end;2356 2405 end 2357 2406 else … … 2363 2412 FindCase := cbPerMatchCase.Checked; 2364 2413 LastFoundNode := FLastFoundPerNode; 2365 if(FPersonalEmptyNodeCount > 0) then2366 begin2367 FInternalHiddenExpand := TRUE;2368 try2369 tvPersonal.Items.GetFirstNode.Expand(TRUE);2370 finally2371 FInternalHiddenExpand := FALSE;2372 end;2373 end;2374 2414 end; 2375 2415 if(edtSearch.text <> '') then 2376 2416 begin 2377 if((FindNext) and assigned (LastFoundNode)) then 2378 TmpNode := LastFoundNode.GetNext 2417 IsNext := ((FindNext) and assigned (LastFoundNode)); 2418 if IsNext then 2419 2420 TmpNode := LastFoundNode 2379 2421 else 2380 2422 TmpNode := Tree.Items.GetFirstNode; 2381 Found := FALSE; 2382 if(assigned(TmpNode)) then 2383 begin 2384 S1 := edtSearch.Text; 2385 if(not FindCase) then 2386 S1 := UpperCase(S1); 2387 while (assigned(TmpNode) and (not Found)) do 2388 begin 2389 S2 := TmpNode.Text; 2390 if(not FindCase) then 2391 S2 := UpperCase(S2); 2392 Found := SearchMatch(S1, S2, FindWholeWords); 2393 if(not Found) then 2394 TmpNode := TmpNode.GetNext; 2395 end; 2396 end; 2397 if(Found) then 2398 begin 2423 FInternalHiddenExpand := TRUE; 2424 try 2425 Found := FindTemplate(edtSearch.Text, Tree, Self, TmpNode, 2426 IsNext, not FindCase, FindWholeWords); 2427 finally 2428 FInternalHiddenExpand := FALSE; 2429 end; 2430 if Assigned(Found) then 2431 begin 2432 Tree.Selected := Found; 2399 2433 if(Tree = tvShared) then 2400 FLastFoundShNode := TmpNode2434 FLastFoundShNode := Found 2401 2435 else 2402 FLastFoundPerNode := TmpNode;2436 FLastFoundPerNode := Found; 2403 2437 SetFindNext(Tree, TRUE); 2404 Tree.Selected := TmpNode;2405 end2406 else2407 begin2408 if(FindNext) then2409 S1 := ''2410 else2411 S1 := ' "' + edtSearch.Text + '" was not Found.';2412 SetFindNext(Tree, FALSE);2413 InfoBox('Search Complete.' + S1, 'Information', MB_OK or MB_ICONINFORMATION);2414 2438 end; 2415 2439 end; … … 2499 2523 end; 2500 2524 pnlBoilerplateResize(Self); 2525 AdjustControls4FontChange; 2526 MoveCopyButtons; 2501 2527 end; 2502 2528 end; … … 2516 2542 begin 2517 2543 UpdatePersonalObjects; 2518 if FPersonalObjects.Count > 0 then2544 if uPersonalObjects.Count > 0 then // -------- CQ #8665 - RV ------------ 2519 2545 begin 2520 2546 DoIt := FALSE; 2521 2547 for i := 0 to dmodShared.TIUObjects.Count-1 do 2522 if FPersonalObjects.IndexOf(Piece(dmodShared.TIUObjects[i],U,2)) >= 0 then2548 if uPersonalObjects.IndexOf(Piece(dmodShared.TIUObjects[i],U,2)) >= 0 then // -------- CQ #8665 - RV ------------ 2523 2549 frmTemplateObjects.cboObjects.Items.Add(dmodShared.TIUObjects[i]); 2524 2550 end; 2525 2551 end; 2526 2552 if DoIt then 2527 frmTemplateObjects.cboObjects.Items.Assign(dmodShared.TIUObjects);2553 FastAssign(dmodShared.TIUObjects, frmTemplateObjects.cboObjects.Items); 2528 2554 frmTemplateObjects.Font := Font; 2529 2555 frmTemplateObjects.re := reBoil; … … 2633 2659 end; 2634 2660 2661 procedure TfrmTemplateEditor.FormClose(Sender: TObject; 2662 var Action: TCloseAction); 2663 begin 2664 SaveUserBounds(Self); 2665 end; 2666 2635 2667 procedure TfrmTemplateEditor.FormCloseQuery(Sender: TObject; 2636 2668 var CanClose: Boolean); … … 2666 2698 procedure TfrmTemplateEditor.splBoilMoved(Sender: TObject); 2667 2699 begin 2700 if pnlBoilerplate.Visible and pnlGroupBP.Visible then 2701 tmplEditorSplitterBoil := reBoil.Height; 2702 if pnlNotes.Visible then 2703 tmplEditorSplitterNotes := pnlNotes.Height; 2668 2704 pnlBoilerplateResize(Self); 2669 2705 end; … … 3105 3141 procedure TfrmTemplateEditor.mbMainResize(Sender: TObject); 3106 3142 begin 3107 pnlMenu.Width := mbMain.Width + 3; 3143 pnlMenu.Width := mbMain.Width + 4; 3144 mbMain.Width := pnlMenu.Width - 3; 3108 3145 end; 3109 3146 … … 3179 3216 dmodShared.LoadTIUObjects; 3180 3217 UpdatePersonalObjects; 3181 GetAutoGenText(AName, AText, FPersonalObjects);3218 GetAutoGenText(AName, AText, uPersonalObjects); // -------- CQ #8665 - RV ------------ 3182 3219 if(AName <> '') and (AText <> '') then 3183 3220 begin … … 3274 3311 pnlNotes.Visible := cbNotes.Checked; 3275 3312 splNotes.Visible := cbNotes.Checked; 3276 splNotes.Top := pnlNotes.Top-3; 3313 if cbNotes.Checked then 3314 begin 3315 pnlNotes.Height := tmplEditorSplitterNotes; 3316 pnlNotes.Top := pnlBottom.Top - pnlNotes.Height; 3317 splNotes.Top := pnlNotes.Top-3; 3318 end; 3277 3319 pnlBoilerplateResize(Self); 3278 3320 end; … … 3397 3439 if (Flds.Count > 0) then begin 3398 3440 ExpandEmbeddedFields(Flds); 3399 F lds.Assign(ExportTemplateFields(Flds));3441 FastAssign(ExportTemplateFields(Flds), Flds); 3400 3442 for i := 0 to Flds.Count-1 do 3401 3443 Flds[i] := ' ' + Flds[i]; 3402 Tmpl.AddStrings(Flds);3444 FastAddStrings(Flds, Tmpl); 3403 3445 end; {if} 3404 3446 Tmpl.Add('</'+XMLHeader+'>'); … … 3704 3746 FUpdating := FALSE; 3705 3747 end; 3706 ShowM essage('Can not assign a Reminder Dialog to a Reason for Request');3748 ShowMsg('Can not assign a Reminder Dialog to a Reason for Request'); 3707 3749 end 3708 3750 else … … 3790 3832 end; 3791 3833 3792 procedure TfrmTemplateEditor.UpdatePersonalObjects;3834 (*procedure TfrmTemplateEditor.UpdatePersonalObjects; 3793 3835 var 3794 3836 i: integer; … … 3803 3845 FPersonalObjects.Sorted := TRUE; 3804 3846 end; 3805 end; 3847 end;*) 3806 3848 3807 3849 (*function TfrmTemplateEditor.ModifyAllowed(const Node: TTreeNode): boolean; … … 3875 3917 begin 3876 3918 Resync([TTemplate(Sender)]); 3877 ShowM essage(Format(TemplateLockedText, [TTemplate(Sender).PrintName]));3919 ShowMsg(Format(TemplateLockedText, [TTemplate(Sender).PrintName])); 3878 3920 end; 3879 3921 … … 4074 4116 try 4075 4117 case TTemplateLinkType(pnlLink.Tag) of 4076 ltTitle: tmpSL.Assign(SubSetOfAllTitles(StartFrom, Direction));4118 ltTitle: FastAssign(SubSetOfAllTitles(StartFrom, Direction), tmpSL); 4077 4119 // ltConsult: 4078 4120 ltProcedure: 4079 4121 begin 4080 tmpSL.Assign(SubSetOfProcedures(StartFrom, Direction));4122 FastAssign(SubSetOfProcedures(StartFrom, Direction), tmpSL); 4081 4123 for i := 0 to tmpSL.Count-1 do 4082 4124 begin … … 4096 4138 var 4097 4139 Template,LinkTemplate: TTemplate; 4140 update: boolean; 4098 4141 4099 4142 begin … … 4104 4147 if assigned(Template) and Template.CanModify then 4105 4148 begin 4149 update := true; 4106 4150 if cbxLink.ItemIEN > 0 then 4107 4151 begin … … 4109 4153 if (assigned(LinkTemplate) and (LinkTemplate <> Template)) then 4110 4154 begin 4111 ShowM essage(GetLinkName(cbxLink.ItemID, TTemplateLinkType(pnlLink.tag)) +4155 ShowMsg(GetLinkName(cbxLink.ItemID, TTemplateLinkType(pnlLink.tag)) + 4112 4156 ' is already assigned to another template.'); 4113 cbxLink.ItemIndex := -1; 4157 cbxLink.SelectByID(Template.LinkIEN); 4158 update := False; 4159 end 4160 else 4161 begin 4162 Template.FileLink := ConvertFileLink(cbxLink.ItemID, TTemplateLinkType(pnlLink.tag)); 4163 if Template.LinkName <> '' then 4164 edtName.Text := copy(Template.LinkName,1,edtName.MaxLength); 4114 4165 end; 4115 Template.FileLink := ConvertFileLink(cbxLink.ItemID, TTemplateLinkType(pnlLink.tag));4116 if Template.LinkName <> '' then4117 edtName.Text := copy(Template.LinkName,1,edtName.MaxLength);4118 4166 end 4119 4167 else 4120 4168 Template.FileLink := ''; 4121 UpdateApply(Template); 4122 end; 4123 end; 4124 end; 4125 4126 procedure TfrmTemplateEditor.cbxLinkSynonymCheck(Sender: TObject; 4127 const Text: String; var IsSynonym: Boolean); 4128 var 4129 LinkTemplate: TTemplate; 4130 var IEN: string; 4131 4132 begin 4133 IsSynonym := FALSE; 4134 if pnlLink.Visible and assigned(FShowingTemplate) then 4135 begin 4136 IEN := Piece(Text,#9,30); 4137 if IEN <> '' then 4138 begin 4139 LinkTemplate := GetLinkedTemplate(IEN, TTemplateLinkType(pnlLink.Tag)); 4140 IsSynonym := (assigned(LinkTemplate) and (LinkTemplate <> FShowingTemplate)); 4141 end 4142 else 4143 IsSynonym := FALSE; 4169 if update then 4170 UpdateApply(Template); 4171 end; 4144 4172 end; 4145 4173 end; -
cprs/trunk/CPRS-Chart/Templates/fTemplateFieldEditor.dfm
r456 r829 1 objectfrmTemplateFieldEditor: TfrmTemplateFieldEditor1 inherited frmTemplateFieldEditor: TfrmTemplateFieldEditor 2 2 Left = 294 3 3 Top = 211 4 Width = 6405 Height = 4476 4 BorderIcons = [biSystemMenu, biMaximize] 7 5 Caption = 'Template Field Editor' 8 Color = clBtnFace 9 Font.Charset = DEFAULT_CHARSET 10 Font.Color = clWindowText 11 Font.Height = -11 12 Font.Name = 'MS Sans Serif' 13 Font.Style = [] 14 OldCreateOrder = False 6 ClientHeight = 420 7 ClientWidth = 788 15 8 Position = poScreenCenter 16 9 OnCloseQuery = FormCloseQuery … … 18 11 OnDestroy = FormDestroy 19 12 OnResize = FormResize 13 ExplicitWidth = 796 14 ExplicitHeight = 454 20 15 PixelsPerInch = 96 21 16 TextHeight = 13 22 object splLeft: TSplitter 23 Left = 27317 object splLeft: TSplitter [0] 18 Left = 429 24 19 Top = 25 25 Width = 326 20 Height = 366 27 Cursor = crHSplit28 21 Beveled = True 22 ExplicitLeft = 273 29 23 end 30 object pnlBottom: TPanel 24 object pnlBottom: TPanel [1] 31 25 Left = 0 32 26 Top = 391 33 Width = 63227 Width = 788 34 28 Height = 29 35 29 Align = alBottom 36 30 TabOrder = 2 37 31 DesignSize = ( 38 63232 788 39 33 29) 40 34 object lblReq: TStaticText … … 47 41 end 48 42 object btnOK: TButton 49 Left = 39243 Left = 548 50 44 Top = 4 51 45 Width = 75 … … 58 52 end 59 53 object btnCancel: TButton 60 Left = 47254 Left = 628 61 55 Top = 4 62 56 Width = 75 … … 70 64 end 71 65 object btnApply: TButton 72 Left = 55266 Left = 708 73 67 Top = 4 74 68 Width = 75 … … 80 74 end 81 75 object btnPreview: TButton 82 Left = 27976 Left = 435 83 77 Top = 4 84 78 Width = 75 … … 102 96 end 103 97 end 104 object pnlObjs: TPanel 98 object pnlObjs: TPanel [2] 105 99 Left = 0 106 100 Top = 25 107 Width = 273101 Width = 429 108 102 Height = 366 109 103 Align = alLeft … … 114 108 Left = 1 115 109 Top = 1 116 Width = 271110 Width = 427 117 111 Height = 13 118 112 Align = alTop 119 113 Caption = 'Template Fields' 114 ExplicitWidth = 74 120 115 end 121 116 object cbxObjs: TORComboBox 122 117 Left = 1 123 118 Top = 14 124 Width = 271119 Width = 427 125 120 Height = 351 126 121 Style = orcsSimple … … 141 136 Sorted = False 142 137 SynonymChars = '<Inactive>' 143 TabPositions = ' 34,45,55,65,75'138 TabPositions = '50,60,70,80,90' 144 139 TabOrder = 0 145 140 OnChange = cbxObjsChange … … 147 142 OnNeedData = cbxObjsNeedData 148 143 OnSynonymCheck = cbxObjsSynonymCheck 144 CharsNeedMatch = 1 149 145 end 150 146 end 151 object pnlRight: TPanel 152 Left = 276147 object pnlRight: TPanel [3] 148 Left = 432 153 149 Top = 25 154 150 Width = 356 … … 182 178 Align = alTop 183 179 Caption = 'Notes:' 180 ExplicitWidth = 31 184 181 end 185 182 object reNotes: TRichEdit … … 370 367 TabOrder = 1 371 368 OnChange = cbxTypeChange 369 CharsNeedMatch = 1 372 370 end 373 371 object edtTextLen: TCaptionEdit … … 389 387 Anchors = [akTop, akRight] 390 388 Associate = edtTextLen 391 Min = 0392 389 Max = 240 393 Position = 0394 390 TabOrder = 5 395 Wrap = False396 391 end 397 392 object pnlSwap: TPanel … … 408 403 Width = 300 409 404 Height = 22 405 Align = alTop 410 406 Font.Charset = ANSI_CHARSET 411 407 Font.Color = clWindowText … … 420 416 OnEnter = edtpopControlEnter 421 417 OnExit = ControlExit 422 Align = alTop423 418 Caption = 'Default Value' 424 419 end … … 460 455 Min = -9999 461 456 Max = 9999 462 Position = 0463 457 TabOrder = 1 464 458 Thousands = False 465 Wrap = False466 459 end 467 460 object edtDefNum: TCaptionEdit … … 483 476 Min = -9999 484 477 Max = 9999 485 Position = 0486 478 TabOrder = 3 487 479 Thousands = False 488 Wrap = False489 480 end 490 481 object edtMinVal: TCaptionEdit … … 508 499 Position = 1 509 500 TabOrder = 7 510 Wrap = False511 501 end 512 502 object edtInc: TCaptionEdit … … 538 528 Min = -9999 539 529 Max = 9999 540 Position = 0541 530 TabOrder = 5 542 531 Thousands = False 543 Wrap = False544 532 end 545 533 end … … 549 537 Width = 300 550 538 Height = 22 539 Align = alTop 551 540 Font.Charset = ANSI_CHARSET 552 541 Font.Color = clWindowText … … 560 549 OnChange = edtURLChange 561 550 OnEnter = edtpopControlEnter 562 Align = alTop563 551 Caption = 'URL' 564 552 end … … 615 603 TabStop = True 616 604 OnChange = cbxDefaultChange 605 CharsNeedMatch = 1 617 606 end 618 607 object pnlDate: TPanel … … 678 667 TabOrder = 1 679 668 OnChange = cbxDateTypeChange 669 CharsNeedMatch = 1 680 670 end 681 671 end … … 703 693 Position = 1 704 694 TabOrder = 3 705 Wrap = False706 695 end 707 696 object gbIndent: TGroupBox … … 743 732 Height = 21 744 733 Associate = edtIndent 745 Min = 0746 734 Max = 30 747 Position = 0748 735 TabOrder = 1 749 736 Thousands = False 750 Wrap = False751 737 end 752 738 object udPad: TUpDown … … 756 742 Height = 21 757 743 Associate = edtPad 758 Min = 0759 744 Max = 30 760 Position = 0761 745 TabOrder = 2 762 746 Thousands = False 763 Wrap = False764 747 end 765 748 object edtPad: TCaptionEdit … … 823 806 end 824 807 end 825 object pnlTop: TPanel 808 object pnlTop: TPanel [4] 826 809 Left = 0 827 810 Top = 0 828 Width = 632811 Width = 788 829 812 Height = 25 830 813 Align = alTop … … 832 815 TabOrder = 3 833 816 DesignSize = ( 834 632817 788 835 818 25) 836 819 object MenuBar1: TMenuBar 837 820 Left = 0 838 821 Top = 0 839 Width = 23822 Width = 41 840 823 Height = 25 841 824 Align = alLeft … … 844 827 ButtonWidth = 43 845 828 Caption = 'MenuBar1' 846 Flat = True847 829 Menu = mnuMain 848 830 ShowCaptions = True … … 850 832 end 851 833 object btnNew: TButton 852 Left = 557834 Left = 711 853 835 Top = 2 854 836 Width = 75 … … 860 842 end 861 843 object btnCopy: TButton 862 Left = 478844 Left = 632 863 845 Top = 2 864 846 Width = 75 … … 871 853 end 872 854 object btnDelete: TButton 873 Left = 399855 Left = 553 874 856 Top = 2 875 857 Width = 75 … … 881 863 OnClick = mnuDeleteClick 882 864 end 865 end 866 inherited amgrMain: TVA508AccessibilityManager 867 Data = ( 868 ( 869 'Component = pnlBottom' 870 'Status = stsDefault') 871 ( 872 'Component = lblReq' 873 'Status = stsDefault') 874 ( 875 'Component = btnOK' 876 'Status = stsDefault') 877 ( 878 'Component = btnCancel' 879 'Status = stsDefault') 880 ( 881 'Component = btnApply' 882 'Status = stsDefault') 883 ( 884 'Component = btnPreview' 885 'Status = stsDefault') 886 ( 887 'Component = cbHide' 888 'Status = stsDefault') 889 ( 890 'Component = pnlObjs' 891 'Status = stsDefault') 892 ( 893 'Component = cbxObjs' 894 'Status = stsDefault') 895 ( 896 'Component = pnlRight' 897 'Status = stsDefault') 898 ( 899 'Component = pnlPreview' 900 'Status = stsDefault') 901 ( 902 'Component = reNotes' 903 'Status = stsDefault') 904 ( 905 'Component = pnlObjInfo' 906 'Status = stsDefault') 907 ( 908 'Component = edtName' 909 'Status = stsDefault') 910 ( 911 'Component = edtLMText' 912 'Status = stsDefault') 913 ( 914 'Component = cbxType' 915 'Status = stsDefault') 916 ( 917 'Component = edtTextLen' 918 'Status = stsDefault') 919 ( 920 'Component = udTextLen' 921 'Status = stsDefault') 922 ( 923 'Component = pnlSwap' 924 'Status = stsDefault') 925 ( 926 'Component = edtDefault' 927 'Status = stsDefault') 928 ( 929 'Component = pnlNum' 930 'Status = stsDefault') 931 ( 932 'Component = udDefNum' 933 'Status = stsDefault') 934 ( 935 'Component = edtDefNum' 936 'Status = stsDefault') 937 ( 938 'Component = udMinVal' 939 'Status = stsDefault') 940 ( 941 'Component = edtMinVal' 942 'Status = stsDefault') 943 ( 944 'Component = udInc' 945 'Status = stsDefault') 946 ( 947 'Component = edtInc' 948 'Status = stsDefault') 949 ( 950 'Component = edtMaxVal' 951 'Status = stsDefault') 952 ( 953 'Component = udMaxVal' 954 'Status = stsDefault') 955 ( 956 'Component = edtURL' 957 'Status = stsDefault') 958 ( 959 'Component = reItems' 960 'Status = stsDefault') 961 ( 962 'Component = cbxDefault' 963 'Status = stsDefault') 964 ( 965 'Component = pnlDate' 966 'Status = stsDefault') 967 ( 968 'Component = edtDateDef' 969 'Status = stsDefault') 970 ( 971 'Component = cbxDateType' 972 'Status = stsDefault') 973 ( 974 'Component = edtLen' 975 'Status = stsDefault') 976 ( 977 'Component = udLen' 978 'Status = stsDefault') 979 ( 980 'Component = gbIndent' 981 'Status = stsDefault') 982 ( 983 'Component = edtIndent' 984 'Status = stsDefault') 985 ( 986 'Component = udIndent' 987 'Status = stsDefault') 988 ( 989 'Component = udPad' 990 'Status = stsDefault') 991 ( 992 'Component = edtPad' 993 'Status = stsDefault') 994 ( 995 'Component = gbMisc' 996 'Status = stsDefault') 997 ( 998 'Component = cbActive' 999 'Status = stsDefault') 1000 ( 1001 'Component = cbRequired' 1002 'Status = stsDefault') 1003 ( 1004 'Component = cbSepLines' 1005 'Status = stsDefault') 1006 ( 1007 'Component = cbExclude' 1008 'Status = stsDefault') 1009 ( 1010 'Component = pnlTop' 1011 'Status = stsDefault') 1012 ( 1013 'Component = MenuBar1' 1014 'Status = stsDefault') 1015 ( 1016 'Component = btnNew' 1017 'Status = stsDefault') 1018 ( 1019 'Component = btnCopy' 1020 'Status = stsDefault') 1021 ( 1022 'Component = btnDelete' 1023 'Status = stsDefault') 1024 ( 1025 'Component = frmTemplateFieldEditor' 1026 'Status = stsDefault')) 883 1027 end 884 1028 object mnuMain: TMainMenu -
cprs/trunk/CPRS-Chart/Templates/fTemplateFieldEditor.pas
r456 r829 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 7 ORCtrls, StdCtrls, ExtCtrls, Menus, ComCtrls, uTemplateFields, ORFn, 8 ToolWin, MenuBar, ORClasses, ORDtTm ;8 ToolWin, MenuBar, ORClasses, ORDtTm, fBase508Form, VA508AccessibilityManager; 9 9 10 10 type 11 TfrmTemplateFieldEditor = class(T Form)11 TfrmTemplateFieldEditor = class(TfrmBase508Form) 12 12 pnlBottom: TPanel; 13 13 btnOK: TButton; … … 184 184 185 185 uses rTemplates, fTemplateDialog, Clipbrd, uSpell, uConst, 186 fTemplateFields ;186 fTemplateFields, VAUtils; 187 187 188 188 {$R *.DFM} … … 470 470 FUpdating := TRUE; 471 471 try 472 cbxDefault.Items.Assign(reItems.Lines);472 QuickCopy(reItems, cbxDefault); 473 473 idx := -1; 474 474 if(assigned(FFld)) and reItems.Visible and cbxDefault.Visible then … … 509 509 tmp := TORStringList.Create; 510 510 try 511 tmp.Assign(SubSetOfTemplateFields(StartFrom, Direction));511 FastAssign(SubSetOfTemplateFields(StartFrom, Direction), tmp); 512 512 for i := 0 to FDeleted.Count-1 do 513 513 begin … … 516 516 tmp.delete(idx); 517 517 end; 518 ConvertCodes2Text(tmp, TRUE);518 ConvertCodes2Text(tmp, FALSE); 519 519 cbxObjs.ForDataUse(tmp); 520 520 finally … … 815 815 if FDeleted.IndexOfPiece(FFld.FldName, U, 2) >= 0 then 816 816 begin 817 ShowM essage('Template field can not be named the same as a deleted' + CRLF +817 ShowMsg('Template field can not be named the same as a deleted' + CRLF + 818 818 'field until OK or Apply has been pressed.'); 819 819 bad := TRUE; -
cprs/trunk/CPRS-Chart/Templates/fTemplateFields.dfm
r456 r829 1 objectfrmTemplateFields: TfrmTemplateFields1 inherited frmTemplateFields: TfrmTemplateFields 2 2 Left = 212 3 3 Top = 155 4 Width = 4185 Height = 3006 4 Caption = 'Insert Template Field' 7 Color = clBtnFace 8 Font.Charset = DEFAULT_CHARSET 9 Font.Color = clWindowText 10 Font.Height = -11 11 Font.Name = 'MS Sans Serif' 12 Font.Style = [] 5 ClientHeight = 319 6 ClientWidth = 450 13 7 FormStyle = fsStayOnTop 14 OldCreateOrder = False15 8 Position = poOwnerFormCenter 16 9 OnClose = FormClose 17 10 OnCreate = FormCreate 18 11 OnShow = FormShow 12 ExplicitWidth = 458 13 ExplicitHeight = 346 19 14 PixelsPerInch = 96 20 15 TextHeight = 13 21 object pnlBottom: TPanel 16 object pnlBottom: TPanel [0] 22 17 Left = 0 23 Top = 2 4624 Width = 4 1025 Height = 2 718 Top = 226 19 Width = 450 20 Height = 28 26 21 Align = alBottom 27 22 BevelOuter = bvNone 28 TabOrder = 023 TabOrder = 1 29 24 DesignSize = ( 30 410 31 27) 32 object lblReq: TStaticText 33 Left = 21 34 Top = 8 35 Width = 134 36 Height = 17 37 Caption = '* Indicates a Required Field' 38 TabOrder = 3 39 end 25 450 26 28) 40 27 object btnCancel: TButton 41 Left = 3 3528 Left = 371 42 29 Top = 4 43 30 Width = 75 … … 47 34 Caption = '&Done' 48 35 ModalResult = 2 49 TabOrder = 236 TabOrder = 3 50 37 OnClick = btnCancelClick 51 38 end 52 39 object btnInsert: TButton 53 Left = 2 5540 Left = 291 54 41 Top = 4 55 42 Width = 75 … … 59 46 Default = True 60 47 ModalResult = 4 61 TabOrder = 148 TabOrder = 2 62 49 OnClick = btnInsertClick 63 50 end 64 51 object btnPreview: TButton 65 Left = 17552 Left = 211 66 53 Top = 4 67 54 Width = 75 68 55 Height = 21 56 Anchors = [akTop, akRight] 69 57 Caption = '&Preview' 70 58 Enabled = False 59 TabOrder = 1 60 OnClick = btnPreviewClick 61 end 62 object lblReq: TVA508StaticText 63 Name = 'lblReq' 64 AlignWithMargins = True 65 Left = 10 66 Top = 12 67 Width = 132 68 Height = 15 69 Alignment = taLeftJustify 70 Anchors = [akLeft, akBottom] 71 Caption = '* Indicates a Required Field' 71 72 TabOrder = 0 72 OnClick = btnPreviewClick73 end 74 end 75 object cboObjects: TORComboBox 73 ShowAccelChar = True 74 end 75 end 76 object cboObjects: TORComboBox [1] 76 77 Left = 0 77 78 Top = 0 78 Width = 4 1079 Height = 2 4679 Width = 450 80 Height = 226 80 81 Style = orcsSimple 81 82 Align = alClient … … 89 90 ListItemsOnly = True 90 91 LongList = True 92 LookupPiece = 0 91 93 MaxLength = 0 92 94 Pieces = '2,3' … … 95 97 SynonymChars = '<Inactive>' 96 98 TabPositions = '50,60,70,80,90' 97 TabOrder = 1 99 TabOrder = 0 100 TabStop = True 98 101 OnChange = cboObjectsChange 99 102 OnDblClick = cboObjectsDblClick 100 103 OnNeedData = cboObjectsNeedData 104 CharsNeedMatch = 1 105 end 106 object pnlBottomSR: TPanel [2] 107 Left = 0 108 Top = 254 109 Width = 450 110 Height = 65 111 Align = alBottom 112 BevelOuter = bvNone 113 TabOrder = 2 114 object lblSRCont2: TVA508StaticText 115 Name = 'lblSRCont2' 116 AlignWithMargins = True 117 Left = 24 118 Top = 45 119 Width = 423 120 Height = 15 121 Margins.Left = 24 122 Margins.Top = 0 123 Margins.Bottom = 0 124 Align = alTop 125 Alignment = taLeftJustify 126 Caption = 127 'speaking text that follows the template field, when the field re' + 128 'ceives focus.' 129 TabOrder = 3 130 ShowAccelChar = True 131 end 132 object lblSRCont1: TVA508StaticText 133 Name = 'lblSRCont1' 134 AlignWithMargins = True 135 Left = 10 136 Top = 30 137 Width = 437 138 Height = 15 139 Margins.Left = 10 140 Margins.Top = 0 141 Margins.Bottom = 0 142 Align = alTop 143 Alignment = taLeftJustify 144 Caption = 145 '*** Place this code after a template field to allow the screen r' + 146 'eader to continue' 147 TabOrder = 2 148 ShowAccelChar = True 149 end 150 object lblSRStop: TVA508StaticText 151 Name = 'lblSRStop' 152 AlignWithMargins = True 153 Left = 10 154 Top = 15 155 Width = 437 156 Height = 15 157 Margins.Left = 10 158 Margins.Top = 0 159 Margins.Bottom = 0 160 Align = alTop 161 Alignment = taLeftJustify 162 Caption = '** Screen reader will stop speaking at this point' 163 TabOrder = 1 164 ShowAccelChar = True 165 end 166 object pnlSRIntro: TPanel 167 Left = 0 168 Top = 0 169 Width = 450 170 Height = 15 171 Align = alTop 172 BevelOuter = bvNone 173 TabOrder = 0 174 object lblSRIntro1: TVA508StaticText 175 Name = 'lblSRIntro1' 176 AlignWithMargins = True 177 Left = 10 178 Top = 0 179 Width = 127 180 Height = 15 181 Margins.Left = 10 182 Margins.Top = 0 183 Margins.Bottom = 0 184 Align = alLeft 185 Alignment = taLeftJustify 186 Caption = 'Screen Reader Codes' 187 Font.Charset = DEFAULT_CHARSET 188 Font.Color = clWindowText 189 Font.Height = -11 190 Font.Name = 'MS Sans Serif' 191 Font.Style = [fsBold] 192 ParentFont = False 193 TabOrder = 0 194 ShowAccelChar = True 195 end 196 object lblSRIntro2: TVA508StaticText 197 Name = 'lblSRIntro2' 198 Left = 140 199 Top = 0 200 Width = 310 201 Height = 15 202 Align = alClient 203 Alignment = taLeftJustify 204 Caption = '(make templates user friendly for those using screen readers)' 205 TabOrder = 1 206 ShowAccelChar = True 207 end 208 end 209 end 210 inherited amgrMain: TVA508AccessibilityManager 211 Data = ( 212 ( 213 'Component = pnlBottom' 214 'Status = stsDefault') 215 ( 216 'Component = btnCancel' 217 'Status = stsDefault') 218 ( 219 'Component = btnInsert' 220 'Status = stsDefault') 221 ( 222 'Component = btnPreview' 223 'Status = stsDefault') 224 ( 225 'Component = cboObjects' 226 'Status = stsDefault') 227 ( 228 'Component = frmTemplateFields' 229 'Status = stsDefault') 230 ( 231 'Component = lblReq' 232 'Status = stsDefault') 233 ( 234 'Component = pnlBottomSR' 235 'Status = stsDefault') 236 ( 237 'Component = lblSRCont2' 238 'Status = stsDefault') 239 ( 240 'Component = lblSRCont1' 241 'Status = stsDefault') 242 ( 243 'Component = lblSRStop' 244 'Status = stsDefault') 245 ( 246 'Component = pnlSRIntro' 247 'Status = stsDefault') 248 ( 249 'Component = lblSRIntro1' 250 'Status = stsDefault') 251 ( 252 'Component = lblSRIntro2' 253 'Status = stsDefault')) 101 254 end 102 255 end -
cprs/trunk/CPRS-Chart/Templates/fTemplateFields.pas
r456 r829 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 ORCtrls, ComCtrls, StdCtrls, ExtCtrls ;7 ORCtrls, ComCtrls, StdCtrls, ExtCtrls, fBase508Form, VA508AccessibilityManager; 8 8 9 9 type 10 TfrmTemplateFields = class(T Form)10 TfrmTemplateFields = class(TfrmBase508Form) 11 11 pnlBottom: TPanel; 12 12 btnCancel: TButton; 13 13 cboObjects: TORComboBox; 14 14 btnInsert: TButton; 15 lblReq: TStaticText;16 15 btnPreview: TButton; 16 lblReq: TVA508StaticText; 17 pnlBottomSR: TPanel; 18 lblSRCont2: TVA508StaticText; 19 lblSRCont1: TVA508StaticText; 20 lblSRStop: TVA508StaticText; 21 pnlSRIntro: TPanel; 22 lblSRIntro1: TVA508StaticText; 23 lblSRIntro2: TVA508StaticText; 17 24 procedure FormShow(Sender: TObject); 18 25 procedure FormCreate(Sender: TObject); … … 28 35 { Fre: TRichEdit;} 29 36 Fre: TCustomEdit; 37 FInsertAllowed: boolean; 38 FInitialized: boolean; 30 39 FAutoLongLines: TNotifyEvent; 31 40 procedure InsertField; 32 41 { procedure Setre(const Value: TRichEdit);} 33 42 procedure Setre(const Value: TCustomEdit); 43 function ValidPreview: boolean; 44 function ValidInsert: boolean; 34 45 public 35 46 procedure UpdateStatus; … … 47 58 48 59 procedure TfrmTemplateFields.FormShow(Sender: TObject); 49 begin 60 var 61 i: integer; 62 begin 63 if not FInitialized then 64 begin 65 with cboObjects do 66 begin 67 for i := low(ScreenReaderCodeLines) to high(ScreenReaderCodeLines) do 68 Items.Add(ScreenReaderCodeLines[i]); 69 InsertSeparator; 70 InitLongList(''); 71 end; 72 FInitialized := TRUE; 73 end; 50 74 cboObjects.SelectAll; 51 75 cboObjects.SetFocus; … … 54 78 procedure TfrmTemplateFields.FormCreate(Sender: TObject); 55 79 begin 56 cboObjects.InitLongList('');57 cboObjects.ItemHeight := 15;58 ResizeAnchoredFormToFont(self);59 //ResizeAnchoredFormToFont doesn't work right on the button positions for some reason.60 btnCancel.Left := pnlBottom.ClientWidth - btnCancel.Width;61 btnInsert.Left := btnCancel.Left - btnInsert.Width - 8;80 ResizeFormToFont(self); 81 cboObjects.ItemHeight := lblReq.Height - 1; 82 FInsertAllowed := TRUE; 83 lblReq.Top := (pnlBottom.Height - lblReq.Height); 84 pnlSRIntro.Height := lblSRStop.Height; 85 pnlBottomSR.Height := lblSRCont1.Height * 4 + 5; 62 86 end; 63 87 … … 76 100 var 77 101 cnt: integer; 78 79 begin 102 p1, p2: string; 103 check: boolean; 104 i: integer; 105 106 begin 107 p1 := Piece(cboObjects.Items[cboObjects.ItemIndex],U,1); 108 if p1 = '' then exit; 80 109 if assigned(Fre) and (not TORExposedCustomEdit(Fre).ReadOnly) and (cboObjects.ItemIndex >= 0) then 81 110 begin … … 83 112 cnt := TRichEdit(FRe).Lines.Count 84 113 else 85 cnt :=0; 86 Fre.SelText := TemplateFieldBeginSignature + 87 Piece(cboObjects.Items[cboObjects.ItemIndex],U,2)+ 88 TemplateFieldEndSignature; 114 cnt := 0; 115 if StrToIntDef(p1, 0) < 0 then 116 begin 117 check := true; 118 for i := low(ScreenReaderCodeIDs) to high(ScreenReaderCodeIDs) do 119 begin 120 if p1 = ScreenReaderCodeIDs[i] then 121 begin 122 p2 := ScreenReaderCodes[i]; 123 check := FALSE; 124 break; 125 end; 126 end; 127 end 128 else 129 check := TRUE; 130 if check then 131 p2 := TemplateFieldBeginSignature + Piece(cboObjects.Items[cboObjects.ItemIndex],U,2) + 132 TemplateFieldEndSignature; 133 Fre.SelText := p2; 89 134 if Fre is TRichEdit then 90 135 if(assigned(FAutoLongLines) and (cnt <> TRichEdit(FRe).Lines.Count)) then … … 95 140 procedure TfrmTemplateFields.cboObjectsDblClick(Sender: TObject); 96 141 begin 97 if btnInsert.Enabledthen142 if ValidInsert then 98 143 InsertField; 99 144 end; … … 118 163 procedure TfrmTemplateFields.UpdateStatus; 119 164 begin 120 btnInsert.Enabled := (not TORExposedCustomEdit(re).ReadOnly); 165 FInsertAllowed := (not TORExposedCustomEdit(re).ReadOnly); 166 btnInsert.Enabled := ValidInsert and FInsertAllowed; 167 end; 168 169 function TfrmTemplateFields.ValidInsert: boolean; 170 begin 171 Result := (cboObjects.ItemIndex >= 0); 172 if Result then 173 Result := (Piece(cboObjects.Items[cboObjects.ItemIndex],U,1) <> ''); 174 end; 175 176 function TfrmTemplateFields.ValidPreview: boolean; 177 var 178 i: integer; 179 code: string; 180 begin 181 Result := ValidInsert; 182 if Result then 183 begin 184 code := Piece(cboObjects.Items[cboObjects.ItemIndex],U,1); 185 for I := low(ScreenReaderCodeIDs) to high(ScreenReaderCodeIDs) do 186 begin 187 if code = ScreenReaderCodeIDs[i] then 188 begin 189 Result := FALSE; 190 break; 191 end; 192 end; 193 end; 121 194 end; 122 195 123 196 procedure TfrmTemplateFields.btnInsertClick(Sender: TObject); 124 197 begin 125 InsertField; 198 if ValidInsert then 199 InsertField; 126 200 end; 127 201 … … 147 221 procedure TfrmTemplateFields.cboObjectsChange(Sender: TObject); 148 222 begin 149 btnPreview.Enabled := (cboObjects.ItemIndex >= 0) 223 btnPreview.Enabled := ValidPreview; 224 btnInsert.Enabled := ValidInsert and FInsertAllowed; 150 225 end; 151 226 -
cprs/trunk/CPRS-Chart/Templates/fTemplateImport.dfm
r456 r829 1 objectfrmTemplateImport: TfrmTemplateImport1 inherited frmTemplateImport: TfrmTemplateImport 2 2 Left = 273 3 3 Top = 195 … … 7 7 ClientHeight = 132 8 8 ClientWidth = 288 9 Color = clBtnFace10 Font.Charset = DEFAULT_CHARSET11 Font.Color = clWindowText12 Font.Height = -1113 Font.Name = 'MS Sans Serif'14 Font.Style = []15 9 FormStyle = fsStayOnTop 16 OldCreateOrder = False17 10 Position = poScreenCenter 18 11 PixelsPerInch = 96 19 12 TextHeight = 13 20 object gaugeImport: TGauge 13 object gaugeImport: TGauge [0] 21 14 Left = 8 22 15 Top = 82 23 16 Width = 272 24 17 Height = 21 25 ForeColor = clNavy 18 BackColor = clHighlightText 19 ForeColor = clHighlight 20 Font.Charset = DEFAULT_CHARSET 21 Font.Color = clCaptionText 22 Font.Height = -11 23 Font.Name = 'MS Sans Serif' 24 Font.Style = [] 25 ParentFont = False 26 26 Progress = 0 27 27 end 28 object lblImporting: TStaticText 28 object lblImporting: TStaticText [1] 29 29 Left = 8 30 30 Top = 4 … … 37 37 TabOrder = 0 38 38 end 39 object animImport: TAnimate 39 object animImport: TAnimate [2] 40 40 Left = 8 41 41 Top = 20 … … 44 44 Active = True 45 45 CommonAVI = aviCopyFile 46 StopFrame = 2 646 StopFrame = 20 47 47 end 48 object btnCancel: TButton 48 object btnCancel: TButton [3] 49 49 Left = 106 50 50 Top = 106 … … 57 57 OnClick = btnCancelClick 58 58 end 59 inherited amgrMain: TVA508AccessibilityManager 60 Data = ( 61 ( 62 'Component = lblImporting' 63 'Status = stsDefault') 64 ( 65 'Component = animImport' 66 'Status = stsDefault') 67 ( 68 'Component = btnCancel' 69 'Status = stsDefault') 70 ( 71 'Component = frmTemplateImport' 72 'Status = stsDefault')) 73 end 59 74 end -
cprs/trunk/CPRS-Chart/Templates/fTemplateImport.pas
r456 r829 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 Gauges, StdCtrls, ComCtrls ;7 Gauges, StdCtrls, ComCtrls, fBase508Form, VA508AccessibilityManager; 8 8 9 9 type 10 TfrmTemplateImport = class(T Form)10 TfrmTemplateImport = class(TfrmBase508Form) 11 11 animImport: TAnimate; 12 12 btnCancel: TButton; -
cprs/trunk/CPRS-Chart/Templates/fTemplateObjects.dfm
r456 r829 1 objectfrmTemplateObjects: TfrmTemplateObjects1 inherited frmTemplateObjects: TfrmTemplateObjects 2 2 Left = 215 3 3 Top = 343 4 Width = 2475 Height = 3006 4 ActiveControl = cboObjects 7 5 Caption = 'Insert Patient Data (Object)' 8 Color = clBtnFace 9 Font.Charset = DEFAULT_CHARSET 10 Font.Color = clWindowText 11 Font.Height = -11 12 Font.Name = 'MS Sans Serif' 13 Font.Style = [] 6 ClientHeight = 273 7 ClientWidth = 239 14 8 FormStyle = fsStayOnTop 15 OldCreateOrder = False16 9 Position = poOwnerFormCenter 17 10 OnClose = FormClose 18 11 OnShow = FormShow 12 ExplicitWidth = 247 13 ExplicitHeight = 300 19 14 PixelsPerInch = 96 20 15 TextHeight = 13 21 object cboObjects: TORComboBox 16 object cboObjects: TORComboBox [0] 22 17 Left = 0 23 18 Top = 0 … … 42 37 TabOrder = 0 43 38 OnDblClick = cboObjectsDblClick 39 CharsNeedMatch = 1 44 40 end 45 object pnlBottom: TPanel 41 object pnlBottom: TPanel [1] 46 42 Left = 0 47 43 Top = 246 … … 91 87 end 92 88 end 89 inherited amgrMain: TVA508AccessibilityManager 90 Data = ( 91 ( 92 'Component = cboObjects' 93 'Status = stsDefault') 94 ( 95 'Component = pnlBottom' 96 'Status = stsDefault') 97 ( 98 'Component = btnCancel' 99 'Status = stsDefault') 100 ( 101 'Component = btnInsert' 102 'Status = stsDefault') 103 ( 104 'Component = btnRefresh' 105 'Status = stsDefault') 106 ( 107 'Component = frmTemplateObjects' 108 'Status = stsDefault')) 109 end 93 110 end -
cprs/trunk/CPRS-Chart/Templates/fTemplateObjects.pas
r456 r829 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 ORCtrls, StdCtrls, ExtCtrls, ComCtrls, ORFn, dShared; 7 ORCtrls, StdCtrls, ExtCtrls, ComCtrls, ORFn, dShared, uTemplates, fBase508Form, 8 VA508AccessibilityManager; 8 9 9 10 type 10 TfrmTemplateObjects = class(T Form)11 TfrmTemplateObjects = class(TfrmBase508Form) 11 12 cboObjects: TORComboBox; 12 13 pnlBottom: TPanel; … … 93 94 94 95 procedure TfrmTemplateObjects.btnRefreshClick(Sender: TObject); 96 var 97 i: integer; 98 DoIt: boolean; 95 99 begin 96 cboObjects.SelectAll; 97 cboObjects.Clear; 98 dmodShared.RefreshObject := true; 99 dmodShared.LoadTIUObjects; 100 CboOBJECTS.Items.AddStrings(dmodShared.TIUObjects); 100 cboObjects.Clear; 101 dmodShared.RefreshObject := true; 102 dmodShared.LoadTIUObjects; 103 //---------- CQ #8665 - RV ---------------- 104 DoIt := TRUE; 105 UpdatePersonalObjects; 106 if uPersonalObjects.Count > 0 then 107 begin 108 DoIt := FALSE; 109 for i := 0 to dmodShared.TIUObjects.Count-1 do 110 if uPersonalObjects.IndexOf(Piece(dmodShared.TIUObjects[i],U,2)) >= 0 then 111 cboObjects.Items.Add(dmodShared.TIUObjects[i]); 112 end; 113 if DoIt then 114 //---------- end CQ #8665 ------------------ 115 cboObjects.Items.Assign(dmodShared.TIUObjects); 101 116 end; 102 117 103 118 end. 119 -
cprs/trunk/CPRS-Chart/Templates/fTemplateView.dfm
r456 r829 1 objectfrmTemplateView: TfrmTemplateView1 inherited frmTemplateView: TfrmTemplateView 2 2 Left = 257 3 3 Top = 105 4 Width = 5785 Height = 3726 4 Caption = 'View Template' 7 Color = clBtnFace 8 Font.Charset = DEFAULT_CHARSET 9 Font.Color = clWindowText 10 Font.Height = -11 11 Font.Name = 'MS Sans Serif' 12 Font.Style = [] 13 OldCreateOrder = False 5 ClientHeight = 343 6 ClientWidth = 568 14 7 Position = poScreenCenter 15 8 OnClose = FormClose 16 9 OnCreate = FormCreate 17 10 OnDestroy = FormDestroy 18 OnShow = FormShow 11 ExplicitWidth = 576 12 ExplicitHeight = 370 19 13 PixelsPerInch = 96 20 14 TextHeight = 13 21 object pnlBottom: TPanel 15 object pnlBottom: TPanel [0] 22 16 Left = 0 23 Top = 31 524 Width = 5 7017 Top = 313 18 Width = 568 25 19 Height = 30 26 20 Align = alBottom … … 28 22 TabOrder = 1 29 23 DesignSize = ( 30 5 7024 568 31 25 30) 32 26 object btnClose: TButton 33 Left = 49 427 Left = 492 34 28 Top = 6 35 29 Width = 75 … … 52 46 end 53 47 object btnPrint: TButton 54 Left = 41 448 Left = 412 55 49 Top = 6 56 50 Width = 75 … … 62 56 end 63 57 end 64 object reMain: TRichEdit 58 object reMain: TRichEdit [1] 65 59 Left = 0 66 60 Top = 0 67 Width = 5 7068 Height = 31 561 Width = 568 62 Height = 313 69 63 Align = alClient 70 64 Color = clCream … … 82 76 WantReturns = False 83 77 WordWrap = False 78 end 79 inherited amgrMain: TVA508AccessibilityManager 80 Data = ( 81 ( 82 'Component = pnlBottom' 83 'Status = stsDefault') 84 ( 85 'Component = btnClose' 86 'Status = stsDefault') 87 ( 88 'Component = cbStayOnTop' 89 'Status = stsDefault') 90 ( 91 'Component = btnPrint' 92 'Status = stsDefault') 93 ( 94 'Component = reMain' 95 'Status = stsDefault') 96 ( 97 'Component = frmTemplateView' 98 'Status = stsDefault')) 84 99 end 85 100 object popView: TPopupMenu -
cprs/trunk/CPRS-Chart/Templates/fTemplateView.pas
r456 r829 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 StdCtrls, ComCtrls, ExtCtrls, Menus, ORFn; 7 StdCtrls, ComCtrls, ExtCtrls, Menus, ORFn, fBase508Form, 8 VA508AccessibilityManager; 8 9 9 10 type 10 TfrmTemplateView = class(T Form)11 TfrmTemplateView = class(TfrmBase508Form) 11 12 pnlBottom: TPanel; 12 13 reMain: TRichEdit; … … 26 27 procedure SelectAll1Click(Sender: TObject); 27 28 procedure btnPrintClick(Sender: TObject); 29 procedure AlignButtons(); 28 30 procedure FormCreate(Sender: TObject); 29 procedure FormShow(Sender: TObject);30 31 private 31 32 end; … … 52 53 if(not assigned(frmTemplateView)) then 53 54 frmTemplateView := TfrmTemplateView.Create(Application); 54 ResizeAnchoredFormToFont(frmTemplateView); 55 //Quick fix to work around glich in resize algorithm 56 frmTemplateView.AlignButtons(); 55 57 frmTemplateView.reMain.Lines.Clear; 56 58 frmTemplateView.Caption := 'Template: ' + Title; … … 80 82 SaveUserBounds(frmTemplateView); 81 83 Action := caFree; 84 end; 85 86 procedure TfrmTemplateView.FormCreate(Sender: TObject); 87 begin 88 inherited; 89 ResizeAnchoredFormToFont(Self); 90 SetFormPosition(Self); 82 91 end; 83 92 … … 118 127 end; 119 128 120 procedure TfrmTemplateView.FormCreate(Sender: TObject); 129 procedure TfrmTemplateView.AlignButtons; 130 Const 131 BtnSpace = 8; 121 132 begin 122 reMain.Color := ReadOnlyColor; 123 end; 124 125 procedure TfrmTemplateView.FormShow(Sender: TObject); 126 begin 127 SetFormPosition(frmTemplateView); 133 btnClose.Left := frmTemplateView.Width - btnClose.Width - BtnSpace; 134 btnPrint.Left := btnClose.Left - BtnSpace - btnPrint.Width; 128 135 end; 129 136 -
cprs/trunk/CPRS-Chart/Templates/mTemplateFieldButton.dfm
r456 r829 2 2 Left = 0 3 3 Top = 0 4 Width = 1 094 Width = 136 5 5 Height = 14 6 AutoScroll = True 6 7 Font.Charset = ANSI_CHARSET 7 8 Font.Color = clWindowText … … 12 13 TabOrder = 0 13 14 TabStop = True 14 OnEnter = pnlBtnEnter15 OnExit = pnlBtnExit15 OnEnter = FrameEnter 16 OnExit = FrameExit 16 17 object pnlBtn: TPanel 17 18 Left = 0 18 19 Top = 0 19 Width = 1 0920 Width = 136 20 21 Height = 14 21 22 Align = alClient 22 23 TabOrder = 0 24 OnExit = FrameExit 23 25 OnMouseDown = pnlBtnMouseDown 24 26 OnMouseUp = pnlBtnMouseUp 27 DesignSize = ( 28 136 29 14) 25 30 object lblText: TLabel 26 31 Left = 2 27 32 Top = -1 28 Width = 1 0533 Width = 132 29 34 Height = 14 30 35 Alignment = taCenter … … 35 40 OnMouseDown = pnlBtnMouseDown 36 41 OnMouseUp = pnlBtnMouseUp 42 ExplicitWidth = 105 37 43 end 38 44 object pbFocus: TPaintBox 39 45 Left = 1 40 46 Top = 1 41 Width = 1 0747 Width = 134 42 48 Height = 12 43 49 Align = alClient … … 45 51 OnMouseUp = pnlBtnMouseUp 46 52 OnPaint = pbFocusPaint 53 ExplicitWidth = 107 47 54 end 48 55 end -
cprs/trunk/CPRS-Chart/Templates/mTemplateFieldButton.pas
r456 r829 5 5 uses 6 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 StdCtrls, ExtCtrls ;7 StdCtrls, ExtCtrls, uDlgComponents, VA508AccessibilityManager; 8 8 9 9 type 10 TfraTemplateFieldButton = class(TFrame )10 TfraTemplateFieldButton = class(TFrame, ICPRSDialogComponent) 11 11 pnlBtn: TPanel; 12 12 lblText: TLabel; … … 16 16 procedure pnlBtnMouseUp(Sender: TObject; Button: TMouseButton; 17 17 Shift: TShiftState; X, Y: Integer); 18 procedure pnlBtnEnter(Sender: TObject);19 procedure pnlBtnExit(Sender: TObject);18 procedure FrameEnter(Sender: TObject); 19 procedure FrameExit(Sender: TObject); 20 20 procedure pbFocusPaint(Sender: TObject); 21 21 private 22 FCPRSDialogData: ICPRSDialogComponent; 22 23 FBtnDown: boolean; 23 24 FItems: TStringList; … … 33 34 property Items: TStringList read FItems; 34 35 property OnChange: TNotifyEvent read FOnChange write FOnChange; 36 property CPRSDialogData: ICPRSDialogComponent read FCPRSDialogData implements ICPRSDialogComponent; 35 37 end; 36 38 … … 40 42 41 43 uses 42 ORFn ;43 44 ORFn, VA508AccessibilityRouter; 45 44 46 procedure TfraTemplateFieldButton.pnlBtnMouseDown(Sender: TObject; Button: TMouseButton; 45 47 Shift: TShiftState; X, Y: Integer); … … 69 71 idx := 0; 70 72 ButtonText := FItems[idx]; 73 if ScreenReaderSystemActive then 74 begin 75 txt := FItems[idx]; 76 if Trim(txt) = '' then 77 txt := 'blank'; 78 GetScreenReader.Speak(txt); 79 end; 71 80 if assigned(FOnChange) then 72 81 FOnChange(Self); … … 86 95 end; 87 96 88 procedure TfraTemplateFieldButton.pnlBtnEnter(Sender: TObject); 97 type 98 TWinControlFriend = class(TWinControl); 99 100 procedure TfraTemplateFieldButton.FrameEnter(Sender: TObject); 89 101 begin 90 102 pbFocus.Invalidate; 91 103 end; 92 104 93 procedure TfraTemplateFieldButton. pnlBtnExit(Sender: TObject);105 procedure TfraTemplateFieldButton.FrameExit(Sender: TObject); 94 106 begin 95 107 pbFocus.Invalidate; … … 98 110 constructor TfraTemplateFieldButton.Create(AOwner: TComponent); 99 111 begin 100 inherited; 112 inherited Create(AOwner); 113 TabStop := TRUE; 101 114 FItems := TStringList.Create; 102 115 OnKeyDown := ButtonKeyDown; 103 116 OnKeyUp := ButtonKeyUp; 104 117 Font.Size := MainFontSize; 118 FCPRSDialogData := TCPRSDialogComponent.Create(Self, 'multi value button'); 105 119 end; 106 120 … … 142 156 begin 143 157 FItems.Free; 158 FCPRSDialogData := nil; 144 159 inherited; 145 160 end; 146 161 162 initialization 163 SpecifyFormIsNotADialog(TfraTemplateFieldButton); 164 147 165 end. -
cprs/trunk/CPRS-Chart/Templates/rTemplates.pas
r456 r829 105 105 CallBroker; 106 106 RPCBrokerV.Results.Delete(0); 107 BoilerPlate.Assign(RPCBrokerV.Results);107 FastAssign(RPCBrokerV.Results, BoilerPlate); 108 108 RPCBrokerV.Results.Clear; 109 109 end; … … 260 260 TmpList := TStringList.Create; 261 261 try 262 TmpList.Assign(RPCBrokerV.Results);262 FastAssign(RPCBrokerV.Results, TmpList); 263 263 SortByPiece(TmpList, U, 2); 264 264 MixedCaseList(TmpList); 265 RPCBrokerV.Results.Assign(TmpList);265 FastAssign(TmpList, RPCBrokerV.Results); 266 266 finally 267 267 TmpList.Free; … … 377 377 begin 378 378 CallV('TIU FIELD CHECK',[nil]); 379 ResultString.Assign(RPCBrokerV.Results);379 FastAssign(RPCBrokerV.Results, ResultString); 380 380 end; 381 381 … … 398 398 CallBroker; 399 399 end; 400 Text.Assign(RPCBrokerV.Results);400 FastAssign(RPCBrokerV.Results, Text); 401 401 end; 402 402 … … 449 449 Result := TRUE; 450 450 CallV('TIU FIELD LIST IMPORT',[nil]); 451 ResultSet.Assign(RPCBrokerV.Results);451 FastAssign(RPCBrokerV.Results, ResultSet); 452 452 if ResultSet.Count < 1 then 453 453 Result := FALSE; -
cprs/trunk/CPRS-Chart/Templates/uTemplateFields.pas
r456 r829 5 5 uses 6 6 Forms, SysUtils, Classes, Dialogs, StdCtrls, ExtCtrls, Controls, Contnrs, 7 Graphics, ORClasses, ComCtrls, ORDtTm ;7 Graphics, ORClasses, ComCtrls, ORDtTm, uDlgComponents, TypInfo, ORFn, StrUtils; 8 8 9 9 type 10 10 TTemplateFieldType = (dftUnknown, dftEditBox, dftComboBox, dftButton, dftCheckBoxes, 11 dftRadioButtons, dftDate, dftNumber, dftHyperlink, dftWP, dftText); 11 dftRadioButtons, dftDate, dftNumber, dftHyperlink, dftWP, dftText, 12 // keep dftScreenReader as last entry - users can not create this type of field 13 dftScreenReader); 12 14 13 15 TTmplFldDateType = (dtUnknown, dtDate, dtDateTime, dtDateReqTime, … … 30 32 FID: string; 31 33 FFont: TFont; 32 FPanel: T Panel;34 FPanel: TDlgFieldPanel; 33 35 FControls: TStringList; 34 36 FIndents: TStringList; … … 47 49 procedure SetFieldValues(const Value: string); 48 50 procedure SetAutoDestroyOnPanelFree(const Value: boolean); 51 function StripCode(var txt: string; code: char): boolean; 49 52 protected 50 53 procedure UpDownChange(Sender: TObject); … … 57 60 constructor Create(AParent: TWinControl; AID, Text: string); 58 61 destructor Destroy; override; 59 function GetPanel(MaxLen: integer; AParent: TWinControl): TPanel; 62 function GetPanel(MaxLen: integer; AParent: TWinControl; 63 OwningCheckBox: TCPRSDialogParentCheckBox): TDlgFieldPanel; 60 64 function GetText: string; 61 65 property Text: string read FText write FText; … … 174 178 procedure ConvertCodes2Text(sl: TStrings; Short: boolean); 175 179 function StripEmbedded(iItems: string): string; 180 procedure StripScreenReaderCodes(var Text: string); overload; 181 procedure StripScreenReaderCodes(SL: TStrings); overload; 182 function HasScreenReaderBreakCodes(SL: TStrings): boolean; 176 183 177 184 const 178 TemplateFieldBeginSignature = '{FLD:'; 185 TemplateFieldSignature = '{FLD'; 186 TemplateFieldBeginSignature = TemplateFieldSignature + ':'; 179 187 TemplateFieldEndSignature = '}'; 188 ScreenReaderCodeSignature = '{SR-'; 189 ScreenReaderCodeType = ' Screen Reader Code'; 190 ScreenReaderCodeCount = 2; 191 ScreenReaderShownCount = 1; 192 ScreenReaderStopCode = ScreenReaderCodeSignature + 'STOP' + TemplateFieldEndSignature; 193 ScreenReaderStopCodeLen = Length(ScreenReaderStopCode); 194 ScreenReaderStopCodeID = '-43'; 195 ScreenReaderStopName = 'SCREEN READER STOP CODE **'; 196 ScreenReaderStopCodeLine = ScreenReaderStopCodeID + U + ScreenReaderStopName + U + ScreenReaderCodeType; 197 ScreenReaderContinueCode = ScreenReaderCodeSignature + 'CONT' + TemplateFieldEndSignature; 198 ScreenReaderContinueCodeLen = Length(ScreenReaderContinueCode); 199 ScreenReaderContinueCodeOld = ScreenReaderCodeSignature + 'CONTINUE' + TemplateFieldEndSignature; 200 ScreenReaderContinueCodeOldLen = Length(ScreenReaderContinueCodeOld); 201 ScreenReaderContinueCodeID = '-44'; 202 ScreenReaderContinueCodeName = 'SCREEN READER CONTINUE CODE ***'; 203 ScreenReaderContinueCodeLine = ScreenReaderContinueCodeID + U + ScreenReaderContinueCodeName + U + ScreenReaderCodeType; 180 204 MissingFieldsTxt = 'One or more required fields must still be entered.'; 205 206 ScreenReaderCodes: array[0..ScreenReaderCodeCount] of string = 207 (ScreenReaderStopCode, ScreenReaderContinueCode, ScreenReaderContinueCodeOld); 208 ScreenReaderCodeLens: array[0..ScreenReaderCodeCount] of integer = 209 (ScreenReaderStopCodeLen, ScreenReaderContinueCodeLen, ScreenReaderContinueCodeOldLen); 210 ScreenReaderCodeIDs: array[0..ScreenReaderShownCount] of string = 211 (ScreenReaderStopCodeID, ScreenReaderContinueCodeID); 212 ScreenReaderCodeLines: array[0..ScreenReaderShownCount] of string = 213 (ScreenReaderStopCodeLine, ScreenReaderContinueCodeLine); 181 214 182 215 TemplateFieldTypeCodes: array[TTemplateFieldType] of string[1] = … … 191 224 { dftHyperlink } 'H', 192 225 { dftWP } 'W', 193 { dftText } 'T'); 226 { dftText } 'T', 227 { dftScreenReader } 'S'); 194 228 195 229 TemplateFieldTypeDesc: array[TTemplateFieldType, boolean] of string = 196 230 { dftUnknown } (('',''), 197 { dftEditBox } ('Edit Box', 'Edit'), 198 { dftComboBox } ('Combo Box', 'Combo'), 199 { dftButton } ('Button', 'Button'), 200 { dftCheckBoxes } ('Check Boxes', 'Check'), 201 { dftRadioButtons } ('Radio Buttons', 'Radio'), 202 { dftDate } ('Date', 'Date'), 203 { dftNumber } ('Number', 'Num'), 204 { dftHyperlink } ('Hyperlink', 'Link'), 205 { dftWP } ('Word Processing','WP'), 206 { dftWP } ('Display Text', 'Text')); 231 { dftEditBox } ('Edit Box', 'Edit'), 232 { dftComboBox } ('Combo Box', 'Combo'), 233 { dftButton } ('Button', 'Button'), 234 { dftCheckBoxes } ('Check Boxes', 'Check'), 235 { dftRadioButtons } ('Radio Buttons', 'Radio'), 236 { dftDate } ('Date', 'Date'), 237 { dftNumber } ('Number', 'Num'), 238 { dftHyperlink } ('Hyperlink', 'Link'), 239 { dftWP } ('Word Processing', 'WP'), 240 { dftText } ('Display Text', 'Text'), 241 { dftScreenReader } ('Screen Reader Stop', 'SRStop')); 207 242 208 243 TemplateDateTypeDesc: array[TTmplFldDateType, boolean] of string = … … 226 261 { dftHyperlink } 'LINK', 227 262 { dftWP } 'WRDP', 228 { dftTExt } 'TEXT'); 263 { dftTExt } 'TEXT', 264 { dftScreenReader } 'SRST'); 229 265 230 266 TemplateFieldDateCodes: array[TTmplFldDateType] of string[1] = … … 239 275 MaxTFWPLines = 20; 240 276 MaxTFEdtLen = 70; 241 242 type 243 TFieldPanel = class(TPanel) {This is the panel associated with the child} 244 private {dialog checkboxes in reminders dialogs} 245 FOnDestroy: TNotifyEvent; 246 FCanvas: TControlCanvas; {used to draw focus rect} 247 function GetFocus: boolean; 248 procedure SetTheFocus(const Value: boolean); 249 protected {used to draw focus rect} 250 procedure Paint; override; {used to draw focus rect} 251 public 252 destructor Destroy; override; 253 property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; 254 property Focus: boolean read GetFocus write SetTheFocus; {to draw focus rect} 255 property OnKeyPress; {to click the checkbox when spacebar is pressed} 256 end; 257 277 258 278 implementation 259 279 260 280 uses 261 ORFn, rTemplates, ORCtrls, mTemplateFieldButton, dShared, uConst, uCore, rCore, Windows; 281 rTemplates, ORCtrls, mTemplateFieldButton, dShared, uConst, uCore, rCore, Windows, 282 VAUtils, VA508AccessibilityManager, VA508AccessibilityRouter; 262 283 263 284 const … … 279 300 FieldIDLen = 6; 280 301 NewLine = 'NL'; 281 282 type283 TFieldLabel = class(TLabel)284 private285 FExclude: boolean;286 public287 property Exclude: boolean read FExclude;288 end;289 290 TWebLabel = class(TFieldLabel)291 private292 FAddr: string;293 procedure Clicked(Sender: TObject);294 public295 procedure Init(Addr: string);296 end;297 302 298 303 function GetNewFieldID: string; … … 694 699 Result := (msg <> ''); 695 700 if(Result) then 696 ShowM essage(msg);701 ShowMsg(msg); 697 702 end; 698 703 … … 861 866 AList.Add(''); 862 867 AList.Add('The following inactive template fields were found:'); 863 AList.AddStrings(InactiveList);868 FastAddStrings(InactiveList, AList); 864 869 end; 865 870 if(AList.Count > 0) then … … 1079 1084 dbox: TORDateBox; 1080 1085 dcbo: TORDateCombo; 1081 lbl: T FieldLabel;1086 lbl: TCPRSTemplateFieldLabel; 1082 1087 re: TRichEdit; 1083 pnl: TPanel; 1084 ud: TUpDown; 1088 pnl: TCPRSDialogNumber; 1085 1089 DefDate: TFMDateTime; 1086 1090 ctrl: TControl; … … 1123 1127 dftEditBox: 1124 1128 begin 1125 edt := TEdit.Create(nil); 1129 edt := TCPRSDialogFieldEdit.Create(nil); 1130 (edt as ICPRSDialogComponent).RequiredField := Required; 1126 1131 edt.Parent := Entry.FPanel; 1127 1132 edt.BorderStyle := bsNone; … … 1135 1140 edt.Tag := CtrlID; 1136 1141 edt.OnChange := Entry.DoChange; 1142 UpdateColorsFor508Compliance(edt, TRUE); 1137 1143 ctrl := edt; 1138 1144 end; … … 1140 1146 dftComboBox: 1141 1147 begin 1142 cbo := TORComboBox.Create(nil); 1148 cbo := TCPRSDialogComboBox.Create(nil); 1149 (cbo as ICPRSDialogComponent).RequiredField := Required; 1143 1150 cbo.Parent := Entry.FPanel; 1144 1151 cbo.TemplateField := TRUE; … … 1165 1172 cbo.DropDownCount := cbo.Items.Count; 1166 1173 end; 1174 UpdateColorsFor508Compliance(cbo, TRUE); 1167 1175 ctrl := cbo; 1168 1176 end; … … 1171 1179 begin 1172 1180 btn := TfraTemplateFieldButton.Create(nil); 1181 (btn as ICPRSDialogComponent).RequiredField := Required; 1173 1182 btn.Parent := Entry.FPanel; 1174 1183 {Clear out embedded fields} … … 1179 1188 btn.Tag := CtrlID; 1180 1189 btn.OnChange := Entry.DoChange; 1190 UpdateColorsFor508Compliance(btn); 1181 1191 ctrl := btn; 1182 1192 end; … … 1192 1202 for i := 0 to TmpSL.Count-1 do 1193 1203 begin 1194 cb := TORCheckBox.Create(nil); 1204 cb := TCPRSDialogCheckBox.Create(nil); 1205 if i = 0 then 1206 (cb as ICPRSDialogComponent).RequiredField := Required; 1195 1207 cb.Parent := Entry.FPanel; 1196 1208 cb.Caption := TmpSL[i]; … … 1210 1222 cb.StringData := NewLine; 1211 1223 cb.OnClick := Entry.DoChange; 1224 UpdateColorsFor508Compliance(cb); 1212 1225 inc(Index); 1213 1226 Entry.FControls.InsertObject(Index, '', cb); … … 1228 1241 if FDateType in DateComboTypes then 1229 1242 begin 1230 dcbo := TORDateCombo.Create(nil); 1243 dcbo := TCPRSDialogDateCombo.Create(nil); 1244 (dcbo as ICPRSDialogComponent).RequiredField := Required; 1231 1245 dcbo.Parent := Entry.FPanel; 1232 1246 dcbo.Tag := CtrlID; … … 1237 1251 dcbo.TemplateField := TRUE; 1238 1252 dcbo.OnChange := Entry.DoChange; 1253 UpdateColorsFor508Compliance(dcbo, TRUE); 1239 1254 ctrl := dcbo; 1240 1255 end 1241 1256 else 1242 1257 begin 1243 dbox := TORDateBox.Create(nil); 1258 dbox := TCPRSDialogDateBox.Create(nil); 1259 (dbox as ICPRSDialogComponent).RequiredField := Required; 1244 1260 dbox.Parent := Entry.FPanel; 1245 1261 dbox.Tag := CtrlID; … … 1254 1270 dbox.Width := (wdth * tmp) + 18; 1255 1271 dbox.OnChange := Entry.DoChange; 1272 UpdateColorsFor508Compliance(dbox, TRUE); 1256 1273 ctrl := dbox; 1257 1274 end; … … 1260 1277 dftNumber: 1261 1278 begin 1262 pnl := TPanel.Create(nil); 1279 pnl := TCPRSDialogNumber.CreatePanel(nil); 1280 (pnl as ICPRSDialogComponent).RequiredField := Required; 1263 1281 pnl.Parent := Entry.FPanel; 1264 1282 pnl.BevelOuter := bvNone; 1265 1283 pnl.Tag := CtrlID; 1266 edt := TEdit.Create(pnl); 1267 edt.Parent := pnl; 1268 edt.BorderStyle := bsNone; 1269 edt.Height := ht; 1270 edt.Width := (wdth * 5 + 4); 1271 edt.Top := 0; 1272 edt.Left := 0; 1273 edt.AutoSelect := True; 1274 ud := TUpDown.Create(pnl); 1275 ud.Parent := pnl; 1276 ud.Associate := edt; 1277 ud.Min := MinVal; 1278 ud.Max := MaxVal; 1279 ud.Min := MinVal; // Both ud.Min settings are needeed! 1284 pnl.Edit.Height := ht; 1285 pnl.Edit.Width := (wdth * 5 + 4); 1286 pnl.UpDown.Min := MinVal; 1287 pnl.UpDown.Max := MaxVal; 1288 pnl.UpDown.Min := MinVal; // Both ud.Min settings are needeed! 1280 1289 i := Increment; 1281 1290 if i < 1 then i := 1; 1282 ud.Increment := i; 1283 ud.Thousands := FALSE; 1284 ud.Position := StrToIntDef(EditDefault, 0); 1285 edt.Tag := Integer(ud); 1286 edt.OnChange := Entry.UpDownChange; 1287 pnl.Height := edt.Height; 1288 pnl.Width := edt.Width + ud.Width; 1291 pnl.UpDown.Increment := i; 1292 pnl.UpDown.Position := StrToIntDef(EditDefault, 0); 1293 pnl.Edit.OnChange := Entry.UpDownChange; 1294 pnl.Height := pnl.Edit.Height; 1295 pnl.Width := pnl.Edit.Width + pnl.UpDown.Width; 1296 UpdateColorsFor508Compliance(pnl, TRUE); 1289 1297 ctrl := pnl; 1290 1298 end; … … 1293 1301 begin 1294 1302 if (FFldType = dftHyperlink) and User.WebAccess then 1295 lbl := T WebLabel.Create(nil)1303 lbl := TCPRSDialogHyperlinkLabel.Create(nil) 1296 1304 else 1297 lbl := T FieldLabel.Create(nil);1305 lbl := TCPRSTemplateFieldLabel.Create(nil); 1298 1306 lbl.Parent := Entry.FPanel; 1299 1307 lbl.ShowAccelChar := FALSE; 1300 lbl. FExclude := FSepLines;1308 lbl.Exclude := FSepLines; 1301 1309 if (FFldType = dftHyperlink) then 1302 1310 begin … … 1313 1321 lbl.Caption := STmp; 1314 1322 end; 1315 if lbl is T WebLabel then1316 T WebLabel(lbl).Init(FURL);1323 if lbl is TCPRSDialogHyperlinkLabel then 1324 TCPRSDialogHyperlinkLabel(lbl).Init(FURL); 1317 1325 lbl.Tag := CtrlID; 1326 UpdateColorsFor508Compliance(lbl); 1318 1327 ctrl := lbl; 1319 1328 end; … … 1321 1330 dftWP: 1322 1331 begin 1323 re := TRichEdit.Create(nil); 1332 re := TCPRSDialogRichEdit.Create(nil); 1333 (re as ICPRSDialogComponent).RequiredField := Required; 1324 1334 re.Parent := Entry.FPanel; 1325 1335 re.Tag := CtrlID; … … 1339 1349 re.Lines.Text := Items; 1340 1350 re.OnChange := Entry.DoChange; 1351 UpdateColorsFor508Compliance(re, TRUE); 1341 1352 ctrl := re; 1342 1353 end; … … 1358 1369 Result := FLocked; 1359 1370 if(not FLocked) then 1360 ShowM essage('Template Field ' + FFldName + ' is currently being edited by another user.');1371 ShowMsg('Template Field ' + FFldName + ' is currently being edited by another user.'); 1361 1372 end 1362 1373 else … … 1707 1718 const 1708 1719 EOL_MARKER = #182; 1720 SR_BREAK = #186; 1709 1721 1710 1722 procedure PanelDestroy(AData: Pointer; Sender: TObject); … … 1737 1749 FControls.Text := Text; 1738 1750 if(FControls.Count > 1) then 1751 begin 1739 1752 for i := 1 to FControls.Count-1 do 1740 1753 FControls[i] := EOL_MARKER + FControls[i]; 1754 if not ScreenReaderSystemActive then 1755 StripScreenReaderCodes(FControls); 1756 end; 1741 1757 FFirstBuild := TRUE; 1742 FPanel := T FieldPanel.Create(AParent.Owner);1758 FPanel := TDlgFieldPanel.Create(AParent.Owner); 1743 1759 FPanel.Parent := AParent; 1744 1760 FPanel.BevelOuter := bvNone; 1745 1761 FPanel.Caption := ''; 1746 1762 FPanel.Font.Assign(FFont); 1763 UpdateColorsFor508Compliance(FPanel, TRUE); 1747 1764 idx := 0; 1748 1765 while (idx < FControls.Count) do … … 1771 1788 FControls[idx] := copy(txt,1,i-1); 1772 1789 if(Fld.Required) then 1790 begin 1791 if ScreenReaderSystemActive then 1792 begin 1793 if Fld.FFldType in [dftCheckBoxes, dftRadioButtons] then 1794 FControls[idx] := FControls[idx] + ScreenReaderStopCode; 1795 end; 1773 1796 FControls[idx] := FControls[idx] + '*'; 1797 end; 1774 1798 Fld.CreateDialogControls(Self, idx, CtrlID); 1775 1799 FControls.Insert(idx+1,copy(txt,i,MaxInt)); … … 1789 1813 end; 1790 1814 inc(idx); 1815 end; 1816 if ScreenReaderSystemActive then 1817 begin 1818 idx := 0; 1819 while (idx < FControls.Count) do 1820 begin 1821 txt := FControls[idx]; 1822 i := pos(ScreenReaderStopCode, txt); 1823 if i > 0 then 1824 begin 1825 FControls[idx] := copy(txt, 1, i-1); 1826 txt := copy(txt, i + ScreenReaderStopCodeLen, MaxInt); 1827 FControls.Insert(idx+1, SR_BREAK + txt); 1828 end; 1829 inc(idx); 1830 end; 1791 1831 end; 1792 1832 end; … … 1867 1907 ind := 0; 1868 1908 end; 1869 if(Ctrl is T FieldLabel) then1870 begin 1871 if not T FieldLabel(Ctrl).Exclude then begin1909 if(Ctrl is TCPRSTemplateFieldLabel) then 1910 begin 1911 if not TCPRSTemplateFieldLabel(Ctrl).Exclude then begin 1872 1912 if emField <> '' then begin 1873 1913 iField := GetTemplateField(emField,FALSE); … … 1884 1924 end; 1885 1925 else {case} 1886 Result := T FieldLabel(Ctrl).Caption1926 Result := TCPRSTemplateFieldLabel(Ctrl).Caption 1887 1927 end; {case iField.FldType} 1888 1928 end {if emField} 1889 1929 else 1890 Result := T FieldLabel(Ctrl).Caption;1930 Result := TCPRSTemplateFieldLabel(Ctrl).Caption; 1891 1931 end; 1892 1932 end … … 2014 2054 end; 2015 2055 2016 function TTemplateDialogEntry.GetPanel(MaxLen: integer; AParent: TWinControl): TPanel; 2017 var 2018 i, x, y, cnt, idx, ind, yinc, ybase, MaxX: integer; 2056 function TTemplateDialogEntry.GetPanel(MaxLen: integer; AParent: TWinControl; 2057 OwningCheckBox: TCPRSDialogParentCheckBox): TDlgFieldPanel; 2058 var 2059 i, x, y, cnt, idx, ind, yinc, ybase, MaxX: integer; 2019 2060 MaxTextLen: integer; {Max num of chars per line in pixels} 2020 2061 MaxChars: integer; {Max num of chars per line} … … 2022 2063 ctrl: TControl; 2023 2064 LastLineBlank: boolean; 2065 sLbl: TCPRSDialogStaticLabel; 2066 nLbl: TVA508ChainedLabel; 2067 sLblHeight: integer; 2068 TabOrdr: integer; 2069 2024 2070 const 2025 2071 FOCUS_RECT_MARGIN = 2; {The margin around the panel so the label won't 2026 2072 overlay the focus rect on its parent panel.} 2073 2074 procedure Add2TabOrder(ctrl: TWinControl); 2075 begin 2076 ctrl.TabOrder := TabOrdr; 2077 inc(TabOrdr); 2078 end; 2079 2080 function StripSRCode(var txt: string; code: string; len: integer): integer; 2081 begin 2082 Result := pos(code, txt); 2083 if Result > 0 then 2084 begin 2085 delete(txt,Result,len); 2086 dec(Result); 2087 end 2088 else 2089 Result := -1; 2090 end; 2091 2027 2092 procedure DoLabel(Atxt: string); 2028 2093 var 2029 lbl: TLabel; 2030 2031 begin 2032 lbl := TLabel.Create(nil); 2033 lbl.Parent := FPanel; 2034 lbl.ShowAccelChar := FALSE; 2035 lbl.Caption := Atxt; 2036 lbl.Left := x; 2037 lbl.Top := y; 2038 inc(x, lbl.Width); 2039 end; 2040 2041 procedure NextLine; 2042 begin 2043 if(MaxX < x) then 2044 MaxX := x; 2045 x := FOCUS_RECT_MARGIN; {leave two pixels on the left for the Focus Rect} 2046 inc(y, yinc); 2047 yinc := ybase; 2048 end; 2049 2050 begin 2051 MaxTextLen := MaxLen - (FOCUS_RECT_MARGIN * 2);{save room for the focus rectangle on the panel} 2052 if(FFirstBuild or (FPanel.Width <> MaxLen)) then 2094 ctrl: TControl; 2095 tempLbl: TVA508ChainedLabel; 2096 2097 begin 2098 if ScreenReaderSystemActive then 2099 begin 2100 if assigned(sLbl) then 2101 begin 2102 tempLbl := TVA508ChainedLabel.Create(nil); 2103 if assigned(nLbl) then 2104 nLbl.NextLabel := tempLbl 2105 else 2106 sLbl.NextLabel := tempLbl; 2107 nLbl := tempLbl; 2108 ctrl := nLbl; 2109 end 2110 else 2111 begin 2112 sLbl := TCPRSDialogStaticLabel.Create(nil); 2113 ctrl := sLbl; 2114 end; 2115 end 2116 else 2117 ctrl := TLabel.Create(nil); 2118 SetOrdProp(ctrl, ShowAccelCharProperty, ord(FALSE)); 2119 SetStrProp(ctrl, CaptionProperty, Atxt); 2120 ctrl.Parent := FPanel; 2121 ctrl.Left := x; 2122 ctrl.Top := y; 2123 if ctrl = sLbl then 2124 begin 2125 Add2TabOrder(sLbl); 2126 sLbl.Height := sLblHeight; 2127 ScreenReaderSystem_CurrentLabel(sLbl); 2128 end; 2129 if ScreenReaderSystemActive then 2130 ScreenReaderSystem_AddText(Atxt); 2131 UpdateColorsFor508Compliance(ctrl); 2132 inc(x, ctrl.Width); 2133 end; 2134 2135 procedure Init; 2136 var 2137 lbl : TLabel; 2053 2138 begin 2054 2139 if(FFirstBuild) then … … 2061 2146 //ybase := FontHeightPixel(FFont.Handle) + 1 + (FOCUS_RECT_MARGIN * 2); AGP commentout line for 2062 2147 //reminder spacing 2063 ybase := FontHeightPixel(FFont.Handle) ;2148 ybase := FontHeightPixel(FFont.Handle) + 2; 2064 2149 yinc := ybase; 2065 2150 LastLineBlank := FALSE; 2151 sLbl := nil; 2152 nLbl := nil; 2153 TabOrdr := 0; 2154 if ScreenReaderSystemActive then 2155 begin 2156 ScreenReaderSystem_CurrentCheckBox(OwningCheckBox); 2157 lbl := TLabel.Create(nil); 2158 try 2159 lbl.Parent := FPanel; 2160 sLblHeight := lbl.Height + 2; 2161 finally 2162 lbl.Free; 2163 end; 2164 2165 end; 2166 end; 2167 2168 procedure Text508Work; 2169 var 2170 ContinueCode: boolean; 2171 begin 2172 if StripCode(txt, SR_BREAK) then 2173 begin 2174 ScreenReaderSystem_Stop; 2175 nLbl := nil; 2176 sLbl := nil; 2177 end; 2178 2179 ContinueCode := FALSE; 2180 while StripSRCode(txt, ScreenReaderContinueCode, ScreenReaderContinueCodeLen) >= 0 do 2181 ContinueCode := TRUE; 2182 while StripSRCode(txt, ScreenReaderContinueCodeOld, ScreenReaderContinueCodeOldLen) >= 0 do 2183 ContinueCode := TRUE; 2184 if ContinueCode then 2185 ScreenReaderSystem_Continue; 2186 end; 2187 2188 procedure Ctrl508Work(ctrl: TControl); 2189 var 2190 lbl: TCPRSTemplateFieldLabel; 2191 begin 2192 if (Ctrl is TCPRSTemplateFieldLabel) and (not (Ctrl is TCPRSDialogHyperlinkLabel)) then 2193 begin 2194 lbl := Ctrl as TCPRSTemplateFieldLabel; 2195 if trim(lbl.Caption) <> '' then 2196 begin 2197 ScreenReaderSystem_CurrentLabel(lbl); 2198 ScreenReaderSystem_AddText(lbl.Caption); 2199 end 2200 else 2201 begin 2202 lbl.TabStop := FALSE; 2203 ScreenReaderSystem_Stop; 2204 end; 2205 end 2206 else 2207 begin 2208 if ctrl is TWinControl then 2209 Add2TabOrder(TWinControl(ctrl)); 2210 if Supports(ctrl, ICPRSDialogComponent) then 2211 ScreenReaderSystem_CurrentComponent(ctrl as ICPRSDialogComponent); 2212 end; 2213 sLbl := nil; 2214 nLbl := nil; 2215 end; 2216 2217 procedure NextLine; 2218 begin 2219 if(MaxX < x) then 2220 MaxX := x; 2221 x := FOCUS_RECT_MARGIN; {leave two pixels on the left for the Focus Rect} 2222 inc(y, yinc); 2223 yinc := ybase; 2224 end; 2225 2226 begin 2227 MaxTextLen := MaxLen - (FOCUS_RECT_MARGIN * 2);{save room for the focus rectangle on the panel} 2228 if(FFirstBuild or (FPanel.Width <> MaxLen)) then 2229 begin 2230 Init; 2066 2231 for i := 0 to FControls.Count-1 do 2067 2232 begin 2068 2233 txt := FControls[i]; 2069 if(copy(txt,1,1) = EOL_MARKER) then 2234 if ScreenReaderSystemActive then 2235 Text508Work; 2236 if StripCode(txt,EOL_MARKER) then 2070 2237 begin 2071 2238 if((x <> 0) or LastLineBlank) then 2072 2239 NextLine; 2073 delete(txt,1,1);2074 2240 LastLineBlank := (txt = ''); 2075 2241 end; … … 2120 2286 if(assigned(ctrl)) then 2121 2287 begin 2288 if ScreenReaderSystemActive then 2289 Ctrl508Work(ctrl); 2122 2290 idx := FIndents.IndexOfObject(Ctrl); 2123 2291 if idx >= 0 then … … 2137 2305 inc(x, Ctrl.Width + 4); 2138 2306 if yinc <= Ctrl.Height then 2139 yinc := Ctrl.Height + 1;2307 yinc := Ctrl.Height + 2; 2140 2308 if (x < MaxLen) and ((Ctrl is TRichEdit) or 2141 2309 ((Ctrl is TLabel) and (pos(CRLF, TLabel(Ctrl).Caption) > 0))) then … … 2150 2318 if(FFieldValues <> '') then 2151 2319 SetFieldValues(FFieldValues); 2320 if ScreenReaderSystemActive then 2321 ScreenReaderSystem_Stop; 2152 2322 Result := FPanel; 2153 2323 end; … … 2162 2332 i, idx: integer; 2163 2333 obj: TObject; 2334 max: integer; 2164 2335 2165 2336 begin 2166 2337 if(assigned(FPanel)) then 2167 2338 begin 2168 for i := FPanel.ControlCount-1 downto 0 do 2169 if(FPanel.Controls[i] is TLabel) then 2339 max := FPanel.ControlCount-1; 2340 for i := max downto 0 do 2341 begin 2342 // deleting TVA508StaticText can delete several TVA508ChainedLabel components 2343 if i < FPanel.ControlCount then 2170 2344 begin 2171 2345 obj := FPanel.Controls[i]; 2172 idx := FControls.IndexOfObject(obj); 2173 if idx < 0 then 2174 obj.Free; 2175 end; 2346 if (not (obj is TVA508ChainedLabel)) and 2347 ((obj is TLabel) or (obj is TVA508StaticText)) then 2348 begin 2349 idx := FControls.IndexOfObject(obj); 2350 if idx < 0 then 2351 obj.Free; 2352 end; 2353 end; 2354 end; 2176 2355 end; 2177 2356 end; … … 2188 2367 M.Data := Self; 2189 2368 M.Code := @PanelDestroy; 2190 TFieldPanel(FPanel).OnDestroy := TNotifyEvent(M);2369 FPanel.OnDestroy := TNotifyEvent(M); 2191 2370 end 2192 2371 else 2193 TFieldPanel(FPanel).OnDestroy := nil;2372 FPanel.OnDestroy := nil; 2194 2373 end; 2195 2374 … … 2232 2411 begin 2233 2412 Done := FALSE; 2413 TORCheckBox(Ctrl).Checked := FALSE; //<-PSI-06-170-ADDED THIS LINE - v27.23 - RV 2234 2414 if(cnt = 0) then 2235 2415 cnt := DelimCount(AText, '|') + 1; … … 2278 2458 end; 2279 2459 2460 function TTemplateDialogEntry.StripCode(var txt: string; code: char): boolean; 2461 var 2462 p: integer; 2463 begin 2464 p := pos(code, txt); 2465 Result := (p > 0); 2466 if Result then 2467 begin 2468 while p > 0 do 2469 begin 2470 delete(txt, p, 1); 2471 p := pos(code, txt); 2472 end; 2473 end; 2474 end; 2475 2280 2476 procedure TTemplateDialogEntry.UpDownChange(Sender: TObject); 2281 2477 begin 2282 2478 EnsureText(TEdit(Sender), TUpDown(TEdit(Sender).Tag)); 2283 2479 DoChange(Sender); 2284 end;2285 2286 { TFieldPanel }2287 2288 destructor TFieldPanel.Destroy;2289 begin2290 if(assigned(FOnDestroy)) then2291 FOnDestroy(Self);2292 inherited;2293 end;2294 2295 {intercept the paint event to draw the focus rect if FFocused is true}2296 function TFieldPanel.GetFocus: boolean;2297 begin2298 result := Focused;2299 end;2300 2301 procedure TFieldPanel.Paint;2302 var2303 DC: HDC;2304 R: TRect;2305 2306 begin2307 inherited;2308 if(Focused) then2309 begin2310 if(not assigned(FCanvas)) then2311 FCanvas := TControlCanvas.Create;2312 DC := GetWindowDC(Handle);2313 try2314 FCanvas.Handle := DC;2315 R := ClientRect;2316 InflateRect(R, -1, -1);2317 FCanvas.DrawFocusRect(R);2318 finally2319 ReleaseDC(Handle, DC);2320 end;2321 end;2322 end;2323 2324 procedure TFieldPanel.SetTheFocus(const Value: boolean);2325 begin2326 if Value then2327 SetFocus;2328 end;2329 2330 { TWebLabel }2331 2332 procedure TWebLabel.Clicked(Sender: TObject);2333 begin2334 GotoWebPage(FAddr);2335 end;2336 2337 procedure TWebLabel.Init(Addr: string);2338 begin2339 FAddr := Addr;2340 OnClick := Clicked;2341 Font.Assign(TORExposedControl(Parent).Font);2342 Font.Color := clActiveCaption;2343 Font.Style := Font.Style + [fsUnderline];2344 AdjustBounds; // make sure we have the right width2345 AutoSize := FALSE;2346 Height := Height + 1; // Courier New doesn't support underline unless it's higher2347 Cursor := crHandPoint;2348 2480 end; 2349 2481 … … 2371 2503 end; 2372 2504 2505 procedure StripScreenReaderCodes(var Text: string); 2506 var 2507 p, j: integer; 2508 begin 2509 for j := low(ScreenReaderCodes) to high(ScreenReaderCodes) do 2510 begin 2511 p := 1; 2512 while (p > 0) do 2513 begin 2514 p := posex(ScreenReaderCodes[j], Text, p); 2515 if p > 0 then 2516 delete(Text, p, ScreenReaderCodeLens[j]); 2517 end; 2518 end; 2519 end; 2520 2521 procedure StripScreenReaderCodes(SL: TStrings); 2522 var 2523 temp: string; 2524 i: integer; 2525 2526 begin 2527 for i := 0 to SL.Count - 1 do 2528 begin 2529 temp := SL[i]; 2530 StripScreenReaderCodes(temp); 2531 SL[i] := temp; 2532 end; 2533 end; 2534 2535 function HasScreenReaderBreakCodes(SL: TStrings): boolean; 2536 var 2537 i: integer; 2538 2539 begin 2540 Result := TRUE; 2541 for i := 0 to SL.Count - 1 do 2542 begin 2543 if pos(ScreenReaderCodeSignature, SL[i]) > 0 then 2544 exit; 2545 end; 2546 Result := FALSE; 2547 end; 2548 2373 2549 initialization 2374 2550 -
cprs/trunk/CPRS-Chart/Templates/uTemplates.pas
r456 r829 253 253 function MakeXMLParamTIU(ADCSummID: string; ADCSummRec: TEditDCSummRec): string; overload; 254 254 function GetXMLParamReturnValueTIU(DocInfo, ParamTag: string): string; 255 procedure UpdatePersonalObjects; 256 procedure SetTemplateDialogCanceled(value: Boolean); 257 function WasTemplateDialogCanceled: Boolean; 258 procedure SetTemplateBPHasObjects(value: Boolean); 259 function TemplateBPHasObjects: Boolean; 255 260 256 261 const … … 278 283 ConsultsTemplate: TTemplate = nil; 279 284 ProceduresTemplate: TTemplate = nil; 285 uPersonalObjects: TStringList = nil; // -------- CQ #8665 - RV ------------ 280 286 281 287 implementation … … 283 289 uses 284 290 Windows, rTemplates, uCore, dShared, fTemplateDialog, ActiveX, ComObj, uTemplateFields, 285 XMLUtils, fTemplateImport, Word97, uSpell, rCore, uConst, ORCtrls, uEventHooks, 286 fReminderDialog, rODBase; 291 XMLUtils, fTemplateImport, uSpell, rCore, uConst, ORCtrls, uEventHooks, 292 fReminderDialog, rODBase 293 {$IFDEF VER140} 294 , Word97; 295 {$ELSE} 296 , WordXP, VAUtils; 297 {$ENDIF} 287 298 288 299 const … … 311 322 uDGroupConsults: integer = 0; 312 323 uDGroupProcedures: integer = 0; 324 uTemplateDialogCanceled: Boolean = FALSE; 325 uTemplateBPHasObjects: Boolean = FALSE; 313 326 314 327 type … … 531 544 try 532 545 GetTemplateRoots; 533 TmpSL.Assign(RPCBrokerV.Results);546 FastAssign(RPCBrokerV.Results, TmpSL); 534 547 for i := 0 to TmpSL.Count-1 do 535 548 AddTemplate(TmpSL[i]); … … 559 572 try 560 573 GetTemplateChildren(tmpl.FID); 561 TmpSL.Assign(RPCBrokerV.Results);574 FastAssign(RPCBrokerV.Results, TmpSL); 562 575 for i := 0 to TmpSL.Count-1 do 563 576 AddTemplate(TmpSL[i], tmpl); … … 597 610 TempSL := nil; 598 611 end; 612 // -------- CQ #8665 - RV ------------ 613 if (assigned(uPersonalObjects)) then 614 begin 615 KillObj(@uPersonalObjects); 616 uPersonalObjects.Free; 617 uPersonalObjects := nil; 618 end; 619 // ------end CQ #8665 ------------ 599 620 if(assigned(Deleted)) then 600 621 begin … … 721 742 begin 722 743 if(assigned(Errors)) then 723 ShowM essage(Errors.text)744 ShowMsg(Errors.text) 724 745 else 725 ShowM essage(SingleError);746 ShowMsg(SingleError); 726 747 end; 727 748 … … 865 886 else 866 887 DescSL.Add('5,1=@'); 867 TempSL.AddStrings(DescSL)888 FastAddStrings(DescSL, TempSL) 868 889 finally 869 890 DescSL.Free; … … 1173 1194 WApp.Connect; 1174 1195 TmpVar := AFileName; 1196 {$IFDEF VER140} 1175 1197 WDoc.ConnectTo(WApp.Documents.Add(TmpVar, EmptyParam)); 1198 {$ELSE} 1199 WDoc.ConnectTo(WApp.Documents.Add(TmpVar, EmptyParam, EmptyParam, EmptyParam)); 1200 {$ENDIF} 1176 1201 ffTotal := WDoc.FormFields.Count; 1177 1202 … … 1307 1332 if tmp <> '' then 1308 1333 AddField(tfDefault, tmp); 1309 F ields.AddStrings(PendingAdd);1334 FastAddStrings(PendingAdd, Fields); 1310 1335 PendingAdd.Clear; 1311 1336 AddFieldHeader(tmpType, FALSE); … … 1396 1421 begin 1397 1422 Fields[0] := Fields[0] + IntToStr(Integer(FldCache.Objects[i])) + '">'; 1398 Data.AddStrings(Fields);1423 FastAddStrings(Fields, Data); 1399 1424 end; 1400 1425 end; … … 1486 1511 1487 1512 begin 1513 SetTemplateDialogCanceled(FALSE); 1514 SetTemplateBPHasObjects(FALSE); 1488 1515 Template := GetLinkedTemplate(IntToStr(IEN), LType); 1489 1516 if assigned(Template) then … … 1878 1905 try 1879 1906 TmpSL.Text := FullBoilerPlate; 1907 if Pos('|', TmpSL.Text) > 0 then SetTemplateBPHasObjects(TRUE); 1880 1908 finally 1881 1909 if(IsDialog) then … … 2550 2578 dmodShared.OnTemplateLock(Self) 2551 2579 else 2552 ShowM essage(Format(TemplateLockedText, [FPrintName]));2580 ShowMsg(Format(TemplateLockedText, [FPrintName])); 2553 2581 end; 2554 2582 end … … 2875 2903 end; 2876 2904 2905 // -------- CQ #8665 - RV ------------ 2906 procedure UpdatePersonalObjects; 2907 var 2908 i: integer; 2909 begin 2910 if not assigned(uPersonalObjects) then 2911 begin 2912 uPersonalObjects := TStringList.Create; 2913 GetAllowedPersonalObjects; 2914 for i := 0 to RPCBrokerV.Results.Count-1 do 2915 uPersonalObjects.Add(Piece(RPCBrokerV.Results[i],U,1)); 2916 uPersonalObjects.Sorted := TRUE; 2917 end; 2918 end; 2919 // -----end CQ #8665 ------------ 2920 2921 2922 procedure SetTemplateDialogCanceled(value: Boolean); 2923 begin 2924 uTemplateDialogCanceled := value; 2925 end; 2926 2927 function WasTemplateDialogCanceled: Boolean; 2928 begin 2929 Result := uTemplateDialogCanceled; 2930 end; 2931 2932 procedure SetTemplateBPHasObjects(value: Boolean); 2933 begin 2934 uTemplateBPHasObjects := value; 2935 end; 2936 2937 function TemplateBPHasObjects: Boolean; 2938 begin 2939 Result := uTemplateBPHasObjects; 2940 end; 2941 2877 2942 initialization 2878 2943 2879 2944 finalization 2880 2945 ReleaseTemplates; 2881 2882 2946 end. 2947
Note:
See TracChangeset
for help on using the changeset viewer.