ctrlScrollValues: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<tt>([a-zA-Z0-9\. _"']+)<\/tt>" to "{{hl|$1}}") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
|descr= Returns scroll values for current scrollbars in range 0...1 (-1 if not applicable) for the following controls: | |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]] | ||
}} | |||
|s1= [[ctrlScrollValues]] control | |s1= [[ctrlScrollValues]] control | ||
|p1= control: [[Control]] | |p1= control: [[Control]] | ||
| | |r1= [[Array]] of [[Number]]s in format [vScrollValue, hScrollValue] | ||
|x2= < | |x1= <sqf>private _scrollvalues = ctrlScrollValues _ctrl;</sqf> | ||
|x2= <sqf> | |||
// ControlsGroup | |||
_ctrl | 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 | _ctrl tvAdd [[0], format ["Tree Item %1", _i]]; | ||
}; | }; | ||
_ctrl | _ctrl ctrlSetPosition [0,0,0.3,1.2]; | ||
_ctrl | _ctrl ctrlCommit 0; | ||
tvExpandAll _ctrl; | |||
_ctrlGrp | _ctrlGrp ctrlSetPosition [0,0,0.2,0.3]; | ||
_ctrlGrp | _ctrlGrp ctrlCommit 0; | ||
uiNamespace setVariable ["_ctrl", _ctrlGrp]; | |||
onEachFrame | |||
{ | { | ||
hintSilent str ctrlScrollValues (uiNamespace getVariable ["_ctrl", controlNull]); | |||
}; | }; | ||
0 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]; | |||
};</ | }; | ||
</sqf> | |||
|seealso= [[ctrlSetScrollValues]] | |seealso= [[ctrlSetScrollValues]] [[sliderPosition]] [[progressPosition]] | ||
}} | }} |
Latest revision as of 16:45, 17 April 2023
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:
- 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]); }; 0 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
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