Olivier Chivet
07-21-2008, 09:37 AM
Hi all,
First I'm new with TrueUpdate and LUA language.
I just downloaded the TrueUpdate 3.0 Trial version and try to use a ListBox in a dialog.
So I added a DlgListBox from the screen gallery in the wizard, changed the Style to "Checklist Box" and checked the "Multi select" option.
In the "On Next" action tab, I just want to display (for debug checking) the name of all selected items.
To do this, I added this code :
--------------------------------------
local Selected = DlgListBox.GetSelected(CTRL_LIST_BOX);
local index;
local value;
for index,value in Selected do
Dialog.Message( "Selection ", index..value, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
--------------------------------------
Even if I selected more than one Item, the GetSelected function always returned only the last item I selected.
Moreover, If I display the existing variable "nSelectedCount" (result of "DlgListBox.GetSelectedCount") it always display "1".
Could someone help me to obtain the complete list of selected items ?
Thanks a lot.
Olivier Chivet
First I'm new with TrueUpdate and LUA language.
I just downloaded the TrueUpdate 3.0 Trial version and try to use a ListBox in a dialog.
So I added a DlgListBox from the screen gallery in the wizard, changed the Style to "Checklist Box" and checked the "Multi select" option.
In the "On Next" action tab, I just want to display (for debug checking) the name of all selected items.
To do this, I added this code :
--------------------------------------
local Selected = DlgListBox.GetSelected(CTRL_LIST_BOX);
local index;
local value;
for index,value in Selected do
Dialog.Message( "Selection ", index..value, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
--------------------------------------
Even if I selected more than one Item, the GetSelected function always returned only the last item I selected.
Moreover, If I display the existing variable "nSelectedCount" (result of "DlgListBox.GetSelectedCount") it always display "1".
Could someone help me to obtain the complete list of selected items ?
Thanks a lot.
Olivier Chivet