If the control's type is set to anything other than 'Folders'.
If I set the type to 'Folders', there are no errors. The 'msg' properties are also working after a computer reboot.
And FWIW, I was hoping to test using "Strings," since I wanted to see which dialog appears when pressing the add button (and to check if any event is triggered when trying to add or remove a value, but it seems that isn't the case, no event is fired).
I have also been playing with this control without actually knowing what to expect and consequently not making a lot of progress . Some code examples would be helpful.
Ok, so now the control is usable in 'Strings' mode.
Leo, Jon here are some ideas that might be worth adding (Or there's maybe a current way to do it?):
Add a way to hide the 'Add' button, so that only the script can decide which values are listed.
In 'Strings' Mode, add a 'read-only' option so that it's not possible to edit current values.
In 'Strings' Mode, add a msg.click event when you click on a value. (maybe only when 'read-only' is enabled to avoid conflicts with editing).
Thanks.
Ok, I'm not sure why, but the script from above looks corrupted.
Try this one instead. dlg_test.opusscriptinstall (1.2 KB)
Edit : I've updated the example so that when you press the 'Clear button', it actually clears the values. Initially, I thought the control would handle that automatically.
It contains a simple example I found about how to get the values and other details related to the control.
However, Jon, I noticed something that might look like a bug—or at least it isn't explained in the release notes:
When 'Edit as text' is enabled, no event is triggered before or after you check/uncheck it in the dialog. This means there's no way to retrieve the values unless you later interact with the control when 'Edit as text' is unchecked.
Jon, is there a way to make the control (when in Strings Mode) such that the values are not editable and there's no 'Add' button, but they can still be deleted (i.e., each value has a 'delete' button, I mean the 'x' icon)? If not, could this be added for completeness?
When the List Edit Control has its Read-Only property set to false, clicking an item starts editing it. That means you can't click items for other purposes anymore. Could you add a way to avoid that? One option could be that holding Ctrl while clicking triggers the click event instead of starting edit mode.
A List Edit control, with Read-Only property set to True :
It means you can't add values or edit existing ones.
Entries are clickable like buttons. And when you click one, a click event is registered.
With the Read-Only property set to False:
You can add and edit entries inline.
Clicking an entry enters edit mode; when you finish editing, an editchange event is registered.
No click event is registered when clicking an entry (technically clicking enters edit mode).
What I suggested is that, to have an in-between state when Read-Only is False (one where you can add/edit entries but existing ones can also be clicked, and therefore, you could actually do something with them), so that an entry can behave both like a button and like an editable field. One idea would be that if you click an entry while holding Ctrl, avoids entering edit mode and behaves like a button, triggering a click event instead of entering edit mode.