Hello
Is it possible to change attributes of a ListBox programmatically. for example I have a dlg with a Listbox
where multiselect is set to "true" in the properties box, and then in the program, I am unsuccessfully trying to change it with this code:
interface listBox
%.............%.............%.............predicates
setMultiSelect :(boolean MultiSelectIsSet).
% @short Specifies whether the list box allows multiple selections.% @exception gui_exception::unableToSetPropertyAfterShow_exception% @end
I have no idea what is going on with the exception, but in every case: Unable To Set Property After Show.
May be you should create two listBox - one multiSelect one not.
Both have the same event listener.
And switch them on your properties box value changes
currentListBox := if true = bla-bla-bla then.... else... end if,
currentListBox:bringToTop()
I have not looked into this, but I believe the behavior follows from a style flag which is set when the actual Windows control is created.
In our context it means that the flag must be set before the control is shown, i.e. before the dialog is shown.
There are many ways to set the flag between generatedInitialize and the show; doing it in the constructor is an obvious way. But I would avoid the duplication of code: