Procedure Init_Panel_DrapDrop (Panel :TPanel; const Redimensionnable, Interdire_le_Drag_And_Drop : boolean;
const Orientation : TDockOrientation =doNoOrient);
{ Concerne les panels qui accueillent SOUS-ECRANS qui sont dockés dans PARFRAISE.}
{ PRINCIPE du DRAG & DROP : il faut renseigner le options suivantes dans }
{ la fenêtre qui va être dockée, et dans le conteneur qui va l'accueillir : }
{ | Conteneur | Fenêtre }
{ ----------------+---------------------+---------------------- }
{ .DockSite | TRUE/False | False }
{ .DragCursor | | }
{ .DragKind | dkDrag | dkDock }
{ .DragMode | dmAutomatic | dmAutomatic/dmManual }
{ .UseDockManager | True | False }
begin
If(Panel=Nil)Then EXIT;
{--- Pour GLISSER-EMPILER ----}
Panel.Visible:=True; { Dock ne marche pas si = False }
Panel.DockSite:=True; { Ce panel peut contenir des fenêtres }
Panel.DockOrientation:=Orientation; { (doNoOrient, doHorizontal, doVertical) }
Panel.UseDockManager:=True;
Panel.Autosize:=False; { Le panel n'apparait que lorsqu'il contient une fenêtre }
If(Not Redimensionnable)Then
begin
Panel.UseDockManager:=False; { Masque la barre de la fenêtre (=========[x]) }
Panel.DockSite :=False; { Libère l'espace réservé à la barre de la fenêtre }
end;
end;
Partager