GUITransform
| Description: | Applies a graphical transformation to all graphics in a module and returns an indication when selected by a mouse button or the <ENTER> key. |
| Returns: | GUI Object Return Codes |
Usage: ![]() |
Steady State only. |
| Function Groups: | Graphics, Advanced Module |
Format: ![]() |
GUITransform(LeftReference, BottomReference, RightReference, TopReference, ScaleLeft, ScaleBottom, ScaleRight, ScaleTop, ScaleWhole, Trajectory, Rotation, Visibility, Options, Button, FocusID, FocusTrigger, ModuleCall) |
| Parameters: |
| 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 0, 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. |
| ModuleCall |
| Required. Any function containing a module call. |
| Comments: |
This function is a layered graphics statement. See "Use Scaling to Position GUI Objects" for information about positioning a layered graphic. A draggable GUITransform has two renderings. The palette rendering is what is displayed in the palette and is the image attached to the mouse at the start of dragging the transform onto a drop-target window. When the mouse cursor is moved over a drop-target window, the module called by the GUITransform is rendered at the native size of the called module and displayed in its place. The rendering is scaled according to the zoom factor of the drop-target window. Moving off the drop target window again displays the palette rendering. The relative mouse position within the graphic when the drag operation is started is maintained throughout the operation. Therefore, when the image switches from the palette rendering to the called module rendering, the mouse position within the called module rendering is over the same feature of the graphic as when the palette rendering is used. |
Examples:
GUITransform(0, 150, 100, 50 { Bounding box of object },
1, 1, 1, 1, 1 { No scaling },
0, 0 { No trajectory or rotation },
1, 0 { Object is visible; reserved },
0, 0, 0 { Graphic cannot be focused },
flow = PumpSymbol(1, amps) { A sample module call });
This shows a pump object in the upper left corner of the window. It cannot be focused. No extra scaling is performed, and no animation is performed.
This shows how a symbol can be defined once, and positioned in a multiple area (reused).
To use the magic formula to situate a button at a position given by left, bottom, right, top:
If GUITransform(0, 1, 1, 0 { Unit bounding box },
1 - (left) { Left scaling },
bottom { Bottom scaling,
right { Right scaling },
1 - (top) { Top scaling },
1, 0, 0 { No overall scaling/movement },
1, 0 { Object is visible; reserved },
0, 0, 0 { Graphic cannot be focused },
flow = PumpSymbol(1, amps) { A sample module call });
[
...
]
The following displays a GridList that will re-size to match the Window object it is displayed within:
BOT = VStatus(Self(), 12);
TOP = VStatus(Self(), 11);
GUITransform(0, 1, 1, 0 { Reference rectangle },
1- 0 { Left edge of window },
BOT { Bottom edge of window },
TOP { Right edge of window },
1- 0 { Top edge of window },
1 { No overall scaling },
0, 0, 1, 0 { No movement; visible; res },
0, 0, 0 { Not selectable },
\System.GridList(GridTitles { Titles array },
AllList { Data array },
Formats { Cell format array },
ColWidths { Column widths array },
PickValid(ArraySize(AllList, 0), 0) { rows },
3 { # Data cols },
15, 8 { Grid BGnd, Grid color },
1, 1 { Grid line width, line style},
30, 30 { Row/Title height },
0, 0 { Horiz/Vert cell padding },
0, 0 { Horiz/Vert Scroll position },
0, 0 { Enable V/H scroll bars },
0 { Enable column sizing },
1 { Disable Sorting },
1 { Disable selected cell },
0, 0 { Disable V/H grid lines },
1 { LockFirstColumn },
Invalid { Sort },
0 { SelectedRow },
0 { SelectedColumn },
\_DialogFont { GridFontParm }));
GetXformRefBox | NextFocusID | Normalize | Point | Rotate | Trajectory | UnTransform | Vertex | VStatus | Window
