Procedure

TfrmTemplateEditor.edtNameExit

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Visibility

Public/Published

Owner

TfrmTemplateEditor

Declaration

procedure edtNameExit(Sender: TObject);

Calls Hierarchy


TfrmTemplateEditor.edtNameExit
 ├BadTemplateName
 └TfrmTemplateEditor.AutoDel
   └TTemplate.GetBoilerplate
     └GetTemplateBoilerplate

Calls

Name Declaration Comments
TfrmTemplateEditor.AutoDel function AutoDel(Template: TTemplate): boolean; -
BadTemplateName function BadTemplateName(Text: string): boolean; -


Source

2747  procedure TfrmTemplateEditor.edtNameExit(Sender: TObject);
2748  var
2749    Warn: boolean;
2750  
2751  begin
2752    Warn := (ActiveControl <> btnCancel) and (BadTemplateName(edtName.Text));
2753    if (Warn and ((ActiveControl = sbShDelete) or (ActiveControl = sbPerDelete))) then
2754    begin
2755      if ((assigned(FCurTree)) and (assigned(FCurTree.Selected))) then
2756        Warn := not AutoDel(TTemplate(FCurTree.Selected.Data));
2757    end;
2758    if (Warn) then
2759    begin
2760      InfoBox('Template has an invalid name: ' + edtName.Text + '.' + BadNameText, 'Error', MB_OK or MB_ICONERROR);
2761      edtName.SetFocus;
2762    end;
2763  end;