Mouse Enter/Exit Event

Description

In BBj 4.0 and higher, the mouse enters or exits the window or control.

Remarks

An ON_MOUSE_EXIT if fired when the mouse enters a control on that window.

Mandatory/Optional

Optional

Event Mask Bit

$10000000$

Event Template

context:u(2),code:c(1),id:u(2),flags:u(1),x:u(2),y:u(2)

Field

Description

context

Context of the window on which the mouse enter/exit event occurred.

code

E

id

Control ID of the control (or 0 if window) on which the mouse enter/exit event occurred.

flags

0 – ON_MOUSE_ENTER: Mouse enters the window or control

1 – ON_MOUSE_EXIT: Mouse exits the window or control

x

0

y

0

Example

SYSGUI = unt
opEN(SYSGUI)"X0"
print(SYSGUI)'WINDOW'(100,100,300,300,"BLAH",$$,$10800100$)
print(SYSGUI)'BUTTOn'(101,50,50,80,30,"button",$$)
print(SYSGUI)'TITLE'(0,"READING RECORDS")
DIM EVENT$:TMPL(SYSGUI)
let EVENTLEN=LEN(EVENT$)
dim base$:noticetpl(0,0)
let DONE=0
CALLBACK(ON_MOUSE_ENTER,ON_BUTT,0,101)
CALLBACK(ON_MOUSE_EXIT,OFF_BUTT,0,101)
CALLBACK(ON_MOUSE_ENTER,ON_WIN,0)
CALLBACK(ON_MOUSE_EXIT,OFF_WIN,0)
X! = BBjAPI().getSysGui().getWindow(0).getControl(101)
Y! = BBJAPI().getSysGui().getWindow(0)
mySysGui! = BBjAPI().getSysGui()
process_events

ON_BUTT:
    rem 'Create the BBjColor Object using colorNum constant
    myColorRed! = mySysGui!.makeColor(mySysGui!.RED)

    rem 'Set the button colors to RED
    X!.setBackColor(myColorRed!)
return

OFF_BUTT:
    myColorGrey! = mySysGui!.makeColor(mySysGui!.LTGRAY)
    X!.setBackColor(myColorGrey!)
return

ON_WIN:
    rem 'Create the BBjColor Object using colorNum constant
    myColorRed! = mySysGui!.makeColor(mySysGui!.RED)

    rem 'Set the button colors to RED
    Y!.setBackColor(myColorRed!)
return

OFF_WIN:
    myColorGrey! = mySysGui!.makeColor(mySysGui!.LTGRAY)
    Y!.setBackColor(myColorGrey!)
return

See Also

BBjMouseEnterEvent

BBjMouseExitEvent