The GLG ActiveX Control provides GLG Toolkit functionality and a complete GLG Programming API in the form of the Windows' ActiveX control. The ActiveX may be used in Visual Studio.NET with C++, C# and Visual Basic. It may also be used with other products that support embedded ActiveX controls. The ActiveX control may be deployed on the Web inside the Internet Explorer Web browser.
The GLG ActiveX Control is implemented as a dynamic link library with the .OCX extension. When registered and loaded, this single glg.ocx file may be used to display an extensive set of GLG widgets and custom drawings that can be accessed by users and applications.
The flexibility of the GLG drawing architecture translates into flexibility for the GLG ActiveX Control. Any GLG drawing may be used as a custom control by loading it into the ActiveX control. For example, loading a custom process control drawing into the GLG ActiveX control makes it a custom control with the functionality of the loaded drawing. The GLG ActiveX Control includes properties and methods to dynamically change the resources of a GLG drawing as your application's data change, allowing you to bind your real-time data to the attributes of the drawing displayed by the control.
For example, in a business application you may bind real-time data like a current stock price, as well as the high and low values, to a graph to display a history of changes. In a chemical process monitoring application, you may bind the temperature and level of fluid in a tank to the color and height of the tank's filling in the drawing, to display these parameters graphically.
The GLG ActiveX Control also defines custom Input and Select events. These events provide user feedback, allowing an application to react to user input or determine which graphical objects were selected with the mouse.
This chapter describes specific details of using the GLG ActiveX Control. Refer to Using the C/C++ version of the Toolkit for a detailed description of the Standard and Extended API methods, as well as details of the Input callback (described in Handling Input Events). The semantics of all API methods is the same in all versions of the Toolkit, and the C/C++ section provides examples and details of using them.
GLG ActiveX Control has the following properties:
Specifies a GLG drawing to display in a control. The drawing file must exist at the time the control is created. This property has priority over the DrawingImageFile property described below.The drawing must contain a viewport object named $Widget with HasResources flag set to YES.
Specifies a drawing to be used and stored in a control. The drawing file must exist at the time this property is set. and a copy of it is stored in the control. Saving the control with this property set saves a copy of the drawing with the control, allowing loading and using the control later with no separate drawing file. The DrawingFile property has higher priority: if both DrawingFile and DrawingImageFile properties are set, the control will use the drawing defined by the DrawingFile property, and only if loading that drawing fails, DrawingImageFile property is used. To discard the stored drawing, set this property to an empty string.
NOTE: the DrawingImageFile property doesn't support compressed drawings. Save drawings with the drawing compression option disabled for use them with this property.
Specifies a URL address to load a drawing from a Web. The drawing is cached. If other drawing properties are used to define the drawing, they have higher priority. DrawingURL property has the lowest priority and is used when other drawing properties are not specified or can't be used. Local drawings may be loaded using this property by specifying " file:// " at the beginning of the complete path name.
Specifies the URL used for the setup data script. The script has the standard GLG script format , described in The Data Generation Utility of GLG Programming Tools and Utilities. The script is invoked after the hierarchy has been setup and may access any resources of the drawing. The H properties of the control may be used to change resources before the hierarchy has been setup. The script is invoked only once when the drawing is loaded and initializes it with data. The script is not cached and is loaded asynchronously.
Specifies the URL of the script to supply data. The script has the standard GLG script format , described in The Data Generation Utility of GLG Programming Tools and Utilities. The script is first invoked after the SetupData script and fills the control with data. If the UpdatePeriod property is set, the script at the DataURL location is invoked repeatedly with the interval defined by the UpdatePeriod property. This enables the ActiveX control to periodically reload data to update display with the latest data.
Specifies a filename for printing the current content of a drawing in the encapsulated PostScript format, which may later imported into most word processors. Setting this property saves a PostScript output into the specified file using a default page layout. The control's Print method described later may be used to control page layout.
Controls whether input events are sent (default: TRUE). Input events are generated when a user activates sliders, dials, buttons or other input controls inside the GLG ActiveX Control. Generating input events is disabled if this property is set to FALSE.
Controls whether selection events are sent (default: TRUE). Selection events are generated when a user selects a graphical object inside the GLG ActiveX Control with the mouse. Generating selection events is disabled if this property is set to FALSE. Set this property to FALSE to increase performance for GLG ActiveX Controls which do not need selection feedback.
Controls whether trace events are sent (default: FALSE). Trace events are low level Windows events which may be used to trace the mouse position inside the ActiveX control, handle mouse and keyboard events, etc. Set this property to FALSE to increase performance for GLG ActiveX Controls which do not need trace events.
When set to TRUE (default value), suppresses the error message dialogs and recording errors in a " glg_err.log " log file. Set the property to FALSE to enable debugging GLG ActiveX Control problems.
Controls the use of the OpenGL driver (default: FALSE). When set to TRUE, the OpenGL driver is enabled for the viewports that have the OpenGLHint=ON. When set to FALSE, the OpenGL driver is disabled and the GDI driver is used for all viewports.
Controls the usage mode of the map server (default: FALSE). When set to FALSE, the maps are rendered using local datasets defined by the GISDataFile property of the GIS Object. When set to TRUE, a web-based map server defined by the GISMapServerURL property of the GIS Object is used to render maps from a centralized web server, without installing map datasets on each client computer.
These are character strings that specify five pre-creation properties. These properties serve as entry points to the GLG drawing resource hierarchy and may be used for setting resources before the drawing's object hierarchy is created. They should be used for setting a drawing's H resources, which control the structure of a GLG drawing's hierarchy. For information about H resources, refer to H and V Resources in Details of using GLG Standard API for C and C++. The syntax for the character strings is described in Dynamic Resource String Syntax of this chapter. These properties are persistent and may be used for customizing a drawing's appearance before saving the control.
The GLG ActiveX Control does not need five different dynamic properties of this type. In one sense, it would be adequate to have just one, and use it repeatedly. However, it is often useful to be able to set the initial values of several drawing resources, so multiple dynamic properties like these are provided. The same is true of the V properties described in the following section.
In the event that there are not enough GLG ActiveX Control dynamic properties for your purpose, you can use the GLG ActiveX Control 's Ready event and call the GLG ActiveX Control's methods to set the initial resources. The GLG ActiveX Control's custom events and methods are described later in this chapter.
These are five character strings that specify five post-creation properties. These properties serve as entry points to the GLG drawing resource hierarchy and may be used for setting resources after the drawing's object hierarchy is created. They should be used for setting a drawing's V resources, which only control the values of attributes within the structure of a GLG drawing's hierarchy. For information about V resources, refer to H and V Resources in Details of using GLG Standard API for C and C++. The syntax for the character strings is described in Dynamic Resource String Syntax of this chapter. These properties are persistent and may be used for customizing a drawing's appearance before saving the control.
Specify resource names to be used for accessing scalar (D) resources of a drawing.
Specify double-precision values to be set for scalar resources whose names are defined by the corresponding DLinkName properties. Use these properties to access frequently used double resources, an entry point of a graph's data samples, for example. These properties are bindable and not persistent.
Specify resource names to be used for accessing string (S) resources of a drawing.
Specify values to be set for string resources whose names are defined by the corresponding SLinkName properties. Use these properties to access frequently used string resources, an entry point of a graph's labels, for example. These properties are bindable and not persistent.
The H and V Properties are dynamic properties of the GLG ActiveX Control. These properties contain character strings which in turn contain the names and values of GLG drawing resources. The strings have the following syntax:
<resource_name> <resource_type> <values>The name of the GLG drawing resource, including the complete path (omitting the "$Widget" ). For example, "XLabelGroup/XLabel4/String" accesses the text string of the fifth label on the X axis in a graph widget.
The type of the resource and can be one of the following:
d Indicates the resource value is represented by a single floating point number (a scalar), like a line width, a font number or a value of a data sample
s The resource value is a string, like a text string of a label text object
g The resource value is a set of three floating point numbers, like a geometrical point with X, Y and Z coordinates or a color, in which case the three components represent the color's Red, Green, and Blue values.
A value or a set of values for the resource. The values given depend on the resource type.
The following strings are examples of specifying resources:
"DataGroup/DataSample3/Value d 2.5" "DataGroup/DataSample5/Value d 4" "XLabelGroup/XLabel4/String s April" "DataGroup/DataSample6/FillColor g 0.5 0 0.9"The following properties are persistent and keep their values when the control is saved and loaded:
DrawingFile (saves the file name only)
DrawingImageFile (saves a copy of the drawing)
PrintFile (saves the file name only)
HProperty0-HProperty4 (the last property resource setting is stored )
VProperty0-VProperty4 (the last property resource setting is stored)
The remaining properties are not persistent and are initialized to their default values when loaded.
GLG ActiveX Control has the following custom events:
Input event is fired on user input, for example when a slider in the ActiveX control drawing is moved. It's parameters are identical to the resources of message object in the GLG API's Input callback . The last input message objects is stored by the ActiveX control, and its resources may also be accessed as resources by prepending " $message/ " to the resource name. For example, " $message/ValueX " may be used to query the value of a slider using methods of the Standard API.
Input2 is an alternative form of the Input event which provides a message object parameter containing all resources of the input event. The message object may be passed to the Extended API methods to query its resources. The Input event may be used with the Standard API methods.
Selection event is fired when objects in the ActiveX control drawing are selected with a mouse click (button press). The parameters define the complete resource name of the selected object and the mouse button which was used for selection. If several closely positioned objects are selected with a mouse click, the callback is called repeatedly with a name of each selected object. The first and last call have " @@SelectionStart@@ " and " @@SelectionEnd@@ " as values of the selected_name parameter, allowing to detect the start and the end of a single mouse selection sequence of events. The name of the selected object and the mouse button used to select it may also be queried using the GetSelectedName and GetSelectionButton methods of the ActiveX control.
Same as the Select event, but invoked just once with an array of resource names of all selected objects. The GetElementExt method of the Extended API may be used to retrieve resource names of selected objects.
Generated for all low-level windowing events such as mouse move, mouse click, button press, etc. May be used to trace the position of the mouse inside the drawing or handle native low-level events. The top_viewport parameter is the top-level viewport of the drawing. The viewport parameter is the viewport where the event occurred. The message parameter is the Windows' message number. The wParam and lParam are message-dependent data parameters.
The Trace event is generated before the event has been dispatched for processing. The Trace2 event is generated after the event has been processed.
Generated after loading the control's drawing but before its hierarchy was set up. It may be used to initialize values of H resources, such as a number of instances in a series object or a number of datasamples in a graph.
The methods of the ActiveX control's API allow you to animate control's drawing with application data from a VC++ or VB application. The methods can also be used to animate the drawing with data when the ActiveX control is deployed on a Web, in which case Java or Visual Basic Script is used to invoke the methods.
The GLG ActiveX Control provides the following methods:
double GetDTag( String tag_source )
Return the value of the drawing's scalar resource or tag. Returns zero if the resource or tag was not found.
BOOL SetDTag( String tag_source, double dvalue, BOOL if_changed )
Set the value of the drawing's scalar resource or tag. Returns TRUE if the resource or tag exists and the setting was successful, FALSE otherwise.
NOTE: Use SetDResourceIfExt with null object parameter for SetDResourceIf functionality.
String GetSTag( String tag_source )
Return the value of the drawing's string resource or tag. Returns the empty string ("") if the resource or tag was not found.
BOOL SetSTag( String resource_name, String svalue, BOOL if_changed )
Set the value of the drawings's string resource or tag. Returns TRUE if the resource or tag exists and the setting was successful; otherwise returns FALSE.
NOTE: Use SetSResourceIfExt with null object parameter for SetSResourceIf functionality.
Set the value of the drawing's string resource to a string obtained by converting the supplied double value according to the format . The format parameter is a C format string. Returns TRUE if the resource exists and the setting was successful; otherwise returns FALSE.
NOTE: Use SetSResourceFromDIfExt with null object parameter for SetSResourceFromDIf functionality.
double GetZTag( String tag_source )
Return the X , Y , or Z value of the drawing's geometric resource or tag. Returns zero if the resource was not found.
BOOL SetGTag( String tag_source, double dvalue1, double dvalue2, double dvalue3,
BOOL if_changed )
Set the value of the drawing's geometric resource or tag. Returns TRUE if the resource or tag exists and the setting was successful.
NOTE: Use SetGResourceIfExt with null object parameter for SetGResourceIf functionality.
Returns TRUE if a named resource object exists, returns FALSE otherwise.
BOOL HasTagName( long object, String tag_name )
BOOL HasTagSource( long object, String tag_source )
Return TRUE if a tag with a specified tag name or tag source exists, returns FALSE otherwise.
long CreateTagList( long object, BOOL unique_tags )
Creates and returns a list of object's tags, or NULL if no tags were found. If unique_tags parameter is set to TRUE, the list will include only one tag instance in case there are multiple tags sharing the same name. The list must be destroyed using DropObject when it is no longer needed.
Forces GLG ActiveX Control to update the displayed drawing to reflect the current object hierarchy. Several resource changes may be effected at once by invoking several resource setting methods and then invoking the update method once to display all changes at once. This also increases performance. Note, however, that setting some H resources may interfere with setting other V resources, and that it may be necessary to invoke either the UpdateGlg or SetupHierarchy methods in between setting these two kinds of resources. For example, before you know that a series has eight members, it makes no sense to query the eighth member. You must set the series Factor resource, execute the UpdateGlg method, and then query the series members.
Same as the UpdateGlg method, deprecated due to a conflict with the .NET environment, where the Update method of the GLG ActiveX Control is shadowed by the object's Update method of the .NET framework. Use the UpdateGlg method instead.
Performs a zoom or pan operation specified by the type parameter. If the res_name parameter is NULL, the viewport itself is zoomed. Otherwise, the zoom operation will be performed on its child viewport specified by the res_name parameter. If the viewport parameter is null , the viewport of the ActiveX control's drawing is used. The value parameter defines the zoom factor or pan distance. Refer to GlgSetZoom on page 72 for a complete list of all zoom and pan types.
If the method attempts to set a very large zoom factor which would result in the overflow of the integer coordinate values used by the native windowing system, the zoom operation is not performed and the method returns FALSE.
Sets or resets a viewport's GIS Zoom Mode. If the GIS zoom mode is set, any zooming and panning operations invoked by the GlgSetZoom method will zoom and pan the map displayed in the viewport's GIS Object instead of being applied to the viewport's drawing. If the res_name parameter is null, the GIS zoom mode of the viewport itself will be set. Otherwise, the GIS zoom mode will be set for its child viewport specified by the res_name parameter. If the gis_name parameter is not null, it specifies the resource path of the GIS Object relative to the gis_object parameter, or relative to the viewport if the gis_object parameter is null. The method may be invoked with gis_object=null and gis_name=null to reset the GIS zoom mode.
Converts coordinates between the GIS coordinate system of the GIS Object and GLG coordinate system of the drawing. If the res_name parameter is NULL, object specifies the GIS Object whose coordinate system to use for conversion. If the res_name parameter is not NULL, object specifies a parent of the GIS Object. The res_name parameter specifies the resource name of the GIS Object inside the parent object specified by the object parameter. The coord_type parameter specifies the type of the GLG coordinate system type to convert to or from: GLG_SCREEN_COORD for screen coordinates or GLG_OBJECT_COORD for world coordinates. If the coord_to_lat_lon parameter is TRUE, coordinates are converted from GLG to GIS coordinate system. If it is FALSE, the coordinates are converted from GIS to GLG coordinate system. The x1, y1 and z1 parameters specify coordinates to be converted. The x2, y2 and z2 parameters point to the variables that will receive converted coordinate values. The function returns TRUE if conversion succeeds. When converting from GLG to GIS coordinates, the Z coordinate is set to a negative GLG_GIS_OUTSIDE_VALUE value for points on the invisible part of the globe.
Sends a message specified by the message parameter. If the res_name parameter is null, the message is sent to the object itself. Otherwise, the message is sent to the object's child specified by the res_name parameter. The param<n> arguments define additional parameters of the message depending on the message type.
Refer to Input Objects on page 115 of the GLG User's Guide and Builder Reference Manual for a list of messages supported by each type of the available input handlers.
Same as SendMessage , but sends the first parameter as a string. It is intended for use in VB.net environment that does not provide type casts.
Writes all text strings defined in the drawing specified by the object parameter into a string translation file using requested separator characters. Refer to Localization Support on page 108 of the GLG User's Guide and Builder Reference Manual for information about the string translation file format. The method returns the number of exported strings or -1 in case of an error.
Replaces text strings in the drawing defined by the object parameter with the strings loaded from a string translation file. Refer to Localization Support on page 108 of the GLG User's Guide and Builder Reference Manual for information about the string translation file format. The method returns the number of imported strings or -1 in case of an error.
Writes tag names and tag sources of all tags defined in the drawing specified by the object parameter into a file using requested separator characters. The method uses the same file format as the ExportStrings method. Refer to Localization Support on page 108 of the GLG User's Guide and Builder Reference Manual for information about the file format. The method returns the number of exported tags or -1 in case of an error.
Replaces tag names and tag sources of tags in the drawing defined by the object parameter with information loaded from a tag translation file. The method uses the same file format as the ImportStrings method. Refer to Localization Support on page 108 of the GLG User's Guide and Builder Reference Manual for information about the tag translation file format. The function returns the number of imported tags or -1 in case of an error.
Saves encapsulated PostScript output with the current state of the drawing into the specified file. The x , y , width , and height parameters define the PostScript page layout. The origin is defined to be in the middle of the page, the left edge of the page is at -1000, and the right edge is at 1000. The top and bottom of the page are similarly defined to be at 1000 and -1000, respectively. The x and y parameters define the lower left corner of the drawing, while width , and height give the dimensions of the drawing area. As an example, the default page layout you get when you print a drawing by setting the PrintFile property puts the lower left corner of the drawing area at ( -900 -900 ), while the dimensions are 1800 by 1800 . This makes the drawing about as large as it can be while still keeping a small border all the way around the page. The portrait parameter specifies portrait (TRUE) or landscape (FALSE) mode. If the stretch parameter is set to FALSE, the X/Y ratio of the drawing is preserved.
Saves a JPEG image of the visible area of the viewport's drawing into a file. Returns TRUE if the image was successfully saved. This method is disabled in Secure mode if GLG_ACTIVEX_SAVE_FILE environment variable is not set. In the current release of GLG, only JPEG image format (format=2) is supported. The res_name parameter specifies the resource name of a child viewport whose image to generate, or null to generate the image of the viewport itself.
Saves a JPEG image of the specified area of the drawing into a file. Returns TRUE if the image was successfully saved. This method is disabled in Secure mode if GLG_ACTIVEX_SAVE_FILE environment variable is not set. In the current release of GLG, only JPEG image format (format=2) is supported. The res_name parameter specifies the resource name of a child viewport whose image to generate, or null to generate the image of the viewport itself. The x, y, width and height parameters specify the area of the drawing in screen pixels for generating the image. If both the width and height parameters are set to 0, the image of the whole drawing is generated, which may be bigger than the visible area of the viewport if the drawing is zoomed in. The gap parameter specifies the padding space between the extent of the drawing and the edge of the image when width and height equal 0. The viewport's zoom factor defines the scaling factor for objects in the drawing when the image is saved.
Displays version number and other GLG ActiveX Control information in a box on the screen.
Returns the name of the last selected object reported by the Select event. It may be used to access the Select event information by using the control's methods in cases when there is no access to the events' parameters (scripting usage).
Returns the mouse button which was pressed to generate the last Select event. Similar to GetSelectedName , it may be used to access the Select event information by using the control's methods.
ADVANCED: Given the top viewport of the drawing and a screen coordinates rectangle in a selected viewport, returns an array of names of all objects within the rectangle. This method may be used in the Trace event handler to implement custom selection logic based on the mouse events.
ADVANCED: Given the top viewport of the drawing and a screen coordinates rectangle in a selected viewport, returns an array of all objects within the rectangle. This method may be used in the Trace event handler to implement custom selection logic based on the mouse events.
ADVANCED: This method is a programming API for the custom events. It may be used in the Trace event handler to retrieve a custom event which would be triggered by a specified mouse action in the rectangular area.
Given the top viewport of the drawing and a screen coordinates rectangle in a selected viewport, the method searches all objects inside the rectangle for the custom event of the specified type attached to an object. The method returns a selection message for the first matching custom event it finds. The selection message is a custom event message equivalent to the message received in the input callback. The selection_type parameter may specify one of the following predefined selection types: GLG_MOVE_SELECTION, GLG_CLICK_SELECTION or GLG_TOOLTIP_SELECTION defined in the GlgAPI.h file.
Sets the object for browsing with the GLG resource or tag browser widgets.
Converts the string to a persistent GLG string and returns its handle. The handle has to be freed with FreeStringID method when done. This function provides conversion between the String and GLG string types for the VB.net environment.
The methods of extended API may be used to add objects, dynamics and constraints to the ActiveX control drawing on the fly. This may be used to create sophisticated VC++ or Visual Basic applications. On the Web, Java or Visual Basic Script may be used to access the Extended API methods, enabling web designers to create complex interactive web applications.
The ActiveX control's Extended API methods mimic the methods of GLG Extended API. Refer to The GLG Extended API for more details on GLG Extended API methods.
The methods of the ActiveX control Extended API listed below have parameters identical to the corresponding methods of the C API, unless mentioned otherwise. A long value is used to represent an object id. This object id has meaning only inside a particular ActiveX control and can't be used interchangeably between several ActiveX controls. Refer to the GlgApi.h file for the values of the enumerated parameters of the methods. In most of the cases a null value may be used as a reasonable default.
There are several methods of Extended API which are identical to the corresponding methods of the regular API with the only difference of having an additional object parameter. For example,
SetDResource( resource_name, resource_value ) SetDResourceExt( object, resource_name, resource_value )The Extended API method above allows setting resources of the specific object while the regular API method sets the resource of the main viewport of the drawing (viewport named "$Widget" ).
If the null value is used as an object parameter of such Extended API methods, the object defaults to the main viewport of the drawing and the result will be identical to the corresponding regular API method invocation. This is also true even for the Extended API method which do not have corresponding regular API methods. For example, to add objects to the main viewport of the drawing using AddObjectExt method, you can use the value of zero as the first parameter, which results in using the main viewport of the drawing as a container. For the Get/SetResource methods of the Extended API passing NULL value for the object parameter allows using the methods even if the Extended API is disabled.
All Extended API methods have the Ext suffix, allowing to differentiate them from methods of the regular API.
The GLG ActiveX Control provides the following Extended API methods:
Adds the object to the beginning of the container . Returns true if the object was successfully added.
Adds the object to the end of container . Returns true if the object was successfully added.
Adds the object to the container at the index position . Returns false if index is invalid.
Adds an object to the container at the position indicated by the access_type (BOTTOM, TOP or CURRENT). If the access type is CURRENT, the object is added before or after the element indicated by the container's current position, as indicated by the position_modifier parameter (BEFORE or AFTER). Sets the container's current position to point to the added object. Returns true if the object was successfully added.
Creates and returns a copy of an object according the clone_type.
Creates and returns an object of a specified type. The object has to be explicitly added to the drawing in order to be displayed.
Deletes the object of the container at the index position . Returns false if index is invalid.
Deletes the first object of this container. Returns true if the object was successfully deleted.
Deletes the first object of this container. Returns true if the object was successfully deleted.
Deletes an object from container . Returns true if the object was successfully deleted.
Finds an object in the container according to the search type and returns it.
Returns the element of the container indicated by the index .
Returns a string of the string list ( container) indicated by the index . This method is intended for VB.net environment which does not provide type casts.
Returns the index of the first occurrence of the object in the container or -1 if the object wasn't found in the container.
Returns the index of the first occurrence of the string in the container or -1 if the string wasn't found in the container.
Returns the named element of the container defined by the name parameter.
Returns the number of parents of an object. Used to determine a type of the return value of the GetParentsExt method.
Returns the objects' parent if object has one parent. If object has more than one parent, returns an array of parents. The type of the return value may be determined by using GetNumParents method.
Finds and returns an object ID of the object's attribute or named resource.
Finds a single tag with a given tag name or tag source, or creates a list of tags matching the wildcard. The search_string specifies either the exact tag name or tag source to search for, or a search pattern which may contain the ? and * wildcards. The by_name parameter defines the search mode: by a tag name or tag source. In the single tag mode, the first tag matching the search criteria is returned. The unique_tags controls if only one tag is included in case there are multiple tags with the same tag name or tag source. The unique_tags flag is ignored in the single tag mode.
In a single tag mode, the function returns an object ID of the first attribute that has a tag matching the search criteria. In the multiple tag mode, it returns an object ID of a group containing all attributes with matching tags. The returned list must be dereferenced using DropObject when it is no longer needed.
Returns the object ID of the main viewport of the drawing (the viewport named "$Widget" )
double GetZTagExt( long object, String tag_source )
Return the value of the X, Y or Z coordinates of a G-type resource or tag.
Returns TRUE if the a Free Non-Commercial version of the ActiveX Extended API is used.
Loads an object from a file and returns its object ID. The object has to be added to the drawing to be displayed.
Loads a viewport named "$Widget" from a file and returns its object ID. The viewport has to be added to the drawing to be displayed.
Finds a viewport named "$Widget" inside the object returns its object ID.
If around_center equals TRUE, scales an object relative to the center by the specified X, Y and Z scale factors, otherwise scales the object relative to the center of the object's bounding box.
If around_center equals TRUE, rotates an object around the specified center by the specified X, Y and Z angles, otherwise rotates the object relatively to the center of the object's bounding box.
Positions an object at the specified location using the specified anchoring.
Performs a requested layout operation. Refer to The GLG Extended API on page 99 for more details.
Converts a point coordinates from the screen to the GLG world coordinate system. The inside_vp flag must be set to TRUE for viewport objects to convert to the world coordinate system inside the viewport.
Converts a point coordinates from the GLG world to the screen coordinate system. The inside_vp flag must be set to TRUE for viewport objects to convert from the world coordinate system inside the viewport.
Saves a PostScript image of the specified viewport object into a file. This method is disabled in Secure mode if GLG_ACTIVEX_PRINT_FILE environment variable is not set.
Releases a previously suspended for editing object. The suspend_info parameter is a returned value of a previous call to SuspendObjectExt .
Moves the container's element from the old_index to the new_index position. The function returns false if indexes are out of range.
Saves object into a file. Returns TRUE if the object was successfully saved. This method is disabled in Secure mode if GLG_ACTIVEX_SAVE_FILE environment variable is not set.
BOOL SetDResourceIfExt( long object, String resource_name, double dvalue, BOOL if_changed)
BOOL SetDTagExt( long object, String tag_source, double dvalue, BOOL if_changed)
Set a new value of a scalar resource or tag. Returns TRUE if the value of the resource or tag was successfully changed.
Replaces the element of the container indicated by the index with new_object .
BOOL SetGResourceIfExt( long object, String resource_name, double dvalue1, dvalue2, dvalue3, BOOL if_changed )
BOOL SetGTagExt( long object, String tag_source, double dvalue1, dvalue2, dvalue3,
BOOL if_changed )
Set a new value of the G-type resource or tag. Returns TRUE if the value of the resource or tag was successfully changed.
Sets a value of the data or matrix resource object defined by the resource_name to the value of the ovalue object. The resource types should match. Returns TRUE if the value of the resource was successfully changed.
Sets a new value of the object's attribute specified by the resource_name . It is used for attaching Custom Property objects and aliases .
BOOL SetSResourceIfExt( long object, String resource_name, String svalue, BOOL if_changed )
BOOL SetSTagExt( long object, String tag_source, String svalue, BOOL if_changed )
Set a new value of a string resource or tag. Returns TRUE if the value of the resource or tag was successfully changed.
BOOL SetSResourceFromDIfExt( long object, String resource_name, String format, double dvalue, BOOL if_changed )
BOOL SetSTagFromDExt( long object, String tag_source, String format, double dvalue,
BOOL if_changed )
Set a new value of a string resource or tag to a string obtained by converting the supplied double value according to the format. The format parameter is a C format string. Returns TRUE if the value of the resource or tag was successfully changed.
Initializes the container for traversing, should be called before using IterateExt method.
Sets the new drawing of the ActiveX control. The setting the drawing by using SetViewportExt method has the highest priority and overrides all other drawing properties.
Sets the object transformation to a constrained copy of the xform parameter. If the xform parameter is NULL, removes any object transformations. The CloneExt method may be used in conjunction with SetXformExt to add unconstrained copies of a transformation to several objects. Returns True if a transformation was successfully added.
Suspends object for editing. It must be called before adding a transformation or constraining attributes of the object whose object hierarchy has been setup (the object has been drawn). The method returns an object ID of the suspend_info object, which is used in a consequent call to the ReleaseObjectExt method.
The GLG ActiveX Control is normally operates in a Secure mode, which does not allow saving any files on a local file system.
You can allow saving and generating PostScript files by setting GLG_ACTIVEX_SAVE_FILE and GLG_ACTIVEX_PRINT_FILE environment variables described later in this document. This variable define filenames for use to save PostScript output of the ActiveX control's Print method and the output of the Save method.
There also is a NonSecure mode, which may be turned on by setting GLG_ACTIVEX_NON_SECURE_MODE environment variable described below. In NonSecure mode, the ActiveX control is allowed to save and print using arbitrary file names defined by the web-page designer, which makes it possible to overwrite files on a local file system.
Several environment variables may be used to modify GLG ActiveX Control's behavior. This is optional and not required for a typical GLG ActiveX Control usage. It is usually used for debugging when new web pages using the GLG ActiveX Control are developed.
On Windows NT, the environment variables may be set in the Systems Control Panel. On Windows 95 the autoexec.bat file may be used to set the variables.
Turns on the NonSecure mode. In NonSecure mode, the file names for printing and saving files are accepted, which may cause overwriting files on a local disk.
Provides a name of a file to be used for the ActiveX Control's Save method. In Secure mode , saving is allowed only if this environment variable is set, in which case the file name parameter of the Save method is ignored and the name defined by GLG_ACTIVEX_SAVE_FILE will be used.