GLG Toolkit, C / C++ API Library  Version 4.5
Hierarchy Setup

These callbacks are used to perform custom processing to set up objects in the drawing before the initial appearance. More...

Detailed Description

These callbacks are used to perform custom processing to set up objects in the drawing before the initial appearance.

Typedefs

typedef void(* GlgCustomSetupHandler) (GlgObject object, GlgCustomSetupType type)
 A custom setup handler installed via GlgSetCustomSetupHandler. More...
 
typedef void(* GlgHierarchyCallback) (GlgObject viewport, GlgAnyType client_data, GlgHierarchyCBStruct *hierarchy_info)
 A Hierarchy callback used to get access to the drawing to be displayed in the SubWindow and SubDrawing objects before the drawing is displayed, installed via GlgAddCallback. More...
 

Typedef Documentation

◆ GlgCustomSetupHandler

typedef void(* GlgCustomSetupHandler) (GlgObject object, GlgCustomSetupType type)

A custom setup handler installed via GlgSetCustomSetupHandler.

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 GlgViewer.c and HMIPage.c files in the DEMOS/SCADAViewer directory of GLG installation provide 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:

◆ GlgHierarchyCallback

typedef void(* GlgHierarchyCallback) (GlgObject viewport, GlgAnyType client_data, GlgHierarchyCBStruct *hierarchy_info)

A Hierarchy callback used to get access to the drawing to be displayed in the SubWindow and SubDrawing objects before the drawing is displayed, installed via GlgAddCallback.

SubWindow objects may be used to switch drawings displayed in them, and an application may want to install a separate Input callback for each loaded drawing to handle user interaction instead of having one giant Input callback that handles input events from all drawings. An Input callback has to be added to the viewport of a drawing displayed in the subwindow before the drawing has been set up and drawn. The Hierarchy callback is invoked with the ID of the subwindow's drawing after it has been loaded but before its hierarchy has been set up, making it possible to add Input callbacks as well as initialize the drawing with data before it is painted on the screen.

The Hierarchy callback can also be used to set up data tags defined in a SubDrawing object when an instance of the subdrawing is created.

The Hierarchy callback may be added to the top level viewport or any of its children viewports. If any of a subwindow's (or subdrawing's) parent viewports has a hierarchy callback added, the callback of the closest parent viewport will be invoked each time a subwindow loads a new drawing or a subdrawing loads its template.

The hierarchy callback is invoked multiple times for each template drawing: when the drawing is loaded but before it has been set up, when the drawing has been set up but before it has been drawn for the first time, as well as before and after the drawing has been reset. The condition field of the GlgHierarchyCBStruct structure received as the hierarchy_info provides information on when the callback is invoked.

The DEMOS/SCADAViewer/GlgViewer.c file in the GLG installation directory provides an elaborate example of using the Hierarchy callback.

Parameters
viewportThe viewport the callback is attached to.
client_dataThe client data specified when the callback was installed.
hierarchy_infoThe structure containing information about the subdrawing that triggered the callback. See GlgHierarchyCBStruct for more information.