From f71e98f6d9a960e2c9a77251e713c7c742aa9ee5 Mon Sep 17 00:00:00 2001 From: dopi Date: Thu, 19 Apr 2012 21:52:48 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2395 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tdi/Demo/TDIDemo.lps | 177 +++++++++++++++++--------------- components/tdi/Demo/uform1.pas | 3 +- components/tdi/tdiclass.pas | 17 +-- 3 files changed, 104 insertions(+), 93 deletions(-) diff --git a/components/tdi/Demo/TDIDemo.lps b/components/tdi/Demo/TDIDemo.lps index 87078ce53..1493cb449 100644 --- a/components/tdi/Demo/TDIDemo.lps +++ b/components/tdi/Demo/TDIDemo.lps @@ -4,7 +4,7 @@ - + @@ -32,10 +32,11 @@ + - - + + @@ -57,14 +58,13 @@ - - + - - + + - + @@ -80,16 +80,16 @@ - + - - + + - + @@ -99,7 +99,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -176,7 +176,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -341,10 +341,12 @@ + - - - + + + + @@ -467,7 +469,7 @@ - + @@ -501,7 +503,7 @@ - + @@ -530,130 +532,139 @@ + + + + + + + + + - - + + - - + + - - + + - + - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - - + + - - + + - + - - + + diff --git a/components/tdi/Demo/uform1.pas b/components/tdi/Demo/uform1.pas index a32dfe739..f8af745d9 100644 --- a/components/tdi/Demo/uform1.pas +++ b/components/tdi/Demo/uform1.pas @@ -85,8 +85,7 @@ begin Edit2.Text := 'Ok, fixed'; end ; - if Assigned( fMainForm ) then - fMainForm.mEvents.Lines.Add( 'Form1.CloseQuery: '+BoolToStr(CanClose,'True','False') ); + fMainForm.mEvents.Lines.Add( 'Form1.CloseQuery: '+BoolToStr(CanClose,'True','False') ); end; procedure TForm1.FormDestroy(Sender : TObject) ; diff --git a/components/tdi/tdiclass.pas b/components/tdi/tdiclass.pas index 570fdb6b1..8e0e7bb1b 100644 --- a/components/tdi/tdiclass.pas +++ b/components/tdi/tdiclass.pas @@ -751,16 +751,17 @@ Var begin CanRemovePage := True; - if Pages[Index] is TTDIPage then - with TTDIPage(Pages[Index]) do - begin - if Assigned( FormInPage ) then + if ([csDesigning, csDestroying] * ComponentState = []) then + if Pages[Index] is TTDIPage then + with TTDIPage(Pages[Index]) do begin - CanRemovePage := FormInPage.CloseQuery ; - if CanRemovePage then - FormInPage.Close ; + if Assigned( FormInPage ) then + begin + CanRemovePage := FormInPage.CloseQuery ; + if CanRemovePage then + FormInPage.Close ; + end ; end ; - end ; if CanRemovePage then begin