BBjChildWindow::setDockLocation

Description

In BBj 5.0 and higher, this method sets the child window's docked location.

Syntax

Return Value

Method

void

setDockLocation(int dock)

Parameters

-1

DOCK_NONE (Child window is not docked) (BBj 19.0 and higher)

0

DOCK_TOP

1

DOCK_BOTTOM

2

DOCK_LEFT

3

DOCK_RIGHT

Return Value

None.

Remarks

In BBj 19.0 and higher, DOCK_NONE (-1) can be specified to undock a docked window and return it to its most recent size and location.

See Child Windows for an introduction to child windows.

Example

rem ' BBjChildWindow::setDockLocation

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(50,50,600,500,"setDockLocation",$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
top! = window!.addChildWindow(101,200,50,110,50,1)
top!.setBackColor(sysgui!.makeColor(rnd(255),rnd(255),rnd(255)))
dock! = top!.addCheckBox(101,5,10,100,25,"Dock top",$$)
dock!.setOpaque(0)
dock!.setCallback(dock!.ON_CHECK_ON,"dock_top")
dock!.setCallback(dock!.ON_CHECK_OFF,"undock_top")
bottom! = window!.addChildWindow(102,200,350,110,50,2)
bottom!.setBackColor(sysgui!.makeColor(rnd(255),rnd(255),rnd(255)))
dock! = bottom!.addCheckBox(101,5,10,100,25,"Dock bottom",$$)
dock!.setOpaque(0)
dock!.setCallback(dock!.ON_CHECK_ON,"dock_bottom")
dock!.setCallback(dock!.ON_CHECK_OFF,"undock_bottom")
left! = window!.addChildWindow(103,100,200,110,50,3)
left!.setBackColor(sysgui!.makeColor(rnd(255),rnd(255),rnd(255)))
dock! = left!.addCheckBox(101,5,10,100,25,"Dock left",$$)
dock!.setOpaque(0)
dock!.setCallback(dock!.ON_CHECK_ON,"dock_left")
dock!.setCallback(dock!.ON_CHECK_OFF,"undock_left")
right! = window!.addChildWindow(104,300,200,110,50,4)
right!.setBackColor(sysgui!.makeColor(rnd(255),rnd(255),rnd(255)))
dock! = right!.addCheckBox(101,5,10,100,25,"Dock right",$$)
dock!.setOpaque(0)
dock!.setCallback(dock!.ON_CHECK_ON,"dock_right")
dock!.setCallback(dock!.ON_CHECK_OFF,"undock_right")
none! = window!.addChildWindow(105,100,100,100,50,5)
none!.setBackColor(sysgui!.makeColor(rnd(255),rnd(255),rnd(255)))
text! = none!.addStaticText(101,5,10,100,25,"Dock None",$$)
text!.setOpaque(0)
status! = window!.addStatusBar(100)
status!.setToolTipText("StatusBar")
process_events

eoj:
release

dock_top:
    top!.setDockLocation(top!.DOCK_TOP)
    child! = top!; gosub info
return

undock_top:
    top!.setDockLocation(top!.DOCK_NONE)
    child! = top!; gosub info
return

dock_bottom:
    bottom!.setDockLocation(bottom!.DOCK_BOTTOM)
    child! = bottom!; gosub info
return

undock_bottom:
    bottom!.setDockLocation(bottom!.DOCK_NONE)
    child! = bottom!; gosub info
return

dock_left:
    left!.setDockLocation(left!.DOCK_LEFT)
    child! = left!; gosub info
return

undock_left:
    left!.setDockLocation(left!.DOCK_NONE)
    child! = left!; gosub info
return

dock_right:
    right!.setDockLocation(right!.DOCK_RIGHT)
    child! = right!; gosub info
return

undock_right:
    right!.setDockLocation(right!.DOCK_NONE)
    child! = right!; gosub info
return

info:
    print "getDockLocation",child!.getDockLocation()
    print "getLocation",child!.getX(),child!.getY()
    print "getSize",child!.getWidth(),child!.getHeight()
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

CHILD Mnemonic

DOCK Mnemonic

See the BBj Object Diagram for an illustration of the relationship between BBj Objects