In the following Test Dialog I configured the second button to have some additional choices in a dropdown menu. I would expect that the first entry of the dropdown menu outputs choice 3 but it doesn't. Clicking the button directly correctly outputs choice 2 but when I select the first dropdown entry I also get choice 2. Is this a bug or by design?
If i= 1 Then
DOpus.Output "Choice 1"
End If
If i= 2 Then
DOpus.Output "Choice 2"
End If
If i= 3 Then
DOpus.Output "Choice 3"
End If
If i= 4 Then
DOpus.Output "Choice 4"
End If
If i= 5 Then
DOpus.Output "Choice 5"
End If
End Function
[/code]
[quote]...you could add a second copy of Choice 2 to the top of the menu.[/quote]Yeah, that's what I did for now but I'll have to remember to change this back after the bug is fixed to have it working correctly.
Thanks for the hint with ClickData.Func.Dlg. With Dopus.Dlg I had the problem that a dialog always opened behind the lister until I added the dlg.window = DOpus.Listers(0) line. Now I understand why this happened.
Actually, this may not be a bug, since all the internal Opus dialogs intentionally duplicate the button as the first entry in the menu, and it'd make sense for scripts to follow the same behaviour.
We're debating what to do here, but it may end up just being something we clarify in the documentation. Or maybe we'll add a flag to choose how it behaves.
This was changed in 11.1 beta 1, so that the button and first menu item each return separate IDs.
If you want your script to work with both versions of Opus, you can test the version information in the main DOpus object and, if it's lower than 11.1.0.1, duplicate the button as an extra menu item.