disabled inline for 2.0.0

git-svn-id: trunk@8134 -
This commit is contained in:
mattias 2005-11-11 16:36:53 +00:00
parent bb35225370
commit e958469de0
2 changed files with 88 additions and 40 deletions

View File

@ -1691,7 +1691,7 @@ var
CharLen: integer; CharLen: integer;
// Copies from SourceStart to Source to Dest and updates Dest // Copies from SourceStart to Source to Dest and updates Dest
procedure CopyPart; inline; procedure CopyPart; {$IFNDEF VER2_0_0}inline;{$ENDIF}
var var
CopyLength: SizeInt; CopyLength: SizeInt;
begin begin

View File

@ -141,6 +141,7 @@ type
protected protected
procedure DeleteSideSplitter(Splitter: TLazDockSplitter; Side: TAnchorKind; procedure DeleteSideSplitter(Splitter: TLazDockSplitter; Side: TAnchorKind;
NewAnchorControl: TControl); NewAnchorControl: TControl);
procedure CombineSpiralSplitterPair(Splitter1, Splitter2: TLazDockSplitter);
public public
constructor Create; constructor Create;
procedure BeginUpdate; override; procedure BeginUpdate; override;
@ -713,6 +714,36 @@ begin
end; end;
end; end;
procedure TAnchoredDockManager.CombineSpiralSplitterPair(Splitter1,
Splitter2: TLazDockSplitter);
{ Four spiral splitters:
Before:
|
A |
---------|
| +--+ | C
B | | | |
| +--+ |
| ----------
| D
The left and right splitter will be combined to one.
After:
|
A |
-------|
| C
B |
|
|------
| D
}
begin
RaiseGDBException('TAnchoredDockManager.CombineSpiralSplitterPair TODO');
end;
constructor TAnchoredDockManager.Create; constructor TAnchoredDockManager.Create;
begin begin
FSplitterSize:=5; FSplitterSize:=5;
@ -1019,6 +1050,7 @@ var
OldAnchorControls: array[TAnchorKind] of TControl; OldAnchorControls: array[TAnchorKind] of TControl;
IsSpiralSplitter: Boolean; IsSpiralSplitter: Boolean;
ParentControl: TWinControl; ParentControl: TWinControl;
Done: Boolean;
begin begin
if Control.Parent=nil then begin if Control.Parent=nil then begin
// already undocked // already undocked
@ -1036,55 +1068,71 @@ begin
end; end;
Control.Anchors:=[akLeft,akTop]; Control.Anchors:=[akLeft,akTop];
// check if their is a splitter, that has a side with only Control anchored Done:=false;
// to it.
for a:=Low(TAnchorKind) to High(TAnchorKind) do begin if not Done then begin
AnchorControl:=OldAnchorControls[a]; // check if their is a splitter, that has a side with only Control anchored
if AnchorControl is TLazDockSplitter then begin // to it.
AnchorSplitter:=TLazDockSplitter(AnchorControl); for a:=Low(TAnchorKind) to High(TAnchorKind) do begin
i:=Control.Parent.ControlCount-1; AnchorControl:=OldAnchorControls[a];
while i>=0 do begin if AnchorControl is TLazDockSplitter then begin
Sibling:=Control.Parent.Controls[i]; AnchorSplitter:=TLazDockSplitter(AnchorControl);
if (Sibling.AnchorSide[a].Control=AnchorSplitter) then begin i:=Control.Parent.ControlCount-1;
// Sibling is anchored with the same side to the splitter while i>=0 do begin
// => this splitter is needed, can not be deleted. Sibling:=Control.Parent.Controls[i];
break; if (Sibling.AnchorSide[a].Control=AnchorSplitter) then begin
// Sibling is anchored with the same side to the splitter
// => this splitter is needed, can not be deleted.
break;
end;
end;
if i<0 then begin
// this splitter is not needed anymore
DeleteSideSplitter(AnchorSplitter,OppositeAnchor[a],
OldAnchorControls[OppositeAnchor[a]]);
Done:=true;
end; end;
end; end;
if i<0 then begin end;
// this splitter is not needed anymore end;
RaiseGDBException('');
DeleteSideSplitter(AnchorSplitter,OppositeAnchor[a], if not Done then begin
OldAnchorControls[OppositeAnchor[a]]); // check if there are four spiral splitters around Control
IsSpiralSplitter:=true;
for a:=Low(TAnchorKind) to High(TAnchorKind) do begin
AnchorControl:=OldAnchorControls[a];
if (AnchorControl=nil)
or (not (AnchorControl is TLazDockSplitter)) then begin
IsSpiralSplitter:=false;
end; end;
end; end;
end; if IsSpiralSplitter then begin
CombineSpiralSplitterPair(OldAnchorControls[akLeft] as TLazDockSplitter,
// check if there are four spiral splitters around Control OldAnchorControls[akRight] as TLazDockSplitter);
IsSpiralSplitter:=true; Done:=true;
for a:=Low(TAnchorKind) to High(TAnchorKind) do begin
AnchorControl:=OldAnchorControls[a];
if (AnchorControl=nil)
or (not (AnchorControl is TLazDockSplitter)) then begin
IsSpiralSplitter:=false;
end; end;
end; end;
if IsSpiralSplitter then begin
RaiseGDBException('TODO');
end;
// check if Control is the only child of a TLazDockPage if not Done then begin
if (Control.Parent.ControlCount=1) // check if Control is the only child of a TLazDockPage
and (Control.Parent is TLazDockPage) then begin if (Control.Parent.ControlCount=1)
RaiseGDBException('TODO'); and (Control.Parent is TLazDockPage) then begin
RaiseGDBException('TODO');
end;
end; end;
// check if Control is the only child of a TLazDockForm if not Done then begin
if (Control.Parent.ControlCount=1) // check if Control is the only child of a TLazDockForm
and (Control.Parent is TLazDockForm) then begin if (Control.Parent.ControlCount=1)
RaiseGDBException('TODO'); and (Control.Parent is TLazDockForm) then begin
RaiseGDBException('TODO');
end;
end; end;
if not Done then begin
// otherwise: keep
end;
finally finally
if ParentControl<>nil then if ParentControl<>nil then
ParentControl.DisableAlign; ParentControl.DisableAlign;