ctrlSetTextSelection: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation - WIP!)
 
m (Text replacement - "|Game version=" to "|Game version= |gr1= GUI Control |GROUP1= ")
(6 intermediate revisions by 3 users not shown)
Line 5: Line 5:


|1.99 |Game version=
|1.99 |Game version=
|gr1= GUI Control |GROUP1=
||gr1= GUI Control|=GROUP1
____________________________________________________________________________________________
____________________________________________________________________________________________


|Selects 'length' characters of control text from the 'start' position |DESCRIPTION=
|Selects 'length' characters of edit control from the 'start' position and places cursor at the end of selection. To move cursor only, set 'length' to 0. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 15: Line 21:


|p2= [start, length]: [[Array]] |PARAMETER2=
|p2= [start, length]: [[Array]] |PARAMETER2=
|p3= start: [[Number]] - selection start position |PARAMETER3=
|p4= length: [[Number]] - length of characters to select (0 to only move the cursor) |PARAMETER4=


| Nothing |RETURNVALUE=
| [[Nothing]] |RETURNVALUE=


____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>_control [[ctrlSetTextSelection]] [5, 10]</code>|EXAMPLE1=  
|x1= <code>_control [[ctrlSetTextSelection]] [5, 10]</code>|EXAMPLE1=  
|x2= <code>[[disableSerialization]];
[[private]] _ctrl = [[findDisplay]] 46 [[createDisplay]] "RscDisplayEmpty" [[ctrlCreate]] ["RscEditMulti", -1];
_ctrl [[ctrlSetPosition]] [0,0,0.5,0.3];
_ctrl [[ctrlCommit]] 0;
_ctrl [[ctrlSetText]] "Hello World";
_ctrl [[ctrlSetTextSelection]] [6, 5]; // selects World
[[ctrlSetFocus]] _ctrl;</code>|EXAMPLE2=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[ctrlTextSelection]]  |SEEALSO=
| [[ctrlTextSelection]] [[ctrlSetText]]  |SEEALSO=


}}
}}

Revision as of 11:12, 18 September 2020

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

Description

Description:
Description needed
Groups:
GUI Control

Syntax

Syntax:
Selects 'length' characters of edit control from the 'start' position and places cursor at the end of selection. To move cursor only, set 'length' to 0.
Parameters:
control: Control
[start, length]: Array
start: Number - selection start position
length: Number - length of characters to select (0 to only move the cursor)
Return Value:
control ctrlSetTextSelection [start, length]

Examples

Example 1:
_control ctrlSetTextSelection [5, 10]
Example 2:
disableSerialization; private _ctrl = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscEditMulti", -1]; _ctrl ctrlSetPosition [0,0,0.5,0.3]; _ctrl ctrlCommit 0; _ctrl ctrlSetText "Hello World"; _ctrl ctrlSetTextSelection [6, 5]; // selects World ctrlSetFocus _ctrl;

Additional Information

See also:
Nothing

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 | CTRLSETTEXTSELECTION]][[ Category: arma3dev: Scripting Commands | CTRLSETTEXTSELECTION]]

Notes

Bottom Section