BBjGrid::setScrollbarTriggerTopBottomEvent

Description

In BBj 20.10 and higher, this method sets a flag to enable or disable the BBjGridHitTopEvent and BBjGridHitBottomEvent events while scrolling.

Syntax

Return Value Method
void setScrollbarTriggerTopBottomEvent(boolean enabled)

Parameters

Variable Description
enabled A boolean which specifies whether GridHitTop and GridHitBottom events are enabled or disabled.

Return Value

None.

Remarks

The default value is true, which allows the events to trigger when the scrollbar hits the bottom or top of the grid. A value of false disables the events for the scrollbar.

The events will still trigger when using page up/down or the up/down arrows when trying to move beyond the grid’s scope of rows. This function only affects the scrollbar’s ability to trigger the events.

This behavior can be set globally in the bbj.properties file by adding the line: com.basis.bbj.grid.disableScrollbarEvent=x, where x is equal to “true” or “false”.

Example

rem ' BBjGrid Scrollbar Events Example

call"_setup",16
w=100,h=40; ? 'size'(w,h),'window'(0,0,w,h),'cs','show'

sysgui = unt
open (sysgui) "X0"
gui!   = BBJAPI().getSysGui()

w!  = gui!.addWindow(10,10,800,400,"RowSelection " + rev)
w!.setCallback(w!.ON_CLOSE, "quit")
c!  = w!.addChildWindow(100,10,10,780,380,5)
colHeaderHeight=25
rowHeight=14
rowCount=4
addEmptyRow = msgbox("Add empty row?",32+4)
? addEmptyRow
g!  = c!.addGrid(200,5,5,770,colHeaderHeight+(rowCount*20)+8+iff(addEmptyRow=6,1,0),$81E6$,rowCount,2)
g!.setColumnHeaderHeight(colHeaderHeight)

rem 'turns the events off.
g!.setScrollbarTriggerTopBottomEvent(0)
g!.getScrollbarTriggerTopBottomEvent()

g!.setScrollUpdate(1)
g!.setVerticalScrollable(1)
g!.setVerticalScrollBarAlways(1)
g!.setPaging(1)

g!.setGridEditable(0)
g!.setEditClickCount(1)
g!.setSelectionMode(g!.GRID_SELECT_ROW)
g!.setRowHeight(rowHeight)
? g!.getRowHeight()

gridRows = g!.getNumRows()

while gridRows > -1
    g!.setCellText(gridRows, 0, str(gridRows))
    gridRows = gridRows - 1
wend

g!.setCallback(g!.ON_GRID_HIT_TOP, "hitTop")
g!.setCallback(g!.ON_GRID_HIT_BOTTOM, "hitBottom")

HITT=1
HITB=1
process_events

quit:
    w!.destroy()
    close (sysgui)
release
end

hitTop:
    ? "hit top "+STR(HITT)
    HITT=HITT+1
return

hitBottom:
    ? "hit bottom "+STR(HITB)
    HITB=HITB+1
return

ClosedVersion History

  • BBj 20.10: BBjGrid::setScrollbarTriggerTopBottomEvent introduced

See Also

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

BBjAPI

BBjGrid

BBjGrid::getScrollbarTriggerTopBottomEvent

BBjGridHitBottomEvent

BBjGridHitTopEvent