Interface MouseWheelEnabled


Description

In BBj 12.0 and higher, BBjWrappedJComponent implements Interface MouseWheelEnabled.

In BBj 6.0 and higher, a BBjControl implements the MouseWheelEnabled interface if the control responds to mouse wheel scrolling.

There are three situations in which a control can respond to the mouse wheel when scrolled:

  1. The mouse is over the control.

  2. The focus is on the control.

  3. The control is a window containing the control which the mouse is over.

The ScrollWheelBehavior property configures which control will respond.

If neither the focused control, nor the moused over control will respond, the ancestors of the moused over control are given a chance to respond. This applies to the third situation listed above.

Subinterfaces

None.

Implementing Classes

BBjCEdit, BBjChildWindow, BBjDataAwareGrid, BBjDataBoundGrid, BBjEditBoxSpinner, BBjInputDSpinner, BBjInputESpinner, BBjInputNSpinner, BBjListBox, BBjListButton, BBjListSpinner, BBjListEdit, BBjNavigator, BBjScrollBar, BBjSlider, BBjStandardGrid, BBjTopLevelWindow, BBjTree, BBjWrappedJComponent

Methods of MouseWheelEnabled

Return Value

Method

int

getScrollWheelBehavior()

void

setScrollWheelBehavior(int trav)

Constants

DEFAULT

Use the defaultScrollWheelBehavior of the BBjSysGui.

NEVER

This control does not respond.

FOCUS

The control responds if focused, unless the moused over control's ScrollWheelBehavior is MOUSE_THEN_FOCUS

MOUSE_OVER

The control responds if moused over and the focused control's ScrollWheeLBehavior is not FOCUS, FOCUS_AND_MOUSE_OVER or FOCUS_THEN_MOUSE.

FOCUS_AND_MOUSE_OVER

The control responds if moused over and focused.

MOUSE_THEN_FOCUS

The control responds if it is moused over and the focused control's ScrollWheelBehavior is not FOCUS, FOCUS_AND_MOUSE_OVER or FOCUS_THEN_MOUSE.

FOCUS_THEN_MOUSE

The control responds if it is focused and the moused over control's ScrollWheelBehavior is not MOUSE_OVER or MOUSE_THEN_FOCUS.

Example

SYSGUI=UNT; OPEN(SYSGUI)"X0"
sysgui! = BBjAPI().getSysGui()

win! = sysgui!.addWindow(10,10,160,160,"Scroll Wheel Test",$0000000B$)
win!.setCallback(win!.ON_CLOSE,"APP_CLOSE")

control! = win!.addListBox(101,10,10,60,100,"")
control!.setScrollWheelBehavior(control!.FOCUS)
PRINT "SCROLL MODE: ", control!.getScrollWheelBehavior()

over! = win!.addListBox(102,80,10,60,100,"")
over!.setScrollWheelBehavior(control!.MOUSE_THEN_FOCUS)

for x = 1 to 500
      control!.addItem(str(x)+": ...")
      over!.addItem(str(x)+": ...")
next x

PROCESS_EVENTS

APP_CLOSE:
release
return

See Also

BBjAPI

BBjSysGui

BBjSysGui::setDefaultScrollWheelBehavior

Mouse Scroll Wheel Event

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



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.