GUIChord
(Engine-Level Function)
Description: | Draws a chord in a window. Can return a Boolean TRUE when selected by a mouse button or when the <ENTER> key is pressed after focus has been acquired. |
Returns: | GUI Object Return Codes |
Usage: | Steady State only. |
Function Groups: | Graphics |
Related to: | DrawArcPath | DrawChordPath | DrawEllipticalPath | DrawPiePath | Ellipse GUIArc | GUIEllipse | GUIPie | GUITransform | NextFocusID | Normalize | PiePoint | Rotate | Trajectory | Vertex | VStatus |
Format: | GUIChord(LeftReference, BottomReference, RightReference, TopReference, ScaleLeft, ScaleBottom, ScaleRight, ScaleTop, ScaleWhole, Trajectory, Rotation, Opacity, Reserved, Button, FocusID, FocusTrigger, Brush, Pen, Vertex) |
Parameters: |
LeftReference | ||||||||||||||||||
A constant number that gives the left side reference coordinate. It must be a constant. A variable or expression is not valid here. | ||||||||||||||||||
BottomReference | ||||||||||||||||||
A constant number that gives the bottom side reference coordinate. It must be a constant. A variable or expression is not valid here. The top and bottom references are measured down from the top of the screen. | ||||||||||||||||||
RightReference | ||||||||||||||||||
A constant number that gives the right side reference coordinate. It must be a constant. A variable or expression is not valid here. | ||||||||||||||||||
TopReference | ||||||||||||||||||
A constant number that gives the top side reference coordinate. It must be a constant. A variable or expression is not valid here. | ||||||||||||||||||
ScaleLeft | ||||||||||||||||||
Required. Either a numeric expression, or any expression that returns a Normalize value. This parameter scales this side from its reference position with respect to the opposite side. If it is a numeric expression, a value of 1 will place the side at its reference position. A value of 0 will place it at the opposite side reference position. Similarly, a Normalize value will scale the side between the high and low limits. If the value is at the high level, the side will be at its reference position. If the value is at the low level, the side will be at the opposite side reference position. | ||||||||||||||||||
ScaleBottom | ||||||||||||||||||
Required. Either a numeric expression, or any expression that returns a Normalize value. This parameter scales this side from its reference position with respect to the opposite side. If it is a numeric expression, a value of 1 will place the side at its reference position. A value of 0 will place it at the opposite side reference position. Similarly, a Normalize value will scale the side between the high and low limits. If the value is at the high level, the side will be at its reference position. If the value is at the low level, the side will be at the opposite side reference position. | ||||||||||||||||||
ScaleRight | ||||||||||||||||||
Required. Either a numeric expression, or any expression that returns a Normalize value. This parameter scales this side from its reference position with respect to the opposite side. If it is a numeric expression, a value of 1 will place the side at its reference position. A value of 0 will place it at the opposite side reference position. Similarly, a Normalize value will scale the side between the high and low limits. If the value is at the high level, the side will be at its reference position. If the value is at the low level, the side will be at the opposite side reference position. | ||||||||||||||||||
ScaleTop | ||||||||||||||||||
Required. Either a numeric expression, or any expression that returns a Normalize value. This parameter scales this side from its reference position with respect to the opposite side. If it is a numeric expression, a value of 1 will place the side at its reference position. A value of 0 will place it at the opposite side reference position. Similarly, a Normalize value will scale the side between the high and low limits. If the value is at the high level, the side will be at its reference position. If the value is at the low level, the side will be at the opposite side reference position. | ||||||||||||||||||
ScaleWhole | ||||||||||||||||||
Required. Either a numeric expression, or any expression that returns a Normalize value. This parameter scales the horizontal and vertical dimensions by the specified factor before the left, bottom, right and top coordinates are scaled. | ||||||||||||||||||
Trajectory | ||||||||||||||||||
Required. Either a Trajectory function, a variable containing a Trajectory value, or a numeric expression. If this is a Trajectory value or function, the appropriate translation is applied to the image after the rotation is applied. If it is a valid numeric expression, the image isn't translated, but is displayed. Any other value is Invalid. | ||||||||||||||||||
Rotation | ||||||||||||||||||
Required. Either a Rotate function, a variable containing a Rotate value, or a numeric expression. If this is a Rotate value or function, the appropriate rotation is applied to the image before the trajectory is applied. If it is a valid numeric expression, the image is rotated clockwise the number of degrees specified. Any other value is Invalid. | ||||||||||||||||||
Opacity | ||||||||||||||||||
Required. Any Numeric expression, setting the opacity of the object. A value of one results in a solid, zero is invisible and values between zero and one are used as an alpha setting for opacity. | ||||||||||||||||||
Reserved n/a | ||||||||||||||||||
Reserved for future use, set to 0. | ||||||||||||||||||
Button | ||||||||||||||||||
Required. Any numeric expression giving the button combination that activates this graphic.
If the above values are multiplied by 8, the meaning for multiple buttons pressed becomes "OR" rather than "AND." For example, to accept any button on a 2 or 3 button mouse, use 56 (i.e. 8 * 7). To accept the left mouse button regardless of whether the right button is pressed, use 32 (i.e. 8 * 4). If a 64 is added to this parameter, the function will become true when the mouse buttons are released rather than when they are pressed. |
FocusID |
Required. Any numeric expression from 0 to 32767 giving the focus number of this graphic. If FocusID is zero, this graphic cannot receive the input focus. This parameter's value may be used in a NextFocusID statement to force this graphic to get the focus. |
FocusTrigger |
Required. Any logical expression. If FocusTrigger changes from a valid false to a valid true, this graphic will attempt to obtain focus. |
Brush |
Required. Any expression that returns a Brush value to be used to describe the fill. For a solid color fill, you may use any of the following:
|
Pen |
Required. Any expression that returns a Pen value to describe the color, width and line style of the border. For a 1-pixel solid border, you may use any of the following:
|
Vertex |
Required. Any expression that returns a Vertex value that describes this chord. The center point of the vertex is the center point of the ellipse that describes the chord. The two vertex handle points are used to find the start and end angle of the chord, by the angle each point makes with the center point. |
Comments: | This function is a layered graphics statement. See "Use Scaling to Position GUI Objects" for information about positioning a layered graphic. The Left and Right references are interchangeable. Whichever is smaller is taken as the left and the larger of the two values will be used as the right. The same is true of the top and bottom references. Note that the 1st 42 pixels of a VTScada application will be obscured by the title bar, if present. |
Example:
GUIChord(400, 150, 600, 55 { Bounding box of the chord }, 1, 1, 1, 1, 1 { No scaling }, 0, 0 { No trajectory or rotation }, 1 { Chord is visible }, 0 { Reserved }, 0 { Not activated }, 6 { Focus ID number }, FALSE { No focus trigger }, Brush(12, 0, 0) { Brush light red, background ignored (style is solid) }, Pen(15, 1, 1) { Pen draws white solid lines 1 pixel wide }, Vertex(0 { Rectangular mode }, Point(50, 50, Invalid, Invalid){ Center }, Point(50, 0, Invalid, Invalid) { Start angle }, Point(0, 50, Invalid, Invalid) { End angle }));
This shows a chord in the upper right corner of the window. If it is selected with the left mouse button, on the release of the mouse button the statement will return true. This is also the case if it is focused and the return key is pressed. This chord will attempt to get the keyboard input focus when the "F" key is pressed (because of the MatchKeys function in the trigger). It is focus number 6. This is the number to use in the NextFocusID function to force this graphic to get the focus. No scaling is performed, and no animation is performed.
The first four parameters must be constants. See GUITransform for an example of how to compute the position dynamically.