SetCursor

Purpose With SetCursor you can set the cursor into a certain input field, into a table cell or on a position in a list.
Examples SetCursor F[Name]
SetCursor cell[Table,Material,5]
SetCursor (4,1)
Format SetCursor F[fieldname]
Sets the cursor into the field.

SetCursor cell[table,column,row]
Sets the cursor into a table cell.

SetCursor (row,col)
List display: Sets the cursor on a certain position in the list.

Options Offset=x  The cursor will be positioned x spaces from the left border within the field (or table cell).
Tips & Tricks
  • If you want to setcursor on an absolute address of a table with a control key (e.g. Ctrl F12), use the following coding in your script:

//GuiXT script:

Pushbutton
(toolbar) “Material column” process=“va01_setcursor2.txt” “Ctrl+F12″

if V[NewCursorPosition]

SetCursor &V[NewCursorPosition]

Set V[NewCursorPosition] “”

endif

// InputScript “va01_setcursor2.txt”:

Set V[NewCursorPosition] cell[All items,2,&V[_tabrow]]”

  • If you want to move the cursor relatively two columns left in a table on Enter event, use the following coding:

//GuiXT script:

if V[NewCursorPosition]

SetCursor &V[NewCursorPosition]

Set V[NewCursorPosition] “”

endif

On Enter Process=“va01_skip2cols.txt”

//InputScript “va01_skip2cols.txt”:

Set V[NextColumn] &V[_tabcol] + 2

Set V[NewCursorPosition] cell[All Items,&V[NextColumn],&V[_tabrow]]”

  • You want to have a focus on a particular pushbutton after the InputScript is executed and the screen refreshed, for example: Button1 Button2 Button3 on the screen. User clicks Button, executes an InputScript and comes back to the main screen with the buttons. The focus/cursor should be on the last button clicked, in this case Button1. SetCursor does not currently allow you to put the focus onto your own pushbutton. But you can use its coordinates in round(!) brackets. In this case, GuiXT does not check the existence of an entry field at this position. Example:
  • Pushbutton(10,1)“Button1″process=“t1.txt”
    Pushbutton(12,1)“Button2″process=“t2.txt”
    Pushbutton(14,1)“Button3″process=“t3.txt”

    ifV[xx_status=1]

      SetCursor(10,1)

    endif

    if V[xx_status=2]

      SetCursor(12,1)

    endif

    if V[xx_status=3]

      SetCursor(14,1)

    endif

    (You set the xx_status in your InputScript.)

SetCursor