git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2399 8e941d3f-bd1b-0410-a28a-d453659cc2b4

This commit is contained in:
dopi
2012-04-21 21:13:38 +00:00
parent b28934bb74
commit f14005671f
8 changed files with 290 additions and 145 deletions

View File

@ -12,7 +12,7 @@
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="36" Y="18"/>
<UsageCount Value="105"/>
<UsageCount Value="109"/>
</Unit0>
<Unit1>
<Filename Value="mainform.pas"/>
@ -23,7 +23,7 @@
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="10" Y="8"/>
<UsageCount Value="105"/>
<UsageCount Value="109"/>
</Unit1>
<Unit2>
<Filename Value="uform1.pas"/>
@ -32,11 +32,11 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="uForm1"/>
<EditorIndex Value="1"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="51"/>
<CursorPos X="28" Y="64"/>
<UsageCount Value="105"/>
<TopLine Value="53"/>
<CursorPos X="13" Y="60"/>
<UsageCount Value="109"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit2>
@ -47,11 +47,11 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="uForm2"/>
<EditorIndex Value="2"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="53"/>
<CursorPos X="21" Y="64"/>
<UsageCount Value="27"/>
<TopLine Value="46"/>
<CursorPos X="75" Y="62"/>
<UsageCount Value="31"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit3>
@ -64,9 +64,9 @@
<IsVisibleTab Value="True"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<TopLine Value="71"/>
<CursorPos X="1" Y="80"/>
<UsageCount Value="52"/>
<TopLine Value="140"/>
<CursorPos X="14" Y="147"/>
<UsageCount Value="53"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit4>
@ -75,13 +75,13 @@
<UnitName Value="TDIClass"/>
<EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="237"/>
<CursorPos X="35" Y="248"/>
<UsageCount Value="52"/>
<TopLine Value="679"/>
<CursorPos X="14" Y="684"/>
<UsageCount Value="53"/>
<Bookmarks Count="4">
<Item0 X="17" Y="877" ID="3"/>
<Item1 X="5" Y="315" ID="2"/>
<Item2 X="23" Y="267" ID="1"/>
<Item0 X="17" Y="899" ID="3"/>
<Item1 X="1" Y="320" ID="2"/>
<Item2 X="23" Y="268" ID="1"/>
<Item3 X="45" Y="56" ID="5"/>
</Bookmarks>
<Loaded Value="True"/>
@ -96,27 +96,27 @@
</Unit6>
<Unit7>
<Filename Value="C:\lazarus\lcl\include\customnotebook.inc"/>
<EditorIndex Value="6"/>
<WindowIndex Value="0"/>
<TopLine Value="292"/>
<CursorPos X="1" Y="303"/>
<UsageCount Value="16"/>
<TopLine Value="448"/>
<CursorPos X="3" Y="457"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit7>
<Unit8>
<Filename Value="C:\lazarus\lcl\include\control.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="4834"/>
<CursorPos X="42" Y="4846"/>
<UsageCount Value="11"/>
<TopLine Value="4828"/>
<CursorPos X="44" Y="4843"/>
<UsageCount Value="12"/>
</Unit8>
<Unit9>
<Filename Value="..\tdireg.pas"/>
<UnitName Value="TDIReg"/>
<EditorIndex Value="6"/>
<WindowIndex Value="0"/>
<TopLine Value="3"/>
<CursorPos X="29" Y="16"/>
<UsageCount Value="36"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
<Filename Value="..\..\..\TOOLS\DJ_FormPrincipal.pas"/>
@ -178,20 +178,20 @@
<Unit16>
<Filename Value="..\tdiconst.pas"/>
<UnitName Value="TDIConst"/>
<EditorIndex Value="5"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="13" Y="10"/>
<UsageCount Value="49"/>
<Loaded Value="True"/>
</Unit16>
<Unit17>
<Filename Value="C:\lazarus\lcl\controls.pp"/>
<UnitName Value="Controls"/>
<EditorIndex Value="7"/>
<WindowIndex Value="0"/>
<TopLine Value="153"/>
<CursorPos X="19" Y="162"/>
<TopLine Value="1585"/>
<CursorPos X="14" Y="1596"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit17>
<Unit18>
<Filename Value="C:\lazarus\lcl\graphics.pp"/>
@ -204,18 +204,20 @@
<Unit19>
<Filename Value="C:\lazarus\components\lazcontrols\extendednotebook.pas"/>
<UnitName Value="ExtendedNotebook"/>
<EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="35"/>
<CursorPos X="3" Y="46"/>
<UsageCount Value="19"/>
<Loaded Value="True"/>
</Unit19>
<Unit20>
<Filename Value="C:\lazarus\lcl\comctrls.pp"/>
<UnitName Value="ComCtrls"/>
<EditorIndex Value="4"/>
<EditorIndex Value="5"/>
<WindowIndex Value="0"/>
<TopLine Value="679"/>
<CursorPos X="3" Y="690"/>
<TopLine Value="424"/>
<CursorPos X="14" Y="432"/>
<UsageCount Value="23"/>
<Loaded Value="True"/>
</Unit20>
@ -406,8 +408,8 @@
<Unit45>
<Filename Value="C:\lazarus\lcl\include\wincontrol.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="4313"/>
<CursorPos X="1" Y="4332"/>
<TopLine Value="7886"/>
<CursorPos X="1" Y="7897"/>
<UsageCount Value="11"/>
</Unit45>
<Unit46>
@ -423,10 +425,12 @@
</Unit46>
<Unit47>
<Filename Value="C:\lazarus\lcl\include\customform.inc"/>
<EditorIndex Value="9"/>
<WindowIndex Value="0"/>
<TopLine Value="199"/>
<CursorPos X="1" Y="209"/>
<UsageCount Value="12"/>
<TopLine Value="2088"/>
<CursorPos X="17" Y="2070"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit47>
<Unit48>
<Filename Value="C:\lazarus\lcl\include\screen.inc"/>
@ -438,10 +442,12 @@
<Unit49>
<Filename Value="C:\lazarus\lcl\forms.pp"/>
<UnitName Value="Forms"/>
<EditorIndex Value="8"/>
<WindowIndex Value="0"/>
<TopLine Value="579"/>
<CursorPos X="15" Y="590"/>
<UsageCount Value="18"/>
<TopLine Value="687"/>
<CursorPos X="14" Y="698"/>
<UsageCount Value="19"/>
<Loaded Value="True"/>
</Unit49>
<Unit50>
<Filename Value="C:\lazarus\lcl\lclmessageglue.pas"/>
@ -531,9 +537,9 @@
<Unit61>
<Filename Value="C:\lazarus\lcl\include\customcontrol.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="79"/>
<CursorPos X="15" Y="90"/>
<UsageCount Value="8"/>
<TopLine Value="49"/>
<CursorPos X="1" Y="60"/>
<UsageCount Value="10"/>
</Unit61>
<Unit62>
<Filename Value="C:\lazarus\fpc\2.6.0\source\rtl\objpas\classes\compon.inc"/>
@ -545,8 +551,8 @@
<Unit63>
<Filename Value="C:\lazarus\lcl\include\application.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="1092"/>
<CursorPos X="21" Y="1101"/>
<TopLine Value="2174"/>
<CursorPos X="3" Y="2155"/>
<UsageCount Value="10"/>
</Unit63>
<Unit64>
@ -560,82 +566,127 @@
<General>
<ActiveWindowIndexAtStart Value="0"/>
</General>
<JumpHistory Count="16" HistoryIndex="15">
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="344" Column="1" TopLine="325"/>
<Filename Value="uform2.pas"/>
<Caret Line="50" Column="15" TopLine="44"/>
</Position1>
<Position2>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="345" Column="1" TopLine="326"/>
<Filename Value="uform2.pas"/>
<Caret Line="51" Column="15" TopLine="45"/>
</Position2>
<Position3>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="271" Column="1" TopLine="260"/>
<Filename Value="uform1.pas"/>
<Caret Line="58" Column="15" TopLine="54"/>
</Position3>
<Position4>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="273" Column="1" TopLine="260"/>
<Filename Value="uform1.pas"/>
<Caret Line="61" Column="8" TopLine="51"/>
</Position4>
<Position5>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="274" Column="1" TopLine="260"/>
<Filename Value="uform1.pas"/>
<Caret Line="62" Column="8" TopLine="52"/>
</Position5>
<Position6>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="276" Column="1" TopLine="260"/>
<Caret Line="374" Column="42" TopLine="362"/>
</Position6>
<Position7>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="267" Column="23" TopLine="260"/>
<Filename Value="umainform.pas"/>
<Caret Line="76" Column="29" TopLine="71"/>
</Position7>
<Position8>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="315" Column="5" TopLine="304"/>
<Filename Value="umainform.pas"/>
<Caret Line="137" Column="3" TopLine="134"/>
</Position8>
<Position9>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="877" Column="17" TopLine="881"/>
<Caret Line="376" Column="23" TopLine="362"/>
</Position9>
<Position10>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="269" Column="1" TopLine="258"/>
<Caret Line="696" Column="8" TopLine="693"/>
</Position10>
<Position11>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="889" Column="1" TopLine="878"/>
<Caret Line="695" Column="1" TopLine="691"/>
</Position11>
<Position12>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="269" Column="1" TopLine="258"/>
<Caret Line="696" Column="30" TopLine="691"/>
</Position12>
<Position13>
<Filename Value="umainform.pas"/>
<Caret Line="93" Column="19" TopLine="93"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="104" Column="24" TopLine="93"/>
</Position13>
<Position14>
<Filename Value="umainform.pas"/>
<Caret Line="79" Column="41" TopLine="71"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="106" Column="15" TopLine="65"/>
</Position14>
<Position15>
<Filename Value="umainform.pas"/>
<Caret Line="81" Column="30" TopLine="71"/>
<Filename Value="C:\lazarus\components\lazcontrols\extendednotebook.pas"/>
<Caret Line="46" Column="3" TopLine="35"/>
</Position15>
<Position16>
<Filename Value="umainform.pas"/>
<Caret Line="80" Column="1" TopLine="71"/>
<Filename Value="C:\lazarus\lcl\comctrls.pp"/>
<Caret Line="505" Column="3" TopLine="494"/>
</Position16>
<Position17>
<Filename Value="C:\lazarus\lcl\comctrls.pp"/>
<Caret Line="569" Column="21" TopLine="553"/>
</Position17>
<Position18>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="126" Column="63" TopLine="110"/>
</Position18>
<Position19>
<Filename Value="C:\lazarus\lcl\comctrls.pp"/>
<Caret Line="428" Column="32" TopLine="417"/>
</Position19>
<Position20>
<Filename Value="C:\lazarus\lcl\comctrls.pp"/>
<Caret Line="432" Column="69" TopLine="417"/>
</Position20>
<Position21>
<Filename Value="C:\lazarus\lcl\comctrls.pp"/>
<Caret Line="433" Column="70" TopLine="417"/>
</Position21>
<Position22>
<Filename Value="C:\lazarus\lcl\comctrls.pp"/>
<Caret Line="569" Column="30" TopLine="550"/>
</Position22>
<Position23>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="374" Column="27" TopLine="322"/>
</Position23>
<Position24>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position24>
<Position25>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="113" Column="30" TopLine="102"/>
</Position25>
<Position26>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="374" Column="1" TopLine="359"/>
</Position26>
<Position27>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="421" Column="33" TopLine="402"/>
</Position27>
<Position28>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="462" Column="37" TopLine="443"/>
</Position28>
<Position29>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="508" Column="35" TopLine="495"/>
</Position29>
<Position30>
<Filename Value="umainform.pas"/>
<Caret Line="146" Column="14" TopLine="139"/>
</Position30>
</JumpHistory>
</ProjectSession>
<Debugging>
<BreakPoints Count="1">
<Item1>
<Kind Value="bpkSource"/>
<WatchScope Value="wpsLocal"/>
<WatchKind Value="wpkWrite"/>
<Source Value="umainform.pas"/>
<Line Value="79"/>
</Item1>
</BreakPoints>
</Debugging>
</CONFIG>

View File

@ -16,19 +16,19 @@ object Form1: TForm1
OnDestroy = FormDestroy
LCLVersion = '1.1'
object bClose: TButton
Left = 376
Left = 392
Height = 25
Top = 216
Width = 111
Width = 86
AutoSize = True
Caption = 'Close,Free Form'
Caption = 'Close Form'
OnClick = bCloseClick
TabOrder = 2
end
object Edit1: TEdit
Left = 24
Height = 23
Top = 80
Top = 62
Width = 82
TabOrder = 0
Text = 'Edit1'
@ -36,7 +36,7 @@ object Form1: TForm1
object Edit2: TEdit
Left = 24
Height = 23
Top = 136
Top = 104
Width = 82
OnExit = Edit2Exit
TabOrder = 1
@ -62,9 +62,11 @@ object Form1: TForm1
ParentFont = False
end
object Label3: TLabel
Left = 16
AnchorSideTop.Control = bClose
AnchorSideTop.Side = asrCenter
Left = 32
Height = 46
Top = 208
Top = 205
Width = 324
Caption = 'You can Close or Hide your Forms the same way you used to.'#13#10'No Special method is necessary. TDINotebook will detect by '#13#10'internal Notification and Close the Tab Sheet'
ParentColor = False
@ -72,9 +74,9 @@ object Form1: TForm1
object bHide: TButton
AnchorSideLeft.Control = bClose
AnchorSideLeft.Side = asrCenter
Left = 390
Left = 394
Height = 25
Top = 256
Top = 159
Width = 82
AutoSize = True
Caption = 'Hide Form'
@ -82,9 +84,11 @@ object Form1: TForm1
TabOrder = 3
end
object lShowmeAgain: TLabel
AnchorSideTop.Control = bHide
AnchorSideTop.Side = asrCenter
Left = 16
Height = 16
Top = 272
Top = 163
Width = 364
Caption = 'But, If you Hide the Form, is better you have a way to Show it again :)'
Font.Color = clRed
@ -97,7 +101,7 @@ object Form1: TForm1
AnchorSideTop.Side = asrCenter
Left = 120
Height = 16
Top = 83
Top = 65
Width = 106
Caption = 'This is a regular Edit'
ParentColor = False
@ -107,11 +111,36 @@ object Form1: TForm1
AnchorSideTop.Side = asrCenter
Left = 120
Height = 46
Top = 124
Top = 92
Width = 347
Caption = 'This Edit has a OnExit Validation, who doesn''t allow Page Change'#13#10' if this Edit is empty, and the focus is on it... '#13#10'This can be disabled changing the property "VerifyIfCanChange"'
ParentColor = False
end
object Label6: TLabel
AnchorSideLeft.Control = bClose
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = bClose
Left = 379
Height = 16
Top = 194
Width = 112
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 6
Caption = 'This Form use caFree'
ParentColor = False
end
object Label7: TLabel
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Side = asrCenter
Left = 35
Height = 16
Top = 264
Width = 431
Caption = 'This Form demonstrate that TDINotebook respects your OnCloseQuery Validation'
ParentColor = False
end
object tShowmeAgain: TTimer
Enabled = False
Interval = 3000

View File

@ -22,6 +22,8 @@ type
Label3 : TLabel ;
Label4 : TLabel ;
Label5 : TLabel ;
Label6 : TLabel ;
Label7 : TLabel ;
lShowmeAgain : TLabel ;
tShowmeAgain : TTimer ;
procedure bCloseClick(Sender : TObject) ;

View File

@ -1,11 +1,11 @@
object Form2: TForm2
Left = 709
Height = 243
Left = 564
Height = 252
Top = 330
Width = 307
Width = 452
Caption = 'Form2'
ClientHeight = 243
ClientWidth = 307
ClientHeight = 252
ClientWidth = 452
OnClose = FormClose
OnCloseQuery = FormCloseQuery
OnDestroy = FormDestroy
@ -13,48 +13,74 @@ object Form2: TForm2
OnShow = FormShow
LCLVersion = '1.1'
object Edit1: TEdit
Left = 56
Left = 48
Height = 23
Top = 32
Width = 211
Top = 80
Width = 356
Anchors = [akTop, akLeft, akRight]
TabOrder = 0
Text = 'Edit1'
end
object Edit2: TEdit
Left = 56
Left = 48
Height = 23
Top = 72
Width = 211
Top = 120
Width = 356
Anchors = [akTop, akLeft, akRight]
TabOrder = 1
Text = 'Edit2'
end
object CheckBox1: TCheckBox
Left = 56
Left = 48
Height = 19
Top = 104
Top = 152
Width = 78
Caption = 'CheckBox1'
TabOrder = 2
end
object CheckBox2: TCheckBox
Left = 56
Left = 48
Height = 19
Top = 136
Top = 184
Width = 78
Caption = 'CheckBox2'
TabOrder = 3
end
object Button1: TButton
Left = 195
object bClose: TButton
Left = 318
Height = 25
Top = 189
Top = 192
Width = 86
Anchors = [akRight, akBottom]
AutoSize = True
Caption = 'Close Form'
OnClick = Button1Click
OnClick = bCloseClick
TabOrder = 4
end
object Label2: TLabel
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
Left = 21
Height = 31
Top = 16
Width = 411
Alignment = taCenter
Caption = 'This Form does NOT have Max Constraints. It will be Aligned by "alClient". '#13#10'Design forms like this using Anchors to expand controls all over the Page'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object Label1: TLabel
AnchorSideLeft.Control = bClose
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = bClose
AnchorSideTop.Side = asrBottom
Left = 302
Height = 16
Top = 223
Width = 118
BorderSpacing.Top = 6
Caption = 'This Form is not Freed'
ParentColor = False
end
end

View File

@ -13,12 +13,14 @@ type
{ TForm2 }
TForm2 = class(TForm)
Button1 : TButton ;
bClose : TButton ;
CheckBox1 : TCheckBox ;
CheckBox2 : TCheckBox ;
Edit1 : TEdit ;
Edit2 : TEdit ;
procedure Button1Click(Sender : TObject) ;
Label1 : TLabel ;
Label2 : TLabel ;
procedure bCloseClick(Sender : TObject) ;
procedure FormClose(Sender : TObject ; var CloseAction : TCloseAction) ;
procedure FormCloseQuery(Sender : TObject ; var CanClose : boolean) ;
procedure FormDestroy(Sender : TObject) ;
@ -44,7 +46,7 @@ begin
fMainForm.mEvents.Lines.Add( 'Form2.Close' );
end;
procedure TForm2.Button1Click(Sender : TObject) ;
procedure TForm2.bCloseClick(Sender : TObject) ;
begin
Close;
ClientRect;

View File

@ -32,7 +32,6 @@ object fMainForm: TfMainForm
Height = 391
Top = 0
Width = 587
TabStop = False
ActivePage = tsFixed
Align = alClient
Constraints.MinHeight = 300
@ -42,6 +41,7 @@ object fMainForm: TfMainForm
TabIndex = 0
TabOrder = 1
OnChange = TDINoteBook1Change
OnCloseTabClicked = TDINoteBook1CloseTabClicked
Options = [nboShowCloseButtons, nboMultiLine, nboKeyboardTabSwitch, nboShowAddTabButton]
TabDragMode = dmAutomatic
TabDragAcceptMode = dmAutomatic
@ -87,6 +87,9 @@ object fMainForm: TfMainForm
TabOrder = 0
end
end
object TabSheet1: TTabSheet
Caption = 'TabSheet1'
end
end
object pBottom: TPanel
Left = 0

View File

@ -33,6 +33,7 @@ type
seFixedPages : TSpinEdit ;
Splitter1 : TSplitter ;
StatusBar1 : TStatusBar ;
TabSheet1 : TTabSheet ;
tsFixed : TTabSheet ;
TDINoteBook1 : TTDINoteBook ;
procedure bToggleLogClick(Sender : TObject) ;
@ -47,6 +48,7 @@ type
procedure miForm2Click(Sender : TObject) ;
procedure seFixedPagesChange(Sender : TObject) ;
procedure TDINoteBook1Change(Sender : TObject) ;
procedure TDINoteBook1CloseTabClicked(Sender : TObject) ;
private
{ private declarations }
Procedure ShowNewControl(Sender: TObject);
@ -136,6 +138,11 @@ begin
mEvents.Lines.Add('OnChange');
end;
procedure TfMainForm.TDINoteBook1CloseTabClicked(Sender : TObject) ;
begin
mEvents.Lines.Add( 'TDINoteBook1.OnCloseTabClicked' );
end;
procedure TfMainForm.ShowNewControl(Sender : TObject) ;
var
ControlCaption : String ;

View File

@ -100,6 +100,7 @@ type
FTabsMenuItem : TMenuItem ;
FTimerRestoreLastControl : TTimer;
FVerifyIfCanChangePage : Boolean ;
FIsRemovingAPage : Boolean;
procedure CreateCloseBitBtn ;
procedure CreateCloseMenuItem ;
@ -269,9 +270,6 @@ begin
RestoreFormProperties;
fsFormInPage := nil;
if Assigned( Parent ) then
Parent.RemoveComponent( Self );
end ;
end ;
@ -312,7 +310,14 @@ begin
// This will force this page be killed by TTDINoteBook.Notification();
if Assigned( fsFormInPage ) then
RemoveComponent( fsFormInPage );
begin
RestoreFormProperties;
fsFormInPage := nil;
if Assigned( Parent ) then
Parent.RemoveComponent( Self );
end ;
end ;
procedure TTDIPage.SaveFormProperties ;
@ -333,15 +338,17 @@ procedure TTDIPage.RestoreFormProperties ;
begin
if not Assigned( fsFormInPage ) then exit ;
if ([csDesigning, csDestroying] * fsFormInPage.ComponentState <> []) then exit ;
fsFormInPage.Parent := fsFormOldParent;
fsFormInPage.Visible := False;
fsFormInPage.OnClose := fsFormOldCloseEvent;
fsFormInPage.Align := fsFormOldAlign;
fsFormInPage.BorderStyle := fsFormOldBorderStyle;
fsFormInPage.Top := fsFormOldClientRect.Top;
fsFormInPage.Left := fsFormOldClientRect.Left;
fsFormInPage.Width := fsFormOldClientRect.Right;
fsFormInPage.Height := fsFormOldClientRect.Bottom;
fsFormInPage.OnClose := fsFormOldCloseEvent;
end ;
{ TTDINoteBook }
@ -355,6 +362,7 @@ begin
FFixedPages := 0;
FRestoreActiveControl := True;
FVerifyIfCanChangePage := True;
FIsRemovingAPage := False;
FBackgroundImage := nil;
FCloseBitBtn := nil;
FCloseMenuItem := nil;
@ -846,27 +854,41 @@ end ;
procedure TTDINoteBook.RemovePage(Index : Integer) ;
Var
CanRemovePage : Boolean ;
LastPageCount : Integer ;
begin
CanRemovePage := True;
FIsRemovingAPage := True;
if ([csDesigning, csDestroying] * ComponentState = []) then
if Pages[Index] is TTDIPage then
with TTDIPage(Pages[Index]) do
begin
if Assigned( FormInPage ) then
try
if ([csDesigning, csDestroying] * ComponentState = []) then
if Pages[Index] is TTDIPage then
with TTDIPage(Pages[Index]) do
begin
CanRemovePage := FormInPage.CloseQuery ;
if CanRemovePage then
if Assigned( FormInPage ) then
begin
{ // This code is ok, but calls CloseQuery twice //
CanRemovePage := FormInPage.CloseQuery ;
if CanRemovePage then
FormInPage.Close ;
}
LastPageCount := PageCount;
FormInPage.Close ;
CanRemovePage := (LastPageCount = PageCount ) and // Page wasn't removed by Notification ?
( (not Assigned(FormInPage)) or // Form Isn't valid ?
( not FormInPage.Showing ) // Form is not showing ?
);
end ;
end ;
end ;
if CanRemovePage then
begin
inherited RemovePage(Index) ;
if CanRemovePage then
begin
inherited RemovePage(Index) ;
if PageCount < 1 then // On this case, DoChange is not fired //
CheckInterface;
if PageCount < 1 then // On this case, DoChange is not fired //
CheckInterface;
end ;
finally
FIsRemovingAPage := False;
end ;
end ;
@ -878,15 +900,18 @@ begin
if (Operation = opRemove) then
begin
if (AComponent = FBackgroundImage) then
FBackgroundImage := nil ;
FBackgroundImage := nil
if (AComponent = FMainMenu) then
FMainMenu := nil ;
else if (AComponent = FMainMenu) then
FMainMenu := nil
if ([csDesigning, csDestroying] * ComponentState <> []) then exit ;
else if ([csDesigning, csDestroying] * ComponentState <> []) then
if {(AComponent is TForm) or} (AComponent is TTDIPage) then
RemoveInvalidPages;
else if (AComponent is TForm) then
RemoveInvalidPages
else if (AComponent is TTDIPage) and (not FIsRemovingAPage) then
RemovePage( TTDIPage( AComponent ).PageIndex ) ;
end ;
end ;