Dela via


DOCK WINDOW Command

Docks an Integrated Development Environment (IDE) tool window or toolbar to the Visual FoxPro desktop window or another IDE window.

Deleting or editing the FoxUser.dbf resource file, which contains your user settings, restores your default window settings.

DOCK WINDOW WindowName POSITION nPosition [ WINDOW WindowName ]

-or-

DOCK WINDOW WindowName WINDOW WindowName

Parameters

  • WindowName
    Specifies the name of the window to dock.
  • POSITION nPosition
    Specifies the docking position of the window. The following table lists the possible values for nPosition. If nPosition is set to 4, the window is tab-docked, for example, it appears as a tabbed window. If nPosition is set between 0 and 3, the window is link-docked, for example, it appears attached to the side of another window.
    nPosition Docking position
    -3 Undock inner container
    -2 Undock outer container
    -1 Undock window
    0 Top
    1 Left
    2 Right
    3 Bottom
    4 Tabbed
  • WINDOW WindowName
    Specifies the name of the target window or toolbar to dock with. If you omit this parameter, the window is docked to the Microsoft Visual FoxPro desktop window.

Remarks

In prior versions of Visual FoxPro, the Data Session window is always referred to as the View window. Additionally, language used to control this window, such as HIDE WINDOW, ACTIVATE WINDOW, WONTOP( ), also refers to this window as the View window. Visual FoxPro continues to refer to the View window for the DOCK WINDOW command.

The following IDE windows and toolbars are supported by DOCK WINDOW:

  • All system toolbars
  • Call Stack
  • Command
  • Data Session (View)
  • Document View
  • Locals
  • Output
  • Properties
  • Trace
  • Watch

The specified window must first exist on the Visual FoxPro desktop. Otherwise, an error occurs.

If you use DOCK WINDOW...WINDOW without including a POSITION clause, DOCK WINDOW uses a tab-docking position as the default.

DOCK WINDOW always forces the window, if it exists, to become dockable and changes the setting for the Visible property of the window to True (.T.).

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. You can dock toolbars only to the desktop. No other window can be docked to a toolbar. Visual FoxPro disregards the WINDOW keyword for toolbars. For more information about linked and tabbed docking, see Docking Windows.

Both system and user-defined toolbars are supported by DOCK WINDOW. You can use the Caption property of the user-defined toolbar as its name.

You can use the WINDOW clause for linked and tabbed docking. You can dock the entire tabbed or linked container to the Visual FoxPro desktop window by calling DOCK WINDOW with any of the windows in the container and omit the WINDOW clause. 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. ).

When you specify a value of -1 for POSITION, you cannot include the WINDOW clause. Otherwise, a syntax error occurs. For example, the following is not permitted:

DOCK WINDOW Command POSITION -1 WINDOW Properties

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

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:

DOCK WINDOW Command WINDOW Standard   && Generates an error.

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

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

You can dock multiple windows that are docked as a group to another window by specifying one of the docked windows. However, if the docking target exists in the same container as the specified window, only that window is docked. This prevents cyclical relations. For example, the following code redocks the Command window to the right side of the Properties window:

DOCK WINDOW Command POSITION 4 WINDOW Properties
DOCK WINDOW Command POSITION 2 WINDOW Properties

Compare this example to the following code, which docks the Command and View windows to the Properties window as tabbed windows:

DOCK WINDOW Command POSITION 4 WINDOW View
DOCK WINDOW Command POSITION 4 WINDOW Properties

If a container (tab or link set of windows) 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.

Example

The following example shows how to use the DOCK WINDOW command to dock the Command window to the Visual FoxPro desktop window and use ADOCKSTATE( ) to obtain the dock state of the Command window. First, make sure the Command window is open. After docking the Command window, you can see that the Standard toolbar and Command windows are docked to the Microsoft Visual FoxPro desktop window. The position of the toolbars or windows in the array returned by ADOCKSTATE( ) can vary depending on the order in which the toolbars or windows are docked.

CLEAR
DOCK WINDOW Command POSITION 0
dockNum = ADOCKSTATE(dockState)
? dockNum   && Returns 2 only if Command window and 
            && Standard toolbar exist.
? dockState(1)  && Outputs "Standard". 
? dockState(4)  && Outputs "Microsoft Visual FoxPro".
? dockState(5)  && Outputs "COMMAND". 
? dockState(8)  && Outputs "Microsoft Visual FoxPro".

See Also

Commands | ADOCKSTATE( ) Function | WDOCKABLE( ) Function | Dock Method | DockPosition Property