Procedure

TfrmTemplateEditor.FormCloseQuery

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Visibility

Public/Published

Owner

TfrmTemplateEditor

Declaration

procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);

Calls Hierarchy


TfrmTemplateEditor.FormCloseQuery
 ├BackupDiffers
 │ └TTemplate.Changed
 │   ├TTemplate.ValidID
 │   └TTemplate.ItemIENs
 │     └TTemplate.GetItems
 │       └ExpandTemplate
 │         ├TTemplate.GetChildren
 │         ├GetTemplateChildren
 │         ├AddTemplate
 │         │ ├TTemplate.Create
 │         │ │ └TTemplate.ReminderDialogIEN
 │         │ └TTemplate.AddChild
 │         │   └TTemplate.GetItems...
 │         └TTemplate.ItemIENs...
 ├TfrmTemplateEditor.ScanNames
 │ └ScanTree
 │   └BadTemplateName
 └SaveAllTemplates
   ├SaveTemplate
   │ ├TTemplate.Changed...
   │ ├TTemplate.Unlock
   │ │ ├TTemplate.ValidID
   │ │ └UnlockTemplate
   │ ├TTemplate.GetBoilerplate
   │ │ └GetTemplateBoilerplate
   │ ├TTemplate.ReminderDialogIEN
   │ ├TTemplate.GetDescription
   │ │ └LoadTemplateDescription
   │ ├UpdateTemplate
   │ │ └UpdateTIURec
   │ ├DisplayErrors
   │ └TTemplate.ClearBackup
   │   └TTemplate.ItemIENs...
   ├TTemplate.ItemIENs...
   ├TTemplate.GetItems...
   ├UpdateChildren
   ├TTemplate.Unlock...
   ├DeleteTemplates
   └DisplayErrors

Calls

Name Declaration Comments
BackupDiffers function BackupDiffers: boolean; -
SaveAllTemplates function SaveAllTemplates: boolean; -
TfrmTemplateEditor.ScanNames function ScanNames: boolean; -


Source

2697  procedure TfrmTemplateEditor.FormCloseQuery(Sender: TObject;
2698    var CanClose: Boolean);
2699  var
2700    ans: word;
2701  
2702  begin
2703    if (not FOK2Close) and (BackupDiffers) then
2704    begin
2705      ans := InfoBox('Save Changes?', 'Confirmation', MB_YESNOCANCEL or MB_ICONQUESTION);
2706      if (ans = IDCANCEL) then
2707        CanClose := FALSE
2708      else
2709        if (ans = IDYES) then
2710        begin
2711          CanClose := FALSE;
2712          if (ScanNames) then
2713          begin
2714            if (SaveAllTemplates) then
2715              CanClose := TRUE
2716            else
2717              BtnApply.Enabled := BackupDiffers;
2718          end;
2719        end;
2720    end;
2721  end;