Toolbar2000

TTBDock

Properties | Events | Methods

Description:

Create TTBDock controls at locations you want toolbars to be able to dock at. These automatically resize as toolbars are docked onto them. Set the Position property to designate which side of the form the dock is to be located.

Key Properties:

  • property AllowDrag: Boolean default True; When True, toolbars on the dock can be dragged. But when it is False, there are several noteworthy differences: child toolbars are not draggable, the positions of child toolbars are neither loaded nor saved, and toolbars from other docks with AllowDrag set to True cannot be docked to it. Remember you are permitted to create two docks with the same Position, so you could create one dock with AllowDrag set to False and another dock with AllowDrag set to True.
  • property Background: TTBBasicBackground;
    Specifies an optional background bitmap to be displayed on the dock. TTBBackground components are assigned to this property.
  • property BackgroundOnToolbars: Boolean default True;
    When True, the Background "shines through" onto docked toolbars.
  • property BoundLines: TTBDockBoundLines;
    TTBDockBoundLines = set of (blTop, blBottom, blLeft, blRight);

    Use this to add extra lines to the sides of the dock. For docks Positioned at the top of the form, it looks best if you set this to [blTop].
  • property FixAlign: Boolean default False;
    If at run-time you notice a dock not appearing in the location it should, enabling this should correct the problem. This problem only occurs when you have a TTBDock and another control with the same Align setting (i.e. a dock and a list view both set to alLeft). When True, this adds an extra pixel to the width or height so that the VCL is able to align it correctly.
  • property LimitToOneRow: Boolean default False;
    Set this to True if you want to prevent the user from having more than one row of docked toolbars. I generally don't recommend you enable this (since Office doesn't do this) unless absolutely necessary. If you have fixed-size form that would look wrong with too many rows of toolbars, you should instead respond to the OnResize event of TTBDock to make your form resize itself.
  • property Position: TTBDockPosition;
    TTBDockPosition = (dpTop, dpBottom, dpLeft, dpRight);

    Determines where the dock is located on the form.
  • property ToolbarCount: Integer;
    The number of visible toolbars currently docked.
  • property Toolbars[Index: Integer]: TTBCustomDockableWindow;
    Zero-based array of all the visible toolbars that are currently docked.

Events:

  • property OnInsertRemoveBar: TTBInsertRemoveEvent;
    TTBInsertRemoveEvent = procedure(Sender: TObject; Inserting: Boolean; Bar: TTBToolbar) of object;

    Occurs after a toolbar is docked (Inserting = True) or undocked (Inserting = False).
  • property OnRequestDock: TTBRequestDockEvent;
    TTBRequestDockEvent = procedure(Sender: TObject; Bar: TTBCustomDockableWindow; var Accept: Boolean) of object;

    Occurs whenever a toolbar is moved over the dock as it is being dragged. By setting Accept to False you can prevent a particular toolbar from being docked.
  • property OnResize: TNotifyEvent;
    Occurs whenever the dock is resized.

Key Methods: