Interface MultiSourceEvent::getWindow



Description

In BBj 22.10 and higher, this method calls SysGuiEvent::getControl() and casts the return value to a BBjWindow.

Syntax

Return Value

Method

BBjWindow

getWindow()

Parameters

None.

Return Value

Returns the BBjWindow that is the source of the event.

Remarks

If the source of the event is not a BBjWindow, then this method will throw an !ERROR=26.

Example

Copy
Interface MultiSourceEvent::getWindow Example
rem ' MultiSourceEvent
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,400,400,"MultiSourceEvent",$00090083$)
window!.setCallback(BBjWindow.ON_CLOSE,"eoj")
cedit! = window!.addCEdit(101,25,25,350,200,"BBjCEdit",$8106$)
cedit!.setCallback(BBjCEdit.ON_GAINED_FOCUS,"cedit")
editbox! = window!.addEditBox(102,25,250,350,25,"BBjEditBox",$$)
editbox!.setCallback(BBjEditBox.ON_GAINED_FOCUS,"editbox")
button! = window!.addButton(103,25,300,350,25,"BBjButton",$$)
button!.setCallback(BBjButton.ON_GAINED_FOCUS,"button")
process_events
eoj:
  release
cedit:
  event! = sysgui!.getLastEvent()
  control! = event!.getCEdit()
  print "BBjCEdit gained focus"
return
editbox:
  event! = sysgui!.getLastEvent()
  control! = event!.getEditBox()
  print "BBjEditBox gained focus"
return
button:
  event! = sysgui!.getLastEvent()
  control! = event!.getButton()
  print "BBjButton gained focus"
return

See Also

BBjAPI

BBjSysGuiEvent::getControl

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