Xbasic

UI_DLG_CTL_COMMAND Function

Syntax

UI_DLG_CTL_COMMAND(C title,C control,C command)

Arguments

title

The name of the dialog box.

control

Unique identifier for control (variable name).

command

Command to send to the control.

Description

Send a command to an xdialog control.

Discussion

Example

Send commands to the listview control to change the presentation of the list.

dim list as c 
list = <<%txt%
{image=$$generic.orb.green}Erica|Jones
{image=$$generic.orb.blue}Tom|Snider
{image=$$generic.orb.yellow}Molly|Maloney
%txt%
list = replicate(list,30)

list = *for_each(x,"{data=" + *index() + "}" + x, list)


dim dlg_title as c = "Quick ListView - Sortable"
ui_dlg_box(dlg_title,<<%dlg%
{wrap=100}
This dialog shows a simple ListView using the new ^" Xdialog syntax.;
Using this technique, it is possible to create a simple ListView with substantialy less Xbasic than the {{Listview} Xdialog command.;
The ^ in the control definition makes the column sortable.;
[%M;K;%.100,20id^"Firstname:30^|Lastname:50^"list!idchange_*];
{lf};
Click button to change List layout;
<List><Report><SmallIcon>
%dlg%,<<%code%
if a_dlg_button = "List" then 
	a_dlg_button = ""
	ui_dlg_ctl_command(dlg_title,"idchange","list")
end if 
if a_dlg_button = "report" then 
	a_dlg_button = ""
	ui_dlg_ctl_command(dlg_title,"idchange","report")
end if 

if a_dlg_button = "smallicon" then 
	a_dlg_button = ""
	ui_dlg_ctl_command(dlg_title,"idchange","SmallIcon")
end if 

if atc("idchange_",a_dlg_button) = 1 then 
	if a_dlg_button = "idchange_dblclick" then 
		ui_msg_box("","double click on : " + id)
	else if a_dlg_button = "idchange_change" then
		ui_msg_box("Note","User clicked on : "  + id )
	end if 
	a_dlg_button = ""
end if 
%code%)

Limitations

Desktop applications only.

See Also