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

A .NET-based custom control component that integrates GLG drawings into the .NET and Visual Studio environment. More...

Detailed Description

A .NET-based custom control component that integrates GLG drawings into the .NET and Visual Studio environment.

It is a .NET encapsulation of a GLG viewport object that loads, displays and animates a GLG drawing. It inherits most of its API from the viewport object and adds methods inherited from its .Net Control superclass. Methods of the control and methods of its viewport may be used interchangeably.

GlgControl implements all GLG listener interfaces and is used as a default listener for all GLG events. The control's listener interface methods may be overridden by the control's subclasses.

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

Public Member Functions

 GlgControl ()
 Constructor. More...
 
virtual Object AddListener (GlgCallbackType listener_type, Object listener)
 Adds an event listener to the control. More...
 
virtual bool AddObjectAt (GlgObject container, Object object, int index)
 Adds an object at the specified position inside the container. More...
 
virtual bool AddObjectToBottom (GlgObject container, Object object)
 Adds an object at the end of the container. More...
 
virtual bool AddObjectToTop (GlgObject container, Object object)
 Adds an object at the end of the container. More...
 
virtual void Bell ()
 Emits an audio beep. More...
 
virtual GlgObject CloneObject (GlgObject glg_object, GlgCloneType clone_type)
 Creates a specialized copy (clone) of an object. More...
 
virtual bool ConstrainObject (GlgObject from_attribute, GlgObject to_attribute)
 Constrains an attribute or a point of the object to an attribute or a point of another object. More...
 
virtual bool ContainsObject (GlgObject container, Object object)
 Checks if object belongs to the container. More...
 
virtual GlgObject CopyObject (GlgObject glg_object)
 Creates a copy of the object. More...
 
virtual String CreateIndexedName (String template_name, int resource_index)
 Creates a string with a name of an enumerated resource. More...
 
virtual bool DeleteBottomObject (GlgObject container)
 Deletes an object from the bottom of the container. More...
 
virtual bool DeleteObject (GlgObject container, Object object)
 Finds and deletes an object from the container. More...
 
virtual bool DeleteObjectAt (GlgObject container, int index)
 Deletes an object from the specified position in the container. More...
 
virtual bool DeleteTopObject (GlgObject container)
 Deletes an object from the beginning of the container. More...
 
bool ExportPostScript (String filename, double x, double y, double width, double height, bool portrait, bool stretch, bool center)
 Generates a PostScript output of the current state of the control drawing's graphics. More...
 
virtual String GetDrawingFile ()
 Returns the value of the DrawingFile property. More...
 
virtual GlgObject GetDrawingObject ()
 Queries the value of the DrawingObject property. More...
 
virtual String GetDrawingURL ()
 Returns the value of the DrawingURL property. More...
 
virtual double GetDResource (String resource_name)
 Returns the current value of a D (double) resource of the control's viewport. More...
 
virtual double GetDTag (String tag_source)
 Returns the current value of a D (double) tag of the control's viewport. More...
 
virtual Object GetElement (GlgObject container, int index)
 Returns element at the specified position in the container. More...
 
virtual Encoding GetEncoding ()
 Returns the default encoding. More...
 
virtual GlgPoint GetGResource (String resource_name)
 Returns the current value of a G (color or point) resource of the control's viewport. More...
 
virtual int GetIndex (GlgObject container, Object object)
 Returns index of the first occurrence of an object in the container. More...
 
virtual GlgObject GetNamedObject (GlgObject container, String name)
 Finds an object with the specified name inside the container of GLG objects and returns it. More...
 
virtual int GetNumParents (GlgObject glg_object)
 ADVANCED: Returns number of the object's parents. More...
 
virtual GlgObject GetParent (GlgObject glg_object)
 ADVANCED: Returns an object's parent object, if one exists., or an array of all parents for constrained data objects. More...
 
virtual Object GetResource (GlgObject glg_object, String resource_name)
 Deprecated, use GetNativeComponent:
Returns an ID of a native resource. More...
 
virtual GlgObject GetResourceObject (GlgObject glg_object, String resource_name)
 Finds and returns a named resource or an attribute of the object. More...
 
virtual int GetSize (GlgObject container)
 Returns size of the container object. More...
 
virtual String GetSResource (String resource_name)
 Returns the current value of an S (string) resource of the control's viewport. More...
 
virtual String GetSTag (String tag_source)
 Returns the current value of an S (string) tag of the control's viewport. More...
 
virtual GlgObject GetViewport ()
 Returns the control's viewport object. More...
 
virtual double GetXResource (String resource_name)
 Returns the X value of a G (geometrical or color) resource of the control's viewport. More...
 
virtual double GetYResource (String resource_name)
 Returns the Y value of a G (geometrical or color) resource of the control's viewport. More...
 
virtual double GetZResource (String resource_name)
 Returns the Z value of a G (geometrical or color) resource of the control's viewport. More...
 
virtual bool HasResourceObject (String resource_name)
 Checks for the existence of a resource object in the control's viewport. More...
 
virtual bool HasTagName (String tag_name)
 Checks if a data tag with a specified tag name exists in the control's viewport. More...
 
virtual bool HasTagSource (String tag_source)
 Checks if a data tag with a specified tag source exists in the control's viewport. More...
 
virtual void HCallback (GlgObject viewport)
 H callback. More...
 
virtual void HierarchyCallback (GlgObject top_viewport, GlgHierarchyData hierarchy_info)
 Hierarchy callback. More...
 
virtual void InitialDraw (GlgObject glg_object)
 Draws a GLG viewport object for the first time after it has been created or loaded. More...
 
virtual void InputCallback (GlgObject vp, GlgObject message_obj)
 Input callback. More...
 
virtual void Inverse (GlgObject container)
 Inverses the order of elements inside the container object. More...
 
virtual bool IsDemo ()
 Checks the type of the GLG library. More...
 
virtual bool IsReady ()
 Queries the ready state of the control. More...
 
virtual Object Iterate (GlgObject container)
 Traverses the container object's elements in the forward direction. More...
 
virtual Object IterateBack (GlgObject container)
 Traverses the container object's elements in the backward direction. More...
 
virtual GlgObject LoadObject (String filename, GlgMediumType medium_type)
 Loads an object from a file or URL using the default encoding. More...
 
virtual GlgObject LoadObject (String filename, GlgMediumType medium_type, Encoding encoding)
 Loads an object from a file or URL using the specified encoding. More...
 
virtual GlgObject LoadWidget (GlgObject glg_object)
 Finds a viewport named $Widget inside an object and returns it. More...
 
virtual GlgObject LoadWidget (String filename, GlgMediumType medium_type)
 Loads a viewport named $Widget from a file or URL using default encoding. More...
 
virtual GlgObject LoadWidget (String filename, GlgMediumType medium_type, Encoding encoding)
 Loads a viewport named $Widget from a file or URL using the specified encoding. More...
 
virtual void ReadyCallback (GlgObject viewport)
 Ready callback. More...
 
virtual void ReleaseObject (GlgObject glg_object, GlgObject suspend_info)
 Releases the object that was suspended for editing. More...
 
virtual bool ReorderElement (GlgObject container, int old_index, int new_index)
 Changes an element's position inside the container. More...
 
virtual void Reset ()
 This method invokes the corresponding method of the control's viewport. More...
 
virtual void ResetHierarchy (GlgObject glg_object)
 Resets the object hierarchy of the object. More...
 
virtual bool SaveObject (GlgObject glg_object, String filename)
 Saves the object to a file using a default encoding. More...
 
virtual bool SaveObject (GlgObject glg_object, String filename, Encoding encoding)
 Saves an object into a file using the specified charset. More...
 
virtual void SelectCallback (GlgObject vp, Object[] name_array, int button)
 Select callback. More...
 
virtual bool SetAutoUpdateOnInput (bool update)
 Enabled or disables automatic updates on input events. More...
 
virtual void SetDrawingFile (String drawing_file)
 Sets the DrawingFile property. More...
 
virtual bool SetDrawingObject (GlgObject drawing_object)
 Sets the DrawingObject property to a GLG object to be used as the control's viewport. More...
 
virtual void SetDrawingURL (String drawing_url)
 Sets the DrawingURL property. More...
 
virtual bool SetDResource (String resource_name, double value)
 Sets a new value of a D (double) resource of the control's viewport. More...
 
virtual bool SetDResource (String resource_name, double value, bool if_changed)
 Sets a new value of a D (double) resource of the control's viewport. More...
 
virtual bool SetDTag (String tag_source, double value, bool if_changed)
 Sets a new value of a D (double) tag of the control's viewport. More...
 
virtual void SetEncoding (Encoding encoding)
 Sets the default encoding. More...
 
virtual void SetEnd (GlgObject container)
 Initializes the container object for the backward traversing. More...
 
virtual bool SetGResource (String resource_name, double value1, double value2, double value3)
 Sets a new value of a G (geometrical or color) resource of the control's viewport. More...
 
virtual bool SetGResource (String resource_name, double value1, double value2, double value3, bool if_changed)
 Sets a new value of a G (geometrical or color) resource of the control's viewport. More...
 
virtual bool SetGTag (String tag_source, GlgPoint gvalue, bool if_changed)
 Sets a new value of a G (geometrical or color) tag of the control's viewport. More...
 
virtual bool SetResourceFromObject (GlgObject glg_object, String resource_name, GlgObject value)
 Sets a new value of the object's resource to the value of contained in the provided data object of the same data type. More...
 
virtual bool SetResourceObject (GlgObject glg_object, String resource_name, GlgObject value)
 Replaces a resource object inside the object the method is invoked on. More...
 
virtual bool SetSResource (String resource_name, String value)
 Sets a new value of an S (string) resource of the control's viewport. More...
 
virtual bool SetSResource (String resource_name, String value, bool if_changed)
 Sets a new value of an S (string) resource of the control's viewport. More...
 
virtual bool SetSResourceFromD (GlgObject glg_object, String resource_name, String format, double value)
 Sets the value of the object's S (string) resource from a double value, converting the value into a string using a C-style printf format string. More...
 
virtual bool SetSTag (String tag_source, String value, bool if_changed)
 Sets a new value of an S (string) tag of the control's viewport. More...
 
virtual void SetStart (GlgObject container)
 Initializes the container object for the forward traversing. More...
 
virtual void SetupHierarchy (GlgObject glg_object)
 Provides an explicit request to set up the object hierarchy of the object without rendering it. More...
 
virtual bool SetXform (GlgObject glg_object, GlgObject xform)
 Adds or deletes transformations attached to the object. More...
 
virtual bool SetZoom (String resource_name, char type, double value)
 Provides a programmatic interface to integrated zooming and panning. More...
 
virtual GlgObject SuspendObject (GlgObject glg_object)
 Suspends the object for editing after it has been drawn. More...
 
virtual void Trace2Callback (GlgObject top_viewport, GlgTraceData trace_info)
 This method is invoked to handle any events in the control's drawing and may be overridden by control's subclasses to implement custom event handling logic. More...
 
virtual void TraceCallback (GlgObject top_viewport, GlgTraceData trace_info)
 Trace callback. More...
 
virtual bool UnconstrainObject (GlgObject glg_object)
 Unconstrains an object's attribute or an object's point. More...
 
virtual void UpdateGlg ()
 Updates the control's drawing with the latest resource values. More...
 
virtual void VCallback (GlgObject viewport)
 V callback. More...
 

Properties

String DrawingFile [get, set]
 Filename of the GLG drawing to be displayed. More...
 
GlgObject DrawingObject [get, set]
 Object ID of a GLG drawing to be displayed. More...
 
String DrawingURL [get, set]
 URL of the GLG drawing to be displayed. More...
 
bool SelectEnabled [get, set]
 Enables or disables the control's Select callback and Select event; is set to false by default. More...
 
bool TraceEnabled [get, set]
 Enables or disables the control's
Trace callback and Trace event; is set to false by default. More...
 
bool Trace2Enabled [get, set]
 Enables or disables the control's Trace2 callback and Trace2 event; is set to false by default. More...
 
bool HierarchyEnabled [get, set]
 Enables or disables the control's Hierarchy callback and Hierarchy event; is set to false by default. More...
 

Events

GlgInputEventHandler GlgInput
 GLG Input event handler, invoked with GlgInputEventArgs. More...
 
GlgSelectEventHandler GlgSelect
 GLG Select event handler, invoked with GlgSelectEventArgs. More...
 
GlgTraceEventHandler GlgTrace
 GLG Trace event handler. More...
 
GlgTrace2EventHandler GlgTrace2
 GLG Trace2 event handler. More...
 
GlgHierarchyEventHandler GlgHierarchy
 GLG Hierarchy event handler, invoked with GlgEventArgs. More...
 
GlgHEventHandler GlgH
 GLG H event handler, invoked with GlgEventArgs. More...
 
GlgVEventHandler GlgV
 GLG V event handler, invoked with GlgEventArgs. More...
 
GlgReadyEventHandler GlgReady
 GLG Ready event handler, invoked with GlgEventArgs. More...
 

Constructor & Destructor Documentation

◆ GlgControl()

Constructor.

It also initializes GLG Toolkit via Init.