|
GLG Toolkit, C# Class Library
Version 4.6
|
This group contains methods used to load, set up and display a GLG drawing. More...
This group contains methods used to load, set up and display a GLG drawing.
Functions | |
| bool | ConfigureWindow (int x, int y, int width, int height, GlgConfigureMask mask, GlgObject parent) |
| Sets the size and/or position of a viewport's window. More... | |
| void | DialogInitialDraw (GlgObject parent) |
| Displays a GLG drawing of the viewport as a floating dialog for the first time after it has been created or loaded. More... | |
| void | DialogSetupHierarchy (GlgObject parent) |
| Provides an explicit request to set up the object hierarchy of a drawing displayed in a dialog window. More... | |
| static void | Init () |
| Initializes GLG Toolkit. More... | |
| void | InitialDraw () |
| Draws a GLG viewport object for the first time after it has been created or loaded. More... | |
| static GlgObject | LoadObject (Object medium, GlgMediumType medium_type) |
| Loads an object from a stream using a default encoding. More... | |
| static GlgObject | LoadObject (Object medium, GlgMediumType medium_type, Encoding encoding) |
| Loads an object from a stream using the specified encoding. More... | |
| static GlgObject | LoadObject (String filename, GlgMediumType medium_type) |
| Loads an object from a GLG drawing file or a URL using a default encoding. More... | |
| static GlgObject | LoadObject (String filename, GlgMediumType medium_type, Encoding encoding) |
| Loads an object from a file or a URL using the specified encoding. More... | |
| static GlgObject | LoadWidget (GlgObject glg_object) |
| Finds a viewport named $Widget inside an object and returns it. More... | |
| static GlgObject | LoadWidget (String filename, GlgMediumType medium_type) |
| Loads a viewport named $Widget from a file or a URL using a default encoding. More... | |
| static GlgObject | LoadWidget (String filename, GlgMediumType medium_type, Encoding encoding) |
| Loads a viewport named $Widget from a file or a URL using the specified encoding. More... | |
| bool | Reset () |
| Reinitializes the viewport's drawing by resetting its drawing hierarchy, then setting it up again and rendering the drawing. More... | |
| void | ResetHierarchy () |
| Resets the object hierarchy of the object. More... | |
| void | SetupHierarchy () |
| Provides an explicit request to set up the object hierarchy of the object without rendering it. More... | |
| static void | Terminate () |
| Destroys GLG Toolkit's internal objects. More... | |
| bool | UpdateGlg () |
| Updates the drawing of a viewport or a light viewport with the latest resource values. More... | |
| bool | UpdateImmediately () |
| Advanced: Updates the drawing of a viewport or a light viewport with the latest resource values, immediately. More... | |
| bool ConfigureWindow | ( | int | x, |
| int | y, | ||
| int | width, | ||
| int | height, | ||
| GlgConfigureMask | mask, | ||
| GlgObject | parent | ||
| ) |
Sets the size and/or position of a viewport's window.
The method is new in the GLG release 4.5. The method should be invoked only for the viewport objects, not the light viewports.
| x | Specifies X coordinate of the window origin in device pixels. |
| y | Specifies Y coordinate of the window origin in device pixels. |
| width | Specifies window width in device pixels. |
| height | Specifies window height in device pixels. |
| mask | Specifies flags that can be combined with bitwise OR to control the action to perform, set size, set position or both:
The set and reset flags are exclusive and can't be used together for the same size or position attribute. |
| parent | Specifies an optional parent viewport for dialog viewports displayed via the DialogSetupHierarchy or DialogInitialDraw methods, or null otherwise. |
Once the viewport's size or position is set using ConfigureWindow, the viewport's control points are no longer used for controlling the viewport's size and/or position. If only the viewport's position is set and not its size, the size will be still controlled by the viewport's control points, and vice versa if only the size is set and not the position. The mask parameter of the method contains options to restore the use of the control points for determining the viewport's size or position after it was set with ConfigureWindow.
| void DialogInitialDraw | ( | GlgObject | parent | ) |
Displays a GLG drawing of the viewport as a floating dialog for the first time after it has been created or loaded.
The method should be invoked only for the viewport objects and not the light viewports.
| parent | Specifies the viewport of the main drawing the dialog will be a child of. |
This method is similar to InitialDraw, with the only difference that the drawing will be displayed as a child dialog of the main drawing specified by the parent parameter.
ConfigureWindow may be used to set the dialog's size and position.
| void DialogSetupHierarchy | ( | GlgObject | parent | ) |
Provides an explicit request to set up the object hierarchy of a drawing displayed in a dialog window.
The method is invoked on a viewport containing the dialog's drawing.
| parent | Specifies the viewport of the main drawing the dialog will be a child of. |
This method similar to SetupHierarchy, with the only difference that the drawing will be set up as a child dialog of the main drawing specified by the parent parameter.
This method needs to be invoked only on the initial draw of the dialog. After the dialog has been set up, a generic SetupHierarchy method may be used for all objects, including the dialog.
|
static |
Initializes GLG Toolkit.
This method is automatically invoked if the GLG library is deployed using GlgControl. However, it's always a good idea to explicitly call this method at the beginning of the application code.
| void InitialDraw | ( | ) |
Draws a GLG viewport object for the first time after it has been created or loaded.
The method displays a viewport's drawing and is part of the GLG Generic API.
The method creates a top level window and renders the viewport's drawing in it.
This method does not need to be explicitly called for the top level viewport of the GlgControl, since the control automatically invokes this method when it is displayed.
InitialDraw is equivalent to the following sequence:
|
static |
Loads an object from a stream using a default encoding.
| medium | The source to load the object from (Stream). |
| medium_type | Source type, must be STREAM. |
|
static |
Loads an object from a stream using the specified encoding.
| medium | The source to load the object from (Stream). |
| medium_type | Source type, must be STREAM. |
| encoding | Encoding for string decoding. |
|
static |
Loads an object from a GLG drawing file or a URL using a default encoding.
| filename | Specifies the name of the file or a URL to load the object from. |
| medium_type | FILE or URL constant. |
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.
|
static |
Finds a viewport named $Widget inside an object and returns it.
| glg_object | An object containing the $Widget viewport. |
|
static |
Loads a viewport named $Widget from a file or a URL using a default encoding.
| filename | Specifies the name of the file or the URL to load the widget from. |
| medium_type | FILE or URL constant. |
This method loads a drawing from a file or a URL and searches the drawing for a viewport object named $Widget. If the viewport is found, it references and returns it, otherwise it produces an error message and returns null.
|
static |
Loads a viewport named $Widget from a file or a URL using the specified encoding.
| filename | Specifies the name of the file or the URL to load the widget from. |
| medium_type | FILE or URL constant. |
| encoding | Encoding for string decoding. |
This method loads a drawing from a file or a URL and searches the drawing for a viewport object named $Widget. If the viewport is found, it references and returns it, otherwise it produces an error message and returns null.
| bool Reset | ( | ) |
Reinitializes the viewport's drawing by resetting its drawing hierarchy, then setting it up again and rendering the drawing.
Calling Reset restores all volatile resource changes to the values the resources had when the widget was first drawn. It also discards currently displayed chart data, unless the chart Persistent attribute is set to true.
The method should be invoked only for the top-level viewports, not the child viewports or the light viewports.
| void ResetHierarchy | ( | ) |
Resets the object hierarchy of the object.
Resets the object hierarchy of a top-level viewport. If a viewport containing a drawing was displayed using the InitialDraw or DialogInitialDraw, this method erases the drawing.
This method should not be called for the top-level viewports used in the GlgControl.
Warning: Do not confuse this method with the Reset method, which is used to redraw a displayed drawing and to regenerate the object hierarchy.
| void SetupHierarchy | ( | ) |
Provides an explicit request to set up the object hierarchy of the object without rendering it.
When invoked on a drawing which has been loaded but not yet displayed, the method sets up the drawing's object hierarchy to prepare the drawing for rendering. The drawing should contain either a top-level viewport object, or a group containing several top-level viewports.
After the initial draw (when the object hierarchy has already been set up), the method can be used to set up any type of object after its resources were changed. Unlike UpdateGlg,SetupHierarchy sets up the object without repainting it.
|
static |
Destroys GLG Toolkit's internal objects.
| bool UpdateGlg | ( | ) |
Updates the drawing of a viewport or a light viewport with the latest resource values.
If the object is a light viewport, an update of its parent viewport will be performed. All resource changes are held until the UpdateGlg method is called or until the viewport's window receives an expose event. (That is, it must be redrawn because another window that was obscuring a part of the viewport's window has been moved. This causes the viewport to redraw itself, using its new data.)
Note: Some drawing resources affect the object hierarchy of the drawing. For example, the Factor attribute of a series object controls the number of template instances that will be created by the series. If a number of instances is increased by setting the series' Factor, the new instances will be created and their resources can be accessed only after the UpdateGlgor SetupHierarchy method is invoked. If the series object is not persistent, any change (either increase or decrease) of its Factor attribute recreates its instances, and either the UpdateGlgor SetupHierarchy method should be called before accessing resources of the series' instances.
| bool UpdateImmediately | ( | ) |
Advanced: Updates the drawing of a viewport or a light viewport with the latest resource values, immediately.
Updates the drawing without deferring the actual painting until the next paint event. It is rarely necessary to call this method, as it is less efficient than the UpdateGlgmethod and does not guarantee a perfect redraw of children viewports. However, this method is useful if one needs to update the display while the current event is being dispatched.