"RokuNB" wrote:
i haven't read that sample - are the "Dialog used to show warnings and the KeyboardDialog" part of it (then pls mention which file/component) or something you added? who has the input focus at that time, when they are up?
<KeyboardDialog
id="KeyboardDialog"
text=" "
visible="false" />
m.keyboardDlg = m.top.findNode("KeyboardDialog")
m.keyboardDlg.observeField("buttonSelected", "OnButtonSelected")
m.keyboardDlg.observeField("text", "OnTextChanged")
m.keyboardDlg.title = "User Login"
m.keyboardDlg.buttons = ["OK", "Cancel"]
m.keyboardDlg.visible = true
m.keyboardDlg.focusButton = 0
m.keyboardDlg.setFocus(true)
"marcelo.cabral" wrote:
Everything works as expected, except the back key that does not close the dialog.
And actually in the documentation there is no declared way to prevent pressing "back" from closing the dialog.
myScene.dialog = myDialog
myScene.optionsDialog = true ' if you want `*` to also close it '
"EnTerr" wrote:"marcelo.cabral" wrote:
Everything works as expected, except the back key that does not close the dialog.
And actually in the documentation there is no declared way to prevent pressing "back" from closing the dialog.
Your sentences - read together - are confusing. One complains Back does not close the dialog, the next says there is no way to prevent dialog from being closed...
"EnTerr" wrote:
Now, i know how to display a modal dialog in a scene and that is by setting scene's dialog property, i.e.myScene.dialog = myDialog
myScene.optionsDialog = true ' if you want `*` to also close it '
That's all - from there on the scene will take care of displaying it modal and hold it on for dear life - that is, until Back button is pressed or say you set myScene.close = true ...
So i think the magic ingredient is to let the scene handle it. If not, i assume dialogs behave as generic windows...
else if key = "options"
if m.DetailsScreen.visible = false
m.OptionsScreen.scene = m.top
m.OptionsScreen.visible = true
m.OptionsList.setFocus(true)
end if
"belltown" wrote:
Why do you need the parent's m.top? Can't you set the child's m.top.dialog to the Dialog?
m.top.scene.dialog = keyboardDlg