Posts: 951
Threads: 111
Joined: Jan 2008
I'm continuing to set up templates for my theater. I'm wondering it the following is possible.
On an overlay page I would like to be able to have a pop up box come up with, say four options. Upon choosing one of the options a global event would run and the box would close. I would call the the pop up from a command button of some kind.
As an example the pop up would say:
What do you want to do?
and the options would be:
Play a Blu Ray       Watch TV        Work on Computer      Play XBox
Thanks
George M
Posts: 40,483
Threads: 491
Joined: Aug 2002
You can either use a set of buttons, or it could a static list browser. The latter would allow for more options to be easily added later and for the list to be scrollable if there are more options than space.
When they press a list item, you get an event that you can react to. And you get the text of the item clicked on. If it's more convenient you can also load the static list browser with two lists, one of which is the displayed text and the other is for internal use. You could use the internal use text to pass to the global action to use (since that would let you change the displayed text if you need, without breaking the underlying logic.)
Dean Roddey
Explorans limites defectum
Posts: 951
Threads: 111
Joined: Jan 2008
But how do I get the pop up box that would contain the list browser?
Thanks
George M
Posts: 40,483
Threads: 491
Joined: Aug 2002
You mean how would you create it, or how once created, you would invoke it? For the former, you just create a template that has the functionality you want. For the latter, you would use the:
IntfViewer::InvokePopup()
command. Point it at the template and it will run that as a popup. You generally want to have some means to cancel as well, so probably a Cancel button. The System::Exit command lets you exit the popup, and return a true/false value so that you can do:
If IntfViewer::InvokePopup()
EndIf
And only do something if the user indicated to do it (e.g. one button does System::Exit(True) and the cancel button does System::Exit(False). That shows up as the result of the InvokePopup command and the If will use that.
But, if you are going to run the global action before the popup returns, then you don't care what the return value is. Both the Cancel button and the handler for the click on the list can just call System::Exit(False) to close the popup.
Dean Roddey
Explorans limites defectum
Posts: 951
Threads: 111
Joined: Jan 2008
Thanks,
I'll play with that and see how far I get.
Thanks
George M
Posts: 40,483
Threads: 491
Joined: Aug 2002
I'll try to get a 5.x compliant tutorial video up on that subject. I need to keep spitting out videos regularly, but I got so caught up in the voice control stuff I put the videos on the back burner. I just did one tonight that I need to upload. Maybe I can do that one tomorrow.
Dean Roddey
Explorans limites defectum
Posts: 951
Threads: 111
Joined: Jan 2008
Would love to see it.
Thanks
George M