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

This commit is contained in:
dopi
2012-04-19 21:25:07 +00:00
parent 24c3f2cd67
commit 374dc36ada
7 changed files with 249 additions and 129 deletions

View File

@ -33,13 +33,16 @@
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<RequiredPackages Count="3">
<Item1>
<PackageName Value="TDI"/>
<PackageName Value="TurboPowerIPro"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
<PackageName Value="TDI"/>
</Item2>
<Item3>
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages>
<Units Count="3">
<Unit0>

View File

@ -12,7 +12,7 @@
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="36" Y="18"/>
<UsageCount Value="95"/>
<UsageCount Value="97"/>
</Unit0>
<Unit1>
<Filename Value="mainform.pas"/>
@ -23,7 +23,7 @@
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="10" Y="8"/>
<UsageCount Value="95"/>
<UsageCount Value="97"/>
</Unit1>
<Unit2>
<Filename Value="uform1.pas"/>
@ -34,9 +34,9 @@
<UnitName Value="uForm1"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="64"/>
<CursorPos X="15" Y="70"/>
<UsageCount Value="95"/>
<TopLine Value="70"/>
<CursorPos X="49" Y="82"/>
<UsageCount Value="97"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit2>
@ -48,24 +48,25 @@
<UnitName Value="uMainForm"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<TopLine Value="79"/>
<CursorPos X="15" Y="82"/>
<UsageCount Value="47"/>
<TopLine Value="110"/>
<CursorPos X="26" Y="121"/>
<UsageCount Value="48"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\tdiclass.pas"/>
<UnitName Value="TDIClass"/>
<EditorIndex Value="3"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="770"/>
<CursorPos X="49" Y="709"/>
<UsageCount Value="47"/>
<TopLine Value="499"/>
<CursorPos X="20" Y="519"/>
<UsageCount Value="48"/>
<Bookmarks Count="3">
<Item0 X="17" Y="729" ID="3"/>
<Item1 X="3" Y="650" ID="2"/>
<Item2 X="3" Y="443" ID="1"/>
<Item0 X="17" Y="778" ID="3"/>
<Item1 X="3" Y="673" ID="2"/>
<Item2 X="3" Y="460" ID="1"/>
</Bookmarks>
<Loaded Value="True"/>
</Unit4>
@ -79,27 +80,30 @@
</Unit5>
<Unit6>
<Filename Value="C:\lazarus\lcl\include\customnotebook.inc"/>
<EditorIndex Value="7"/>
<WindowIndex Value="0"/>
<TopLine Value="740"/>
<CursorPos X="1" Y="751"/>
<TopLine Value="587"/>
<CursorPos X="3" Y="582"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit6>
<Unit7>
<Filename Value="C:\lazarus\lcl\include\control.inc"/>
<EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="2124"/>
<CursorPos X="1" Y="2135"/>
<TopLine Value="659"/>
<CursorPos X="3" Y="646"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit7>
<Unit8>
<Filename Value="..\tdireg.pas"/>
<UnitName Value="TDIReg"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="6"/>
<EditorIndex Value="10"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="22"/>
<UsageCount Value="31"/>
<TopLine Value="3"/>
<CursorPos X="29" Y="16"/>
<UsageCount Value="32"/>
<Loaded Value="True"/>
</Unit8>
<Unit9>
@ -162,20 +166,22 @@
<Unit15>
<Filename Value="..\tdiconst.pas"/>
<UnitName Value="TDIConst"/>
<EditorIndex Value="5"/>
<EditorIndex Value="9"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="13" Y="10"/>
<UsageCount Value="44"/>
<UsageCount Value="45"/>
<Loaded Value="True"/>
</Unit15>
<Unit16>
<Filename Value="C:\lazarus\lcl\controls.pp"/>
<UnitName Value="Controls"/>
<EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="2104"/>
<CursorPos X="21" Y="2123"/>
<UsageCount Value="9"/>
<TopLine Value="1203"/>
<CursorPos X="15" Y="1214"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit16>
<Unit17>
<Filename Value="C:\lazarus\lcl\graphics.pp"/>
@ -196,10 +202,12 @@
<Unit19>
<Filename Value="C:\lazarus\lcl\comctrls.pp"/>
<UnitName Value="ComCtrls"/>
<EditorIndex Value="6"/>
<WindowIndex Value="0"/>
<TopLine Value="218"/>
<CursorPos X="3" Y="218"/>
<TopLine Value="385"/>
<CursorPos X="22" Y="395"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit19>
<Unit20>
<Filename Value="C:\lazarus\lcl\include\pagecontrol.inc"/>
@ -420,12 +428,10 @@
<Unit48>
<Filename Value="C:\lazarus\lcl\forms.pp"/>
<UnitName Value="Forms"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="588"/>
<CursorPos X="31" Y="598"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
<UsageCount Value="18"/>
</Unit48>
<Unit49>
<Filename Value="C:\lazarus\lcl\lclmessageglue.pas"/>
@ -461,10 +467,12 @@
<Unit53>
<Filename Value="C:\lazarus\lcl\lclproc.pas"/>
<UnitName Value="LCLProc"/>
<EditorIndex Value="5"/>
<WindowIndex Value="0"/>
<TopLine Value="851"/>
<CursorPos X="1" Y="865"/>
<UsageCount Value="8"/>
<CursorPos X="40" Y="862"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit53>
<Unit54>
<Filename Value="C:\lazarus\lcl\include\tabsheet.inc"/>
@ -493,11 +501,11 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="DJ_FormPrincipal"/>
<EditorIndex Value="4"/>
<EditorIndex Value="8"/>
<WindowIndex Value="0"/>
<TopLine Value="132"/>
<CursorPos X="1" Y="154"/>
<UsageCount Value="17"/>
<TopLine Value="388"/>
<CursorPos X="1" Y="404"/>
<UsageCount Value="18"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit57>
@ -529,123 +537,123 @@
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="244" Column="27" TopLine="237"/>
<Caret Line="745" Column="1" TopLine="727"/>
</Position1>
<Position2>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="210" Column="70" TopLine="196"/>
<Caret Line="738" Column="1" TopLine="727"/>
</Position2>
<Position3>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="227" Column="73" TopLine="214"/>
<Caret Line="743" Column="1" TopLine="727"/>
</Position3>
<Position4>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="721" Column="17" TopLine="706"/>
<Caret Line="744" Column="1" TopLine="727"/>
</Position4>
<Position5>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="80" Column="20" TopLine="69"/>
<Filename Value="umainform.pas"/>
<Caret Line="78" Column="22" TopLine="70"/>
</Position5>
<Position6>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="443" Column="3" TopLine="429"/>
<Filename Value="umainform.pas"/>
<Caret Line="79" Column="22" TopLine="71"/>
</Position6>
<Position7>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="754" Column="27" TopLine="747"/>
<Filename Value="umainform.pas"/>
<Caret Line="81" Column="22" TopLine="73"/>
</Position7>
<Position8>
<Filename Value="uform1.pas"/>
<Caret Line="44" Column="18" TopLine="40"/>
<Filename Value="umainform.pas"/>
<Caret Line="121" Column="26" TopLine="110"/>
</Position8>
<Position9>
<Filename Value="uform1.pas"/>
<Caret Line="45" Column="18" TopLine="41"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="144" Column="61" TopLine="127"/>
</Position9>
<Position10>
<Filename Value="uform1.pas"/>
<Caret Line="46" Column="18" TopLine="42"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="446" Column="2" TopLine="441"/>
</Position10>
<Position11>
<Filename Value="uform1.pas"/>
<Caret Line="48" Column="18" TopLine="44"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="512" Column="3" TopLine="510"/>
</Position11>
<Position12>
<Filename Value="uform1.pas"/>
<Caret Line="71" Column="22" TopLine="42"/>
<Filename Value="C:\lazarus\lcl\lclproc.pas"/>
<Caret Line="864" Column="51" TopLine="851"/>
</Position12>
<Position13>
<Filename Value="uform1.pas"/>
<Caret Line="53" Column="12" TopLine="42"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="512" Column="3" TopLine="510"/>
</Position13>
<Position14>
<Filename Value="uform1.pas"/>
<Caret Line="56" Column="12" TopLine="45"/>
<Filename Value="..\..\..\..\TOOLS\DJ_FormPrincipal.pas"/>
<Caret Line="141" Column="38" TopLine="141"/>
</Position14>
<Position15>
<Filename Value="uform1.pas"/>
<Caret Line="93" Column="8" TopLine="66"/>
<Filename Value="..\..\..\..\TOOLS\DJ_FormPrincipal.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position15>
<Position16>
<Filename Value="umainform.pas"/>
<Caret Line="93" Column="17" TopLine="90"/>
<Filename Value="..\..\..\..\TOOLS\DJ_FormPrincipal.pas"/>
<Caret Line="304" Column="21" TopLine="291"/>
</Position16>
<Position17>
<Filename Value="umainform.pas"/>
<Caret Line="92" Column="17" TopLine="89"/>
<Filename Value="..\..\..\..\TOOLS\DJ_FormPrincipal.pas"/>
<Caret Line="305" Column="21" TopLine="291"/>
</Position17>
<Position18>
<Filename Value="umainform.pas"/>
<Caret Line="91" Column="17" TopLine="88"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="114" Column="15" TopLine="112"/>
</Position18>
<Position19>
<Filename Value="umainform.pas"/>
<Caret Line="90" Column="17" TopLine="87"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="508" Column="2" TopLine="493"/>
</Position19>
<Position20>
<Filename Value="umainform.pas"/>
<Caret Line="89" Column="17" TopLine="86"/>
<Filename Value="uform1.pas"/>
<Caret Line="87" Column="3" TopLine="69"/>
</Position20>
<Position21>
<Filename Value="umainform.pas"/>
<Caret Line="90" Column="17" TopLine="87"/>
<Filename Value="uform1.pas"/>
<Caret Line="84" Column="27" TopLine="70"/>
</Position21>
<Position22>
<Filename Value="uform1.pas"/>
<Caret Line="68" Column="15" TopLine="62"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="502" Column="30" TopLine="493"/>
</Position22>
<Position23>
<Filename Value="uform1.pas"/>
<Caret Line="69" Column="15" TopLine="63"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="503" Column="1" TopLine="493"/>
</Position23>
<Position24>
<Filename Value="umainform.pas"/>
<Caret Line="90" Column="17" TopLine="87"/>
<Filename Value="C:\lazarus\lcl\controls.pp"/>
<Caret Line="1625" Column="14" TopLine="1614"/>
</Position24>
<Position25>
<Filename Value="umainform.pas"/>
<Caret Line="89" Column="17" TopLine="86"/>
<Filename Value="C:\lazarus\lcl\include\control.inc"/>
<Caret Line="3994" Column="3" TopLine="3987"/>
</Position25>
<Position26>
<Filename Value="umainform.pas"/>
<Caret Line="88" Column="17" TopLine="85"/>
<Filename Value="C:\lazarus\lcl\include\control.inc"/>
<Caret Line="3680" Column="3" TopLine="3675"/>
</Position26>
<Position27>
<Filename Value="umainform.pas"/>
<Caret Line="87" Column="17" TopLine="84"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="506" Column="39" TopLine="493"/>
</Position27>
<Position28>
<Filename Value="umainform.pas"/>
<Caret Line="88" Column="17" TopLine="85"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position28>
<Position29>
<Filename Value="umainform.pas"/>
<Caret Line="87" Column="17" TopLine="84"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="59" Column="15" TopLine="48"/>
</Position29>
<Position30>
<Filename Value="umainform.pas"/>
<Caret Line="80" Column="4" TopLine="78"/>
<Filename Value="..\tdiclass.pas"/>
<Caret Line="514" Column="25" TopLine="499"/>
</Position30>
</JumpHistory>
</ProjectSession>

View File

@ -28,7 +28,7 @@ object Form1: TForm1
object Edit1: TEdit
Left = 24
Height = 23
Top = 24
Top = 80
Width = 82
TabOrder = 0
Text = 'Edit1'
@ -36,7 +36,7 @@ object Form1: TForm1
object Edit2: TEdit
Left = 24
Height = 23
Top = 96
Top = 136
Width = 82
OnExit = Edit2Exit
TabOrder = 1
@ -51,12 +51,15 @@ object Form1: TForm1
object Label2: TLabel
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
Left = 23
Height = 16
Top = 143
Width = 454
Caption = 'This Form has Max Constraints. It will be centralized on Tab Sheet if it is smaller than it'
Left = 98
Height = 31
Top = 16
Width = 305
Alignment = taCenter
Caption = 'This Form has Max Constraints.'#13#10'It will be centralized on Tab Sheet if it is smaller than it'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object Label3: TLabel
Left = 16
@ -90,19 +93,23 @@ object Form1: TForm1
Visible = False
end
object Label4: TLabel
Left = 24
AnchorSideTop.Control = Edit1
AnchorSideTop.Side = asrCenter
Left = 120
Height = 16
Top = 8
Top = 83
Width = 106
Caption = 'This is a regular Edit'
ParentColor = False
end
object Label5: TLabel
Left = 24
Height = 31
Top = 63
Width = 450
Caption = 'This Edit has a OnExit Validation, who doesn''t allow Page Change if this Edit is empty'#13#10'This can be configured by "VerifyIfCanChange" property'
AnchorSideTop.Control = Edit2
AnchorSideTop.Side = asrCenter
Left = 120
Height = 46
Top = 124
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 tShowmeAgain: TTimer

View File

@ -84,7 +84,9 @@ begin
ShowMessage( 'Remember... Edit2 cannot be empty' );
Edit2.Text := 'Ok, fixed';
end ;
fMainForm.mEvents.Lines.Add( 'Form1.CloseQuery: '+BoolToStr(CanClose,'True','False') );
if Assigned( fMainForm ) then
fMainForm.mEvents.Lines.Add( 'Form1.CloseQuery: '+BoolToStr(CanClose,'True','False') );
end;
procedure TForm1.FormDestroy(Sender : TObject) ;

View File

@ -32,7 +32,7 @@ object fMainForm: TfMainForm
Top = 0
Width = 587
TabStop = False
ActivePage = TabSheet1
ActivePage = tsFixed
Align = alClient
Constraints.MinHeight = 300
Constraints.MinWidth = 500
@ -53,13 +53,13 @@ object fMainForm: TfMainForm
TDIActions.CloseAllTabs.Caption = 'Close All Tabs'
TDIActions.CloseAllTabs.ImageIndex = 2
FixedPages = 1
object TabSheet1: TTabSheet
Caption = 'TabSheet1'
object tsFixed: TTabSheet
Caption = 'TTDINotebook Demo'
ClientHeight = 363
ClientWidth = 579
ImageIndex = 5
object Label2: TLabel
AnchorSideLeft.Control = TabSheet1
AnchorSideLeft.Control = tsFixed
AnchorSideLeft.Side = asrCenter
Left = 167
Height = 31
@ -120,6 +120,37 @@ object fMainForm: TfMainForm
Caption = 'BackgroundCorner'
ParentColor = False
end
object bToggleLog: TButton
AnchorSideTop.Control = pBottom
AnchorSideTop.Side = asrCenter
Left = 622
Height = 25
Top = 13
Width = 85
Anchors = [akTop, akRight]
AutoSize = True
Caption = 'Hide Log >'
OnClick = bToggleLogClick
TabOrder = 1
end
object Label3: TLabel
Left = 182
Height = 16
Top = 1
Width = 59
Caption = 'FixedPages'
ParentColor = False
end
object seFixedPages: TSpinEdit
Left = 184
Height = 23
Top = 17
Width = 50
MaxValue = 10
OnChange = seFixedPagesChange
TabOrder = 2
Value = 1
end
end
object mEvents: TMemo
Left = 592

View File

@ -6,19 +6,21 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
ComCtrls, Buttons, StdCtrls, ExtCtrls, TDIClass , types, SynMemo, IpHtml;
ComCtrls, Buttons, StdCtrls, ExtCtrls, Spin, TDIClass , types, IpHtml;
type
{ TfMainForm }
TfMainForm = class(TForm)
bToggleLog : TButton ;
cbxBackgroundCorner : TComboBox ;
Image1 : TImage ;
ImageList1 : TImageList ;
IpHtmlPanel1 : TIpHtmlPanel ;
Label1 : TLabel ;
Label2 : TLabel ;
Label3 : TLabel ;
MainMenu1 : TMainMenu ;
mEvents : TMemo ;
MenuItem1 : TMenuItem ;
@ -27,16 +29,19 @@ type
miForm2 : TMenuItem ;
miForm1 : TMenuItem ;
pBottom : TPanel ;
seFixedPages : TSpinEdit ;
Splitter1 : TSplitter ;
StatusBar1 : TStatusBar ;
TabSheet1 : TTabSheet ;
tsFixed : TTabSheet ;
TDINoteBook1 : TTDINoteBook ;
procedure bToggleLogClick(Sender : TObject) ;
procedure cbxBackgroundCornerChange(Sender : TObject) ;
procedure FormClose(Sender : TObject ; var CloseAction : TCloseAction) ;
procedure FormCloseQuery(Sender : TObject ; var CanClose : boolean) ;
procedure FormCreate(Sender : TObject) ;
procedure miExitClick(Sender : TObject) ;
procedure miForm1Click(Sender : TObject) ;
procedure seFixedPagesChange(Sender : TObject) ;
procedure TDINoteBook1Change(Sender : TObject) ;
private
{ private declarations }
@ -70,6 +75,16 @@ begin
TDINoteBook1.BackgroundCorner := TTDIBackgroundCorner( cbxBackgroundCorner.ItemIndex );
end;
procedure TfMainForm.bToggleLogClick(Sender : TObject) ;
begin
mEvents.Visible := not mEvents.Visible ;
if mEvents.Visible then
bToggleLog.Caption := 'Hide Log >'
else
bToggleLog.Caption := '< Show Log' ;
end;
procedure TfMainForm.FormClose(Sender : TObject ; var CloseAction : TCloseAction
) ;
begin
@ -92,6 +107,11 @@ begin
TDINoteBook1.CreateFormInNewPage( TForm1, 3 );
end;
procedure TfMainForm.seFixedPagesChange(Sender : TObject) ;
begin
TDINoteBook1.FixedPages := seFixedPages.Value;
end;
procedure TfMainForm.TDINoteBook1Change(Sender : TObject) ;
begin
mEvents.Lines.Add('OnChange');

View File

@ -56,6 +56,7 @@ type
procedure SetFormInPage(AValue : TForm) ;
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure CheckFormAlign ;
public
constructor Create(TheOwner: TComponent ); override;
@ -81,6 +82,7 @@ type
procedure SetBackgroundCorner(AValue : TTDIBackgroundCorner) ;
procedure SetCloseTabButtom(AValue : TTDICloseTabButtom) ;
procedure SetMainMenu(AValue : TMainMenu) ;
procedure SetFixedPages(AValue : Integer) ;
private
FCloseBitBtn : TBitBtn ;
FCloseMenuItem : TMenuItem ;
@ -110,6 +112,8 @@ type
function CanChange: Boolean; override;
procedure DoChange; override;
procedure Loaded; override;
procedure RemovePage(Index: Integer); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public
@ -138,7 +142,7 @@ type
write FRestoreActiveControl default True;
property VerifyIfCanChangePage : Boolean read FVerifyIfCanChangePage
write FVerifyIfCanChangePage default True;
property FixedPages : Integer read FFixedPages write FFixedPages default 0;
property FixedPages : Integer read FFixedPages write SetFixedPages default 0;
end ;
@ -246,7 +250,7 @@ begin
fsFormInPage := nil;
end ;
procedure TTDIPage.OnResizeTDIPage(Sender : TObject) ;
procedure TTDIPage.CheckFormAlign ;
begin
if not Assigned(fsFormInPage) then exit ;
@ -266,6 +270,11 @@ begin
fsFormInPage.Align := alClient;
end ;
procedure TTDIPage.OnResizeTDIPage(Sender : TObject) ;
begin
CheckFormAlign;
end ;
{ TTDINoteBook }
constructor TTDINoteBook.Create(TheOwner : TComponent) ;
@ -435,6 +444,14 @@ begin
FTabsMenuItem.Add(FCloseAllTabsMenuItem);
end ;
procedure TTDINoteBook.SetFixedPages(AValue : Integer) ;
begin
if FFixedPages = AValue then Exit ;
FFixedPages := AValue ;
CheckInterface;
end ;
procedure TTDINoteBook.SetBackgroundImage(AValue : TImage) ;
begin
if FBackgroundImage = AValue then Exit ;
@ -483,17 +500,24 @@ procedure TTDINoteBook.ShowForInNewPage(AForm : TForm ; ImageIndex : Integer) ;
Var
NewPage : TTDIPage ;
begin
Visible := True;
// Create a new Page
NewPage := TTDIPage.Create(Self);
NewPage.ImageIndex := ImageIndex;
Visible := True;
// This will call TTDIPage.SetFormInPage, who does the magic //
NewPage.FormInPage := AForm;
// Activate the new Page
ActivePage := NewPage;
// First Page always need a little help for align form inside //
if PageCount = 1 then
begin
NewPage.CheckFormAlign ;
CheckInterface;
end ;
end ;
procedure TTDINoteBook.CheckInterface ;
@ -558,8 +582,7 @@ end ;
procedure TTDINoteBook.CloseTabClicked(Sender : TObject) ;
begin
if CanCloseAPage( ActivePageIndex ) then
RemovePage( ActivePageIndex );
RemovePage( ActivePageIndex );
end ;
procedure TTDINoteBook.CloseAllTabsClicked(Sender : TObject) ;
@ -573,9 +596,9 @@ begin
// Close while have pages, and Pages still being closed //
while (PageCount > FFixedPages) and (LastPageCount <> PageCount) do
begin
LastPageCount := PageCount ;
CloseTabClicked(Sender);
Application.ProcessMessages;
LastPageCount := PageCount ;
RemovePage( ActivePageIndex );
Application.ProcessMessages;
end;
end ;
@ -722,6 +745,32 @@ begin
CheckInterface;
end ;
procedure TTDINoteBook.RemovePage(Index : Integer) ;
Var
CanRemovePage : Boolean ;
begin
CanRemovePage := True;
if Pages[Index] is TTDIPage then
with TTDIPage(Pages[Index]) do
begin
if Assigned( FormInPage ) then
begin
CanRemovePage := FormInPage.CloseQuery ;
if CanRemovePage then
FormInPage.Close ;
end ;
end ;
if CanRemovePage then
begin
inherited RemovePage(Index) ;
if PageCount < 1 then // On this case, DoChange is not fired //
CheckInterface;
end ;
end ;
procedure TTDINoteBook.Notification(AComponent : TComponent ;
Operation : TOperation) ;
begin