mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 11:16:09 +02:00
dockmanager example: elasticsite now also reflects enlarged forms
git-svn-id: trunk@22394 -
This commit is contained in:
parent
929dc64acd
commit
5d7eca12b4
@ -1,7 +1,7 @@
|
|||||||
object DockingSite: TDockingSite
|
object DockingSite: TDockingSite
|
||||||
Left = 384
|
Left = 444
|
||||||
Height = 163
|
Height = 163
|
||||||
Top = 157
|
Top = 156
|
||||||
Width = 255
|
Width = 255
|
||||||
Caption = 'Dock Site'
|
Caption = 'Dock Site'
|
||||||
ClientHeight = 163
|
ClientHeight = 163
|
||||||
@ -52,7 +52,6 @@ object DockingSite: TDockingSite
|
|||||||
Top = 142
|
Top = 142
|
||||||
Width = 255
|
Width = 255
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
AutoSize = True
|
|
||||||
Caption = 'pnlBottom'
|
Caption = 'pnlBottom'
|
||||||
DockSite = True
|
DockSite = True
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
@ -61,15 +60,6 @@ object DockingSite: TDockingSite
|
|||||||
OnGetSiteInfo = pnlLeftGetSiteInfo
|
OnGetSiteInfo = pnlLeftGetSiteInfo
|
||||||
OnUnDock = pnlLeftUnDock
|
OnUnDock = pnlLeftUnDock
|
||||||
end
|
end
|
||||||
object splitBottom: TSplitter
|
|
||||||
Cursor = crVSplit
|
|
||||||
Left = 0
|
|
||||||
Height = 4
|
|
||||||
Top = 138
|
|
||||||
Width = 255
|
|
||||||
Align = alBottom
|
|
||||||
ResizeAnchor = akBottom
|
|
||||||
end
|
|
||||||
object splitRight: TSplitter
|
object splitRight: TSplitter
|
||||||
Left = 251
|
Left = 251
|
||||||
Height = 138
|
Height = 138
|
||||||
@ -94,7 +84,7 @@ object DockingSite: TDockingSite
|
|||||||
Caption = 'Client'
|
Caption = 'Client'
|
||||||
ClientHeight = 138
|
ClientHeight = 138
|
||||||
ClientWidth = 247
|
ClientWidth = 247
|
||||||
TabOrder = 7
|
TabOrder = 6
|
||||||
object buNewForm: TButton
|
object buNewForm: TButton
|
||||||
Left = 96
|
Left = 96
|
||||||
Height = 20
|
Height = 20
|
||||||
@ -105,4 +95,13 @@ object DockingSite: TDockingSite
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object splitBottom: TSplitter
|
||||||
|
Cursor = crVSplit
|
||||||
|
Left = 0
|
||||||
|
Height = 4
|
||||||
|
Top = 138
|
||||||
|
Width = 255
|
||||||
|
Align = alBottom
|
||||||
|
ResizeAnchor = akBottom
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{ This is an automatically generated lazarus resource file }
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
LazarusResources.Add('TDockingSite','FORMDATA',[
|
LazarusResources.Add('TDockingSite','FORMDATA',[
|
||||||
'TPF0'#12'TDockingSite'#11'DockingSite'#4'Left'#3#128#1#6'Height'#3#163#0#3'T'
|
'TPF0'#12'TDockingSite'#11'DockingSite'#4'Left'#3#188#1#6'Height'#3#163#0#3'T'
|
||||||
+'op'#3#157#0#5'Width'#3#255#0#7'Caption'#6#9'Dock Site'#12'ClientHeight'#3
|
+'op'#3#156#0#5'Width'#3#255#0#7'Caption'#6#9'Dock Site'#12'ClientHeight'#3
|
||||||
+#163#0#11'ClientWidth'#3#255#0#10'LCLVersion'#6#6'0.9.29'#7'Visible'#9#0#6'T'
|
+#163#0#11'ClientWidth'#3#255#0#10'LCLVersion'#6#6'0.9.29'#7'Visible'#9#0#6'T'
|
||||||
+'Panel'#7'pnlLeft'#4'Left'#2#0#6'Height'#3#138#0#3'Top'#2#0#5'Width'#2#0#5'A'
|
+'Panel'#7'pnlLeft'#4'Left'#2#0#6'Height'#3#138#0#3'Top'#2#0#5'Width'#2#0#5'A'
|
||||||
+'lign'#7#6'alLeft'#7'Caption'#6#7'pnlLeft'#5'Color'#7#7'clWhite'#8'DockSite'
|
+'lign'#7#6'alLeft'#7'Caption'#6#7'pnlLeft'#5'Color'#7#7'clWhite'#8'DockSite'
|
||||||
@ -15,18 +15,18 @@ LazarusResources.Add('TDockingSite','FORMDATA',[
|
|||||||
+'TabOrder'#2#2#10'OnDockDrop'#7#15'pnlLeftDockDrop'#10'OnDockOver'#7#15'pnlL'
|
+'TabOrder'#2#2#10'OnDockDrop'#7#15'pnlLeftDockDrop'#10'OnDockOver'#7#15'pnlL'
|
||||||
+'eftDockOver'#13'OnGetSiteInfo'#7#18'pnlLeftGetSiteInfo'#8'OnUnDock'#7#13'pn'
|
+'eftDockOver'#13'OnGetSiteInfo'#7#18'pnlLeftGetSiteInfo'#8'OnUnDock'#7#13'pn'
|
||||||
+'lLeftUnDock'#0#0#6'TPanel'#9'pnlBottom'#4'Left'#2#0#6'Height'#2#1#3'Top'#3
|
+'lLeftUnDock'#0#0#6'TPanel'#9'pnlBottom'#4'Left'#2#0#6'Height'#2#1#3'Top'#3
|
||||||
+#142#0#5'Width'#3#255#0#5'Align'#7#8'alBottom'#8'AutoSize'#9#7'Caption'#6#9
|
+#142#0#5'Width'#3#255#0#5'Align'#7#8'alBottom'#7'Caption'#6#9'pnlBottom'#8'D'
|
||||||
+'pnlBottom'#8'DockSite'#9#8'TabOrder'#2#3#10'OnDockDrop'#7#15'pnlLeftDockDro'
|
+'ockSite'#9#8'TabOrder'#2#3#10'OnDockDrop'#7#15'pnlLeftDockDrop'#10'OnDockOv'
|
||||||
+'p'#10'OnDockOver'#7#15'pnlLeftDockOver'#13'OnGetSiteInfo'#7#18'pnlLeftGetSi'
|
+'er'#7#15'pnlLeftDockOver'#13'OnGetSiteInfo'#7#18'pnlLeftGetSiteInfo'#8'OnUn'
|
||||||
+'teInfo'#8'OnUnDock'#7#13'pnlLeftUnDock'#0#0#9'TSplitter'#11'splitBottom'#6
|
+'Dock'#7#13'pnlLeftUnDock'#0#0#9'TSplitter'#10'splitRight'#4'Left'#3#251#0#6
|
||||||
+'Cursor'#7#8'crVSplit'#4'Left'#2#0#6'Height'#2#4#3'Top'#3#138#0#5'Width'#3
|
+'Height'#3#138#0#3'Top'#2#0#5'Width'#2#4#5'Align'#7#7'alRight'#12'ResizeAnch'
|
||||||
+#255#0#5'Align'#7#8'alBottom'#12'ResizeAnchor'#7#8'akBottom'#0#0#9'TSplitter'
|
+'or'#7#7'akRight'#0#0#10'TStatusBar'#10'StatusBar1'#4'Left'#2#0#6'Height'#2
|
||||||
+#10'splitRight'#4'Left'#3#251#0#6'Height'#3#138#0#3'Top'#2#0#5'Width'#2#4#5
|
+#20#3'Top'#3#143#0#5'Width'#3#255#0#6'Panels'#14#0#0#0#6'TPanel'#6'Panel1'#4
|
||||||
+'Align'#7#7'alRight'#12'ResizeAnchor'#7#7'akRight'#0#0#10'TStatusBar'#10'Sta'
|
+'Left'#2#4#6'Height'#3#138#0#3'Top'#2#0#5'Width'#3#247#0#5'Align'#7#8'alClie'
|
||||||
+'tusBar1'#4'Left'#2#0#6'Height'#2#20#3'Top'#3#143#0#5'Width'#3#255#0#6'Panel'
|
+'nt'#7'Caption'#6#6'Client'#12'ClientHeight'#3#138#0#11'ClientWidth'#3#247#0
|
||||||
+'s'#14#0#0#0#6'TPanel'#6'Panel1'#4'Left'#2#4#6'Height'#3#138#0#3'Top'#2#0#5
|
+#8'TabOrder'#2#6#0#7'TButton'#9'buNewForm'#4'Left'#2'`'#6'Height'#2#20#3'Top'
|
||||||
+'Width'#3#247#0#5'Align'#7#8'alClient'#7'Caption'#6#6'Client'#12'ClientHeigh'
|
+#2#16#5'Width'#2'>'#7'Caption'#6#8'New Form'#7'OnClick'#7#14'buNewFormClick'
|
||||||
+'t'#3#138#0#11'ClientWidth'#3#247#0#8'TabOrder'#2#7#0#7'TButton'#9'buNewForm'
|
+#8'TabOrder'#2#0#0#0#0#9'TSplitter'#11'splitBottom'#6'Cursor'#7#8'crVSplit'#4
|
||||||
+#4'Left'#2'`'#6'Height'#2#20#3'Top'#2#16#5'Width'#2'>'#7'Caption'#6#8'New Fo'
|
+'Left'#2#0#6'Height'#2#4#3'Top'#3#138#0#5'Width'#3#255#0#5'Align'#7#8'alBott'
|
||||||
+'rm'#7'OnClick'#7#14'buNewFormClick'#8'TabOrder'#2#0#0#0#0#0
|
+'om'#12'ResizeAnchor'#7#8'akBottom'#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@ -41,8 +41,8 @@ type
|
|||||||
pnlBottom: TPanel;
|
pnlBottom: TPanel;
|
||||||
pnlLeft: TPanel;
|
pnlLeft: TPanel;
|
||||||
pnlRight: TPanel;
|
pnlRight: TPanel;
|
||||||
splitLeft: TSplitter;
|
|
||||||
splitBottom: TSplitter;
|
splitBottom: TSplitter;
|
||||||
|
splitLeft: TSplitter;
|
||||||
splitRight: TSplitter;
|
splitRight: TSplitter;
|
||||||
StatusBar1: TStatusBar;
|
StatusBar1: TStatusBar;
|
||||||
procedure buNewFormClick(Sender: TObject);
|
procedure buNewFormClick(Sender: TObject);
|
||||||
@ -54,7 +54,11 @@ type
|
|||||||
var InfluenceRect: TRect; MousePos: TPoint; var CanDock: Boolean);
|
var InfluenceRect: TRect; MousePos: TPoint; var CanDock: Boolean);
|
||||||
procedure pnlLeftUnDock(Sender: TObject; Client: TControl;
|
procedure pnlLeftUnDock(Sender: TObject; Client: TControl;
|
||||||
NewTarget: TWinControl; var Allow: Boolean);
|
NewTarget: TWinControl; var Allow: Boolean);
|
||||||
|
private
|
||||||
|
FAutoExpand: boolean;
|
||||||
public
|
public
|
||||||
|
published
|
||||||
|
property AutoExpand: boolean read FAutoExpand write FAutoExpand;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -63,13 +67,22 @@ var
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
fDockClient; //test only
|
LCLIntf;
|
||||||
|
|
||||||
|
//uses fDockClient; //test only
|
||||||
|
|
||||||
{ TDockingSite }
|
{ TDockingSite }
|
||||||
|
|
||||||
procedure TDockingSite.buNewFormClick(Sender: TObject);
|
procedure TDockingSite.buNewFormClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Client: TPanel;
|
||||||
begin
|
begin
|
||||||
TDockingClient.Create(self);
|
//TDockingClient.Create(self);
|
||||||
|
Client := TPanel.Create(self);
|
||||||
|
Client.DragMode := dmAutomatic;
|
||||||
|
Client.DragKind := dkDock;
|
||||||
|
Client.Visible := True;
|
||||||
|
Client.ManualFloat(Rect(200,200, 400,400));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDockingSite.pnlLeftDockDrop(Sender: TObject;
|
procedure TDockingSite.pnlLeftDockDrop(Sender: TObject;
|
||||||
@ -77,12 +90,17 @@ procedure TDockingSite.pnlLeftDockDrop(Sender: TObject;
|
|||||||
var
|
var
|
||||||
w: integer;
|
w: integer;
|
||||||
r: TRect;
|
r: TRect;
|
||||||
|
Site: TWinControl absolute Sender;
|
||||||
begin
|
begin
|
||||||
(* Adjust docksite extent, if required.
|
(* Adjust docksite extent, if required.
|
||||||
H/V depending on align LR/TB.
|
H/V depending on align LR/TB.
|
||||||
Take 1/3 of the form's extent for the dock site.
|
Take 1/3 of the form's extent for the dock site.
|
||||||
When changed, ensure that the form layout is updated.
|
When changed, ensure that the form layout is updated.
|
||||||
*)
|
*)
|
||||||
|
if (TWinControl(Source.DragTarget).DockClientCount > 1)
|
||||||
|
or ((Site.Width > 1) and (Site.Height > 1)) //NoteBook!
|
||||||
|
then
|
||||||
|
exit; //no adjustments of the dock site required
|
||||||
with Source do begin
|
with Source do begin
|
||||||
if DragTarget.Align in [alLeft, alRight] then begin
|
if DragTarget.Align in [alLeft, alRight] then begin
|
||||||
w := self.Width div 3;
|
w := self.Width div 3;
|
||||||
@ -91,7 +109,7 @@ begin
|
|||||||
DisableAlign; //form(?)
|
DisableAlign; //form(?)
|
||||||
DragTarget.Width := w;
|
DragTarget.Width := w;
|
||||||
if DragTarget.Align = alRight then begin
|
if DragTarget.Align = alRight then begin
|
||||||
if AutoSize then begin
|
if AutoExpand then begin
|
||||||
r := self.BoundsRect;
|
r := self.BoundsRect;
|
||||||
inc(r.Right, w);
|
inc(r.Right, w);
|
||||||
BoundsRect := r;
|
BoundsRect := r;
|
||||||
@ -99,7 +117,7 @@ begin
|
|||||||
dec(DragTarget.Left, w);
|
dec(DragTarget.Left, w);
|
||||||
dec(splitRight.Left, w);
|
dec(splitRight.Left, w);
|
||||||
end;
|
end;
|
||||||
end else if AutoSize then begin
|
end else if AutoExpand then begin
|
||||||
//enlarge left
|
//enlarge left
|
||||||
r := BoundsRect;
|
r := BoundsRect;
|
||||||
dec(r.Left, w);
|
dec(r.Left, w);
|
||||||
@ -114,7 +132,7 @@ begin
|
|||||||
DisableAlign; //form(?)
|
DisableAlign; //form(?)
|
||||||
DragTarget.Height := w;
|
DragTarget.Height := w;
|
||||||
if DragTarget.Align = alBottom then begin
|
if DragTarget.Align = alBottom then begin
|
||||||
if AutoSize then begin
|
if AutoExpand then begin
|
||||||
//dec(self.Left, w);
|
//dec(self.Left, w);
|
||||||
r := self.BoundsRect;
|
r := self.BoundsRect;
|
||||||
inc(r.Bottom, w);
|
inc(r.Bottom, w);
|
||||||
@ -135,28 +153,74 @@ end;
|
|||||||
procedure TDockingSite.pnlLeftDockOver(Sender: TObject;
|
procedure TDockingSite.pnlLeftDockOver(Sender: TObject;
|
||||||
Source: TDragDockObject; X, Y: Integer; State: TDragState;
|
Source: TDragDockObject; X, Y: Integer; State: TDragState;
|
||||||
var Accept: Boolean);
|
var Accept: Boolean);
|
||||||
begin
|
var
|
||||||
if Source.DragTarget = nil then
|
r: TRect;
|
||||||
exit;
|
|
||||||
if State = dsDragMove then begin
|
procedure Adjust(dw, dh: integer);
|
||||||
Accept := True;
|
begin
|
||||||
//make DockRect reflect the docking area
|
(* r.TopLeft in screen coords, r.BottomRight is W/H(?)
|
||||||
with Source do begin
|
negative values mean expansion towards screen origin
|
||||||
StatusBar1.SimpleText := AlignNames[DropAlign];
|
*)
|
||||||
DockRect := DragTarget.ClientRect;
|
if dw <> 0 then begin
|
||||||
{ TODO : AutoSize }
|
r.Right := r.Left;
|
||||||
if DragTarget.Width <= 0 then begin
|
inc(r.Bottom, r.Top);
|
||||||
dec(DockRect.Left, 10);
|
if dw > 0 then
|
||||||
inc(DockRect.Right, 20);
|
inc(r.Right, dw)
|
||||||
end else if DragTarget.Height <= 0 then begin
|
else
|
||||||
dec(DockRect.Top, 10);
|
inc(r.Left, dw);
|
||||||
inc(DockRect.Bottom, 20);
|
end else begin
|
||||||
end;
|
r.Bottom := r.Top;
|
||||||
DockRect.TopLeft := TWinControl(DragTarget).ClientToScreen(DockRect.TopLeft);
|
inc(r.Right, r.Left);
|
||||||
inc(DockRect.Bottom, DockRect.Top);
|
if dh > 0 then
|
||||||
inc(DockRect.Right, DockRect.Left);
|
inc(r.Bottom, dh)
|
||||||
|
else
|
||||||
|
inc(r.Top, dh);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Site: TWinControl; // absolute Sender;
|
||||||
|
dw, dh: integer;
|
||||||
|
dummy: boolean;
|
||||||
|
begin
|
||||||
|
(* This handler has to determine the intended DockRect,
|
||||||
|
and the alignment within this rectangle.
|
||||||
|
|
||||||
|
This is impossible when the mouse leaves the InfluenceRect,
|
||||||
|
i.e. when the site is not yet expanded :-(
|
||||||
|
|
||||||
|
For a shrinked site we only can display the intended DockRect,
|
||||||
|
and signal alClient.
|
||||||
|
*)
|
||||||
|
if Source.DragTarget = nil then
|
||||||
|
exit; //shit happens :-(
|
||||||
|
if State = dsDragMove then begin
|
||||||
|
TObject(Site) := Source.DragTarget;
|
||||||
|
if Site.DockClientCount > 0 then
|
||||||
|
exit; //everything should be okay
|
||||||
|
//make DockRect reflect the docking area
|
||||||
|
//with Source do begin
|
||||||
|
//StatusBar1.SimpleText := AlignNames[Source.DropAlign];
|
||||||
|
{$IFnDEF old}
|
||||||
|
r := Site.BoundsRect; //XYWH
|
||||||
|
r.TopLeft := Site.Parent.ClientToScreen(r.TopLeft);
|
||||||
|
{$ELSE}
|
||||||
|
GetWindowRect(TWinControl(Source.DragTarget).handle, r);
|
||||||
|
//Site.GetSiteInfo(Site, r, Point(0,0), dummy);
|
||||||
|
{$ENDIF}
|
||||||
|
dw := Width div 3; //r.Right := r.Left + dw;
|
||||||
|
dh := Height div 3; //r.Bottom := r.Top + dh;
|
||||||
|
//determine inside/outside
|
||||||
|
case Site.Align of
|
||||||
|
alLeft: if AutoExpand then Adjust(-dw, 0) else Adjust(dw, 0);
|
||||||
|
alRight: if AutoExpand then Adjust(dw, 0) else Adjust(-dw, 0);
|
||||||
|
alBottom: if AutoExpand then Adjust(0, dh) else Adjust(0, -dh);
|
||||||
|
else exit;
|
||||||
|
end;
|
||||||
|
Source.DockRect := r;
|
||||||
|
//end;
|
||||||
|
Accept := True;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDockingSite.pnlLeftGetSiteInfo(Sender: TObject;
|
procedure TDockingSite.pnlLeftGetSiteInfo(Sender: TObject;
|
||||||
@ -184,7 +248,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
wh := Site.Width;
|
wh := Site.Width;
|
||||||
Site.Width := 0; //behaves as expected
|
Site.Width := 0; //behaves as expected
|
||||||
if AutoSize then begin
|
if AutoExpand then begin
|
||||||
r := BoundsRect;
|
r := BoundsRect;
|
||||||
inc(r.Left, wh);
|
inc(r.Left, wh);
|
||||||
BoundsRect := r;
|
BoundsRect := r;
|
||||||
@ -194,7 +258,7 @@ begin
|
|||||||
begin //problem: does NOT resize?
|
begin //problem: does NOT resize?
|
||||||
wh := Site.Width;
|
wh := Site.Width;
|
||||||
Site.Width := 0;
|
Site.Width := 0;
|
||||||
if AutoSize then begin
|
if AutoExpand then begin
|
||||||
r := BoundsRect;
|
r := BoundsRect;
|
||||||
dec(r.Right, wh);
|
dec(r.Right, wh);
|
||||||
BoundsRect := r; //does not resize :-(
|
BoundsRect := r; //does not resize :-(
|
||||||
@ -207,7 +271,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
wh := Site.Height;
|
wh := Site.Height;
|
||||||
Site.Height := 0;
|
Site.Height := 0;
|
||||||
if AutoSize then begin
|
if AutoExpand then begin
|
||||||
r := BoundsRect;
|
r := BoundsRect;
|
||||||
dec(r.Bottom, wh);
|
dec(r.Bottom, wh);
|
||||||
BoundsRect := r;
|
BoundsRect := r;
|
||||||
|
@ -34,16 +34,14 @@
|
|||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item2>
|
</Item2>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="15">
|
<Units Count="16">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="project1.lpr"/>
|
<Filename Value="project1.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="project1"/>
|
<UnitName Value="project1"/>
|
||||||
<CursorPos X="69" Y="10"/>
|
<CursorPos X="56" Y="10"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="1"/>
|
||||||
<EditorIndex Value="13"/>
|
<UsageCount Value="41"/>
|
||||||
<UsageCount Value="36"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
@ -51,46 +49,46 @@
|
|||||||
<ComponentName Value="DockingSite"/>
|
<ComponentName Value="DockingSite"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="fElastic"/>
|
<UnitName Value="fElastic"/>
|
||||||
<CursorPos X="64" Y="218"/>
|
<CursorPos X="10" Y="204"/>
|
||||||
<TopLine Value="127"/>
|
<TopLine Value="178"/>
|
||||||
<EditorIndex Value="0"/>
|
<EditorIndex Value="0"/>
|
||||||
<UsageCount Value="36"/>
|
<UsageCount Value="41"/>
|
||||||
|
<Bookmarks Count="1">
|
||||||
|
<Item0 X="1" Y="201" ID="1"/>
|
||||||
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="fdockclient.pas"/>
|
<Filename Value="fdockclient.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
|
||||||
<ComponentName Value="DockingClient"/>
|
<ComponentName Value="DockingClient"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="fDockClient"/>
|
<UnitName Value="fDockClient"/>
|
||||||
<CursorPos X="22" Y="24"/>
|
<CursorPos X="22" Y="24"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="1"/>
|
||||||
<EditorIndex Value="14"/>
|
<UsageCount Value="38"/>
|
||||||
<UsageCount Value="36"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="..\..\..\lcl\include\wincontrol.inc"/>
|
<Filename Value="..\..\..\lcl\include\wincontrol.inc"/>
|
||||||
<CursorPos X="30" Y="5223"/>
|
<CursorPos X="3" Y="5195"/>
|
||||||
<TopLine Value="5199"/>
|
<TopLine Value="5186"/>
|
||||||
<EditorIndex Value="9"/>
|
<EditorIndex Value="6"/>
|
||||||
<UsageCount Value="18"/>
|
<UsageCount Value="19"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit3>
|
</Unit3>
|
||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
<Filename Value="..\..\..\lcl\include\dragmanager.inc"/>
|
||||||
<CursorPos X="1" Y="606"/>
|
<CursorPos X="1" Y="606"/>
|
||||||
<TopLine Value="582"/>
|
<TopLine Value="582"/>
|
||||||
<EditorIndex Value="12"/>
|
<EditorIndex Value="9"/>
|
||||||
<UsageCount Value="18"/>
|
<UsageCount Value="19"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit4>
|
</Unit4>
|
||||||
<Unit5>
|
<Unit5>
|
||||||
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
||||||
<CursorPos X="1" Y="1125"/>
|
<CursorPos X="1" Y="1125"/>
|
||||||
<TopLine Value="1101"/>
|
<TopLine Value="1101"/>
|
||||||
<EditorIndex Value="11"/>
|
<EditorIndex Value="8"/>
|
||||||
<UsageCount Value="18"/>
|
<UsageCount Value="19"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit5>
|
</Unit5>
|
||||||
<Unit6>
|
<Unit6>
|
||||||
@ -102,7 +100,7 @@
|
|||||||
<CursorPos X="1" Y="85"/>
|
<CursorPos X="1" Y="85"/>
|
||||||
<TopLine Value="43"/>
|
<TopLine Value="43"/>
|
||||||
<EditorIndex Value="4"/>
|
<EditorIndex Value="4"/>
|
||||||
<UsageCount Value="31"/>
|
<UsageCount Value="36"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit6>
|
</Unit6>
|
||||||
<Unit7>
|
<Unit7>
|
||||||
@ -110,191 +108,191 @@
|
|||||||
<UnitName Value="ExtCtrls"/>
|
<UnitName Value="ExtCtrls"/>
|
||||||
<CursorPos X="23" Y="1094"/>
|
<CursorPos X="23" Y="1094"/>
|
||||||
<TopLine Value="1070"/>
|
<TopLine Value="1070"/>
|
||||||
<EditorIndex Value="8"/>
|
<UsageCount Value="17"/>
|
||||||
<UsageCount Value="16"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit7>
|
</Unit7>
|
||||||
<Unit8>
|
<Unit8>
|
||||||
<Filename Value="..\..\..\lcl\controls.pp"/>
|
<Filename Value="..\..\..\lcl\controls.pp"/>
|
||||||
<UnitName Value="Controls"/>
|
<UnitName Value="Controls"/>
|
||||||
<CursorPos X="14" Y="365"/>
|
<CursorPos X="15" Y="1780"/>
|
||||||
<TopLine Value="404"/>
|
<TopLine Value="1756"/>
|
||||||
<EditorIndex Value="5"/>
|
<EditorIndex Value="5"/>
|
||||||
<UsageCount Value="15"/>
|
<UsageCount Value="16"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit8>
|
</Unit8>
|
||||||
<Unit9>
|
<Unit9>
|
||||||
<Filename Value="..\package\easydocksite.pas"/>
|
<Filename Value="..\package\easydocksite.pas"/>
|
||||||
<UnitName Value="EasyDockSite"/>
|
<UnitName Value="EasyDockSite"/>
|
||||||
<CursorPos X="1" Y="641"/>
|
<CursorPos X="1" Y="694"/>
|
||||||
<TopLine Value="618"/>
|
<TopLine Value="694"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="2"/>
|
||||||
<UsageCount Value="11"/>
|
<UsageCount Value="12"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit9>
|
</Unit9>
|
||||||
<Unit10>
|
<Unit10>
|
||||||
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\inc\objpash.inc"/>
|
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\inc\objpash.inc"/>
|
||||||
<CursorPos X="23" Y="151"/>
|
<CursorPos X="23" Y="151"/>
|
||||||
<TopLine Value="127"/>
|
<TopLine Value="127"/>
|
||||||
<EditorIndex Value="10"/>
|
<UsageCount Value="12"/>
|
||||||
<UsageCount Value="11"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit10>
|
</Unit10>
|
||||||
<Unit11>
|
<Unit11>
|
||||||
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\objpas\classes\classesh.inc"/>
|
<Filename Value="..\..\..\..\..\lazarus\fpc\2.2.4\source\rtl\objpas\classes\classesh.inc"/>
|
||||||
<CursorPos X="3" Y="355"/>
|
<CursorPos X="3" Y="355"/>
|
||||||
<TopLine Value="331"/>
|
<TopLine Value="331"/>
|
||||||
<EditorIndex Value="7"/>
|
<UsageCount Value="12"/>
|
||||||
<UsageCount Value="11"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit11>
|
</Unit11>
|
||||||
<Unit12>
|
<Unit12>
|
||||||
<Filename Value="..\..\..\lcl\interfacebase.pp"/>
|
<Filename Value="..\..\..\lcl\interfacebase.pp"/>
|
||||||
<UnitName Value="InterfaceBase"/>
|
<UnitName Value="InterfaceBase"/>
|
||||||
<CursorPos X="3" Y="37"/>
|
<CursorPos X="3" Y="37"/>
|
||||||
<TopLine Value="13"/>
|
<TopLine Value="13"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="3"/>
|
||||||
<UsageCount Value="11"/>
|
<UsageCount Value="12"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit12>
|
</Unit12>
|
||||||
<Unit13>
|
<Unit13>
|
||||||
<Filename Value="..\..\..\lcl\include\docktree.inc"/>
|
<Filename Value="..\..\..\lcl\include\docktree.inc"/>
|
||||||
<CursorPos X="3" Y="204"/>
|
<CursorPos X="3" Y="204"/>
|
||||||
<TopLine Value="178"/>
|
<TopLine Value="178"/>
|
||||||
<EditorIndex Value="3"/>
|
<UsageCount Value="12"/>
|
||||||
<UsageCount Value="11"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit13>
|
</Unit13>
|
||||||
<Unit14>
|
<Unit14>
|
||||||
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
|
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
|
||||||
<UnitName Value="LDockTree"/>
|
<UnitName Value="LDockTree"/>
|
||||||
<CursorPos X="1" Y="2043"/>
|
<CursorPos X="15" Y="93"/>
|
||||||
<TopLine Value="2042"/>
|
<TopLine Value="67"/>
|
||||||
<EditorIndex Value="6"/>
|
<EditorIndex Value="7"/>
|
||||||
<UsageCount Value="11"/>
|
<UsageCount Value="12"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit14>
|
</Unit14>
|
||||||
|
<Unit15>
|
||||||
|
<Filename Value="..\..\..\lcl\include\winapih.inc"/>
|
||||||
|
<CursorPos X="10" Y="150"/>
|
||||||
|
<TopLine Value="126"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit15>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="30" HistoryIndex="29">
|
<JumpHistory Count="30" HistoryIndex="28">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="..\..\..\lcl\controls.pp"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="493" Column="28" TopLine="469"/>
|
<Caret Line="140" Column="15" TopLine="117"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="..\..\..\lcl\interfacebase.pp"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="141" Column="1" TopLine="117"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="..\..\..\lcl\include\docktree.inc"/>
|
<Filename Value="..\package\easydocksite.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="659" Column="1" TopLine="612"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="..\..\..\lcl\interfacebase.pp"/>
|
<Filename Value="..\package\easydocksite.pas"/>
|
||||||
<Caret Line="37" Column="3" TopLine="13"/>
|
<Caret Line="641" Column="1" TopLine="618"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="..\..\..\lcl\controls.pp"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="495" Column="1" TopLine="469"/>
|
<Caret Line="141" Column="1" TopLine="117"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="..\..\..\lcl\controls.pp"/>
|
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
||||||
<Caret Line="3663" Column="6" TopLine="3643"/>
|
<Caret Line="1125" Column="1" TopLine="1101"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="..\..\..\lcl\controls.pp"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="488" Column="1" TopLine="488"/>
|
<Caret Line="133" Column="5" TopLine="117"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="..\..\..\lcl\controls.pp"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="3665" Column="1" TopLine="3640"/>
|
<Caret Line="143" Column="1" TopLine="119"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="1" Column="1" TopLine="1"/>
|
<Caret Line="146" Column="1" TopLine="122"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="..\package\easydocksite.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="217" Column="58" TopLine="189"/>
|
<Caret Line="147" Column="1" TopLine="123"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="..\package\easydocksite.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="330" Column="17" TopLine="306"/>
|
<Caret Line="148" Column="1" TopLine="124"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="2044" Column="3" TopLine="2042"/>
|
<Caret Line="150" Column="1" TopLine="126"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="236" Column="1" TopLine="212"/>
|
<Caret Line="136" Column="19" TopLine="117"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="2043" Column="1" TopLine="2042"/>
|
<Caret Line="218" Column="64" TopLine="171"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="2042" Column="40" TopLine="2018"/>
|
<Caret Line="77" Column="15" TopLine="57"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="236" Column="49" TopLine="235"/>
|
<Caret Line="75" Column="13" TopLine="51"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="..\..\..\lcl\ldocktree.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="2043" Column="1" TopLine="2042"/>
|
<Caret Line="76" Column="13" TopLine="51"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="140" Column="15" TopLine="117"/>
|
<Caret Line="71" Column="15" TopLine="51"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="141" Column="1" TopLine="117"/>
|
<Caret Line="75" Column="12" TopLine="51"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="..\package\easydocksite.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="659" Column="1" TopLine="612"/>
|
<Caret Line="78" Column="41" TopLine="51"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="..\package\easydocksite.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="641" Column="1" TopLine="618"/>
|
<Caret Line="77" Column="41" TopLine="51"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="141" Column="1" TopLine="117"/>
|
<Caret Line="105" Column="18" TopLine="71"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="..\..\..\lcl\include\control.inc"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="1125" Column="1" TopLine="1101"/>
|
<Caret Line="261" Column="22" TopLine="236"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
<Position24>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="133" Column="5" TopLine="117"/>
|
<Caret Line="61" Column="34" TopLine="25"/>
|
||||||
</Position24>
|
</Position24>
|
||||||
<Position25>
|
<Position25>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="..\..\..\lcl\controls.pp"/>
|
||||||
<Caret Line="143" Column="1" TopLine="119"/>
|
<Caret Line="1159" Column="27" TopLine="1112"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
<Position26>
|
<Position26>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="146" Column="1" TopLine="122"/>
|
<Caret Line="201" Column="22" TopLine="173"/>
|
||||||
</Position26>
|
</Position26>
|
||||||
<Position27>
|
<Position27>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="147" Column="1" TopLine="123"/>
|
<Caret Line="206" Column="1" TopLine="173"/>
|
||||||
</Position27>
|
</Position27>
|
||||||
<Position28>
|
<Position28>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="148" Column="1" TopLine="124"/>
|
<Caret Line="208" Column="11" TopLine="181"/>
|
||||||
</Position28>
|
</Position28>
|
||||||
<Position29>
|
<Position29>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="felastic.pas"/>
|
||||||
<Caret Line="150" Column="1" TopLine="126"/>
|
<Caret Line="209" Column="18" TopLine="181"/>
|
||||||
</Position29>
|
</Position29>
|
||||||
<Position30>
|
<Position30>
|
||||||
<Filename Value="felastic.pas"/>
|
<Filename Value="..\..\..\lcl\include\wincontrol.inc"/>
|
||||||
<Caret Line="136" Column="19" TopLine="117"/>
|
<Caret Line="5195" Column="3" TopLine="5186"/>
|
||||||
</Position30>
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
|
@ -7,7 +7,7 @@ uses
|
|||||||
cthreads,
|
cthreads,
|
||||||
{$ENDIF}{$ENDIF}
|
{$ENDIF}{$ENDIF}
|
||||||
Interfaces, // this includes the LCL widgetset
|
Interfaces, // this includes the LCL widgetset
|
||||||
Forms, fElastic, EasyDockMgr, LResources, fDockClient, fTestPanels
|
Forms, fElastic, EasyDockMgr, LResources, fTestPanels
|
||||||
{ you can add units after this };
|
{ you can add units after this };
|
||||||
|
|
||||||
{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}
|
{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}
|
||||||
@ -16,7 +16,6 @@ begin
|
|||||||
{$I project1.lrs}
|
{$I project1.lrs}
|
||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
Application.CreateForm(TDockingSite, DockingSite);
|
Application.CreateForm(TDockingSite, DockingSite);
|
||||||
Application.CreateForm(TDockingClient, DockingClient);
|
|
||||||
Application.CreateForm(TForm1, Form1);
|
Application.CreateForm(TForm1, Form1);
|
||||||
Application.Run;
|
Application.Run;
|
||||||
end.
|
end.
|
||||||
|
@ -216,6 +216,7 @@ type
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
constructor Create(ADockSite: TWinControl); override;
|
constructor Create(ADockSite: TWinControl); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
function DetectAlign(ZoneRect: TRect; MousePos: TPoint): TAlign;
|
||||||
{$IFDEF old}
|
{$IFDEF old}
|
||||||
procedure AdjustDockRect(Control: TControl; var ARect: TRect);
|
procedure AdjustDockRect(Control: TControl; var ARect: TRect);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -590,11 +591,60 @@ begin
|
|||||||
ResetBounds(True); //splitters may have to be inserted
|
ResetBounds(True); //splitters may have to be inserted
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TEasyTree.DetectAlign(ZoneRect: TRect; MousePos: TPoint): TAlign;
|
||||||
|
var
|
||||||
|
w, h, zphi: integer;
|
||||||
|
cx, cy: integer;
|
||||||
|
dx, dy: integer;
|
||||||
|
phi: double;
|
||||||
|
izone: integer;
|
||||||
|
dir: TAlign;
|
||||||
|
const
|
||||||
|
k = 5; //matrix dimension
|
||||||
|
//mapping octants into aligns, assuming k=5
|
||||||
|
cDir: array[-4..4] of TAlign = (
|
||||||
|
alLeft, alLeft, alTop, alTop, alRight, alBottom, alBottom, alLeft, alLeft
|
||||||
|
);
|
||||||
|
begin
|
||||||
|
(* Determine alignment from the location of the mouse within ZoneRect.
|
||||||
|
ZoneRect in screen TLBR coordinates, MousePos in screen coordinates.
|
||||||
|
*)
|
||||||
|
//center and extent of dock zone
|
||||||
|
cx := (ZoneRect.Right + ZoneRect.Left) div 2;
|
||||||
|
cy := (ZoneRect.Top + ZoneRect.Bottom) div 2;
|
||||||
|
w := ZoneRect.Right - ZoneRect.Left;
|
||||||
|
h := ZoneRect.Bottom - ZoneRect.Top;
|
||||||
|
if (w > 0) and (h > 0) then begin
|
||||||
|
//mouse position within k*k rectangles (squares)
|
||||||
|
dx := trunc((MousePos.x - cx) / w * k);
|
||||||
|
dy := trunc((MousePos.y - cy) / h * k);
|
||||||
|
izone := max(abs(dx), abs(dy)); //0..k
|
||||||
|
//map into 0=innermost (custom), 1=inner, 2=outer
|
||||||
|
if izone = 0 then begin
|
||||||
|
//zone := zInnermost;
|
||||||
|
dir := alCustom; //pages
|
||||||
|
end else begin
|
||||||
|
{ not yet: outer zones, meaning docking into parent zone
|
||||||
|
if izone >= k-1 then
|
||||||
|
zone := zOuter
|
||||||
|
else //if izone > 0 then
|
||||||
|
zone := zInner;
|
||||||
|
}
|
||||||
|
phi := arctan2(dy, dx);
|
||||||
|
zphi := trunc(radtodeg(phi)) div 45;
|
||||||
|
dir := cDir[zphi];
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
dir := alClient;
|
||||||
|
Result := dir;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TEasyTree.PositionDockRect(ADockObject: TDragDockObject);
|
procedure TEasyTree.PositionDockRect(ADockObject: TDragDockObject);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
zone: TEasyZone;
|
zone: TEasyZone;
|
||||||
|
|
||||||
|
{$IFDEF old}
|
||||||
function DetectAlign(ZoneRect: TRect; MousePos: TPoint): TAlign;
|
function DetectAlign(ZoneRect: TRect; MousePos: TPoint): TAlign;
|
||||||
var
|
var
|
||||||
w, h, zphi: integer;
|
w, h, zphi: integer;
|
||||||
@ -640,6 +690,9 @@ var
|
|||||||
dir := alClient;
|
dir := alClient;
|
||||||
Result := dir;
|
Result := dir;
|
||||||
end;
|
end;
|
||||||
|
{$ELSE}
|
||||||
|
//made method
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
var
|
var
|
||||||
ZoneExtent: TPoint;
|
ZoneExtent: TPoint;
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<ComponentName Value="Form1"/>
|
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="Unit1"/>
|
<UnitName Value="Unit1"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
|
Loading…
Reference in New Issue
Block a user