mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 15:59:13 +02:00
started TDockTree
git-svn-id: trunk@4536 -
This commit is contained in:
parent
d0b28bec51
commit
a9d2994382
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -786,6 +786,8 @@ lcl/include/customradiogroup.inc svneol=native#text/pascal
|
|||||||
lcl/include/customstatictext.inc svneol=native#text/pascal
|
lcl/include/customstatictext.inc svneol=native#text/pascal
|
||||||
lcl/include/customupdown.inc svneol=native#text/pascal
|
lcl/include/customupdown.inc svneol=native#text/pascal
|
||||||
lcl/include/defaultbitbtnimages.inc svneol=native#text/pascal
|
lcl/include/defaultbitbtnimages.inc svneol=native#text/pascal
|
||||||
|
lcl/include/docktree.inc svneol=native#text/pascal
|
||||||
|
lcl/include/dockzone.inc svneol=native#text/pascal
|
||||||
lcl/include/dragobject.inc svneol=native#text/pascal
|
lcl/include/dragobject.inc svneol=native#text/pascal
|
||||||
lcl/include/edit.inc svneol=native#text/pascal
|
lcl/include/edit.inc svneol=native#text/pascal
|
||||||
lcl/include/filectrl.inc svneol=native#text/pascal
|
lcl/include/filectrl.inc svneol=native#text/pascal
|
||||||
|
203
lcl/controls.pp
203
lcl/controls.pp
@ -467,6 +467,25 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TDockManager is an abstract class for managing a dock site's docked
|
||||||
|
controls. See TDockTree for the default dock manager }
|
||||||
|
TDockManager = class
|
||||||
|
procedure BeginUpdate; virtual; abstract;
|
||||||
|
procedure EndUpdate; virtual; abstract;
|
||||||
|
procedure GetControlBounds(Control: TControl; var CtlBounds: TRect); virtual; abstract;
|
||||||
|
procedure InsertControl(Control: TControl; InsertAt: TAlign;
|
||||||
|
DropCtl: TControl); virtual; abstract;
|
||||||
|
procedure LoadFromStream(Stream: TStream); virtual; abstract;
|
||||||
|
procedure PaintSite(DC: HDC); virtual; abstract;
|
||||||
|
procedure PositionDockRect(Client, DropCtl: TControl; DropAlign: TAlign;
|
||||||
|
var DockRect: TRect); virtual; abstract;
|
||||||
|
procedure RemoveControl(Control: TControl); virtual; abstract;
|
||||||
|
procedure ResetBounds(Force: Boolean); virtual; abstract;
|
||||||
|
procedure SaveToStream(Stream: TStream); virtual; abstract;
|
||||||
|
procedure SetReplacingControl(Control: TControl); virtual; abstract;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TSizeConstraints }
|
{ TSizeConstraints }
|
||||||
|
|
||||||
TConstraintSize = 0..MaxInt;
|
TConstraintSize = 0..MaxInt;
|
||||||
@ -729,6 +748,7 @@ type
|
|||||||
procedure DoDock(NewDockSite: TWinControl; var ARect: TRect); dynamic;
|
procedure DoDock(NewDockSite: TWinControl; var ARect: TRect); dynamic;
|
||||||
procedure DoStartDock(var DragObject: TDragObject); dynamic;
|
procedure DoStartDock(var DragObject: TDragObject); dynamic;
|
||||||
function GetDockEdge(const MousePos: TPoint): TAlign; dynamic;
|
function GetDockEdge(const MousePos: TPoint): TAlign; dynamic;
|
||||||
|
procedure PositionDockRect(DragDockObject: TDragDockObject); dynamic;
|
||||||
procedure Click; dynamic;
|
procedure Click; dynamic;
|
||||||
procedure DblClick; dynamic;
|
procedure DblClick; dynamic;
|
||||||
procedure TripleClick; dynamic;
|
procedure TripleClick; dynamic;
|
||||||
@ -812,6 +832,13 @@ type
|
|||||||
function ColorIsStored: boolean; virtual;
|
function ColorIsStored: boolean; virtual;
|
||||||
constructor Create(AOwner: TComponent);override;
|
constructor Create(AOwner: TComponent);override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure Dock(NewDockSite: TWinControl; ARect: TRect); dynamic;
|
||||||
|
function ManualDock(NewDockSite: TWinControl;
|
||||||
|
DropControl: TControl {$IFDEF VER1_1}= nil{$ENDIF};
|
||||||
|
ControlSide: TAlign {$IFDEF VER1_1}= alNone{$ENDIF}): Boolean;
|
||||||
|
function ManualFloat(ScreenPos: TRect): Boolean;
|
||||||
|
function ReplaceDockedControl(Control: TControl; NewDockSite: TWinControl;
|
||||||
|
DropControl: TControl; ControlSide: TAlign): Boolean;
|
||||||
function HasParent: Boolean; override;
|
function HasParent: Boolean; override;
|
||||||
function IsParentOf(AControl: TControl): boolean; virtual;
|
function IsParentOf(AControl: TControl): boolean; virtual;
|
||||||
procedure Refresh;
|
procedure Refresh;
|
||||||
@ -835,7 +862,6 @@ type
|
|||||||
procedure SetZOrderPosition(Position : Integer); virtual;
|
procedure SetZOrderPosition(Position : Integer); virtual;
|
||||||
Procedure SetZOrder(Topmost: Boolean); virtual;
|
Procedure SetZOrder(Topmost: Boolean); virtual;
|
||||||
function HandleObjectShouldBeVisible: boolean; virtual;
|
function HandleObjectShouldBeVisible: boolean; virtual;
|
||||||
procedure Dock(NewDockSite: TWinControl; ARect: TRect); dynamic;
|
|
||||||
public
|
public
|
||||||
// Event lists
|
// Event lists
|
||||||
procedure RemoveAllControlHandlersOfObject(AnObject: TObject);
|
procedure RemoveAllControlHandlersOfObject(AnObject: TObject);
|
||||||
@ -944,7 +970,11 @@ type
|
|||||||
//FDockSite: Boolean;
|
//FDockSite: Boolean;
|
||||||
FClientWidth: Integer;
|
FClientWidth: Integer;
|
||||||
FClientHeight: Integer;
|
FClientHeight: Integer;
|
||||||
|
FDockManager: TDockManager;
|
||||||
|
FDockSite: Boolean;
|
||||||
FFlags: TWinControlFlags;
|
FFlags: TWinControlFlags;
|
||||||
|
FOnDockDrop: TDockDropEvent;
|
||||||
|
FOnDockOver: TDockOverEvent;
|
||||||
//FUseDockManager : Boolean;
|
//FUseDockManager : Boolean;
|
||||||
FOnKeyDown: TKeyEvent;
|
FOnKeyDown: TKeyEvent;
|
||||||
FOnKeyPress: TKeyPressEvent;
|
FOnKeyPress: TKeyPressEvent;
|
||||||
@ -954,22 +984,29 @@ type
|
|||||||
FOnMouseWheelUp: TMouseWheelUpDownEvent;
|
FOnMouseWheelUp: TMouseWheelUpDownEvent;
|
||||||
FOnEnter: TNotifyEvent;
|
FOnEnter: TNotifyEvent;
|
||||||
FOnExit: TNotifyEvent;
|
FOnExit: TNotifyEvent;
|
||||||
|
FOnUnDock: TUnDockEvent;
|
||||||
FParentWindow: hwnd;
|
FParentWindow: hwnd;
|
||||||
FParentCtl3D: Boolean;
|
FParentCtl3D: Boolean;
|
||||||
FRealizeBoundsLockCount: integer;
|
FRealizeBoundsLockCount: integer;
|
||||||
FHandle: Hwnd;
|
FHandle: Hwnd;
|
||||||
FShowing: Boolean;
|
FShowing: Boolean;
|
||||||
FTabList: TList;
|
FTabList: TList;
|
||||||
|
FUseDockManager: Boolean;
|
||||||
FWinControls: TList;
|
FWinControls: TList;
|
||||||
procedure AlignControl(AControl : TControl);
|
procedure AlignControl(AControl : TControl);
|
||||||
function GetControl(const Index: Integer): TControl;
|
function GetControl(const Index: Integer): TControl;
|
||||||
function GetControlCount: Integer;
|
function GetControlCount: Integer;
|
||||||
|
function GetDockClientCount: Integer;
|
||||||
|
function GetDockClients(Index: Integer): TControl;
|
||||||
function GetHandle : HWND;
|
function GetHandle : HWND;
|
||||||
function GetIsResizing: boolean;
|
function GetIsResizing: boolean;
|
||||||
function GetTabOrder: TTabOrder;
|
function GetTabOrder: TTabOrder;
|
||||||
|
function GetVisibleDockClientCount: Integer;
|
||||||
|
procedure SetDockSite(const AValue: Boolean);
|
||||||
procedure SetHandle(NewHandle: HWND);
|
procedure SetHandle(NewHandle: HWND);
|
||||||
Procedure SetBorderWidth(Value : TBorderWidth);
|
Procedure SetBorderWidth(Value : TBorderWidth);
|
||||||
Procedure SetParentCtl3D(Value : Boolean);
|
Procedure SetParentCtl3D(Value : Boolean);
|
||||||
|
procedure SetUseDockManager(const AValue: Boolean);
|
||||||
procedure UpdateTabOrder(NewTabValue: TTabOrder);
|
procedure UpdateTabOrder(NewTabValue: TTabOrder);
|
||||||
protected
|
protected
|
||||||
procedure AdjustSize; override;
|
procedure AdjustSize; override;
|
||||||
@ -1033,7 +1070,19 @@ type
|
|||||||
procedure Update; override;
|
procedure Update; override;
|
||||||
procedure ShowControl(AControl: TControl); virtual;
|
procedure ShowControl(AControl: TControl); virtual;
|
||||||
procedure WndProc(var Message : TLMessage); override;
|
procedure WndProc(var Message : TLMessage); override;
|
||||||
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; dynamic;
|
procedure DoAddDockClient(Client: TControl; const ARect: TRect); dynamic;
|
||||||
|
procedure DockOver(Source: TDragDockObject; X, Y: Integer;
|
||||||
|
State: TDragState; var Accept: Boolean); dynamic;
|
||||||
|
procedure DoDockOver(Source: TDragDockObject; X, Y: Integer;
|
||||||
|
State: TDragState; var Accept: Boolean); dynamic;
|
||||||
|
procedure DoRemoveDockClient(Client: TControl); dynamic;
|
||||||
|
function DoUnDock(NewTarget: TWinControl; Client: TControl): Boolean; dynamic;
|
||||||
|
procedure GetSiteInfo(Client: TControl; var InfluenceRect: TRect;
|
||||||
|
MousePos: TPoint; var CanDock: Boolean); dynamic;
|
||||||
|
procedure ReloadDockedControl(const AControlName: string;
|
||||||
|
var AControl: TControl); dynamic;
|
||||||
|
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;
|
||||||
|
MousePos: TPoint): Boolean; dynamic;
|
||||||
function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; dynamic;
|
function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; dynamic;
|
||||||
function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; dynamic;
|
function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; dynamic;
|
||||||
function DoKeyDown(var Message: TLMKey): Boolean;
|
function DoKeyDown(var Message: TLMKey): Boolean;
|
||||||
@ -1054,21 +1103,29 @@ type
|
|||||||
procedure SetZOrderPosition(Position: Integer); override;
|
procedure SetZOrderPosition(Position: Integer); override;
|
||||||
procedure SetZOrder(Topmost: Boolean); override;
|
procedure SetZOrder(Topmost: Boolean); override;
|
||||||
procedure SendMoveSizeMessages(SizeChanged, PosChanged: boolean); override;
|
procedure SendMoveSizeMessages(SizeChanged, PosChanged: boolean); override;
|
||||||
|
public
|
||||||
property BorderWidth : TBorderWidth read FBorderWidth write SetBorderWidth default 0;
|
property BorderWidth : TBorderWidth read FBorderWidth write SetBorderWidth default 0;
|
||||||
property DefWndProc: Pointer read FDefWndProc write FDefWndPRoc;
|
property DefWndProc: Pointer read FDefWndProc write FDefWndPRoc;
|
||||||
property IsResizing : Boolean read GetIsResizing;
|
property DockClientCount: Integer read GetDockClientCount;
|
||||||
|
property DockClients[Index: Integer]: TControl read GetDockClients;
|
||||||
property ParentCtl3D : Boolean read FParentCtl3D write SetParentCtl3d default True;
|
property DockSite: Boolean read FDockSite write SetDockSite default False;
|
||||||
{ events }
|
property DockManager: TDockManager read FDockManager write FDockManager;
|
||||||
property OnEnter : TNotifyEvent read FOnEnter write FOnEnter;
|
property IsResizing: Boolean read GetIsResizing;
|
||||||
property OnExit : TNotifyEvent read FOnExit write FOnExit;
|
property OnDockDrop: TDockDropEvent read FOnDockDrop write FOnDockDrop;
|
||||||
property OnKeyDown: TKeyEvent read FOnKeyDown write FOnKeyDown;
|
property OnDockOver: TDockOverEvent read FOnDockOver write FOnDockOver;
|
||||||
property OnKeyPress: TKeyPressEvent read FOnKeyPress write FOnKeyPress;
|
property OnEnter : TNotifyEvent read FOnEnter write FOnEnter;
|
||||||
property OnKeyUp: TKeyEvent read FOnKeyUp write FOnKeyUp;
|
property OnExit : TNotifyEvent read FOnExit write FOnExit;
|
||||||
property OnMouseWheel: TMouseWheelEvent read FOnMouseWheel write FOnMouseWheel;
|
property OnKeyDown: TKeyEvent read FOnKeyDown write FOnKeyDown;
|
||||||
property OnMouseWheelDown: TMouseWheelUpDownEvent read FOnMouseWheelDown write FOnMouseWheelDown;
|
property OnKeyPress: TKeyPressEvent read FOnKeyPress write FOnKeyPress;
|
||||||
property OnMouseWheelUp: TMouseWheelUpDownEvent read FOnMouseWheelUp write FOnMouseWheelUp;
|
property OnKeyUp: TKeyEvent read FOnKeyUp write FOnKeyUp;
|
||||||
|
property OnMouseWheel: TMouseWheelEvent read FOnMouseWheel write FOnMouseWheel;
|
||||||
|
property OnMouseWheelDown: TMouseWheelUpDownEvent read FOnMouseWheelDown write FOnMouseWheelDown;
|
||||||
|
property OnMouseWheelUp: TMouseWheelUpDownEvent read FOnMouseWheelUp write FOnMouseWheelUp;
|
||||||
|
property OnUnDock: TUnDockEvent read FOnUnDock write FOnUnDock;
|
||||||
|
property ParentCtl3D: Boolean read FParentCtl3D write SetParentCtl3d default True;
|
||||||
|
property UseDockManager: Boolean read FUseDockManager
|
||||||
|
write SetUseDockManager default False;
|
||||||
|
property VisibleDockClientCount: Integer read GetVisibleDockClientCount;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent);override;
|
constructor Create(TheOwner: TComponent);override;
|
||||||
constructor CreateParented(ParentWindow: HWnd);
|
constructor CreateParented(ParentWindow: HWnd);
|
||||||
@ -1078,6 +1135,7 @@ type
|
|||||||
procedure EndUpdateBounds;
|
procedure EndUpdateBounds;
|
||||||
procedure LockRealizeBounds;
|
procedure LockRealizeBounds;
|
||||||
procedure UnlockRealizeBounds;
|
procedure UnlockRealizeBounds;
|
||||||
|
procedure DockDrop(Source: TDragDockObject; X, Y: Integer); dynamic;
|
||||||
Function CanFocus : Boolean;
|
Function CanFocus : Boolean;
|
||||||
Function ControlAtPos(const Pos : TPoint; AllowDisabled : Boolean): TControl;
|
Function ControlAtPos(const Pos : TPoint; AllowDisabled : Boolean): TControl;
|
||||||
Function ControlAtPos(const Pos : TPoint;
|
Function ControlAtPos(const Pos : TPoint;
|
||||||
@ -1115,8 +1173,8 @@ type
|
|||||||
property Brush: TBrush read FBrush;
|
property Brush: TBrush read FBrush;
|
||||||
property Controls[Index: Integer]: TControl read GetControl;
|
property Controls[Index: Integer]: TControl read GetControl;
|
||||||
property ControlCount: Integer read GetControlCount;
|
property ControlCount: Integer read GetControlCount;
|
||||||
property Handle : HWND read GetHandle write SetHandle;
|
property Handle: HWND read GetHandle write SetHandle;
|
||||||
property Showing : Boolean read FShowing;
|
property Showing: Boolean read FShowing;
|
||||||
property CachedClientWidth: integer read FClientWidth;
|
property CachedClientWidth: integer read FClientWidth;
|
||||||
property CachedClientHeight: integer read FClientHeight;
|
property CachedClientHeight: integer read FClientHeight;
|
||||||
end;
|
end;
|
||||||
@ -1172,6 +1230,108 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TDockZone }
|
||||||
|
|
||||||
|
TDockTree = class;
|
||||||
|
|
||||||
|
{ TDockZone is a node in the TDockTree and encapsulates a region into which
|
||||||
|
other zones are contained. }
|
||||||
|
|
||||||
|
TDockZone = class
|
||||||
|
private
|
||||||
|
function GetChildCount: Integer;
|
||||||
|
function GetHeight: Integer;
|
||||||
|
function GetLeft: Integer;
|
||||||
|
function GetLimitBegin: Integer;
|
||||||
|
function GetLimitSize: Integer;
|
||||||
|
function GetTop: Integer;
|
||||||
|
function GetVisible: Boolean;
|
||||||
|
function GetVisibleChildCount: Integer;
|
||||||
|
function GetWidth: Integer;
|
||||||
|
function GetZoneLimit: Integer;
|
||||||
|
procedure SetZoneLimit(const AValue: Integer);
|
||||||
|
public
|
||||||
|
constructor Create(Tree: TDockTree);
|
||||||
|
procedure ExpandZoneLimit(NewLimit: Integer);
|
||||||
|
function FirstVisibleChild: TDockZone;
|
||||||
|
function NextVisible: TDockZone;
|
||||||
|
function PrevVisible: TDockZone;
|
||||||
|
procedure ResetChildren;
|
||||||
|
procedure ResetZoneLimits;
|
||||||
|
procedure Update;
|
||||||
|
property ChildCount: Integer read GetChildCount;
|
||||||
|
property Height: Integer read GetHeight;
|
||||||
|
property Left: Integer read GetLeft;
|
||||||
|
property LimitBegin: Integer read GetLimitBegin;
|
||||||
|
property LimitSize: Integer read GetLimitSize;
|
||||||
|
property Top: Integer read GetTop;
|
||||||
|
property Visible: Boolean read GetVisible;
|
||||||
|
property VisibleChildCount: Integer read GetVisibleChildCount;
|
||||||
|
property Width: Integer read GetWidth;
|
||||||
|
property ZoneLimit: Integer read GetZoneLimit write SetZoneLimit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TDockTree - a tree of TDockZones }
|
||||||
|
|
||||||
|
TForEachZoneProc = procedure(Zone: TDockZone) of object;
|
||||||
|
|
||||||
|
TDockTreeClass = class of TDockTree;
|
||||||
|
|
||||||
|
TDockTreeFlag = (
|
||||||
|
dtfUpdateAllNeeded
|
||||||
|
);
|
||||||
|
TDockTreeFlags = set of TDockTreeFlag;
|
||||||
|
|
||||||
|
TDockTree = class(TDockManager)
|
||||||
|
private
|
||||||
|
FBorderWidth: Integer;
|
||||||
|
FDockSite: TWinControl;
|
||||||
|
FGrabberSize: Integer;
|
||||||
|
FGrabbersOnTop: Boolean;
|
||||||
|
FFlags: TDockTreeFlags;
|
||||||
|
//FOldRect: TRect;
|
||||||
|
FOldWndProc: TWndMethod;
|
||||||
|
//FReplacementZone: TDockZone;
|
||||||
|
//FScaleBy: Double;
|
||||||
|
//FShiftScaleOrient: TDockOrientation;
|
||||||
|
//FShiftBy: Integer;
|
||||||
|
//FSizePos: TPoint;
|
||||||
|
//FSizingDC: HDC;
|
||||||
|
//FSizingWnd: HWND;
|
||||||
|
//FSizingZone: TDockZone;
|
||||||
|
FTopZone: TDockZone;
|
||||||
|
//FTopXYLimit: Integer;
|
||||||
|
FUpdateCount: Integer;
|
||||||
|
//FVersion: Integer;
|
||||||
|
procedure WindowProc(var AMessage: TLMessage);
|
||||||
|
procedure DeleteZone(Zone: TDockZone);
|
||||||
|
protected
|
||||||
|
procedure AdjustDockRect(AControl: TControl; var ARect: TRect); virtual;
|
||||||
|
procedure BeginUpdate; override;
|
||||||
|
procedure EndUpdate; override;
|
||||||
|
procedure GetControlBounds(AControl: TControl; var CtlBounds: TRect); override;
|
||||||
|
function HitTest(const MousePos: TPoint; var HTFlag: Integer): TControl; virtual;
|
||||||
|
procedure InsertControl(AControl: TControl; InsertAt: TAlign;
|
||||||
|
DropCtl: TControl); override;
|
||||||
|
procedure LoadFromStream(SrcStream: TStream); override;
|
||||||
|
procedure PaintDockFrame(ACanvas: TCanvas; AControl: TControl;
|
||||||
|
const ARect: TRect); virtual;
|
||||||
|
procedure PositionDockRect(AClient, DropCtl: TControl; DropAlign: TAlign;
|
||||||
|
var DockRect: TRect); override;
|
||||||
|
procedure RemoveControl(AControl: TControl); override;
|
||||||
|
procedure SaveToStream(DestStream: TStream); override;
|
||||||
|
procedure SetReplacingControl(AControl: TControl); override;
|
||||||
|
procedure ResetBounds(Force: Boolean); override;
|
||||||
|
procedure UpdateAll;
|
||||||
|
property DockSite: TWinControl read FDockSite write FDockSite;
|
||||||
|
public
|
||||||
|
constructor Create(TheDockSite: TWinControl); virtual;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure PaintSite(DC: HDC); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TMouse }
|
{ TMouse }
|
||||||
|
|
||||||
TMouse = class
|
TMouse = class
|
||||||
@ -1648,6 +1808,8 @@ end;
|
|||||||
{$I control.inc}
|
{$I control.inc}
|
||||||
{$I graphiccontrol.inc}
|
{$I graphiccontrol.inc}
|
||||||
{$I customcontrol.inc}
|
{$I customcontrol.inc}
|
||||||
|
{$I dockzone.inc}
|
||||||
|
{$I docktree.inc}
|
||||||
{$I mouse.inc}
|
{$I mouse.inc}
|
||||||
{$I dragobject.inc}
|
{$I dragobject.inc}
|
||||||
|
|
||||||
@ -1668,6 +1830,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.146 2003/08/27 11:01:10 mattias
|
||||||
|
started TDockTree
|
||||||
|
|
||||||
Revision 1.145 2003/08/26 20:30:39 mattias
|
Revision 1.145 2003/08/26 20:30:39 mattias
|
||||||
fixed updating component tree on delete component
|
fixed updating component tree on delete component
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ type
|
|||||||
property AutoScroll;
|
property AutoScroll;
|
||||||
property AutoSize;
|
property AutoSize;
|
||||||
property Constraints;
|
property Constraints;
|
||||||
//property DockSite;
|
property DockSite;
|
||||||
property DragCursor;
|
property DragCursor;
|
||||||
property DragKind;
|
property DragKind;
|
||||||
property DragMode;
|
property DragMode;
|
||||||
|
@ -140,6 +140,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TControl.PositionDockRect(DragDockObject: TDragDockObject);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
TControl.BoundsChanged
|
TControl.BoundsChanged
|
||||||
|
|
||||||
@ -2214,7 +2219,28 @@ end;
|
|||||||
|
|
||||||
procedure TControl.Dock(NewDockSite: TWinControl; ARect: TRect);
|
procedure TControl.Dock(NewDockSite: TWinControl; ARect: TRect);
|
||||||
begin
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TControl.ManualDock(NewDockSite: TWinControl; DropControl: TControl;
|
||||||
|
ControlSide: TAlign): Boolean;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TControl.ManualFloat(ScreenPos: TRect): Boolean;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TControl.ReplaceDockedControl(Control: TControl;
|
||||||
|
NewDockSite: TWinControl; DropControl: TControl; ControlSide: TAlign
|
||||||
|
): Boolean;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.AddHandlerOnResize(OnResizeEvent: TNotifyEvent;
|
procedure TControl.AddHandlerOnResize(OnResizeEvent: TNotifyEvent;
|
||||||
@ -2535,6 +2561,9 @@ end;
|
|||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.152 2003/08/27 11:01:10 mattias
|
||||||
|
started TDockTree
|
||||||
|
|
||||||
Revision 1.151 2003/08/26 20:30:39 mattias
|
Revision 1.151 2003/08/26 20:30:39 mattias
|
||||||
fixed updating component tree on delete component
|
fixed updating component tree on delete component
|
||||||
|
|
||||||
|
166
lcl/include/docktree.inc
Normal file
166
lcl/include/docktree.inc
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
// included by controls.pp
|
||||||
|
|
||||||
|
{******************************************************************************
|
||||||
|
TDockTree
|
||||||
|
******************************************************************************
|
||||||
|
|
||||||
|
*****************************************************************************
|
||||||
|
* *
|
||||||
|
* This file is part of the Lazarus Component Library (LCL) *
|
||||||
|
* *
|
||||||
|
* See the file COPYING.LCL, included in this distribution, *
|
||||||
|
* for details about the copyright. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
|
* *
|
||||||
|
*****************************************************************************
|
||||||
|
}
|
||||||
|
|
||||||
|
const
|
||||||
|
DefaultDockGrabberSize = 12;
|
||||||
|
|
||||||
|
procedure TDockTree.WindowProc(var AMessage: TLMessage);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
if Assigned(FOldWndProc) then
|
||||||
|
FOldWndProc(AMessage);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.DeleteZone(Zone: TDockZone);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.AdjustDockRect(AControl: TControl; var ARect: TRect);
|
||||||
|
begin
|
||||||
|
// Allocate room for the caption on the left or top
|
||||||
|
if FDockSite.Align in [alTop, alBottom] then
|
||||||
|
Inc(ARect.Left,FGrabberSize)
|
||||||
|
else
|
||||||
|
Inc(ARect.Top,FGrabberSize);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.BeginUpdate;
|
||||||
|
begin
|
||||||
|
Inc(FUpdateCount);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.EndUpdate;
|
||||||
|
begin
|
||||||
|
Dec(FUpdateCount);
|
||||||
|
if FUpdateCount<0 then RaiseGDBException('TDockTree.EndUpdate');
|
||||||
|
if FUpdateCount = 0 then begin
|
||||||
|
if dtfUpdateAllNeeded in FFlags then
|
||||||
|
UpdateAll;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.GetControlBounds(AControl: TControl; var CtlBounds: TRect);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockTree.HitTest(const MousePos: TPoint; var HTFlag: Integer
|
||||||
|
): TControl;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.InsertControl(AControl: TControl; InsertAt: TAlign;
|
||||||
|
DropCtl: TControl);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.LoadFromStream(SrcStream: TStream);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.PaintDockFrame(ACanvas: TCanvas; AControl: TControl;
|
||||||
|
const ARect: TRect);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.PositionDockRect(AClient, DropCtl: TControl;
|
||||||
|
DropAlign: TAlign; var DockRect: TRect);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.RemoveControl(AControl: TControl);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.SaveToStream(DestStream: TStream);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.SetReplacingControl(AControl: TControl);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.ResetBounds(Force: Boolean);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.UpdateAll;
|
||||||
|
begin
|
||||||
|
if FUpdateCount>0 then begin
|
||||||
|
Include(FFlags,dtfUpdateAllNeeded);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
Exclude(FFlags,dtfUpdateAllNeeded);
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TDockTree.Create(TheDockSite: TWinControl);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
FBorderWidth:=4;
|
||||||
|
FDockSite:=TheDockSite;
|
||||||
|
FGrabberSize:=DefaultDockGrabberSize;
|
||||||
|
FGrabbersOnTop:=(FDockSite.Align <> alTop) and (FDockSite.Align <> alBottom);
|
||||||
|
FTopZone:=TDockZone.Create(Self);
|
||||||
|
// insert existing controls into tree
|
||||||
|
BeginUpdate;
|
||||||
|
try
|
||||||
|
for i:=0 to FDockSite.ControlCount-1 do
|
||||||
|
InsertControl(FDockSite.Controls[i],alLeft,nil);
|
||||||
|
FTopZone.ResetChildren;
|
||||||
|
finally
|
||||||
|
EndUpdate;
|
||||||
|
end;
|
||||||
|
if not (csDesigning in FDockSite.ComponentState) then begin
|
||||||
|
FOldWndProc := FDockSite.WindowProc;
|
||||||
|
FDockSite.WindowProc := @WindowProc;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TDockTree.Destroy;
|
||||||
|
begin
|
||||||
|
if FOldWndProc=@WindowProc then begin
|
||||||
|
FDockSite.WindowProc:=FOldWndProc;
|
||||||
|
FOldWndProc:=nil;
|
||||||
|
end;
|
||||||
|
DeleteZone(FTopZone);
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockTree.PaintSite(DC: HDC);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
// included by controls.pp
|
||||||
|
|
130
lcl/include/dockzone.inc
Normal file
130
lcl/include/dockzone.inc
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
// included by control.pp
|
||||||
|
|
||||||
|
{******************************************************************************
|
||||||
|
TDockZone
|
||||||
|
******************************************************************************
|
||||||
|
|
||||||
|
*****************************************************************************
|
||||||
|
* *
|
||||||
|
* This file is part of the Lazarus Component Library (LCL) *
|
||||||
|
* *
|
||||||
|
* See the file COPYING.LCL, included in this distribution, *
|
||||||
|
* for details about the copyright. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
|
* *
|
||||||
|
*****************************************************************************
|
||||||
|
}
|
||||||
|
|
||||||
|
function TDockZone.GetChildCount: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.GetHeight: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.GetLeft: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.GetLimitBegin: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.GetLimitSize: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.GetTop: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.GetVisible: Boolean;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.GetVisibleChildCount: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.GetWidth: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.GetZoneLimit: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockZone.SetZoneLimit(const AValue: Integer);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TDockZone.Create(Tree: TDockTree);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockZone.ExpandZoneLimit(NewLimit: Integer);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.FirstVisibleChild: TDockZone;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.NextVisible: TDockZone;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDockZone.PrevVisible: TDockZone;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockZone.ResetChildren;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockZone.ResetZoneLimits;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDockZone.Update;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
// included by control.pp
|
||||||
|
|
@ -1644,6 +1644,47 @@ Begin
|
|||||||
inherited WndProc(Message);
|
inherited WndProc(Message);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.DoAddDockClient(Client: TControl; const ARect: TRect);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.DockOver(Source: TDragDockObject; X, Y: Integer;
|
||||||
|
State: TDragState; var Accept: Boolean);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.DoDockOver(Source: TDragDockObject; X, Y: Integer;
|
||||||
|
State: TDragState; var Accept: Boolean);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.DoRemoveDockClient(Client: TControl);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TWinControl.DoUnDock(NewTarget: TWinControl; Client: TControl
|
||||||
|
): Boolean;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.GetSiteInfo(Client: TControl; var InfluenceRect: TRect;
|
||||||
|
MousePos: TPoint; var CanDock: Boolean);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.ReloadDockedControl(const AControlName: string;
|
||||||
|
var AControl: TControl);
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TWinControl.MainWndProc
|
Method: TWinControl.MainWndProc
|
||||||
Params: Message:
|
Params: Message:
|
||||||
@ -1688,6 +1729,13 @@ Begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.SetUseDockManager(const AValue: Boolean);
|
||||||
|
begin
|
||||||
|
if FUseDockManager=AValue then exit;
|
||||||
|
FUseDockManager:=AValue;
|
||||||
|
// ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TWinControl.UpdateTabOrder(NewTabValue: TTabOrder);
|
procedure TWinControl.UpdateTabOrder(NewTabValue: TTabOrder);
|
||||||
var
|
var
|
||||||
CurIndex, Count: Integer;
|
CurIndex, Count: Integer;
|
||||||
@ -2107,6 +2155,19 @@ begin
|
|||||||
if FWinControls <> nil then Inc(Result, FWinControls.Count);
|
if FWinControls <> nil then Inc(Result, FWinControls.Count);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TWinControl.GetDockClientCount: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TWinControl.GetDockClients(Index: Integer): TControl;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
RaiseGDBException('not implemented');
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
{ TWinControl GetHandle }
|
{ TWinControl GetHandle }
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -2793,6 +2854,11 @@ begin
|
|||||||
RealizeBounds;
|
RealizeBounds;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.DockDrop(Source: TDragDockObject; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TControl.GetIsResizing
|
Method: TControl.GetIsResizing
|
||||||
Params: None
|
Params: None
|
||||||
@ -2813,6 +2879,18 @@ begin
|
|||||||
Result := -1;
|
Result := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TWinControl.GetVisibleDockClientCount: Integer;
|
||||||
|
begin
|
||||||
|
// ToDo
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWinControl.SetDockSite(const AValue: Boolean);
|
||||||
|
begin
|
||||||
|
if FDockSite=AValue then exit;
|
||||||
|
FDockSite:=AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TWinControl.SetBounds
|
Method: TWinControl.SetBounds
|
||||||
Params: aLeft, aTop, aWidth, aHeight
|
Params: aLeft, aTop, aWidth, aHeight
|
||||||
@ -2986,6 +3064,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.165 2003/08/27 11:01:10 mattias
|
||||||
|
started TDockTree
|
||||||
|
|
||||||
Revision 1.164 2003/08/26 14:33:40 mattias
|
Revision 1.164 2003/08/26 14:33:40 mattias
|
||||||
implemented component tree for OI
|
implemented component tree for OI
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user