GLG Toolkit, C# Class Library  Version 4.2
GlgControl Class Reference

Detailed Description

GLG Control, is used to display a GLG drawing.

Implements both the Standard and Extended API methods. These methods are also implemented by the GlgObject class for individual objects, while the control provides a centralized container-based interface.

Inherits Control, GlgInputListener, GlgSelectListener, GlgTraceListener, GlgReadyListener, GlgHListener, GlgVListener, and GlgHierarchyListener.

Public Member Functions

virtual Object AddListener (GlgCallbackType listener_type, Object listener)
 
virtual bool AddObjectAt (GlgObject container, Object obj, int index)
 
virtual bool AddObjectToBottom (GlgObject container, Object obj)
 
virtual bool AddObjectToTop (GlgObject container, Object obj)
 
virtual void Bell ()
 
virtual GlgObject CloneObject (GlgObject glg_object, GlgCloneType clone_type)
 
virtual bool ConstrainObject (GlgObject from_object, GlgObject to_object)
 
virtual bool ContainsObject (GlgObject container, Object obj)
 
virtual GlgObject CopyObject (GlgObject glg_object)
 
virtual String CreateIndexedName (String template_name, int res_index)
 
virtual bool DeleteBottomObject (GlgObject container)
 
virtual bool DeleteObject (GlgObject container, Object obj)
 
virtual bool DeleteObjectAt (GlgObject container, int index)
 
virtual bool DeleteTopObject (GlgObject container)
 
virtual String GetDrawingFile ()
 
virtual GlgObject GetDrawingObject ()
 
virtual String GetDrawingURL ()
 
virtual double GetDResource (String res_name)
 
virtual double GetDResource (GlgObject glg_object, String name)
 
virtual double GetDTag (String tag_source)
 
virtual Object GetElement (GlgObject container, int index)
 
virtual Encoding GetEncoding ()
 
virtual GlgPoint GetGResource (String res_name)
 
virtual GlgPoint GetGResource (GlgObject glg_object, String name)
 
virtual String GetHResource0 ()
 
virtual String GetHResource1 ()
 
virtual String GetHResource2 ()
 
virtual String GetHResource3 ()
 
virtual String GetHResource4 ()
 
virtual int GetIndex (GlgObject container, Object obj)
 
virtual GlgObject GetNamedObject (GlgObject container, String name)
 
virtual int GetNumParents (GlgObject glg_object)
 
virtual GlgObject GetParent (GlgObject glg_object)
 
virtual Object GetResource (GlgObject glg_object, String name)
 
virtual GlgObject GetResourceObject (GlgObject glg_object, String name)
 
virtual int GetSize (GlgObject container)
 
virtual String GetSResource (String res_name)
 
virtual String GetSResource (GlgObject glg_object, String name)
 
virtual String GetSTag (String tag_source)
 
virtual GlgObject GetViewport ()
 
virtual String GetVResource0 ()
 
virtual String GetVResource1 ()
 
virtual String GetVResource2 ()
 
virtual String GetVResource3 ()
 
virtual String GetVResource4 ()
 
virtual double GetXResource (String res_name)
 
virtual double GetXResource (GlgObject glg_object, String name)
 
virtual double GetYResource (String res_name)
 
virtual double GetYResource (GlgObject glg_object, String name)
 
virtual double GetZResource (String res_name)
 
virtual double GetZResource (GlgObject glg_object, String name)
 
virtual bool HasResourceObject (String res_name)
 
virtual bool HasResourceObject (GlgObject glg_object, String name)
 
virtual bool HasTagName (String tag_name)
 
virtual bool HasTagSource (String tag_source)
 
virtual void HCallback (GlgObject viewport)
 
virtual void HierarchyCallback (GlgObject top_viewport, GlgHierarchyData hierarchy_info)
 
virtual void InitialDraw (GlgObject glg_object)
 
virtual void InputCallback (GlgObject vp, GlgObject message_obj)
 
virtual void Inverse (GlgObject container)
 
virtual bool IsDemo ()
 
virtual bool IsDemoExt ()
 
virtual bool IsDemoInt ()
 
virtual bool IsReady ()
 
virtual Object Iterate (GlgObject container)
 
virtual Object IterateBack (GlgObject container)
 
virtual GlgObject LoadObject (String filename, GlgMediumType medium_type)
 
virtual GlgObject LoadObject (String filename, GlgMediumType medium_type, Encoding encoding)
 
virtual GlgObject LoadWidget (String filename, GlgMediumType medium_type)
 
virtual GlgObject LoadWidget (String filename, GlgMediumType medium_type, Encoding encoding)
 
virtual GlgObject LoadWidget (GlgObject glg_object)
 
bool Print (String filename, double x, double y, double width, double height, bool portrait, bool stretch)
 
bool Print (GlgObject glg_object, String filename, double x, double y, double width, double height, bool portrait, bool stretch)
 
virtual void ReadyCallback (GlgObject viewport)
 
virtual void ReleaseObject (GlgObject glg_object, GlgObject suspend_info)
 
virtual bool ReorderElement (GlgObject container, int old_index, int new_index)
 
virtual void Reset ()
 
virtual void ResetHierarchy (GlgObject glg_object)
 
virtual bool SaveObject (GlgObject glg_object, String filename)
 
virtual bool SaveObject (GlgObject glg_object, String filename, Encoding encoding)
 
virtual void SelectCallback (GlgObject vp, Object[] name_array, int button)
 
virtual bool SetAutoUpdateOnInput (bool update)
 
virtual void SetDrawingFile (String drawing_file)
 
virtual bool SetDrawingObject (GlgObject drawing_object)
 
virtual void SetDrawingURL (String drawing_url)
 
virtual bool SetDResource (String res_name, double value)
 
virtual bool SetDResource (String res_name, double value, bool if_changed)
 
virtual bool SetDResource (GlgObject glg_object, String name, double value)
 
virtual bool SetDTag (String tag_source, double value, bool if_changed)
 
virtual void SetEncoding (Encoding encoding)
 
virtual void SetEnd (GlgObject container)
 
virtual bool SetGResource (String res_name, double value1, double value2, double value3)
 
virtual bool SetGResource (String res_name, double value1, double value2, double value3, bool if_changed)
 
virtual bool SetGResource (GlgObject glg_object, String name, double value1, double value2, double value3)
 
virtual bool SetGTag (String tag_source, GlgPoint gvalue, bool if_changed)
 
virtual void SetHResource0 (String value)
 
virtual void SetHResource1 (String value)
 
virtual void SetHResource2 (String value)
 
virtual void SetHResource3 (String value)
 
virtual void SetHResource4 (String value)
 
virtual bool SetResourceFromObject (GlgObject glg_object, String name, GlgObject ovalue)
 
virtual bool SetResourceObject (GlgObject glg_object, String name, GlgObject data_object)
 
virtual bool SetSResource (String res_name, String value)
 
virtual bool SetSResource (String res_name, String value, bool if_changed)
 
virtual bool SetSResource (GlgObject glg_object, String name, String value)
 
virtual bool SetSResourceFromD (GlgObject glg_object, String name, String format, double value)
 
virtual bool SetSTag (String tag_source, String value, bool if_changed)
 
virtual void SetStart (GlgObject container)
 
virtual void SetupHierarchy (GlgObject glg_object)
 
virtual void SetVResource0 (String value)
 
virtual void SetVResource1 (String value)
 
virtual void SetVResource2 (String value)
 
virtual void SetVResource3 (String value)
 
virtual void SetVResource4 (String value)
 
virtual bool SetXform (GlgObject glg_object, GlgObject xform)
 
virtual bool SetZoom (String res_name, char type, double value)
 
virtual GlgObject SuspendObject (GlgObject glg_object)
 
virtual void Trace2Callback (GlgObject top_viewport, GlgTraceData trace_info)
 
virtual void TraceCallback (GlgObject top_viewport, GlgTraceData trace_info)
 
virtual bool UnconstrainObject (GlgObject glg_object)
 
virtual void UpdateGlg ()
 
virtual void UpdateGlg (GlgObject glg_object)
 
virtual void VCallback (GlgObject viewport)
 

Properties

String DrawingFile [get, set]
 
GlgObject DrawingObject [get, set]
 
String DrawingURL [get, set]
 
bool HierarchyEnabled [get, set]
 
bool SelectEnabled [get, set]
 
bool Trace2Enabled [get, set]
 
bool TraceEnabled [get, set]
 

Events

GlgHEventHandler GlgH
 
GlgHierarchyEventHandler GlgHierarchy
 
GlgInputEventHandler GlgInput
 
GlgReadyEventHandler GlgReady
 
GlgSelectEventHandler GlgSelect
 
GlgTraceEventHandler GlgTrace
 
GlgTrace2EventHandler GlgTrace2
 
GlgVEventHandler GlgV
 

Member Function Documentation

◆ AddListener()

virtual Object AddListener ( GlgCallbackType  listener_type,
Object  listener 
)
virtual

Adds an event listener to the control.

Only a single event listener for each listener type is enabled. Setting a new event listener overrides any previous settings. Hierarchy listener must be done before loading the control's drawing.

By default, the control itself is used as a listener for all GLG events; adding a different listener disables the corresponding event-handling callback of the control (for example, adding the INPUT_CB listener disables the control's InputCallback). Therefore, the application must use only one type of the event handling: either a control's callback or a listener. The control's callback method is usually used for applications which subclass the control to provide different event-handling functionality for derived classes.

The control's C# events are handled independently and are not affected if a corresponding listener is added: both the listener and an event handler will be invoked.

Parameters
listener_typeThe type of listener to add. May be one of the following: GlgCallbackType.INPUT_CB, GlgCallbackType.SELECT_CB, GlgCallbackType.TRACE_CB, GlgCallbackType.TRACE2_CB, GlgCallbackType.HIERARCHY_CB, GlgCallbackType.READY_CB, GlgCallbackType.H_CB or GlgCallbackType.V_CB.
listenerThe listener to be added. Must implement one of the matching GlgInputListener, GlgSelectListener, GlgTraceListener, GlgHierarchyListener, GlgReadyListener, GlgHListener or GlgVListener interfaces. null value may be used to remove a listener for the events specified by the listener_type parameter.
Returns
Previous listener

◆ AddObjectAt()

virtual bool AddObjectAt ( GlgObject  container,
Object  obj,
int  index 
)
virtual

Extended API: Adds object to the container at the specified position.

Parameters
containerContainer object
objObject to add
indexPosition index
Returns
true on success

◆ AddObjectToBottom()

virtual bool AddObjectToBottom ( GlgObject  container,
Object  obj 
)
virtual

Extended API: Adds object to the bottom of the container.

Parameters
containerContainer object
objObject to add
Returns
true on success

◆ AddObjectToTop()

virtual bool AddObjectToTop ( GlgObject  container,
Object  obj 
)
virtual

Extended API: Adds object to the top of the container.

Parameters
containerContainer object
objObject to add
Returns
true on success

◆ Bell()

virtual void Bell ( )
virtual

Emits an audio beep.

◆ CloneObject()

virtual GlgObject CloneObject ( GlgObject  glg_object,
GlgCloneType  clone_type 
)
virtual

Extended API: Creates and returns a copy of an object according to the clone_type (WEAK_CLONE, STRONG_CLONE, FULL_CLONE or CONSTRAINED_CLONE).

Returns
Object copy

◆ ConstrainObject()

virtual bool ConstrainObject ( GlgObject  from_object,
GlgObject  to_object 
)
virtual

Intermediate API: Constrains the attribute object.

Parameters
from_objectObject to constrain
to_objectThe attribute object to constrain to
Returns
true on success

◆ ContainsObject()

virtual bool ContainsObject ( GlgObject  container,
Object  obj 
)
virtual

Intermediate API: Checks if the object is contained by the container.

Parameters
containerContainer object
objThe object to search for.
Returns
true if the object is contained in container.

◆ CopyObject()

virtual GlgObject CopyObject ( GlgObject  glg_object)
virtual

Extended API: Creates a copy of an object using FULL_CLONE copy method.

Returns
Object copy

◆ CreateIndexedName()

virtual String CreateIndexedName ( String  template_name,
int  res_index 
)
virtual

Creates an indexed name by inserting a number into the first % character of the name template.

Returns
Created name

◆ DeleteBottomObject()

virtual bool DeleteBottomObject ( GlgObject  container)
virtual

Extended API: Deletes last object from the container.

Parameters
containerContainer object
Returns
true on success

◆ DeleteObject()

virtual bool DeleteObject ( GlgObject  container,
Object  obj 
)
virtual

Extended API: Deletes the object from the container.

Parameters
containerContainer object
objObject to delete.
Returns
true if the object was successfully deleted.

◆ DeleteObjectAt()

virtual bool DeleteObjectAt ( GlgObject  container,
int  index 
)
virtual

Extended API: Deletes the object of the container at the specified position.

Parameters
containerContainer object
indexIndex of the object to delete.
Returns
true on success

◆ DeleteTopObject()

virtual bool DeleteTopObject ( GlgObject  container)
virtual

Extended API: Deletes the first object from the container.

Parameters
containerContainer object
Returns
true on success

◆ GetDrawingFile()

virtual String GetDrawingFile ( )
virtual

Returns value of the DrawingFile property.

◆ GetDrawingObject()

virtual GlgObject GetDrawingObject ( )
virtual

Returns the value of the DrawingObject property.

◆ GetDrawingURL()

virtual String GetDrawingURL ( )
virtual

Returns value of the DrawingURL property.

◆ GetDResource() [1/2]

virtual double GetDResource ( String  res_name)
virtual

Returns value of a D (double) resource.

Parameters
res_nameResource name
Returns
Resource value

◆ GetDResource() [2/2]

virtual double GetDResource ( GlgObject  glg_object,
String  name 
)
virtual

Returns value of a D (double) resource.

Parameters
glg_objectObject to query
nameResource name
Returns
Resource value

◆ GetDTag()

virtual double GetDTag ( String  tag_source)
virtual

Returns value of a D (double) tag.

Parameters
tag_sourceTag source
Returns
Tag value

◆ GetElement()

virtual Object GetElement ( GlgObject  container,
int  index 
)
virtual

Returns container's element at the specified position.

Parameters
containerContainer object
indexPosition Index
Returns
Container's element or null.

◆ GetEncoding()

virtual Encoding GetEncoding ( )
virtual

Returns value of the default encoding.

◆ GetGResource() [1/2]

virtual GlgPoint GetGResource ( String  res_name)
virtual

Returns value of a G (color or point) resource.

Parameters
res_nameResource name
Returns
Resource value

◆ GetGResource() [2/2]

virtual GlgPoint GetGResource ( GlgObject  glg_object,
String  name 
)
virtual

Returns value of an G (color or point) resource.

Parameters
glg_objectObject to query
nameResource name
Returns
Resource value

◆ GetHResource0()

virtual String GetHResource0 ( )
virtual

Returns value of the HResource0 property.

◆ GetHResource1()

virtual String GetHResource1 ( )
virtual

Returns value of the HResource1 property.

◆ GetHResource2()

virtual String GetHResource2 ( )
virtual

Returns value of the HResource2 property.

◆ GetHResource3()

virtual String GetHResource3 ( )
virtual

Returns value of the HResource3 property.

◆ GetHResource4()

virtual String GetHResource4 ( )
virtual

Returns value of the HResource4 property.

◆ GetIndex()

virtual int GetIndex ( GlgObject  container,
Object  obj 
)
virtual

Intermediate API: Returns the index of the first occurrence of the object in the container

Parameters
containerContainer object
objThe object to search for.
Returns
Object's index or -1 if the object wasn't found in the container.

◆ GetNamedObject()

virtual GlgObject GetNamedObject ( GlgObject  container,
String  name 
)
virtual

Intermediate API: Returns container's element with the specified name

Parameters
containerContainer object
nameThe element's name
Returns
Container's element or null if named element wasn't found.

◆ GetNumParents()

virtual int GetNumParents ( GlgObject  glg_object)
virtual

ADVANCED: Intermediate API: Returns the number of object's parents.

Used to determine the type of the return value of the GetParent method.

Parameters
glg_objectObject to query
Returns
number object's parents

◆ GetParent()

virtual GlgObject GetParent ( GlgObject  glg_object)
virtual

ADVANCED: Intermediate API: Returns the object's parent(s).

Returns the object's parent or a group containing all parents if the object has more then one parent. Use GetParentNum method to determine the type of the return value. Drawn geometrical parents always have a single parent.

Parameters
glg_objectObject to query
Returns
Object parent or group of parents.

◆ GetResource()

virtual Object GetResource ( GlgObject  glg_object,
String  name 
)
virtual

Intermediate API: Finds and returns a resource of an arbitrary type.

Parameters
glg_objectObject to search
nameResource name
Returns
Resource object (Object)

◆ GetResourceObject()

virtual GlgObject GetResourceObject ( GlgObject  glg_object,
String  name 
)
virtual

Intermediate API: Finds and returns a named resource or an attribute of the object.

Parameters
glg_objectObject to search
nameResource name
Returns
Resource or attribute object (GlgObject)

◆ GetSize()

virtual int GetSize ( GlgObject  container)
virtual

Returns container's size.

Parameters
containerContainer object
Returns
Size

◆ GetSResource() [1/2]

virtual String GetSResource ( String  res_name)
virtual

Returns value of a S (string) resource.

Parameters
res_nameResource name
Returns
Resource value

◆ GetSResource() [2/2]

virtual String GetSResource ( GlgObject  glg_object,
String  name 
)
virtual

Returns value of an S (string) resource.

Parameters
glg_objectObject to query
nameResource name
Returns
Resource value

◆ GetSTag()

virtual String GetSTag ( String  tag_source)
virtual

Returns value of a S (string) tag.

Parameters
tag_sourceTag source
Returns
Tag value

◆ GetViewport()

virtual GlgObject GetViewport ( )
virtual

Returns the top viewport object of the drawing.

Returns null if the drawing hasn't been loaded.

◆ GetVResource0()

virtual String GetVResource0 ( )
virtual

Returns value of the VResource0 property.

◆ GetVResource1()

virtual String GetVResource1 ( )
virtual

Returns value of the VResource1 property.

◆ GetVResource2()

virtual String GetVResource2 ( )
virtual

Returns value of the VResource2 property.

◆ GetVResource3()

virtual String GetVResource3 ( )
virtual

Returns value of the VResource3 property.

◆ GetVResource4()

virtual String GetVResource4 ( )
virtual

Returns value of the VResource4 property.

◆ GetXResource() [1/2]

virtual double GetXResource ( String  res_name)
virtual

Returns the X value of a G (geometrical or color) resource.

Parameters
res_nameResource name
Returns
Resource value

◆ GetXResource() [2/2]

virtual double GetXResource ( GlgObject  glg_object,
String  name 
)
virtual

Returns the X value of a G (geometrical or color) resource.

Parameters
glg_objectObject to query
nameResource name
Returns
Resource value

◆ GetYResource() [1/2]

virtual double GetYResource ( String  res_name)
virtual

Returns the Y value of a G (geometrical or color) resource.

Parameters
res_nameResource name
Returns
Resource value

◆ GetYResource() [2/2]

virtual double GetYResource ( GlgObject  glg_object,
String  name 
)
virtual

Returns the Y value of a G (geometrical or color) resource.

Parameters
glg_objectObject to query
nameResource name
Returns
Resource value

◆ GetZResource() [1/2]

virtual double GetZResource ( String  res_name)
virtual

Returns the Z value of a G (geometrical or color) resource.

Parameters
res_nameResource name
Returns
Resource value

◆ GetZResource() [2/2]

virtual double GetZResource ( GlgObject  glg_object,
String  name 
)
virtual

Returns the Z value of a G (geometrical or color) resource.

Parameters
glg_objectObject to query
nameResource name
Returns
Resource value

◆ HasResourceObject() [1/2]

virtual bool HasResourceObject ( String  res_name)
virtual

Checks for the existence of the resource object

Parameters
res_nameResource name
Returns
true on success

◆ HasResourceObject() [2/2]

virtual bool HasResourceObject ( GlgObject  glg_object,
String  name 
)
virtual

Checks for the existence of the resource object

Parameters
glg_objectObject whose resources to search
nameResource name
Returns
true on success

◆ HasTagName()

virtual bool HasTagName ( String  tag_name)
virtual

Checks for the existence of the tag object with a given tag name.

Parameters
tag_nameTag name
Returns
true on success

◆ HasTagSource()

virtual bool HasTagSource ( String  tag_source)
virtual

Checks for the existence of the tag object with a given tag source.

Parameters
tag_sourceTag source
Returns
true on success

◆ HCallback()

virtual void HCallback ( GlgObject  viewport)
virtual

H callback.

This method is invoked after the drawing was loaded but before the hierarchy setup (before graphs create their datasamples).

It may be used for setting initial parameters of the loaded drawing, which control number of instances to be created (number of samples and labels) as well as other parameters of the datasample's and label's templates (ranges, initial values, etc.)

Implements GlgHListener.

◆ HierarchyCallback()

virtual void HierarchyCallback ( GlgObject  top_viewport,
GlgHierarchyData  hierarchy_info 
)
virtual

Hierarchy callback.

This method is invoked when a subwindow object in the drawing loads its own drawing, or when a subdrawing loads its template. The method may be overridden by subclasses to handle custom application logic. The method is invoked twice, before the template hierrachy setup and after the setup but before it is drawn. The condition field of GlgHierarchyData indicates when the callback is invoked (before or after the hierarchy setup).

Parameters
top_viewportTop-level viewport object.
hierarchy_infoGlgHierarchyData object containing information about the SubWindow or SubDrawing object that triggered the callback.

Implements GlgHierarchyListener.

◆ InitialDraw()

virtual void InitialDraw ( GlgObject  glg_object)
virtual

Draws a viewport object for the first time.

◆ InputCallback()

virtual void InputCallback ( GlgObject  vp,
GlgObject  message_obj 
)
virtual

Input callback.

This method is invoked to handle user interaction with input objects and may be overridden by subclasses to handle custom interaction logic. An input listener can be used as an alternative.

Parameters
vpTop-level viewport object of the input listener.
message_objMessage object containing input event information. Use GetResource methods to extract detailed event information.

Implements GlgInputListener.

◆ Inverse()

virtual void Inverse ( GlgObject  container)
virtual

Intermediate API: Reverses the order of the objects in the container.

Parameters
containerContainer object to inverse.

◆ IsDemo()

virtual bool IsDemo ( )
virtual

Returns true if the Evaluation Version of the Toolkit is used.

◆ IsDemoExt()

virtual bool IsDemoExt ( )
virtual

Returns true if a trial version of the Extended API is used.

◆ IsDemoInt()

virtual bool IsDemoInt ( )
virtual

Returns true if a trial version of the Intermediate or Extended API is used.

◆ IsReady()

virtual bool IsReady ( )
virtual

Returns true if the control finished loading the drawing.

◆ Iterate()

virtual Object Iterate ( GlgObject  container)
virtual

Intermediate API: Returns the next element of a container.

Parameters
containerContainer object
Returns
next element

◆ IterateBack()

virtual Object IterateBack ( GlgObject  container)
virtual

Intermediate API: Returns the previous element of a container.

Parameters
containerContainer object
Returns
previous element

◆ LoadObject() [1/2]

virtual GlgObject LoadObject ( String  filename,
GlgMediumType  medium_type 
)
virtual

Loads object from a file or URL using default charset.

Parameters
filenameDefines a drawing file or URL.
medium_typeFILE or URL constant
Returns
Loaded object or null if load fails.

◆ LoadObject() [2/2]

virtual GlgObject LoadObject ( String  filename,
GlgMediumType  medium_type,
Encoding  encoding 
)
virtual

Loads object from a file or URL using the specified charset.

Parameters
filenameDefines a drawing file or URL.
medium_typeFILE or URL constant
encodingOnly in C#: Encoding for string decoding.
Returns
Loaded object or null if load fails.

◆ LoadWidget() [1/3]

virtual GlgObject LoadWidget ( String  filename,
GlgMediumType  medium_type 
)
virtual

Loads a viewport named "$Widget" from a file or URL using default charset.

Parameters
filenameDefines a drawing file or URL.
medium_typeFILE or URL constant
Returns
Loaded viewport or null if load fails.

◆ LoadWidget() [2/3]

virtual GlgObject LoadWidget ( String  filename,
GlgMediumType  medium_type,
Encoding  encoding 
)
virtual

Loads a viewport named "$Widget" from a file or URL using the specified charset.

Parameters
filenameDefines a drawing file or URL.
medium_typeFILE or URL constant
encodingOnly in C#: Encoding for string decoding.
Returns
Loaded viewport or null if load fails.

◆ LoadWidget() [3/3]

virtual GlgObject LoadWidget ( GlgObject  glg_object)
virtual

Finds a viewport named "$Widget" inside an object and returns it.

Parameters
glg_objectAn object containing $Widget viewport
Returns
Viewport or null if search fails.

◆ Print() [1/2]

bool Print ( String  filename,
double  x,
double  y,
double  width,
double  height,
bool  portrait,
bool  stretch 
)

Prints the viewport drawing and saves it in a PostScript file.

Parameters
filenameFilename
xThe X coordinate of the lower left corner of the postcript output on a page in GLG coordinates [-1000;1000].
yThe Y coordinate of the lower left corner of the postcript output on a page in GLG coordinates [-1000;1000].
widthThe width of the postcript output on a page in GLG coordinates [-1000;1000].
heightThe height of the postcript output on a page in GLG coordinates [-1000;1000].
portraitOrientation: true for portrait
stretchPreserving X/Y ratio: true to stretch, false to preserve.

◆ Print() [2/2]

bool Print ( GlgObject  glg_object,
String  filename,
double  x,
double  y,
double  width,
double  height,
bool  portrait,
bool  stretch 
)

Prints the viewport's drawing and saves it in a PostScript file.

Parameters
glg_objectViewport object to print
filenameFilename
xThe X coordinate of the lower left corner of the postcript output on a page in GLG coordinates [-1000;1000].
yThe Y coordinate of the lower left corner of the postcript output on a page in GLG coordinates [-1000;1000].
widthThe width of the postcript output on a page in GLG coordinates [-1000;1000].
heightThe height of the postcript output on a page in GLG coordinates [-1000;1000].
portraitOrientation: true for portrait
stretchPreserving X/Y ratio: true to stretch, false to preserve.

◆ ReadyCallback()

virtual void ReadyCallback ( GlgObject  viewport)
virtual

Ready callback.

This method is invoked when the bean (Java) or the control (C#) has finished initializing and loading its drawing. This method may be overridden by subclasses to provide a custom initialization.

Parameters
viewportThe viewport object of the loaded drawing.

Implements GlgReadyListener.

◆ ReleaseObject()

virtual void ReleaseObject ( GlgObject  glg_object,
GlgObject  suspend_info 
)
virtual

Intermediate API: Releases the object after suspending for editing.

Parameters
glg_objectObject to release
suspend_infoReturned value of a previous call to SuspendObject

◆ ReorderElement()

virtual bool ReorderElement ( GlgObject  container,
int  old_index,
int  new_index 
)
virtual

Intermediate API: Moves the container's element from the old_index to the new_index position.

Parameters
containerContainer object
old_indexIndex of the object to move.
new_indexIndex of the new object position.
Returns
false if indexes are out of range.

◆ Reset()

virtual void Reset ( )
virtual

Resets the object hierarchy.

◆ ResetHierarchy()

virtual void ResetHierarchy ( GlgObject  glg_object)
virtual

Resets object hierarchy.

◆ SaveObject() [1/2]

virtual bool SaveObject ( GlgObject  glg_object,
String  filename 
)
virtual

Intermediate API: Saves an object into a file using default charset.

Parameters
filenameFilename
glg_objectObject to save
Returns
true on success

◆ SaveObject() [2/2]

virtual bool SaveObject ( GlgObject  glg_object,
String  filename,
Encoding  encoding 
)
virtual

Intermediate API: Saves an object into a file using the specified charset.

Parameters
filenameFilename
glg_objectObject to save
encodingOnly in C#: Encoding for string encoding.
Returns
true on success

◆ SelectCallback()

virtual void SelectCallback ( GlgObject  vp,
Object []  name_array,
int  button 
)
virtual

Select callback.

This method is invoked to handle object selection and may be overridden by subclasses to handle custom interaction logic. A select listener can be used as an alternative.

Parameters
vpTop-level viewport object of the selection listener.
name_arrayNull-terminated array of names of all selected objects, including a complete path name.
buttonThe mouse button that was pressed to select objects.

Implements GlgSelectListener.

◆ SetAutoUpdateOnInput()

virtual bool SetAutoUpdateOnInput ( bool  update)
virtual

Enabled or disables automatic updates on input events. Returns the previous setting of the automatic updates.

Automatic updates on input evants are enabled by default, but may be disabled to prevent slowing down scrolling and other operations of the real-time charts. If automatic updates are turned off, input objects redraw themselves on user input event, but an explicit Update() call has to be used to redraw any objects constrained to input objects and located outside them. When automatic updates are turned off, the application code also has to explicitely invoke Update() for timer events (Format="Timer") to update objects in the drawing with the timer transformation attached.

◆ SetDrawingFile()

virtual void SetDrawingFile ( String  drawing_file)
virtual

Sets DrawingFile property.

◆ SetDrawingObject()

virtual bool SetDrawingObject ( GlgObject  drawing_object)
virtual

Sets the DrawingObject property.

May be used to replace a drawing displayed in the Java bean or the C# control.

Returns
true on success

◆ SetDrawingURL()

virtual void SetDrawingURL ( String  drawing_url)
virtual

Sets DrawingURL property.

◆ SetDResource() [1/3]

virtual bool SetDResource ( String  res_name,
double  value 
)
virtual

Sets value of a D (double) resource.

Parameters
res_nameResource name
valueResource value
Returns
true on success

◆ SetDResource() [2/3]

virtual bool SetDResource ( String  res_name,
double  value,
bool  if_changed 
)
virtual

Sets value of a D (double) resource.

Parameters
res_nameResource name
valueResource value
if_changedIf set to true, the graphics will be redrawn only if the new resource value is different from the old one.
Returns
true on success

◆ SetDResource() [3/3]

virtual bool SetDResource ( GlgObject  glg_object,
String  name,
double  value 
)
virtual

Sets value of a D (double) resource.

Parameters
glg_objectObject whose resource to set
nameResource name
valueResource value
Returns
true on success

◆ SetDTag()

virtual bool SetDTag ( String  tag_source,
double  value,
bool  if_changed 
)
virtual

Sets value of a D (double) tag. All tags with the specified tag_source will be set to the supplied value.

Parameters
tag_sourceTag source
valueTag value
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
Returns
true on success

◆ SetEncoding()

virtual void SetEncoding ( Encoding  encoding)
virtual

Sets default encoding.

◆ SetEnd()

virtual void SetEnd ( GlgObject  container)
virtual

Intermediate API: Initializes container for traversing in the reversed direction.

This method should be called before invoking the container's IterateBack method.

Parameters
containerContainer object

◆ SetGResource() [1/3]

virtual bool SetGResource ( String  res_name,
double  value1,
double  value2,
double  value3 
)
virtual

Sets value of a G (geometrical or color) resource.

Parameters
res_nameResource name
value1The first value of the XYZ or RGB value triplet.
value2The second value of the XYZ or RGB value triplet.
value3The third value of the XYZ or RGB value triplet.
Returns
true on success

◆ SetGResource() [2/3]

virtual bool SetGResource ( String  res_name,
double  value1,
double  value2,
double  value3,
bool  if_changed 
)
virtual

Sets value of a G (geometrical or color) resource.

Parameters
res_nameResource name
value1The first value of the XYZ or RGB value triplet.
value2The second value of the XYZ or RGB value triplet.
value3The third value of the XYZ or RGB value triplet.
if_changedIf set to true, the graphics will be redrawn only if the new resource value is different from the old one.
Returns
true on success

◆ SetGResource() [3/3]

virtual bool SetGResource ( GlgObject  glg_object,
String  name,
double  value1,
double  value2,
double  value3 
)
virtual

Sets value of a G (geometrical or color) resource.

Parameters
glg_objectObject whose resource to set
nameResource name
value1The first value of the XYZ or RGB value triplet.
value2The second value of the XYZ or RGB value triplet.
value3The third value of the XYZ or RGB value triplet.
Returns
true on success

◆ SetGTag()

virtual bool SetGTag ( String  tag_source,
GlgPoint  gvalue,
bool  if_changed 
)
virtual

Sets value of a G (geometrical or color) tag. All tags with the specified tag_source will be set to the supplied values.

Parameters
tag_sourceTag source
gvalueXYZ or RGB value triplet
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
Returns
true on success

◆ SetHResource0()

virtual void SetHResource0 ( String  value)
virtual

Sets value of the HResource0 property.

◆ SetHResource1()

virtual void SetHResource1 ( String  value)
virtual

Sets value of the HResource1 property.

◆ SetHResource2()

virtual void SetHResource2 ( String  value)
virtual

Sets value of the HResource2 property.

◆ SetHResource3()

virtual void SetHResource3 ( String  value)
virtual

Sets value of the HResource3 property.

◆ SetHResource4()

virtual void SetHResource4 ( String  value)
virtual

Sets value of the HResource4 property.

◆ SetResourceFromObject()

virtual bool SetResourceFromObject ( GlgObject  glg_object,
String  name,
GlgObject  ovalue 
)
virtual

Sets value of the data or matrix resource to the value of the data object.

Parameters
glg_objectObject whose resource to set
nameResource name
ovalueGlg data object proving a value (must match resource's data type)
Returns
true on success

◆ SetResourceObject()

virtual bool SetResourceObject ( GlgObject  glg_object,
String  name,
GlgObject  data_object 
)
virtual

Extended API: Sets the new value of the object's attribute.

This method is used for attaching Custom Property objects, aliases and history objects.

Parameters
glg_objectObject whose attribute to set
nameAttribute name
data_objectGlgObject to attach.
Returns
true on success

◆ SetSResource() [1/3]

virtual bool SetSResource ( String  res_name,
String  value 
)
virtual

Sets value of an S (string) resource.

Parameters
res_nameResource name
valueResource value
Returns
true on success

◆ SetSResource() [2/3]

virtual bool SetSResource ( String  res_name,
String  value,
bool  if_changed 
)
virtual

Sets value of an S (string) resource.

Parameters
res_nameResource name
valueResource value
if_changedIf set to true, the graphics will be redrawn only if the new resource value is different from the old one.
Returns
true on success

◆ SetSResource() [3/3]

virtual bool SetSResource ( GlgObject  glg_object,
String  name,
String  value 
)
virtual

Sets value of an S (string) resource.

Parameters
glg_objectObject whose resource to set
nameResource name
valueResource value
Returns
true on success

◆ SetSResourceFromD()

virtual bool SetSResourceFromD ( GlgObject  glg_object,
String  name,
String  format,
double  value 
)
virtual

Sets value of an S (string) resource from a double value, converting the value into a string using a C-style format.

Parameters
glg_objectObject whose resource to set
nameResource name
formatC-style format (for example, "%.2lf")
valueValue
Returns
true on success

◆ SetSTag()

virtual bool SetSTag ( String  tag_source,
String  value,
bool  if_changed 
)
virtual

Sets value of an S (string) tag. All tags with the specified tag_source will be set to the supplied value.

Parameters
tag_sourceTag source
valueTag value
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
Returns
true on success

◆ SetStart()

virtual void SetStart ( GlgObject  container)
virtual

Intermediate API: Initializes container for traversing.

This method should be called before invoking the container's Iterate method.

Parameters
containerContainer object

◆ SetupHierarchy()

virtual void SetupHierarchy ( GlgObject  glg_object)
virtual

Sets up object hierarchy.

◆ SetVResource0()

virtual void SetVResource0 ( String  value)
virtual

Sets value of the VResource0 property.

◆ SetVResource1()

virtual void SetVResource1 ( String  value)
virtual

Sets value of the VResource1 property.

◆ SetVResource2()

virtual void SetVResource2 ( String  value)
virtual

Sets value of the VResource2 property.

◆ SetVResource3()

virtual void SetVResource3 ( String  value)
virtual

Sets value of the VResource3 property.

◆ SetVResource4()

virtual void SetVResource4 ( String  value)
virtual

Sets value of the VResource4 property.

◆ SetXform()

virtual bool SetXform ( GlgObject  glg_object,
GlgObject  xform 
)
virtual

Extended API: Sets the object's transformation to a constrained copy of the xform parameter.

Parameters
glg_objectObject to attach transformation to.
xformTransformation to attach to the object.
Returns
true on success

◆ SetZoom()

virtual bool SetZoom ( String  res_name,
char  type,
double  value 
)
virtual

Programmatic interface for the integrated zoom and pan features.

Zooms or pans the drawing by the specified amount. If the res_name parameter is not null, the children viewport of the drawing with the name specified by the res_name parameter is zoomed or panned.

The type may be one of the following: 'u' - pan up (default amount is 1/2 of the window height). 'd' - pan down (default amount is 1/2 of the window height). 'l' - pan left (default amount is 1/2 of the window width). 'r' - pan right (default amount is 1/2 of the window width). 'i' - zoom in (default zoom scale is 2 ). 'o' - zoom out (default zoom scale is 1/2 ). 'U' - pan the drawing all the way up 'D' - pan the drawing all the way down 'L' - pan the drawing all the way to the left 'R' - pan the drawing all the way to the right 'x' - pan horizontally by the distance in screen coordinates 'y' - pan vertically by the distance in screen coordinates 'X' - pan horizontally by the distance in world coordinates 'Y' - pan vertically by the distance in world coordinates 'f' - fit the drawing to the window 'F' - fit the area of drawing defined by an object named GlgFitArea to the window 'n' - reset any zoom and pan 't' - start ZoomTo mode 'T' - start custom ZoomTo mode 'e' - abort ZoomTo mode in progress (if any)

The value specifies the amount to zoom or pan by (when the value of 0 is passed, the default value is used). For pan operations, the value is expressed in the fractions of the screen size (for example, using 2/3 as the value will pan by 2/3 of the screen width or height). For zoom operations, the value defines the zoom scale (for example, using 5 as the value will zoom in or out by the factor of 5). The value is ignored in Reset, Start ZoomTo or Abort ZoomTo modes.

The method returns false if the zoom factor or pan amount is too big and would result in the overflow of the integer values used for drawing primitives by the windowing system, otherwise true is returned.

◆ SuspendObject()

virtual GlgObject SuspendObject ( GlgObject  glg_object)
virtual

Intermediate API: Suspends the object for editing.

This method must be called before adding a transformation or constraining attributes of the object whose object hierarchy has been setup (the object has been drawn).

Parameters
glg_objectObject to suspend
Returns
Suspend information (GlgObject) to be used as a suspend_info parameter in a subsequent call to the ReleaseObject method.

◆ Trace2Callback()

virtual void Trace2Callback ( GlgObject  top_viewport,
GlgTraceData  trace_info 
)
virtual

Trace2 callback.

This method is invoked to handle any events in a Glg drawing and may be overridden by subclasses to handle custom event handling logic. A trace2 listener can be used as an alternative. The method is invoked AFTER the event is processed.

Parameters
top_viewportTop-level viewport object.
trace_infoGlgTraceData object containing detailed event information.

◆ TraceCallback()

virtual void TraceCallback ( GlgObject  top_viewport,
GlgTraceData  trace_info 
)
virtual

Trace callback.

This method is invoked to handle any events in a Glg drawing and may be overridden by subclasses to handle custom event handling logic. A trace listener can be used as an alternative. The method is invoked BEFORE the event is processed.

Parameters
top_viewportTop-level viewport object.
trace_infoGlgTraceData object containing detailed event information.

Implements GlgTraceListener.

◆ UnconstrainObject()

virtual bool UnconstrainObject ( GlgObject  glg_object)
virtual

Intermediate API: Unconstrains the attribute object.

Parameters
glg_objectObject to unconstrain
Returns
true on success

◆ UpdateGlg() [1/2]

virtual void UpdateGlg ( )
virtual

Updates the drawing with the latest resource values.

◆ UpdateGlg() [2/2]

virtual void UpdateGlg ( GlgObject  glg_object)
virtual

Updates the drawing with the latest resource values.

Parameters
glg_objectViewport object to update

◆ VCallback()

virtual void VCallback ( GlgObject  viewport)
virtual

V callback.

This method is invoked after the drawing hierarchy has been setup (graph's datasamples already created) but before the drawing is painted for the first time.

This method may be used to fill graphs with initial data.

Implements GlgVListener.

Property Documentation

◆ DrawingFile

String DrawingFile
getset

Filename of the GLG drawing to be displayed.

If GLG event listeners are used instead of the C# event handlers, the propery should be set in the application code after adding the listeners, as opposed to setting the property using the control's properties in the VisualStudio designer mode.

◆ DrawingObject

GlgObject DrawingObject
getset

Object ID if a GLG drawing to be displayed.

◆ DrawingURL

String DrawingURL
getset

URL of the GLG drawing to be displayed.

If GLG event listeners are used instead of the C# event handlers, the propery should be set in the application code after adding the listeners, as opposed to setting the property using the control's properties in the VisualStudio designer mode.

◆ HierarchyEnabled

bool HierarchyEnabled
getset

Enables or disables the GLG Hierarchy callback, listener and event; is set to true by default.

To increase performance when the Hierarchy callback is not used, set HierarchyEnabled to false before loading the component's drawing.

◆ SelectEnabled

bool SelectEnabled
getset

Enables or disables the GLG Select callback, listener and event; is set to true by default.

To increase performance when the Select callback is not used, set SelectEnabled to false before loading the component's drawing.

◆ Trace2Enabled

bool Trace2Enabled
getset

Enables or disables the GLG Trace2 callback, listener and event; is set to false by default.

To activate Trace2 events and callbacks, set Trace2Enabled to true before loading the component's drawing.

◆ TraceEnabled

bool TraceEnabled
getset

Enables or disables the GLG Trace callback, listener and event; is set to false by default.

To activate Trace events and callbacks, set TraceEnabled to true before loading the component's drawing.

Event Documentation

◆ GlgH

GlgHEventHandler GlgH

GLG H event handler.

It may be used for setting initial parameters of the loaded drawing, which control number of instances to be created (number of samples and labels) as well as other parameters of the datasample's and label's templates (ranges, initial values, etc.)

◆ GlgHierarchy

GlgHierarchyEventHandler GlgHierarchy

GLG Hierarchy event handler.

Hierarchy events are generated by subwindows and subdrawings when their templates are loaded. This event may be used to attach different input listeners to viewports displayed in a subwindow, as well as to initialize the template drawing.

◆ GlgInput

GlgInputEventHandler GlgInput

GLG Input event handler.

◆ GlgReady

GlgReadyEventHandler GlgReady

GLG Ready event handler.

◆ GlgSelect

GlgSelectEventHandler GlgSelect

GLG Select event handler.

◆ GlgTrace

GlgTraceEventHandler GlgTrace

GLG Trace event handler.

Generated for every native event occuring in the GLG viewports displayed in the GlgControl.

Trace event is fired before processing GLG Input events, with the trace_info.trace2 parameter of the event is set to false.

◆ GlgTrace2

GlgTrace2EventHandler GlgTrace2

GLG Trace2 event handler.

Generated for every native event occuring in the GLG viewports displayed in the GlgControl.

Trace2 event is fired after processing GLG Input events, with the trace_info.trace2 parameter of the event is set to true.

◆ GlgV

GlgVEventHandler GlgV

GLG V event handler.