setAnchorPoints
Specifies how an object moves if the user interface is resized for different monitor and window sizes. Anchor points are relative to the container in which they are located (for example, a tab, a split pane, etc.).
The setAnchorPoints function allows you to anchor or release an object to/from the top, left, bottom, or right sides. By setting these values, you can effectively anchor an object to a corner, a side, or the center.
Syntax
ogscript.setAnchorPoints (ID, top, left, bottom, right);
Parameters
Parameter |
Type |
Required |
Description |
ID |
String |
Yes |
ID of the object you want to anchor. |
top |
Boolean |
Yes |
true — object is anchored to the top false — object is not anchored to the top |
left |
Boolean |
Yes |
true — object is anchored to the left false — object is not anchored to the left |
bottom |
Boolean |
Yes |
true — object is anchored to the bottom false — object is not anchored to the bottom |
right |
Boolean |
Yes |
true — object is anchored to the right false — object is not anchored to the right |
Returns
N/A
Example
The button in this example has a task that anchors an object (with ID 'dialog') to the top left.
<buttonbuttontype="push" name="anchorTopLeft">
<task tasktype="ogscript">ogscript.setAnchorPoints('dialog', true, true, false, false);
</task>
</button>