Difference between revisions of "ctrlScrollValues"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]3(\|.*)]]" to "{{GameCategory|arma3|Scripting Commands}}")
m (Some wiki formatting)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
+
{{RV|type=command
____________________________________________________________________________________________
 
  
| arma3 |Game name=
+
|game1= arma3
 +
|version1= 2.00
  
|2.00|Game version=
+
|gr1= GUI Control
  
|gr1= GUI Control |GROUP1=
+
|descr= Returns scroll values for current scrollbars in range 0...1 (-1 if not applicable) for the following controls:
____________________________________________________________________________________________
+
{{Columns|2|
 +
* [[CT_CONTROLS_TABLE]]
 +
* [[CT_CONTROLS_GROUP]]
 +
* [[CT_TREE]]
 +
* [[CT_LISTBOX]]
 +
* [[CT_COMBO]]
 +
* [[CT_XCOMBO]]
 +
* [[CT_LISTNBOX]]
 +
* [[CT_LISTNBOX_CHECKABLE]]
 +
|shrink= y
 +
}}
 +
 
 +
|s1= [[ctrlScrollValues]] control
  
| Returns scroll values for current scrollbars in range 0...1 (-1 if not applicable) for the following controls:
+
|p1= control: [[Control]]
  
* <tt>CT_CONTROLS_TABLE</tt>
+
|r1= [[Array]] of [[Number]]s in format [vScrollValue, hScrollValue]
* <tt>CT_CONTROLS_GROUP</tt>
 
* <tt>CT_TREE</tt>
 
* <tt>CT_LISTBOX</tt>
 
* <tt>CT_COMBO</tt>
 
* <tt>CT_XCOMBO</tt>
 
* <tt>CT_LISTNBOX</tt>
 
* <tt>CT_LISTNBOX_CHECKABLE</tt> |DESCRIPTION=
 
____________________________________________________________________________________________
 
  
| [[ctrlScrollValues]] control |SYNTAX=
+
|x1= <sqf>private _scrollvalues = ctrlScrollValues _ctrl;</sqf>
|p1= control: [[Control]] |PARAMETER1=
 
| [[Array]] - in format [vScrollValue, hScrollValue]  |RETURNVALUE=
 
 
 
|x1= <code>_scrollvalues = [[ctrlScrollValues]] _ctrl;</code> |EXAMPLE1=
 
  
|x2= <code>// ControlsGroup
+
|x2= <sqf>
[[private]] _disp = [[findDisplay]] 46 [[createDisplay]] "RscDisplayEmpty";
+
// ControlsGroup
[[private]] _ctrlGrp = _disp [[ctrlCreate]] ["RscControlsGroup", -1];  
+
private _disp = findDisplay 46 createDisplay "RscDisplayEmpty";
[[private]] _ctrl = _disp [[ctrlCreate]] ["RscTree", -1, _ctrlGrp];  
+
private _ctrlGrp = _disp ctrlCreate ["RscControlsGroup", -1];
_ctrl [[tvAdd]] [<nowiki>[</nowiki>], "Root"];
+
private _ctrl = _disp ctrlCreate ["RscTree", -1, _ctrlGrp];
[[for]] "_i" [[from]] 1 [[to]] 25 [[do]]
+
_ctrl tvAdd [[], "Root"];
 +
for "_i" from 1 to 25 do
 
{
 
{
_ctrl [[tvAdd]] [<nowiki>[</nowiki>0], [[format]] ["Tree Item %1", _i]];
+
_ctrl tvAdd [[0], format ["Tree Item %1", _i]];
 
};
 
};
_ctrl [[ctrlSetPosition]] [0,0,0.3,1.2];  
+
_ctrl ctrlSetPosition [0,0,0.3,1.2];
_ctrl [[ctrlCommit]] 0;
+
_ctrl ctrlCommit 0;
[[tvExpandAll]] _ctrl;
+
tvExpandAll _ctrl;
_ctrlGrp [[ctrlSetPosition]] [0,0,0.2,0.3];
+
_ctrlGrp ctrlSetPosition [0,0,0.2,0.3];
_ctrlGrp [[ctrlCommit]] 0;
+
_ctrlGrp ctrlCommit 0;
 
   
 
   
[[uiNamespace]] [[setVariable]] ["_ctrl", _ctrlGrp];  
+
uiNamespace setVariable ["_ctrl", _ctrlGrp];
[[onEachFrame]]
+
onEachFrame
 
{
 
{
[[hintSilent]] [[str]] [[ctrlScrollValues]] ([[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]]);
+
hintSilent str ctrlScrollValues (uiNamespace getVariable ["_ctrl", controlNull]);
 
};
 
};
[] [[spawn]]
+
[] spawn
 
{
 
{
[[sleep]] 1;
+
sleep 1;
[[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]] [[ctrlSetScrollValues]] [0.3, -1];
+
uiNamespace getVariable ["_ctrl", controlNull] ctrlSetScrollValues [0.3, -1];
[[sleep]] 1;
+
sleep 1;
[[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]] [[ctrlSetScrollValues]] [-1, 0.3];
+
uiNamespace getVariable ["_ctrl", controlNull] ctrlSetScrollValues [-1, 0.3];
[[sleep]] 1;
+
sleep 1;
[[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]] [[ctrlSetScrollValues]] [0.7, -1];
+
uiNamespace getVariable ["_ctrl", controlNull] ctrlSetScrollValues [0.7, -1];
[[sleep]] 1;
+
sleep 1;
[[uiNamespace]] [[getVariable]] ["_ctrl", [[controlNull]]] [[ctrlSetScrollValues]] [-1, 0.7];
+
uiNamespace getVariable ["_ctrl", controlNull] ctrlSetScrollValues [-1, 0.7];
};</code> |EXAMPLE2=
+
};
____________________________________________________________________________________________
+
</sqf>
 
 
| [[ctrlSetScrollValues]], [[sliderPosition]], [[progressPosition]] |SEEALSO=
 
  
 +
|seealso= [[ctrlSetScrollValues]] [[sliderPosition]] [[progressPosition]]
 
}}
 
}}
 
<h3 style="display:none">Notes</h3>
 
<dl class="command_description">
 
<!-- Note Section BEGIN -->
 
 
<!-- Note Section END -->
 
</dl>
 
 
<h3 style="display:none">Bottom Section</h3>
 
[[Category:Scripting Commands|CTRLSCROLLVALUES]]
 
{{GameCategory|arma3|Scripting Commands}}
 
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
 

Latest revision as of 11:27, 4 May 2022

Hover & click on the images for description

Description

Description:
Returns scroll values for current scrollbars in range 0...1 (-1 if not applicable) for the following controls:
Groups:
GUI Control

Syntax

Syntax:
ctrlScrollValues control
Parameters:
control: Control
Return Value:
Array of Numbers in format [vScrollValue, hScrollValue]

Examples

Example 1:
private _scrollvalues = ctrlScrollValues _ctrl;
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:
ctrlSetScrollValues sliderPosition progressPosition

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