dockmanager example: allow to use LDockTree manager (alternatively)

git-svn-id: trunk@19953 -
This commit is contained in:
dodi 2009-05-13 11:09:18 +00:00
parent 18fa3ce4ca
commit 7ba7100c21
6 changed files with 19 additions and 27 deletions

2
.gitattributes vendored
View File

@ -2169,6 +2169,7 @@ examples/docking/unit1.lrs svneol=native#text/pascal
examples/docking/unit1.pas svneol=native#text/pascal
examples/dockmanager/easytree/BUGS.txt svneol=native#text/plain
examples/dockmanager/easytree/README.txt svneol=native#text/plain
examples/dockmanager/easytree/easy_dock_images.lrs svneol=native#text/plain
examples/dockmanager/easytree/easydockhelpers.pas svneol=native#text/plain
examples/dockmanager/easytree/easydocking.lpi svneol=native#text/plain
examples/dockmanager/easytree/easydocking.lpr svneol=native#text/plain
@ -2182,7 +2183,6 @@ examples/dockmanager/easytree/fmain.pas svneol=native#text/plain
examples/dockmanager/easytree/ftree.lfm svneol=native#text/plain
examples/dockmanager/easytree/ftree.lrs svneol=native#text/plain
examples/dockmanager/easytree/ftree.pas svneol=native#text/plain
examples/dockmanager/easytree/lcl_dock_images.lrs svneol=native#text/plain
examples/dragimagelist/project1.lpi svneol=native#text/plain
examples/dragimagelist/project1.lpr svneol=native#text/pascal
examples/dragimagelist/readme.txt svneol=native#text/plain

View File

@ -1,10 +1,10 @@
LazarusResources.Add('lcl_dock_close','PNG',[
LazarusResources.Add('easy_dock_close','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#10#0#0#0#10#8#6#0#0#0#141'2'#207
+#189#0#0#0'0IDATx'#218'c````d '#1#252#135'b'#130#226#255#177#8#254#199'e'#192
+''#28#24#175#19#240'*b '#215'4'#130#238#195#235#25#162#131#135' '#0#0#177'5'
+''''#218'{1'#230#136#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('lcl_dock_restore','PNG',[
LazarusResources.Add('easy_dock_restore','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#10#0#0#0#10#8#6#0#0#0#141'2'#207
+#189#0#0#0'&IDATx'#218'c````d '#3#252#199#131#201'W'#136#203'&'#162'L"O!!'
+#207#17#231'6'#178#20#226#13#22#0#23#22'.'#211'T'#186#182'Q'#0#0#0#0'IEND'

View File

@ -80,7 +80,7 @@ const
implementation
uses
Classes, SysUtils, math, Themes, LResources, LCLIntf, LCLProc;
Classes, SysUtils, Themes, LResources, LCLIntf, LCLProc;
type
{
@ -100,8 +100,8 @@ type
const
DockHeaderImageNames: array[TDockHeaderImageKind] of String =
(
{ dhiRestore } 'lcl_dock_restore',
{ dhiClose } 'lcl_dock_close'
{ dhiRestore } 'easy_dock_restore',
{ dhiClose } 'easy_dock_close'
);
var
@ -188,8 +188,6 @@ end;
class function TEasyDockHeader.GetRectOfPart(AHeaderRect: TRect; AOrientation: TDockOrientation;
APart: TEasyZonePart; HasSplitter: boolean): TRect;
var
d, dRight, dWidth: Integer;
begin
(* AHeaderRect is (must be) TLBR zone rectangle, on input.
*)
@ -326,7 +324,10 @@ const
);
var
Details: TThemedElementDetails;
{$IFDEF old}
dx, dy: integer;
{$ELSE}
{$ENDIF}
begin
Details := ThemeServices.GetElementDetails(BtnDetail[IsMouseDown, IsMouseOver]);
ThemeServices.DrawElement(ACanvas.Handle, Details, ARect);
@ -457,7 +458,7 @@ end;
initialization
{$I lcl_dock_images.lrs}
{$I easy_dock_images.lrs}
CreateDockHeaderImages;
finalization
DestroyDockHeaderImages;

View File

@ -32,7 +32,7 @@
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="8">
<Units Count="7">
<Unit0>
<Filename Value="easydocking.lpr"/>
<IsPartOfProject Value="True"/>
@ -76,28 +76,17 @@
<IsPartOfProject Value="True"/>
<UnitName Value="EasyDockHelpers"/>
</Unit6>
<Unit7>
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="LDockTree"/>
</Unit7>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<PathDelim Value="\"/>
<SearchPaths>
<OtherUnitFiles Value="..\..\..\lcl\"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<CStyleOperator Value="False"/>
</SyntaxOptions>
</Parsing>
<Other>
<Verbosity>
<ShowAll Value="True"/>
</Verbosity>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>

View File

@ -6,7 +6,7 @@ program EasyDocking;
uses
Interfaces,
Forms, LDockTree,
Forms,
fMain in 'fMain.pas' {EasyDockMain},
fDockable in 'fDockable.pas' {Dockable},
EasyDockSite in 'EasyDockSite.pas',

View File

@ -63,7 +63,7 @@ type
function GetLeft: Integer;
function GetTop: Integer;
function GetTopOrLeft(fTop: boolean): Integer;
private //very basic liniking
private //very basic linking
(* Beware: Lazarus tends to insert a private member FChildControl,
which hides the inherited member of the same name!
*)
@ -671,6 +671,7 @@ var
var
ZoneExtent: TPoint;
ADockRect: TRect;
begin
(* New DockManager interface, called instead of the old version.
Determine exact target (zone) and DropAlign.
@ -696,11 +697,11 @@ Signal results:
DropAlign := alClient; //first element in entire site
end else begin
//determined the alignment within the zone.
DockRect := zone.GetBounds; //include header
ADockRect := zone.GetBounds; //include header
DropAlign := DetectAlign(zone.BR, DragTargetPos);
//to screen coords
DockRect.TopLeft := FDockSite.ClientToScreen(DockRect.TopLeft);
DockRect.BottomRight := FDockSite.ClientToScreen(DockRect.BottomRight);
ADockRect.TopLeft := FDockSite.ClientToScreen(ADockRect.TopLeft);
ADockRect.BottomRight := FDockSite.ClientToScreen(ADockRect.BottomRight);
end;
end;
//position DockRect
@ -714,8 +715,9 @@ Signal results:
//DockRect := Rect(MaxInt, 0, MaxInt, 0); //LTRB
{$ENDIF}
end else begin
PositionDockRect(Control, DropOnControl, DropAlign, DockRect);
PositionDockRect(Control, DropOnControl, DropAlign, ADockRect);
end;
DockRect := ADockRect;
end;
end;