From 05e7dfaf66cac6048ae8887c11ed61505d56c3bf Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 20 May 2010 15:43:15 +0000 Subject: [PATCH] LCL: TCustomForm.CloseQuery query all child forms git-svn-id: trunk@25547 - --- lcl/include/customform.inc | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 5e5861abe7..3da0d19262 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -2013,19 +2013,30 @@ end; TCustomForm Method CloseQuery ------------------------------------------------------------------------------} function TCustomForm.CloseQuery: boolean; -var - i: Integer; + + function Check(AControl: TWinControl): boolean; + var + i: Integer; + Child: TControl; + begin + for i:=0 to AControl.ControlCount-1 do begin + Child:=AControl.Controls[i]; + if Child is TWinControl then begin + if Child is TCustomForm then begin + if not TCustomForm(Child).CloseQuery then exit(false); + end else begin + if not Check(TWinControl(Child)) then exit(false); + end; + end; + end; + Result:=true; + end; + begin if FormStyle = fsMDIForm then begin // Query children forms whether we can close - i:=0; - while i