[Lazarus] Docking state question
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Tue Dec 14 12:00:34 CET 2010
Hans-Peter Diettrich schrieb:
> In the 64 bit and SVN trunk version (32 bit) docking works much
> smoother, but the dockable IDE is a mess. The DragManager gets no keys,
> i.e. docking cannot be aborted with Esc.
See workaround in preceding message.
> The dockable IDE is not
> dockable at all, i.e. the docked forms cannot be undocked or docked to
> other windows.
Fix for this problem (dragmanager.inc):
procedure TDragManagerDefault.CaptureChanged(OldCaptureControl: TControl);
{
var
i: integer;
AIsDragging,
AIsDocking: Boolean;
}
begin
// if this is TWinControl, and it have controls (not TWinControls)
// then we should check Dragging in those controls
{$IFDEF old}
AIsDocking := False;
AIsDragging := OldCaptureControl.Dragging;
if AIsDragging then
AIsDocking := OldCaptureControl.DragKind = dkDock;
if (not AIsDragging) and (OldCaptureControl is TWinControl) then
begin
for i := 0 to TWinControl(OldCaptureControl).ControlCount - 1 do
begin
AIsDragging := AIsDragging or
TWinControl(OldCaptureControl).Controls[i].Dragging;
if AIsDragging then
begin
AIsDocking :=
TWinControl(OldCaptureControl).Controls[i].DragKind = dkDock;
break;
end;
end;
end;
// when we are start drag/dock in TDockHeader then we should
// take into account that it doesnot belong to our control - it
// belongs to parent => we should allow parent to get capture
if not (AIsDocking and (CaptureControl = OldCaptureControl.Parent)) then
DragStop(AIsDragging);
{$ELSE}
if (FPerformer = nil) or (CaptureControl = OldCaptureControl) then
exit;
if not (FPerformer is TDockPerformer) then
exit;
if assigned(CaptureControl) and (CaptureControl.Parent =
OldCaptureControl) then
exit;
DragStop(False);
{$ENDIF}
end;
More information about the Lazarus
mailing list