Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.31

Description

Description:

Resizes of a group of controls by dragging another control (edge drag). For best results, an invisible control should be created at the very edge of a larger control, and passed to the function as the second parameter.

Syntax

Syntax:[actionType, [edge control], edgeType, [marginXmin, marginXmax, marginYmin, marginYmax], controlGroup, cursorName, onMouseEnter, onMouseMoving, onMouseExit, onMouseButtonDown, onMouseButtonUp, toolTip, avoidGroup] call fn_vbs_resizeControls
Parameters:
  • actionType: Number - 0 means install script, 1 means uninstall script.
  • [edge control]: Array - Array containing the edge Control to grab on to.
  • edgeType: Number - 1-left, 2-right, 4-top, 8-bottom and corner combinations are added together as such: 1 + 8.
  • [marginXmin, marginXmax, marginYmin, marginYmax]: Number Array - Margins which prevent resizing beyond those points.
  • controlGroup: Number Array - List of control IDCs that are resized by dragging the edge, first one must be largest / parent. Since V1.40+, this array can accept sub-arrays listing the IDC numbers of the controlGroup controls to be resized (the first IDC must be of the actual controlGroup).
  • cursorName: String - Cursor to display on mouse hover ("" for no change).
  • onMouseEnter: Code - Additional code to execute during the onMouseEnter event handler execution ({} for none).
  • onMouseMoving: Code - Additional code to execute during the onMouseMoving event handler execution ({} for none).
  • onMouseExit: Code - Additional code to execute during the onMouseExit event handler execution ({} for none).
  • onMouseButtonDown: Code - Additional code to execute during the onMouseButtonDown event handler ({} for none).
  • onMouseButtonUp: Code - Additional code to execute during the onMouseButtonUp event handler ({} for none).
  • toolTip: String - Tooltip to set for edge control ("" for none).
  • avoidGroup: Number Array - List of control IDCs to block the resizing action ([] for empty, mandatory in V1.40+).
Return Value:Nothing

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:To resize RTE object tree by Object Tree button in RTE, call:
edge = (findDisplay 137)displayCtrl 514;
[1,[edge],1,[0.55,0.95,0,0],[1001,1000,201,236,237,238,239,240,514,515],"Drag",{hint"ON ENTER EH2"},
{hint"ON MOVING EH2"},{hint"ON EXIT EH2"},{hint"ON DOWN EH2"},{hint"ON UP EH2"},"Tool Tip",[]] call fn_vbs_resizeControls
To disable the script:
edge = (findDisplay 137)displayCtrl 514;
[0,[edge]] call call fn_vbs_resizeControls
To resize RTE Quick Add panel (containing a controlsGroup) by Quick Add button in RTE, while avoiding a collision with top right panel IDC 1001 call:
edge = (findDisplay 137)displayCtrl 529;
[1,[edge],2,[0.2,0.8,0,1],[3001,3000,529,[232, 223,222,224,241,227,228,229,230,231]],"Drag",{},{},{},{},{},"Tool Tip",[1001]] call fn_vbs_resizeControls;
Add more IDC numbers to get a more complete effect.

Additional Information

See also: 
Multiplayer: 
Problems: 

Notes