BBjWindow::addVerticalSlider

Description

In BBj 7.0 and higher, this method adds a vertical slider control to the BBjWindow.

Syntax

Return Value

Method

BBjSlider

addVerticalSlider(int ID, int x, int y, int width, int height)

BBjSlider

addVerticalSlider(int ID, int x, int y, int width, int height, String flags)

Parameters

Return Value

Method

ID

Control ID number. It must be an integer between 1 and 32767 and be unique within a given top-level window.

x

Horizontal position of the upper-left corner of the control in current units.

y

Vertical position of the upper-left corner of the control in current units.

width

Width of the control in current units.

height

Height of the control in current units.

flags

Control flags, as follows:

$0001$
Sets the control to be initially disabled.

$0010$
Sets the control to be initially invisible.

$0800$
Draws a recessed client edge around the control.
$1000$
Draws a raised edge around the control.

Return Value

Returns the created vertical BBjSlider object.

Remarks

None.

Example

REM Add a vertical Slider control to a window

REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()

REM Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"

REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()

REM Set addWindow param values
X=10
Y=10
WIDTH=200
HEIGHT=200
TITLE$="BBj Window"

REM Set the current context
mySysGui!.setContext(0)

REM Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

REM Add a vertical Slider on the window
myVSlider! = myWindow!.addVerticalSlider(101,180,0,20,200,$0000$)

REM Register the CALLBACK routines
CALLBACK(ON_CONTROL_SCROLL,SLIDER_SCROLLED,mySysGui!.getContext(),myVSlider!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

REM Process Events
PROCESS_EVENTS

REM Callback routine called when the Slider is used to scroll
SLIDER_SCROLLED:
REM Display a message that the Slider has been used to scroll
MESSAGE$="The Slider has been used to scroll"
LET X=MSGBOX(MESSAGE$)
RETURN

REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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