Page MenuHomeFeedback Tracker

Add new commands for getting and setting text cursor position in EditBox dialog controls
Acknowledged, WishlistPublic

Description

This request is about the text cursor position (see attached textcursor.png) - not the mouse cursor position.

There's currently no way to get/set the current text cursor position in EditBox dialog controls (https://community.bistudio.com/wiki/DialogControls-EditBox).

getter Syntax:
ebCursor ctrl
and alternative syntax:
ebCursor idc

where:
ctrl: Control
idc: Number - ID of the control

Returns: Number

  • 0 - text cursor at start
  • 1 - text cursor between element 0 and 1
  • ...
  • count (toArray (ctrlText _ctrl)) - text cursor at end

setter syntax:
ctrl ebSetCursor pos
and alternative syntax:
ebSetCursor [idc,pos]

where:
ctrl: Control
pos: Number - text cursor position
idc: Number - ID of the control {F23598}

Details

Legacy ID
1253451110
Severity
None
Resolution
Reopened
Reproducibility
N/A
Category
Feature Request
Additional Information

text cursor position is preserved when using <Tab> to switch between controls so the commands should work on controls without focus, too

instead of setting and getting just the text cursor position (as number), an array [from, to] could be used to get/set the start/end-position of selected text, too
e.g.
[0,1] - element 0 selected
[1,1] - no selection, cursor between element 0 and 1
[0,2] - element 0 and 1 selected
...
nowadays with the extended select syntax (... select [from, length])
an array in the form [from, length] would be more suitable to get/set the selection position
e.g.
[0,1] - element 0 selected
[1,0] - no selection, cursor between element 0 and 1
[1,2] - element 1 and 2 selected
...

Event Timeline

Master85 edited Additional Information. (Show Details)
Master85 set Category to Feature Request.
Master85 set Reproducibility to N/A.
Master85 set Severity to None.
Master85 set Resolution to Reopened.
Master85 set Legacy ID to 1253451110.May 7 2016, 6:17 PM
Master85 edited a custom field.
Moricky added a subscriber: Moricky.May 7 2016, 6:17 PM

There is a way

Use setMousePosition to set the position
https://community.bistudio.com/wiki/setMousePosition

Getting the position can be achieved using mouseMoving / mouseHolding UI event handlers added to the display (adding it to a control will return relative coordinates, not absolute ones)
https://community.bistudio.com/wiki/User_Interface_Event_Handlers

The request is not about setting the mouse position on the screen, but to set/get the cursor char position in the string entered in a text control.

This feature will be great. It will allow to finish my "multi line text editor" implementation requested here : http://feedback.arma3.com/view.php?id=12651

ok, I've added a picture and some text to clarify my request.

master85 asked me to re-open it ...

+1 Essentially the last two commands that are missing for creating an EH that handles the enter key as a line break.

I would really like to see this implemented, would be extremely useful.