Build custom dock manager

From Lazarus wiki
Revision as of 10:39, 26 August 2010 by Chronos (talk | contribs) (New page: ==Introduction== VCL and LCL support basic docking of controls. For advanced docking behavior custom dock manager have to be created. Basic abstract dock manager class TDockManager is pla...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

VCL and LCL support basic docking of controls. For advanced docking behavior custom dock manager have to be created. Basic abstract dock manager class TDockManager is placed in Controls unit. All custom manager have to be deriver from this class. Basic LCL implementation of TDockManager is TDockTree which is capable of handling tree of dock zones.

TControl support

TControl = class
    ...
  procedure DragDrop(Source: TObject; X,Y: Integer); virtual;
  procedure Dock(NewDockSite: TWinControl; ARect: TRect); virtual;
  function ManualDock(NewDockSite: TWinControl;
    DropControl: TControl = nil; ControlSide: TAlign = alNone;
    KeepDockSiteSize: Boolean = true): Boolean; virtual;
  function ManualFloat(TheScreenRect: TRect;
    KeepDockSiteSize: Boolean = true): Boolean; virtual;
  ...
end

Basic custom DockManager

TCustomDockManager = class(TDockManager)
end;

Possible docking features

  • Docking zone hiearchy
    • One item
    • Linear list
    • Tree
    • Anchored layout
  • Tabbed docking
  • Docking multiple forms to floating conjoined window
  • Themes
  • Persistence, Store/Restore docking layout
  • Tabbed docking with autoshow/autohide forms, pin button to switch autohide/visible
  • Custom header buttons
  • Building default layout directly from code, manual management
  • Supporting visual design-time components, docking customize form

External links