questions & answers
Q: How is text and text cursor position
controlled in XuiTextArea grids?
Send a #SetTextCursor message to XuiTextArea grids to position the text cursor within the body of text and to position the text within the grid, as follows:
XuiSendMessage (grid, #SetTextCursor, v0, v1, v2, v3, kid, 0)
v0 = cursorPos = set text cursor to this character # on the cursor line.
v1 = cursorLine = set text cursor to this line #.
v2 = leftIndent = horizontal pixel # to start displaying line.
v3 = topLine = top line of displayed text.
any argument can be -1 to say don't change current value.
Whenever one or more of these values is changed with #SetTextCursor, a check is performed to make sure the values are reasonable and consistent. So it is not possible to place the text cursor outside the text region, set the top line such that the cursor is not in the displayed portion of text, etc. Reasonable values are assigned.
Incidently, #SetTextCursor is also recognized by:
XuiDropBox - v0 sets cursorPos in the XuiTextLine kid
v1 sets cursorLine in the XuiPullDown kid
XuiDropButton - v1 sets cursorLine in the XuiPullDown kid
XuiListBox - v0 sets cursorPos in the XuiTextLine kid
v1 sets cursorLine in the XuiList kid
XuiListButton - v1 sets cursorLine in the XuiList kid
In XuiList and XuiPullDown grids, cursorLine means the selected line. Send #SetTextCursor to the indicated grids, not directly to the kids.