GLG Toolkit, JavaScript Library  Version 4.6
GlgCustomSetupHandler Interface Reference

A custom setup handler used to implement custom object processing logic. More...

Detailed Description

A custom setup handler used to implement custom object processing logic.

A custom setup handler can be installed via SetCustomSetupHandler. Use CreateCustomSetupHandler to create a custom setup handler.

See ProcessObject for details of object processing.

Public Member Functions

void ProcessObject (GlgObject object, GlgCustomSetupType type)
 This method implements custom object processing logic and is invoked for objects tagged using the CustomSetup flag in the GLG drawing. More...
 

Static Public Member Functions

static GlgHandler CreateCustomSetupHandler (function handler_func)
 Constructor. More...
 

Member Function Documentation

◆ CreateCustomSetupHandler()

static GlgHandler CreateCustomSetupHandler ( function  handler_func)
static

Constructor.

Creates an custom setup handler that can be used as a parameter of SetCustomSetupHandler. The static method is invoked on the GLG Toolkit handle obtained via a 'new GlgToolkit()' call at the application start-up.

Parameters
handler_funcA custom setup handler function that implements the handler's logic. The function's type signature must match the type signature of the ProcessObject method.
Returns
An opaque internal object representing GlgCustomSetupHandler.

◆ ProcessObject()

void ProcessObject ( GlgObject  object,
GlgCustomSetupType  type 
)

This method implements custom object processing logic and is invoked for objects tagged using the CustomSetup flag in the GLG drawing.

The custom setup may be used to automate object data tags assignment based on the object ID, or to attach Input and Trace callbacks to objects representing custom widgets that handle user interaction.

The DEMOS_HTML/SCADAViewer directory of the GLG installation contains an elaborate example of an application framework that uses a custom setup handler to process special custom widgets.

Parameters
objectA tagged object to be processed.
typeIndicates when the method is invoked:

The execution order of the custom setup callback relative to the hierarchy callback of the containing object depends on the invocation type: