Procedure

TfrmTemplateEditor.cbxTypeChange

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Visibility

Public/Published

Owner

TfrmTemplateEditor

Declaration

procedure cbxTypeChange(Sender: TObject);

Calls Hierarchy


TfrmTemplateEditor.cbxTypeChange
 ├TfrmTemplateEditor.CanClone
 │ ├GetFirstPersonalNode
 │ │ └..(rec)..
 │ └TTemplate.CanModify
 │   ├TTemplate.ValidID
 │   └LockTemplate
 ├TfrmTemplateEditor.GetLinkType
 ├TfrmTemplateEditor.Clone
 │ ├TfrmTemplateEditor.CanClone...
 │ ├..(rec)..
 │ ├TTemplate.CanModify...
 │ ├TTemplate.Clone
 │ │ ├TTemplate.TrueClone
 │ │ │ ├TTemplate.GetChildren
 │ │ │ ├TTemplate.Create
 │ │ │ │ └TTemplate.ReminderDialogIEN
 │ │ │ ├TTemplate.SetBoilerplate
 │ │ │ │ ├TTemplate.CanModify...
 │ │ │ │ └TTemplate.ValidID
 │ │ │ ├TTemplate.GetBoilerplate
 │ │ │ │ └GetTemplateBoilerplate
 │ │ │ ├TTemplate.SetDescription
 │ │ │ │ ├TTemplate.CanModify...
 │ │ │ │ └TTemplate.ValidID
 │ │ │ └TTemplate.GetDescription
 │ │ │   └LoadTemplateDescription
 │ │ ├TTemplate.GetItems
 │ │ │ └ExpandTemplate
 │ │ │   ├TTemplate.GetChildren
 │ │ │   ├GetTemplateChildren
 │ │ │   ├AddTemplate
 │ │ │   │ ├TTemplate.Create...
 │ │ │   │ └TTemplate.AddChild
 │ │ │   │   └TTemplate.GetItems...
 │ │ │   └TTemplate.ItemIENs
 │ │ │     └TTemplate.GetItems...
 │ │ └TTemplate.BackupItems
 │ │   └TTemplate.ItemIENs...
 │ ├TTemplate.RemoveNode
 │ ├MarkDeleted
 │ │ ├TTemplate.ValidID
 │ │ ├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)..
 │ │ ├TTemplate.GetItems...
 │ │ └..(rec)..
 │ ├TTemplate.AddNode
 │ ├TTemplate.GetItems...
 │ └TfrmTemplateEditor.ShowTemplateType
 ├TTemplate.CanModify...
 ├TTemplate.SetDialog
 │ ├TTemplate.CanModify...
 │ └TTemplate.ValidID
 ├TTemplate.SetRealType
 │ ├TTemplate.CanModify...
 │ ├TTemplate.ValidID
 │ └TTemplate.SetFileLink...
 ├TfrmTemplateEditor.UpdateApply
 │ └TTemplate.Changed
 │   ├TTemplate.ValidID
 │   └TTemplate.ItemIENs...
 ├TdmodShared.ImgIdx
 │ ├COMObjectOK
 │ └TTemplate.GetTemplateType
 └TfrmTemplateEditor.tvTreeChange
   ├TfrmTemplateEditor.ChangeTree
   ├TfrmTemplateEditor.IsTemplateLocked
   │ ├TTemplate.AutoLock
   │ │ └TTemplate.LinkType
   │ ├TTemplate.IsLocked
   │ │ └TTemplate.AutoLock...
   │ └..(rec)..
   ├TfrmTemplateEditor.EnableControls
   │ ├TfrmTemplateEditor.UpdateInsertsDialogs
   │ │ ├TfrmTemplateObjects.UpdateStatus
   │ │ └TfrmTemplateFields.UpdateStatus
   │ │   └TfrmTemplateFields.ValidInsert
   │ └TfrmTemplateEditor.EnableNavControls
   │   └TfrmTemplateEditor.AllowMove
   │     ├TfrmTemplateEditor.IsTemplateLocked...
   │     └TTemplate.GetItems...
   └TfrmTemplateEditor.ShowInfo
     ├TfrmTemplateEditor.ShowTemplateType
     ├TfrmTemplateEditor.GetLinkType
     ├LoadServiceListWithSynonyms
     ├TTemplate.LinkName
     │ ├GetLinkName
     │ │ └ExternalName
     │ ├TTemplate.LinkIEN
     │ └TTemplate.LinkType
     ├TTemplate.LinkIEN
     ├TTemplate.GetDescription...
     ├TTemplate.IsLocked...
     ├TTemplate.AutoLock...
     ├TfrmTemplateEditor.IsTemplateLocked...
     ├TTemplate.GetChildren
     ├TTemplate.ReminderDialogIEN
     ├TdmodShared.InDialog
     │ └TTemplate.IsDialog
     ├TTemplate.GetBoilerplate...
     ├TfrmTemplateEditor.DisplayBoilerplate
     │ ├TfrmTemplateEditor.pnlBoilerplateResize
     │ ├TTemplate.GetBoilerplate...
     │ ├TTemplate.FullBoilerplate
     │ │ ├TTemplate.GetBoilerplate...
     │ │ ├TTemplate.ItemBoilerplate
     │ │ │ ├TTemplate.GetItems...
     │ │ │ ├TTemplate.GetTemplateType
     │ │ │ ├DlgText
     │ │ │ └TTemplate.DialogProperties
     │ │ │   ├TTemplate.GetBoilerplate...
     │ │ │   └TTemplate.DlgID
     │ │ ├DlgText
     │ │ └TTemplate.DialogProperties...
     │ ├TfrmTemplateEditor.UpdateInsertsDialogs...
     │ ├TfrmTemplateEditor.ShowBoilerPlate
     │ └TfrmTemplateEditor.ShowGroupBoilerplate
     ├TfrmTemplateEditor.ShowGroupBoilerplate
     └TfrmTemplateEditor.pnlBoilerplateResize

Calls

Name Declaration Comments
TfrmTemplateEditor.CanClone function CanClone(const Node: TTreeNode): boolean; -
TTemplate.CanModify function CanModify: boolean; -
TfrmTemplateEditor.Clone function Clone(Node: TTreeNode): boolean; -
TfrmTemplateEditor.GetLinkType function GetLinkType(const ANode: TTreeNode): TTemplateLinkType; -
TdmodShared.ImgIdx function ImgIdx(Node: TTreeNode): integer; -
TTemplate.SetDialog procedure SetDialog(const Value: boolean); -
TTemplate.SetRealType procedure SetRealType(const Value: TTemplateType); -
TfrmTemplateEditor.tvTreeChange procedure tvTreeChange(Sender: TObject; Node: TTreeNode); -
TfrmTemplateEditor.UpdateApply procedure UpdateApply(Template: TTemplate); -


Source

3782  procedure TfrmTemplateEditor.cbxTypeChange(Sender: TObject);
3783  var
3784    i, tg: integer;
3785    Template: TTemplate;
3786    ttyp: TTemplateType;
3787    Node: TTreeNode;
3788    idx: TTypeIndex;
3789  
3790  begin
3791    if ((not FUpdating) and (assigned(FCurTree)) and (assigned(FCurTree.Selected))) then
3792    begin
3793      tg := cbxType.ItemIndex;
3794      if tg >= 0 then
3795      begin
3796        if CanClone(FCurTree.Selected) then
3797        begin
3798          idx := IdxForced[FForceContainer, tg];
3799          if (idx = tiRemDlg) and (not (GetLinkType(FCurTree.Selected) in [ltNone, ltTitle])) then
3800          begin
3801            FUpdating := TRUE;
3802            try
3803              cbxType.ItemIndex := ord(tiTemplate);
3804            finally
3805              FUpdating := FALSE;
3806            end;
3807            ShowMsg('Can not assign a Reminder Dialog to a Reason for Request');
3808          end
3809          else
3810          begin
3811            Clone(FCurTree.Selected);
3812            Template := TTemplate(FCurTree.Selected.Data);
3813            if assigned(Template) and Template.CanModify then
3814            begin
3815              ttyp := TypeTag[idx];
3816              if (not FForceContainer) or (not (idx in [tiTemplate, tiRemDlg])) then
3817              begin
3818                if (ttyp = ttDialog) then
3819                begin
3820                  Template.Dialog := TRUE;
3821                  ttyp := ttGroup;
3822                end
3823                else
3824                  Template.Dialog := FALSE;
3825                Template.RealType := ttyp;
3826                if (Template.RealType = ttDoc) and (idx = tiRemDlg) then
3827                  Template.IsReminderDialog := TRUE
3828                else
3829                  Template.IsReminderDialog := FALSE;
3830                if (Template.RealType = ttDoc) and (idx = tiCOMObj) then
3831                  Template.IsCOMObject := TRUE
3832                else
3833                  Template.IsCOMObject := FALSE;
3834                UpdateApply(Template);
3835              end;
3836              for i := 0 to Template.Nodes.Count - 1 do
3837              begin
3838                Node := TTreeNode(Template.Nodes.Objects[i]);
3839                Node.ImageIndex := dmodShared.ImgIdx(Node);
3840                Node.SelectedIndex := dmodShared.ImgIdx(Node);
3841              end;
3842              tvShared.Invalidate;
3843              tvPersonal.Invalidate;
3844              Node := FCurTree.Selected;
3845              tvTreeChange(TTreeView(Node.TreeView), Node);
3846            end;
3847          end;
3848        end;
3849      end;
3850    end;
3851  end;