DOCK Command

Docks an Integrated Development Environment (IDE) tool window or toolbar to the Visual FoxPro desktop window or another IDE window. There are two versions of the syntax.

NoteNote

DOCK WINDOW is not supported during run time.

DOCK WINDOW WindowName1 | NAME ObjectName1 POSITION nPosition [ WINDOW WindowName2 | NAME ObjectName2 ]
DOCK WINDOW WindowName1 WINDOW WindowName2

Parameters

WindowName1

Specifies the name of the window or toolbar to dock. For a user-defined toolbar, you can use the Caption property as its name.

If you specify an undockable window as the window to be docked, it becomes dockable internally. For example:

 CopyCode imageCopy Code
WDOCKABLE("Command", .F.)
DOCK WINDOW Command
? WDOCKABLE("Command")  && Returns .T.

If you want to dock a single window that is currently bound inside a tabbed or linked container to the main Visual FoxPro window, you must first undock it from the container, for example, by using POSITION -1 or WDOCKABLE(, .F. ).

A tabbed or linked container is a set of tabbed or linked windows.

NAME ObjectName1

Specifies an object reference for a valid dockable form to dock. If ObjectName1 is docked, Visual FoxPro undocks and redocks it as specified.

NoteNote

If ObjectName1 is undefined or not valid, Visual FoxPro generates an error.

POSITION nPosition

Specifies the docking position of the window or toolbar.

The following table lists the possible values for nPosition.

nPosition Docking position

-3

Undock inner container.

-2

Undock outer container.

-1

Undock window.

NoteNote

When you specify a value of -1 for POSITION, you cannot include the WINDOW clause. Otherwise, a syntax error occurs.

0

Top

1

Left

2

Right

3

Bottom

If nPosition is set between 0 and 3, the window is link-docked, for example, it appears attached to the side of another window.

4

Tabbed

If nPosition is set to 4, the window is tab-docked, for example, it appears as a tabbed window.

NoteNote

If you specify a value of 4 for POSITION, you must specify a WINDOW clause. Otherwise, an error occurs.

NoteNote

Tab and link docking is not supported for debugger windows inside the Debug Frame. You can control the Frame setting in the Options dialog box. Toolbars do not support linked or tabbed docking.

If a tabbed or linked container is docked, you can undock that container if you specify a value of -2 or -3 for any of the windows in the container, according to the following details:

  • If you pass a value of -2, the entire container is undocked if the container is docked to the Visual FoxPro desktop.

  • If you pass a value of -3, only the inner container that is part of an larger outer container is undocked. This applies only to tab-docked containers bound inside link-docked containers. If the window specified is not part of an inner tab-docked container, Visual FoxPro treats the value of -3 as a value of -2 and undocks entire outer container.

  • If the window specified is not part of a container, Visual FoxPro undocks it as if you passed a value of -1.

If the window or container is already undocked, Visual FoxPro does nothing.

For more information about linked and tabbed docking, see How to: Dock Windows.

WINDOW WindowName2

Specifies the name of the target window or toolbar to dock with. If you omit the WindowName2 parameter, the window is docked to the Visual FoxPro desktop window.

NoteNote

Visual FoxPro disregards the WINDOW keyword for toolbars. You can dock toolbars only to the desktop. No other window can be docked to a toolbar.

You can use the WINDOW clause for linked and tabbed docking. DOCK WINDOW uses a tab-docking position as the default if you use DOCK WINDOW...WINDOW without including a POSITION clause.

To dock an entire tabbed or linked container to the Visual FoxPro desktop window, call DOCK WINDOW with any of the windows in the container and omit the WINDOW clause.

If you specify an undockable window as the docking target, Visual FoxPro generates "Function argument value, type, or count is invalid (Error 11)". For example:

 CopyCode imageCopy Code
DOCK WINDOW Command WINDOW Standard   && Generates an error.
NAME ObjectName2

Specifies an object reference for a valid dockable form to dock with. If ObjectName2 is docked, Visual FoxPro undocks and redocks it as specified.

NoteNote

If ObjectName2 is undefined or not valid, Visual FoxPro generates an error.

Expand imageRemarks

Expand imageExample

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic