Xdialog - List Control - W=milliseconds Directive to Delay Firing Selected Event

Syntax

%W=milliseconds%

Description

Can be added to a List control to delay firing the selected event for a specified number of milliseconds.

The directive:

W=milliseconds

is inserted in the Listbox commands (between the % symbols).

Example

To test the effect of this directive, create a new Xbasic script and paste this code in. Then click on a row - a message box will show the selected value. Then hold the down arrow down and the selection will move quickly down the list, but the event which shows the current selection will not fire until you have stopped holding down the down key. Then, repeat the exercise with te W=2000 directive removed. You will see that the message box is shown for every row.

dim colors as c 
colors = a5.Color_Enum()
dim selected as c 
dim dlg_title as c 
dim dlg_body as c 
dim dlg_event as c 
dlg_title = "Title"
dlg_body = <<%dlg%
{removecomments}
{removeleadingspaces}
[%W=2000%.100,30selected^#colors!selected_changed];
%dlg%
dlg_event = <<%code%
if a_dlg_button = "selected_changed" then 
a_dlg_button = ""
ui_msg_box("",selected)
end if 
%code%
dim flagOK as l = .f.
ui_dlg_box(dlg_title,dlg_body,dlg_event)

See Also