Procedure

TfrmTemplateDialog.FormCloseQuery

Module

fTemplateDialog

Last Modified

7/15/2014 3:26:44 PM

Visibility

Public/Published

Owner

TfrmTemplateDialog

Declaration

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

Calls Hierarchy


TfrmTemplateDialog.FormCloseQuery
 └AreTemplateFieldsRequired
   ├GetTemplateField
   │ ├LoadTemplateFieldByIEN
   │ ├LoadTemplateField
   │ └TTemplateField.Create
   │   ├TemplateFieldCode2Field
   │   └TemplateDateCode2DateType
   ├TTemplateField.GetRequired
   └TTemplateDialogEntry.GetControlText
     ├GetTemplateField...
     ├GetOriginalItem
     │ ├GetTemplateField...
     │ └StripEmbedded
     └TfraTemplateFieldButton.GetButtonText

Calls

Name Declaration Comments
AreTemplateFieldsRequired function AreTemplateFieldsRequired(const Text: string; FldValues: TORStringList = nil): boolean; -


Source

758   procedure TfrmTemplateDialog.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
759   var
760     Txt, tmp: string;
761     i, p1, p2: integer;
762     Save: boolean;
763   
764   begin
765     CanClose := TRUE;
766     if FCheck4Required then
767     begin
768       FCheck4Required := FALSE;
769       Txt := SL.Text;
770       for i := 0 to sbMain.ControlCount-1 do
771       begin
772         Save := FALSE;
773         if(sbMain.Controls[i] is TORCheckBox) and
774           (TORCheckBox(sbMain.Controls[i]).Checked) then
775           Save := TRUE
776         else
777         if(OneOnly and (sbMain.Controls[i] is TPanel)) then
778           Save := TRUE;
779         if(Save) then
780         begin
781           tmp := Piece(Index,U,sbMain.Controls[i].Tag);
782           p1 := StrToInt(Piece(tmp,'~',1));
783           p2 := StrToInt(Piece(tmp,'~',2));
784           if AreTemplateFieldsRequired(Copy(Txt,p1,p2)) then
785             CanClose := FALSE;
786         end;
787         if not CanClose then
788         begin
789           ShowMsg(MissingFieldsTxt);
790           break;
791         end;
792       end;
793     end;
794   end;