Interface MultiSourceEvent


Description

In BBj 7.0 and higher, a number of BBjEvent Objects can be generated from numerous controls. These BBjEvents implement the interface MultiSourceEvent. The interface allows a program to retrieve the source of the event cast to a specifed type.

Implementing Classes

BBjDragSourceDropEvent, BBjDropTargetDropEvent, BBjGainedFocusEvent, BBjLostFocusEvent, BBjMouseEnterEvent, BBjMouseExitEvent, BBjPopupRequestEvent, BBjRightMouseDownEvent

Methods of MultiSourceEvent

Return Value

Method

BBjBarChart

getBarChart()

BBjButton

getButton()

BBjCEdit

getCEdit()

BBjCheckBox

getCheckBox()

BBjChildWindow

getChildWindow()

BBjColorChooser

getColorChooser()

BBjEditBox

getEditBox()

BBjEditBoxSpinner

getEditBoxSpinner()

BBjFileChooser

getFileChooser()

BBjFontChooser

getFontChooser()

BBjGridHeader

getGridHeader()

BBjHtmlView

getHtmlView()

BBjImageCtrl

getImageCtrl()

BBjInputD

getInputD()

BBjInputDSpinner

getInputDSpinner()

BBjInputE

getInputE()

BBjInputESpinner

getInputESpinner()

BBjInputN

getInputN()

BBjInputNSpinner

getInputNSpinner()

BBjLineChart

getLineChart()

BBjListBox

getListBox()

BBjListButton

getListButton()

BBjListEdit

getListEdit()

BBjListSpinner

getListSpinner()

BBjMenuButton

getMenuButton()

BBjNavigator

getNavigator()

BBjPieChart

getPieChart()

BBjPrintPreview

getPrintPreview()

BBjProgressBar

getProgressBar()

BBjRadioButton

getRadioButton()

BBjScrollBar

getScrollBar()

BBjSlider

getSlider()

BBjStandardGrid

getStandardGrid()

BBjStatusBar

getStatusBar()

BBjTabCtrl

getTabCtrl()

BBjToolButton

getToolButton()

BBjTopLevelWindow

getTopLevelWindow()

BBjTree

getTree()

Example

open(unt)"X0"
sg!=BBjAPI().getSysGui()
win! = sg!.addWindow(10,10,300,300,"")
cedit! = win!.addCEdit(101, 10,10,80,140,"cedit")
button! = win!.addButton(102, 10,210,80,40,"button")
handler! = new EventHandler()
cedit!.setCallback(cedit!.ON_GAINED_FOCUS, handler!, "handleEvent")
button!.setCallback(button!.ON_GAINED_FOCUS, handler!, "handleEvent")
process_events

class public EventHandler
  field public BBjControl control!
  method public void handleEvent(MultiSourceEvent event!)
        #control! = event!.getCEdit(err = getButton)
        print "CEdit received focus"
        methodret
     getButton:
        #control! = event!.getButton(err = getWindow)
        print "button received focus"
        methodret
     getWindow:
        #control! = event!.getTopLevelWindow()
        print "window received focus"
        methodret

  methodend
classend

See Also

BBjAPI

BBjSysGui

SysGuiEvent::getControl()



______________________________________________________________________________________

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