Difference between revisions of "ctrlSetScrollValues"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Command|Comments= ____________________________________________________________________________________________ | arma3dev |Game name= |1.99|Game version= _________________...")
 
(example)
Line 27: Line 27:
 
   
 
   
 
|x1= <code>_ctrlGrp [[ctrlSetScrollValues]] [-1, 0.5];</code> |EXAMPLE1=
 
|x1= <code>_ctrlGrp [[ctrlSetScrollValues]] [-1, 0.5];</code> |EXAMPLE1=
 +
 +
|x2= <code>// ControlsGroup
 +
[[private]] _disp = [[findDisplay]] 46 [[createDisplay]] "RscDisplayEmpty";
 +
[[private]] _ctrlGrp = _disp [[ctrlCreate]] ["RscControlsGroup", -1];
 +
[[private]] _ctrl = _disp [[ctrlCreate]] ["RscTree", -1, _ctrlGrp];
 +
_ctrl [[tvAdd]] [<nowiki>[</nowiki>], "Root"];
 +
[[for]] "_i" [[from]] 1 [[to]] 25 [[do]]
 +
{
 +
_ctrl [[tvAdd]] [<nowiki>[</nowiki>0], [[format]] ["Tree Item %1", _i]]; 
 +
};
 +
_ctrl [[ctrlSetPosition]] [0,0,0.3,1.2];
 +
_ctrl [[ctrlCommit]] 0;
 +
[[tvExpandAll]] _ctrl;
 +
_ctrlGrp [[ctrlSetPosition]] [0,0,0.2,0.3];
 +
_ctrlGrp [[ctrlCommit]] 0;
 +
 +
[[uiNamespace]] [[setVariable]] ["_ctrl", _ctrlGrp]; 
 +
[[onEachFrame]]
 +
{
 +
[[hintSilent]] [[str]] [[ctrlScrollValues]] ([[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]]);
 +
};
 +
[] [[spawn]]
 +
{
 +
[[sleep]] 1;
 +
[[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]] [[ctrlSetScrollValues]] [0.3, -1];
 +
[[sleep]] 1;
 +
[[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]] [[ctrlSetScrollValues]] [-1, 0.3];
 +
[[sleep]] 1;
 +
[[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]] [[ctrlSetScrollValues]] [0.7, -1];
 +
[[sleep]] 1;
 +
[[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]] [[ctrlSetScrollValues]] [-1, 0.7];
 +
};</code> |EXAMPLE2=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  

Revision as of 19:44, 8 July 2020

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 1.99|1.99]]
Hover & click on the images for description

Description

Description:
Sets scroll values for current scrollbasrs in range 0...1 for the following controls:
  • CT_CONTROLS_TABLE
  • CT_CONTROLS_GROUP
  • CT_TREE
  • CT_LISTBOX
  • CT_COMBO
  • CT_XCOMBO
  • CT_LISTNBOX
  • CT_LISTNBOX_CHECKABLE
Groups:
Uncategorised

Syntax

Syntax:
control ctrlSetScrollValues [vScrollValue, hScrollValue]
Parameters:
control: Control
[vScrollValue, hScrollValue]: Array
vScrollValue: Number - vertical scroll value in 0..1 range. -1 to skip
hScrollValue: Number - horizontal scroll value in 0..1 range. -1 to skip
Return Value:
Nothing

Examples

Example 1:
_ctrlGrp ctrlSetScrollValues [-1, 0.5];
Example 2:
// ControlsGroup private _disp = findDisplay 46 createDisplay "RscDisplayEmpty"; private _ctrlGrp = _disp ctrlCreate ["RscControlsGroup", -1]; private _ctrl = _disp ctrlCreate ["RscTree", -1, _ctrlGrp]; _ctrl tvAdd [[], "Root"]; for "_i" from 1 to 25 do { _ctrl tvAdd [[0], format ["Tree Item %1", _i]]; }; _ctrl ctrlSetPosition [0,0,0.3,1.2]; _ctrl ctrlCommit 0; tvExpandAll _ctrl; _ctrlGrp ctrlSetPosition [0,0,0.2,0.3]; _ctrlGrp ctrlCommit 0; uiNamespace setVariable ["_ctrl", _ctrlGrp]; onEachFrame { hintSilent str ctrlScrollValues (uiNamespace getVariable ["_ctrl", controlNull]); }; [] spawn { sleep 1; uiNamespace getVariable ["_ctrl", controlNull] ctrlSetScrollValues [0.3, -1]; sleep 1; uiNamespace getVariable ["_ctrl", controlNull] ctrlSetScrollValues [-1, 0.3]; sleep 1; uiNamespace getVariable ["_ctrl", controlNull] ctrlSetScrollValues [0.7, -1]; sleep 1; uiNamespace getVariable ["_ctrl", controlNull] ctrlSetScrollValues [-1, 0.7]; };

Additional Information

See also:
ctrlScrollValuessliderSetPositionprogressSetPosition

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

[[Category:Introduced with arma3dev version 1.99]][[ Category: arma3dev: New Scripting Commands | CTRLSETSCROLLVALUES]][[ Category: arma3dev: Scripting Commands | CTRLSETSCROLLVALUES]]

Notes

Bottom Section