I'm building an xDialog that is primarily a pair of listboxes. The user clicks on the left listbox to select a category, and then selections that may be chosen for that category are shown on the right.
I've got the code working so that the listbox on the right changes when the listbox on the left is clicked. View the "Xdialog KeyList Filter Syntax" thread for details on how, plus here's the code I'm using:
varC_result = ui_dlg_box("Select Project Requirements",
%dlg%,"OK" then
a_dlg_button=""
end if
The problem I face now is that the right dialog box should sometimes be multi-select, and sometimes allow only a single selection.
Since changing the contents of the right list box was no problem, I though I might be able to simulate a "single select list box" by intercepting the changing event of the right listbox (vsels/vlist) to clear out VSELS:
if ltype="D" then
vsels=""
end if
This does not work. I'm not too terribly surprised by that as A5 probably doesn't expect to get "interrupted" in the middle of its change cycle.
Right now, the only solution I can see to this problem is to use "macro substitution". This is described by Selwyn in the "Xdialog KeyList Filter Syntax" thread, though in there he says that it's "explained in the Learning Xdialog book", and I can't find any instance of the word macro appearing in either the PDF "Learning Xdialog" and the "Xdialog Reference" does not have any topic containing the word "macro". Nonetheless, it doesn't appear to be too complicated.
Is there another solution, however. If I could know WHICH item had been clicked on in the right dialog box, I could simply replace this code:
vsels = table.external_record_content_get("wprojectselections", "Value", "", "Field="+quote(tsel)+" .AND. Project_no="+quote(projno))
with
vsels = a_currently_selected_item
Any seasoned vets tackle this problem before?
I've got the code working so that the listbox on the right changes when the listbox on the left is clicked. View the "Xdialog KeyList Filter Syntax" thread for details on how, plus here's the code I'm using:
varC_result = ui_dlg_box("Select Project Requirements",
%dlg%,"OK" then
a_dlg_button=""
end if
The problem I face now is that the right dialog box should sometimes be multi-select, and sometimes allow only a single selection.
Since changing the contents of the right list box was no problem, I though I might be able to simulate a "single select list box" by intercepting the changing event of the right listbox (vsels/vlist) to clear out VSELS:
if ltype="D" then
vsels=""
end if
This does not work. I'm not too terribly surprised by that as A5 probably doesn't expect to get "interrupted" in the middle of its change cycle.
Right now, the only solution I can see to this problem is to use "macro substitution". This is described by Selwyn in the "Xdialog KeyList Filter Syntax" thread, though in there he says that it's "explained in the Learning Xdialog book", and I can't find any instance of the word macro appearing in either the PDF "Learning Xdialog" and the "Xdialog Reference" does not have any topic containing the word "macro". Nonetheless, it doesn't appear to be too complicated.
Is there another solution, however. If I could know WHICH item had been clicked on in the right dialog box, I could simply replace this code:
vsels = table.external_record_content_get("wprojectselections", "Value", "", "Field="+quote(tsel)+" .AND. Project_no="+quote(projno))
with
vsels = a_currently_selected_item
Any seasoned vets tackle this problem before?
Comment