Queue click

Command group Flag affected Reversible Execute on client Platform(s)
Events NO NO NO All

Syntax

Queue click ([Shift][,Command/Ctrl]) {field-name (selection-range)}

Options

Shift If specified, the queued event behaves as if the shift key has been pressed
Command/Ctrl If specified, the queued event behaves as if the command/ctrl key has been pressed

Description

This command queues a "mouse click" event on a specified field, that is, it simulates a user-generated mouse click/drag operation on a field. You must specify the name of the field as a parameter, including the click positions within the field (that is, Start Row, Finish Row for lists and Start Character, Finish Character for text field selection). The specified field will get the focus.

There are options for including up to three modifier keys (that is, Shift, Ctrl/Cmnd) along with the click.

The field name parameter must be the name of a window field, not the name of the method associated with the field or the data name ($name, not $dataname).

Queue clicks returns an error if the field cannot be found. You can turn off this error by setting the option "reportQueueCommandFieldNotFoundErrors" to false, located in the "defaults" section of config.json.

Queue click for pushbuttons

If the specified field is a pushbutton it is activated and an evClick event is generated as if the user had clicked on the button.

Queue click for Radio buttons and check boxes

If the specified field is a check box or set of radio buttons, the check box field or group of radio buttons is checked/unchecked accordingly, and an evClick event is generated. Methods behind radio buttons and check boxes run as if the user had clicked on the window fields.

Queue click for Radio groups

If the specified field is a radio group, you identify the member of the group that is to receive the click by setting the selection-range parameter to the value of$dataname that corresponds to the member. When the command executes, Omnis checks the member and generates an evClick event. Event methods for the radio group run as if the user had clicked on the field.

Queue click on Edit fields

You can specify a range of characters. For example, the parameter field-name (2,5), highlights the characters within cursor positions 2 to 5 (that is, characters 3 to 5). Note that cursor position 0 is to the left of character 1, and cursor position 1 is to the right of character 1 (or to the left of character 2).

If Shift is selected and 5 is passed as the selection point, all characters between the current cursor position and cursor position 5 will be highlighted.

As the Queue click examples for Edit show, the two parameters act as a "click on, drag to" key operation.

Queue click for lists

If the specified field is a window list box or grid, the range is interpreted as a range of list lines. For example, the parameter list-field-name (2,5), selects the lines 2 to 5 (if $multipleselect for the list field is set), and the current line will be set to 2. An evClick event is generated after the specified lines have been selected.

Example

# Queue click for edit fields

# highlight characters 3 to 7
Queue click {myEntryField (7,2)}

# highlight characters 6 to 9
Queue click {myEntryField (5,7)}

# assuming the current cursor is at position 15,
# characters 9 to 15 are highlighted
Queue click (Shift) {myEntryField (8)}

# assuming the current cursor is at position 15,
# characters 16 to 22 are highlighted
Queue click (Shift) {myEntryField (22)}

# assuming the current cursor is at position 15,
# characters 10 to 15 are highlighted
Queue click (Shift) {myEntryField (7,9)}

# assuming the current cursor is at position 15,
# characters 8 to 15 are highlighted
Queue click (Shift) {myEntryField (9,7)}

# Queue click for lists
# lines 7 to 3 are selected and the current line set to 7
Queue click {myListField (7,3)}

# lines 2 to 9 are selected and the current line set to 2
Queue click {myListField (2,9)}

# the current line to line 12 are selected
# the current line does not change
Queue click (Shift) {myListField (12)}

# line 13 is selected and any lines currently selected remain selected
# the current line does not change
Queue click (Shift,Command/Ctrl) {myListField (13)}

# lines 4 to 8 are selected and any lines currently selected remain selected
# the current line does not change
Queue click (Shift,Command/Ctrl) {myListField (4,8)}