GLG Toolkit, C# Class Library  Version 4.6
Standard API Methods

Detailed Description

Functions

virtual void Bell ()
 Emits an audio beep. More...
 
virtual String CreateIndexedName (String template_name, int resource_index)
 Creates a string with a name of an enumerated resource. 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 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 GlgPoint GetGResource (String resource_name)
 Returns the current value of a G (color or point) resource of the control's viewport. 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 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 InitialDraw (GlgObject glg_object)
 Draws a GLG viewport object for the first time after it has been created or loaded. More...
 
virtual bool IsDemo ()
 Checks the type of the GLG library. 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 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 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 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 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 SetupHierarchy (GlgObject glg_object)
 Provides an explicit request to set up the object hierarchy of the object without rendering it. More...
 
virtual bool SetZoom (String resource_name, char type, double value)
 Provides a programmatic interface to integrated zooming and panning. More...
 
virtual void UpdateGlg ()
 Updates the control's drawing with the latest resource values. More...
 

Function Documentation

◆ Bell()

virtual void Bell ( )
virtual

Emits an audio beep.

◆ CreateIndexedName()

virtual String CreateIndexedName ( String  template_name,
int  resource_index 
)
virtual

Creates a string with a name of an enumerated resource.

This method invokes the corresponding method of the GlgObject class. See CreateIndexedName for more information.

Parameters
template_nameA character string containing the template name to be expanded. This name uses the % character to define the expansion position.
resource_indexSpecifies the number to use for expanding the % character in the template name.
Returns
Created resource name.

◆ ExportPostScript()

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.

This method invokes the corresponding method of the control's viewport. See ExportPostScript for more information.

Parameters
filenameFilename
xThe X coordinate of the lower left corner of the postcript output.
yThe Y coordinate of the lower left corner of the postcript output.
widthThe width of the postcript output.
heightThe height of the postcript output.
portraitOrientation: true for portrait
stretchPreserving X/Y ratio: true to stretch, false to preserve.
centerIf true, the output is centered inside the defined area when stretch=false resulted in unused space on the sides of the output.
Returns
true if PostScript output was successfully written to the file, otherwise false.

◆ GetDResource()

virtual double GetDResource ( String  resource_name)
virtual

Returns the current value of a D (double) resource of the control's viewport.

Parameters
resource_nameResource path.
Returns
Resource value.

If a scalar resource with the given resource path does not exist, an error message is generated, and zero is returned.

◆ GetDTag()

virtual double GetDTag ( String  tag_source)
virtual

Returns the current value of a D (double) tag of the control's viewport.

Parameters
tag_sourceSpecifies the TagSource of the scalar tag to query.
Returns
Tag value.

If a scalar resource with the given TagSource does not exist, an error message is generated, and null is returned.

◆ GetGResource()

virtual GlgPoint GetGResource ( String  resource_name)
virtual

Returns the current value of a G (color or point) resource of the control's viewport.

Parameters
resource_nameResource path.
Returns
A GlgPoint containing XYZ or RGB resource values.

If a G resource with the given resource path exists, this method returns its values in a GlgPoint object, otherwise it generates an error message and returns null.

For efficiency, if the returned object is not null, it can be returned to the internal cache via the object's ReleaseToCache method.

◆ GetSResource()

virtual String GetSResource ( String  resource_name)
virtual

Returns the current value of an S (string) resource of the control's viewport.

Parameters
resource_nameResource path.
Returns
Resource value.

If a string resource with the given resource path does not exist, an error message is generated, and null is returned.

◆ GetSTag()

virtual String GetSTag ( String  tag_source)
virtual

Returns the current value of an S (string) tag of the control's viewport.

Parameters
tag_sourceSpecifies the TagSource of the string tag to query.
Returns
Tag value.

If a string tag with the given TagSource does not exist, an error message is generated, and zero is returned.

◆ GetXResource()

virtual double GetXResource ( String  resource_name)
virtual

Returns the X value of a G (geometrical or color) resource of the control's viewport.

Parameters
resource_nameResource path.
Returns
Resource's X value.

If a G resource with the given resource path does not exist, an error message is generated, and zero is returned.

◆ GetYResource()

virtual double GetYResource ( String  resource_name)
virtual

Returns the Y value of a G (geometrical or color) resource of the control's viewport.

Parameters
resource_nameResource path.
Returns
Resource's Y value.

If a G resource with the given resource path does not exist, an error message is generated, and zero is returned.

◆ GetZResource()

virtual double GetZResource ( String  resource_name)
virtual

Returns the Z value of a G (geometrical or color) resource of the control's viewport.

Parameters
resource_nameResource path.
Returns
Resource's Z value.

If a G resource with the given resource path does not exist, an error message is generated, and zero is returned.

◆ HasResourceObject()

virtual bool HasResourceObject ( String  resource_name)
virtual

Checks for the existence of a resource object in the control's viewport.

Parameters
resource_nameThe resource path of the resource object to query.
Returns
true if a resource object with the given resource path exists, otherwise returns false without generating an error message.

◆ HasTagName()

virtual bool HasTagName ( String  tag_name)
virtual

Checks if a data tag with a specified tag name exists in the control's viewport.

Parameters
tag_nameSpecifies the tag name to query.
Returns
true if a tag with the given tag name exists, otherwise returns false without generating an error message.

◆ HasTagSource()

virtual bool HasTagSource ( String  tag_source)
virtual

Checks if a data tag with a specified tag source exists in the control's viewport.

Parameters
tag_sourceSpecifies the tag source to query.
Returns
true if a tag with the given tag source exists, otherwise returns false without generating an error message.

◆ InitialDraw()

virtual void InitialDraw ( GlgObject  glg_object)
virtual

Draws a GLG viewport object for the first time after it has been created or loaded.

Parameters
glg_objectThe viewport object.

This method invokes the corresponding method of the GlgObject class and draws the viewport in a top-level window outside of the control. It should not be used on the viewport of the control. See InitialDraw for more information.

◆ IsDemo()

virtual bool IsDemo ( )
virtual

Checks the type of the GLG library.

Returns
true if the Community Edition version of the library is used.

◆ LoadObject() [1/2]

virtual GlgObject LoadObject ( String  filename,
GlgMediumType  medium_type 
)
virtual

Loads an object from a file or URL using the default encoding.

Parameters
filenameSpecifies the name of the file or the URL to load the object from.
medium_typeFILE or URL constant.
Returns
Loaded object or null if load fails.

This method loads an object from the specified file or URL and returns the object. If the file or the URL is not accessible or is not in the GLG save format, an error message is generated and null is returned.

◆ LoadObject() [2/2]

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

Loads an object from a file or URL using the specified encoding.

Parameters
filenameSpecifies the name of the file or the URL to load the object from.
medium_typeFILE or URL constant.
encodingEncoding for string decoding.
Returns
Loaded object or null if load fails.

This method loads an object from the specified file or URL and returns the object. If the file or the URL is not accessible or is not in the GLG save format, an error message is generated and null is returned.

◆ LoadWidget() [1/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
The found $Widget viewport or null if the search fails.

◆ LoadWidget() [2/3]

virtual GlgObject LoadWidget ( String  filename,
GlgMediumType  medium_type 
)
virtual

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

Parameters
filenameSpecifies the name of the file or the URL to load the widget from.
medium_typeFILE or URL constant.
Returns
Loaded viewport or null if load fails.

◆ LoadWidget() [3/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 encoding.

Parameters
filenameSpecifies the name of the file or the URL to load the widget from.
medium_typeFILE or URL constant.
encodingEncoding for string decoding.
Returns
Loaded viewport or null if load fails.

◆ Reset()

virtual void Reset ( )
virtual

This method invokes the corresponding method of the control's viewport.

See Reset for more information.

◆ ResetHierarchy()

virtual void ResetHierarchy ( GlgObject  glg_object)
virtual

Resets the object hierarchy of the object.

Parameters
glg_objectThe object to be reset.

This method invokes the corresponding method of the GlgObject class. See ResetHierarchy for more information.

◆ SetDResource() [1/2]

virtual bool SetDResource ( String  resource_name,
double  value 
)
virtual

Sets a new value of a D (double) resource of the control's viewport.

Parameters
resource_nameResource path.
valueResource value.
Returns
Success or failure status.

If a scalar resource with the given resource path doesn'y exists, the method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Optimization for more.

◆ SetDResource() [2/2]

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

Sets a new value of a D (double) resource of the control's viewport.

Parameters
resource_nameResource path.
valueResource value.
if_changedIf true, the graphics will be redrawn only if the new resource value is different from the old one.
Returns
Success or failure status.

If a scalar resource with the given resource path doesn'y exists, the method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Optimization for more.

◆ SetDTag()

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

Sets a new value of a D (double) tag of the control's viewport.

Parameters
tag_sourceSpecifies TagSource of the scalar tag to be set.
valueSpecifies a new value.
if_changedIf true, the graphics will be redrawn only if the new tag value is different from the old one.
Returns
Success or failure status.

If scalar tags with the given TagSource exist, this method sets their new values and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetGResource() [1/2]

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

Sets a new value of a G (geometrical or color) resource of the control's viewport.

Parameters
resource_nameResource path.
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
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns true, otherwise it generates an error message and returns false.

See Resource Access Optimization for more.

◆ SetGResource() [2/2]

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

Sets a new value of a G (geometrical or color) resource of the control's viewport.

Parameters
resource_nameResource path.
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 true, the graphics will be redrawn only if the new resource value is different from the old one.
Returns
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns true, otherwise it generates an error message and returns false.

See Resource Access Optimization for more.

◆ SetGTag()

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

Sets a new value of a G (geometrical or color) tag of the control's viewport.

Parameters
tag_sourceSpecifies the TagSource of the geometrical or color tag to be set.
gvalueGlgPoint containing XYZ or RGB resource values.
if_changedIf true, the graphics will be redrawn only if the new tag value is different from the old one.
Returns
Success or failure status.

If G tags with the given TagSource exist, this method sets their new value and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetResourceFromObject()

virtual bool SetResourceFromObject ( GlgObject  glg_object,
String  resource_name,
GlgObject  value 
)
virtual

Sets a new value of the object's resource to the value of contained in the provided data object of the same data type.

Parameters
glg_objectObject whose resource to set.
resource_nameResource path.
valueAn object of the matching data type containing the new value.
Returns
Success or failure status.

If a resource of a matching type at the given resource path exists, the method sets the value of the resource to a value defined by the value object and returns true, otherwise it generates an error message and returns false.

The object type and data type of the resource specified by the resource path should match the corresponding types of the value object.

See Resource Access Optimization for more.

◆ SetSResource() [1/2]

virtual bool SetSResource ( String  resource_name,
String  value 
)
virtual

Sets a new value of an S (string) resource of the control's viewport.

Parameters
resource_nameResource path.
valueResource value.
Returns
Success or failure status.

If a string resource with the given resource path doesn'y exists, the method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Optimization for more.

◆ SetSResource() [2/2]

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

Sets a new value of an S (string) resource of the control's viewport.

Parameters
resource_nameResource path.
valueResource value.
if_changedIf true, the graphics will be redrawn only if the new resource value is different from the old one.
Returns
Success or failure status.

If a string resource with the given resource path doesn'y exists, the method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Optimization for more.

◆ SetSResourceFromD()

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

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.

Parameters
glg_objectObject whose resource to set.
resource_nameResource path.
formatSpecifies the C-style printf format to use (for example, "%.2f").
valueSpecifies the numerical value to be converted to a string according to the specified format.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets it to a new string containing the value parameter formatter using the format argument and returns true, otherwise it generates an error message and returns false.

See Resource Access Optimization for more.

◆ SetSTag()

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

Sets a new value of an S (string) tag of the control's viewport.

Parameters
tag_sourceSpecifies TagSource of the string tag to be set.
valueSpecifies a new value.
if_changedIf true, the graphics will be redrawn only if the new tag value is different from the old one.
Returns
Success or failure status.

If string tags with the given TagSource exist, this method sets their new values and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetupHierarchy()

virtual void SetupHierarchy ( GlgObject  glg_object)
virtual

Provides an explicit request to set up the object hierarchy of the object without rendering it.

Parameters
glg_objectThe object to be set up.

This method invokes the corresponding method of the GlgObject class. See SetupHierarchy for more information.

◆ SetZoom()

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

Provides a programmatic interface to integrated zooming and panning.

Parameters
resource_nameA resource path of a child viewport to zoom or pan, or null to zoom or pan the control's top viewport.
typeA char value that specifies the type of the zoom or pan operation to perform. For example, 'i' may be used to zoom in. See SetZoom for information on available zoom types.
valueSpecifies a value for zoom and pan operations, see SetZoom for more information.
Returns
Success or failure status.

This method invokes the corresponding method of the control's viewport. See SetZoom for more information.

◆ UpdateGlg()

virtual void UpdateGlg ( )
virtual

Updates the control's drawing with the latest resource values.

This method invokes the corresponding method of the control's viewport. See UpdateGlg for more information.