Procedure

TfrmTemplateEditor.cbxLinkExit

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Visibility

Public/Published

Owner

TfrmTemplateEditor

Declaration

procedure cbxLinkExit(Sender: TObject);

Calls Hierarchy


TfrmTemplateEditor.cbxLinkExit
 ├TTemplate.CanModify
 │ ├TTemplate.ValidID
 │ └LockTemplate
 ├GetLinkedTemplate
 │ ├GetLinkedTemplateData
 │ └AddTemplate
 │   ├TTemplate.Create
 │   │ └TTemplate.ReminderDialogIEN
 │   └TTemplate.AddChild
 │     └TTemplate.GetItems
 │       └ExpandTemplate
 │         ├TTemplate.GetChildren
 │         ├GetTemplateChildren
 │         ├AddTemplate...
 │         └TTemplate.ItemIENs
 │           └TTemplate.GetItems...
 ├GetLinkName
 │ └ExternalName
 ├TTemplate.LinkIEN
 ├TTemplate.SetFileLink
 │ └TTemplate.AssignFileLink
 │   ├TTemplate.CanModify...
 │   ├TTemplate.ValidID
 │   ├TTemplate.LinkType
 │   ├TTemplate.SetReminderDialog
 │   │ ├TTemplate.CanModify...
 │   │ ├TTemplate.ValidID
 │   │ ├TTemplate.ReminderDialogIEN
 │   │ ├TTemplate.LinkType
 │   │ └TTemplate.SetFileLink...
 │   ├TTemplate.GetItems...
 │   └..(rec)..
 ├ConvertFileLink
 └TfrmTemplateEditor.UpdateApply
   └TTemplate.Changed
     ├TTemplate.ValidID
     └TTemplate.ItemIENs...

Calls

Name Declaration Comments
TTemplate.CanModify function CanModify: boolean; -
ConvertFileLink function ConvertFileLink(IEN: string; LType: TTemplateLinkType): string; -
GetLinkedTemplate function GetLinkedTemplate(IEN: string; LType: TTemplateLinkType): TTemplate; -
GetLinkName function GetLinkName(IEN: string; LType: TTemplateLinkType): string; -
TTemplate.LinkIEN function LinkIEN: string; -
TTemplate.SetFileLink procedure SetFileLink(const Value: string); -
TfrmTemplateEditor.UpdateApply procedure UpdateApply(Template: TTemplate); -


Source

4197  procedure TfrmTemplateEditor.cbxLinkExit(Sender: TObject);
4198  var
4199    Template, LinkTemplate: TTemplate;
4200    update: boolean;
4201  
4202  begin
4203    if ((not FUpdating) and (assigned(FCurTree)) and (assigned(FCurTree.Selected)) and
4204      (FCurTree = tvShared)) then
4205    begin
4206      Template := TTemplate(FCurTree.Selected.Data);
4207      if assigned(Template) and Template.CanModify then
4208      begin
4209        update := true;
4210        if cbxLink.ItemIEN > 0 then
4211        begin
4212          LinkTemplate := GetLinkedTemplate(cbxLink.ItemID, TTemplateLinkType(pnlLink.tag));
4213          if (assigned(LinkTemplate) and (LinkTemplate <> Template)) then
4214          begin
4215            ShowMsg(GetLinkName(cbxLink.ItemID, TTemplateLinkType(pnlLink.tag)) +
4216              ' is already assigned to another template.');
4217            cbxLink.SetFocus;
4218            cbxLink.SelectByID(Template.LinkIEN);
4219            update := False;
4220          end
4221          else
4222          begin
4223            Template.FileLink := ConvertFileLink(cbxLink.ItemID, TTemplateLinkType(pnlLink.tag));
4224            if Template.LinkName <> '' then
4225              edtName.Text := copy(Template.LinkName, 1, edtName.MaxLength);
4226          end;
4227        end
4228        else
4229          Template.FileLink := '';
4230        if update then
4231          UpdateApply(Template);
4232      end;
4233    end;
4234  end;