BBjScrollBar::setBlockIncrement

Description

In BBj 16.00 and higher, this method sets the number of units to adjust the BBjScrollBar control when clicking in the body (as opposed to dragging the thumb).

Syntax

Return Value

Method

void

setBlockIncrement(int block)

Parameters

Variable

Description

block

Specifies the number of units to adjust the scrollbar when clicking in the body (as opposed to dragging the thumb).

Return Value

None.

Remarks

The default block increment is usually 10 units.

Example

rem ' BBjScrollBar::setBlockIncrement

native_scrollbar$="FALSE"
if (info(3,6)="5" and msgbox("NATIVE_SCROLLBAR?",4+32+256) = 6) then
    native_scrollbar$="TRUE"
endif
print stbl("!OPTIONS","NATIVE_SCROLLBAR="+native_scrollbar$)
title$ = "NATIVE_SCROLLBAR="+native_scrollbar$
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(100,100,250,200,title$,$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
vscroll! = window!.addVerticalScrollBar(101,212,10,20,150,$0000$)
vscroll!.setFocusable(1)
vscroll!.setToolTipText("Vertical ScrollBar")
vscroll!.setText("vscroll")
vscroll!.setCallback(sysgui!.ON_CONTROL_SCROLL,"scroll")
vprop! = window!.addInputNSpinner(102,25,25,50,25,0,100)
vprop!.setValue(vscroll!.getScrollProp())
vprop!.setToolTipText("Vertical ScrollBar setScrollProp (thumb size)")
vprop!.setCallback(sysgui!.ON_SPIN,"setVerticalScrollProp")
vpos! = window!.addInputNSpinner(103,85,25,50,25,0,100)
vpos!.setValue(vscroll!.getScrollPosition())
vpos!.setToolTipText("Vertical ScrollBar setScrollPosition (thumb position)")
vpos!.setCallback(sysgui!.ON_SPIN,"setVerticalScrollPosition")
vblock! = window!.addInputNSpinner(104,145,25,50,25,0,100)
vblock!.setValue(vscroll!.getBlockIncrement())
vblock!.setToolTipText("Vertical ScrollBar setBlockIncrement")
vblock!.setCallback(sysgui!.ON_SPIN,"setVerticalBlockIncrement")
hscroll! = window!.addHorizontalScrollBar(105,10,160,200,20,$0000$)
hscroll!.setFocusable(1)
hscroll!.setToolTipText("Horizontal ScrollBar")
hscroll!.setText("hscroll")
hscroll!.setCallback(sysgui!.ON_CONTROL_SCROLL,"scroll")
hprop! = window!.addInputNSpinner(106,25,75,50,25,0,100)
hprop!.setValue(hscroll!.getScrollProp())
hprop!.setToolTipText("Horizontal ScrollBar setScrollProp (thumb size)")
hprop!.setCallback(sysgui!.ON_SPIN,"setHorizontalScrollProp")
hpos! = window!.addInputNSpinner(107,85,75,50,25,0,100)
hpos!.setValue(hscroll!.getScrollPosition())
hpos!.setToolTipText("Horizontal ScrollBar setScrollPosition (thumb position)")
hpos!.setCallback(sysgui!.ON_SPIN,"setHorizontalScrollPosition")
hblock! = window!.addInputNSpinner(108,145,75,50,25,0,100)
hblock!.setValue(hscroll!.getBlockIncrement())
hblock!.setToolTipText("Horizontal ScrollBar setBlockIncrement")
hblock!.setCallback(sysgui!.ON_SPIN,"setHorizontalBlockIncrement")
process_events

eoj:
release

scroll:
    event! = sysgui!.getLastEvent()
    control! = event!.getControl()
    print control!.getText(),event!.getPosition()," ",event!.isAdjusting()
return

setVerticalScrollProp:
    event! = sysgui!.getLastEvent()
    value$ = event!.getText()
    value = num(value$)
    vscroll!.setScrollProp(value)
return

setHorizontalScrollProp:
    event! = sysgui!.getLastEvent()
    value$ = event!.getText()
    value = num(value$)
    hscroll!.setScrollProp(value)
return

setVerticalScrollPosition:
    event! = sysgui!.getLastEvent()
    value$ = event!.getText()
    value = num(value$)
    vscroll!.setScrollPosition(value)
return

setHorizontalScrollPosition:
    event! = sysgui!.getLastEvent()
    value$ = event!.getText()
    value = num(value$)
    hscroll!.setScrollPosition(value)
return

setVerticalBlockIncrement:
    event! = sysgui!.getLastEvent()
    value$ = event!.getText()
    value = num(value$)
    vscroll!.setBlockIncrement(value)
return

setHorizontalBlockIncrement:
    event! = sysgui!.getLastEvent()
    value$ = event!.getText()
    value = num(value$)
    hscroll!.setBlockIncrement(value)
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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