BBjWindow::setReportAllMouseEvents

Description

In BBj 15.0 and higher, this method sets an option to have all controls report low-level mouse events (mouse down, mouse up, etc.) to the window.

Syntax

Return Value

Method

void

setReportAllMouseEvents(boolean report)

Parameters

Variable

Description

report

Specifies whether mouse events should be reported for all controls on the window.
0 = events are not reported
1 = events are reported

Return Value

None.

Remarks

By default, low-level mouse events are only reported when the user clicks directly on the window, or on certain selected controls (static text, image, group box).

Example

rem ' BBjWindow::setReportAllMouseEvents

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
image$ = "http://basis.cloud/sites/basis.com/files/amity_island_logo.jpg"
imagemanager! = sysgui!.getImageManager()
image! = javax.imageio.ImageIO.read(new java.net.URL(image$))
os! = new java.io.ByteArrayOutputStream()
javax.imageio.ImageIO.write(image!,"jpg",os!)
bytes! = os!.toByteArray()
image! = imagemanager!.loadImageFromBytes(bytes!)
width = image!.getWidth()
height = image!.getHeight()
title$ = "setReportAllMouseEvents"
window! = sysgui!.addWindow(100,100,250,300,title$,$10090003$)
gosub print
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_MOUSE_DOWN,"event")
window!.setCallback(window!.ON_MOUSE_UP,"event")
window!.setCallback(window!.ON_MOUSE_MOVE,"event")
window!.setCallback(window!.ON_DOUBLE_CLICK,"event")
checkbox! = window!.addCheckBox(101,25,25,200,25,title$,$0004$)
checkbox!.setCallback(checkbox!.ON_CHECK_ON,"on")
checkbox!.setCallback(checkbox!.ON_CHECK_OFF,"off")
text! = window!.addStaticText(102,25,75,200,25,"BBjStaticText",$$)
edit! = window!.addEditBox(103,25,125,200,25,"BBjEditBox",$$)
imagectrl! = window!.addImageCtrl(104,25,175,width,height,image!)
process_events

eoj:
release

on:
    window!.setReportAllMouseEvents(1)
    gosub print
return

off:
    window!.setReportAllMouseEvents(0)
    gosub print
return

print:
    print "BBjWindow::getReportAllMouseEvents() = ",
    print window!.getReportAllMouseEvents()
return

event:
    event! = sysgui!.getLastEvent()
    print event!," on ",event!.getOriginalControl()
return

See Also

BBjAPI

BBjWindow

Object Variables

BBjMouseEvent::getOriginalControl

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