Procedure

GetText

Module

fTemplateDialog

Last Modified

7/15/2014 3:26:44 PM

Scope

Global

Declaration

procedure GetText(SL: TStrings; IncludeEmbeddedFields: Boolean);

Calls Hierarchy


GetText
 └ResolveTemplateFields
   ├TTemplateDialogEntry.GetControlText
   │ ├GetTemplateField
   │ │ ├LoadTemplateFieldByIEN
   │ │ ├LoadTemplateField
   │ │ └TTemplateField.Create
   │ │   ├TemplateFieldCode2Field
   │ │   └TemplateDateCode2DateType
   │ ├GetOriginalItem
   │ │ ├GetTemplateField...
   │ │ └StripEmbedded
   │ └TfraTemplateFieldButton.GetButtonText
   ├GetTemplateField...
   ├AddNewTxt
   └WordWrapText
     └WrappedText

Called-By Hierarchy


                                           GetText
                                DoTemplateDialog┤ 
                       CheckBoilerplate4Fields┤ │ 
                         DoTemplateDialog...┤ │ │ 
                            ShowTemplateData┘ │ │ 
       TfrmDrawers.mnuPreviewTemplateClick┤   │ │ 
      TfrmDCSumm.popSummMemoPreviewClick┤ │   │ │ 
    TfrmConsults.popNoteMemoPreviewClick┤ │   │ │ 
     TfrmSurgery.popNoteMemoPreviewClick┤ │   │ │ 
       TfrmNotes.popNoteMemoPreviewClick┘ │   │ │ 
          TfrmTemplateEditor.mnuBPTryClick┘   │ │ 
        TfrmTemplateEditor.tvTreeKeyDown┘     │ │ 
                             TTemplate.GetText┘ │ 
                ExecuteTemplateOrBoilerPlate┤   │ 
                      TfrmDrawers.InsertText┤   │ 
           TfrmDrawers.tvTemplatesDblClick┤ │   │ 
            TfrmDrawers.tvTemplatesKeyDown┤ │   │ 
                TfrmDrawers.NewRECDragDrop┤ │   │ 
          TfrmDrawers.SetRichEditControl┘ │ │   │ 
                 TfrmDCSumm.FormCreate┤   │ │   │ 
               TfrmConsults.FormCreate┤   │ │   │ 
                TfrmSurgery.FormCreate┤   │ │   │ 
                  TfrmNotes.FormCreate┘   │ │   │ 
        TfrmDrawers.mnuInsertTemplateClick┘ │   │ 
  TfrmDCSumm.popSummMemoInsTemplateClick┤   │   │ 
TfrmConsults.popNoteMemoInsTemplateClick┤   │   │ 
 TfrmSurgery.popNoteMemoInsTemplateClick┤   │   │ 
   TfrmNotes.popNoteMemoInsTemplateClick┘   │   │ 
      TfrmDrawers.mnuPreviewTemplateClick...┤   │ 
            TfrmDrawers.mnuCopyTemplateClick┤   │ 
         TfrmTemplateEditor.mnuBPTryClick...┘   │ 
              TfrmTemplateDialog.btnPreviewClick┘ 

Calls

Name Declaration Comments
ResolveTemplateFields function ResolveTemplateFields(Text: string; AutoWrap: boolean; Hidden: boolean = FALSE; IncludeEmbedded: boolean = FALSE): string; -

Called-By

Name Declaration Comments
TfrmTemplateDialog.btnPreviewClick procedure btnPreviewClick(Sender: TObject); -
DoTemplateDialog function DoTemplateDialog(SL: TStrings; const CaptionText: string; PreviewMode: boolean = FALSE): boolean; -


Source

95    procedure GetText(SL: TStrings; IncludeEmbeddedFields: Boolean);
96    var
97      i, p1, p2: integer;
98      Txt, tmp: string;
99      Save, Hidden: boolean;
100     TmpCtrl: TStringList;
101   
102   begin
103     Txt := SL.Text;
104     SL.Clear;
105     TmpCtrl := TStringList.Create;
106     try
107       for i := 0 to frmTemplateDialog.sbMain.ControlCount-1 do
108         with frmTemplateDialog.sbMain do
109         begin
110           tmp := IntToStr(Controls[i].Tag);
111           tmp := StringOfChar('0', 7-length(tmp)) + tmp;
112           TmpCtrl.AddObject(tmp, Controls[i]);
113         end;
114       TmpCtrl.Sort;
115       for i := 0 to TmpCtrl.Count-1 do
116       begin
117         Save := FALSE;
118         if(TmpCtrl.Objects[i] is TORCheckBox) and (TORCheckBox(TmpCtrl.Objects[i]).Checked) then
119           Save := TRUE
120         else
121         if(frmTemplateDialog.OneOnly and (TmpCtrl.Objects[i] is TPanel)) then
122           Save := TRUE;
123         if(Save) then
124         begin
125           tmp := Piece(frmTemplateDialog.Index,U,TControl(TmpCtrl.Objects[i]).Tag);
126           p1 := StrToInt(Piece(tmp,'~',1));
127           p2 := StrToInt(Piece(tmp,'~',2));
128           Hidden := (copy(Piece(tmp,'~',3),2,1)=BOOLCHAR[TRUE]);
129           SL.Text := SL.Text + ResolveTemplateFields(Copy(Txt,p1,p2), FALSE, Hidden, IncludeEmbeddedFields);
130         end;
131       end;
132     finally
133       TmpCtrl.Free;
134     end;
135   end;