BBjWindow::getHorizontalScrollPosition

Description

In BBj 14.0 and higher, this method returns the horizontal scroll position (left margin) of the BBjWindow.

Syntax

Return Value

Method

int

getHorizontalScrollPosition()

Parameters

None.

Return Values

Returns the horizontal scroll position (left margin) of the BBjWindow. Returns 0 if the window isn't scrollable.

Remarks

This method is only meaningful if the window is scrollable.

Example

rem ' getHorizontalScrollPosition

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(50,50,600,500,"Scroll",$00090003$,$$)
window!.setCallback(window!.ON_CLOSE,"eoj")
child! = window!.addChildWindow(101,50,50,1000,1000,"",$0000001c$,1,$$)
child!.setTrack(0)
child!.setSize(500,300)
for i = 0 to 99
    x = mod(i,10) * 100 + 25
    y = int(i/10) * 100 + 25
    child!.addStaticText(1000+i,x,y,50,50,str(i),$$)
next i
child!.setVisible(1)
mask$ = "-###,##0"
vertical = child!.getVerticalScrollHeight()
vertical! = window!.addInputNSpinner(102,50,400,100,25,$$,mask$,$$,0,0,0,vertical)
vertical!.setCallback(vertical!.ON_SPIN,"vertical")
verticalPosition! = window!.addInputN(103,200,400,100,25,$$,mask$)
verticalPosition!.setEditable(0)
horizontal = child!.getHorizontalScrollWidth()
horizontal! = window!.addInputNSpinner(104,50,450,100,25,$$,mask$,$$,0,0,0,horizontal)
horizontal!.setCallback(horizontal!.ON_SPIN,"horizontal")
horizontalPosition! = window!.addInputN(105,200,450,100,25,$$,mask$)
horizontalPosition!.setEditable(0)
process_events

eoj:
release

vertical:
    event! = sysgui!.getLastEvent()
    position = num(event!.getText())
    child!.setVerticalScrollPosition(position)
    position = child!.getVerticalScrollPosition()
    verticalPosition!.setValue(position)
return

horizontal:
    event! = sysgui!.getLastEvent()
    position = num(event!.getText())
    child!.setHorizontalScrollPosition(position)
    position = child!.getHorizontalScrollPosition()
    horizontalPosition!.setValue(position)
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

BBjWindow::setTrack

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