EventManager

The EventManager object allows you to register objects that will receive event callbacks from Personal Stock Streamer.  To get a reference to the EventManager object, call Application.GetObject("EventManager").

Methods:

RegisterHandler(object)

object: EventHandler object (see below)

 

Description: Registers an event handler object for the application.  The event manager auto-discovers which methods the event handler has defined and hooks them up to the related events.

 

RegisterHandlerMethod(object, method)

object: EventHandler object (see below)

method: String

 

Description: Registers an event handler object for the application.  This alternate registration method allows applications to register only specific functions when necessary.  This can be beneficial with time-consuming callbacks such as OnAppTimer.

 

UnregisterHandlerMethod(object, method)

object: EventHandler object (see below)

method: String

 

Description: Unregisters an event handler method for the given object.  This can be beneficial with time-consuming callbacks such as OnAppTimer that may not need to be called constantly.

EventHandler object

The EventHandler object can define any of a number of callback methods.  The EventManager object will query the EventHandler object to see which callback methods are defined, so you only need to define the methods that will actually be used.

Methods:

OnTickerUpdated(ticker)

ticker: Ticker object

 

Description: This method is called when any ticker in the document is updated.  Because with a streaming application this method may be called as often as once per second, this method should complete as quickly as possible so as not to slow down the rest of the application.

 

OnBeforeTickerDeleted(ticker)

ticker: Ticker object

 

Description: This method is called when any ticker in the document is about to be deleted.

 

OnMenuItemSelected(id)

id: Integer

 

Description: This method is called when a menu item is selected from the top level menu.  The id that is passed is the id of the menu item added through the Menu object's InsertItem method.

 

OnMenuPopup(menu)

menu: Menu object

 

Description: This method is called when a right-click menu (context menu) is about to be displayed.  This callback gives the script an opportunity to modify the menu to add custom menu items before it is displayed to the user.  Any items added to the popup menu must be added each time the menu is displayed, and all item ids added to this menu item are valid only for the duration the popup menu is on the screen.

 

OnHistoryBeginUpdate(ticker)

ticker: Ticker object

 

Description: This method is called when the historical data for a ticker is about to be updated

 

OnHistoryUpdated(ticker)

ticker: Ticker object

 

Description: This method is called when the historical data for a ticker has been updated

 

OnAppTimer()

Description: This method is called when the periodic application timer fires, usually at one second intervals.  Be careful when using this method.  Because with a streaming application this method will be called once per second, this method should complete as quickly as possible so as not to slow down the rest of the application.