If targetAddress = "" then
showOKDialog("Notice","Due to Roku restrictions, blah blah blah blah........")
Else
' debug testing... why is this not displaying either
showOKDialog("Test",targetAddress)
End if
Sub showOKDialog(title = "NOTE" as String,message = "Press OK to continue" as String)
port = CreateObject("roMessagePort")
dialog = CreateObject("roMessageDialog")
dialog.SetMessagePort(port)
dialog.SetTitle(ttl)
dialog.SetText(message)
dialog.AddButton(1, "OK")
dialog.EnableBackButton(true)
dialog.Show()
While True
dlgMsg = wait(0, dialog.GetMessagePort())
If type(dlgMsg) = "roMessageDialogEvent"
if dlgMsg.isButtonPressed()
if dlgMsg.GetIndex() = 1
exit while
end if
else if dlgMsg.isScreenClosed()
exit while
end if
end if
end while
End Sub
Sub Main()
'initialize theme attributes like titles, logos and overhang color
initTheme()
'display a fake screen while the real one initializes. this screen
'has to live for the duration of the whole app to prevent flashing
'back to the roku home screen.
screenFacade = CreateObject("roParagraphScreen")
screenFacade.addParagraph("Please wait...")
screenFacade.show()
' =========================
' GET SETTINGS FROM REGISTRY
' =========================
targetAddress = RegRead("ip")
targetPort = RegRead("port")
targetUsername = RegRead("username")
targetPassword = RegRead("password")
If targetAddress = "" then
showOKDialog("Notice","Due to Roku restrictions, only blah blah blah....") ' to fix later
Else
' debug testing... why is this not displaying either
showOKDialog("Test",targetAddress)
End if
Function showOKDialog(title = "NOTE" as String,message = "Press OK to continue" as String,buttonText = "OK" as String) as Void
port = CreateObject("roMessagePort")
dialog = CreateObject("roMessageDialog")
dialog.SetMessagePort(port)
dialog.SetTitle(title)
dialog.SetText(message)
dialog.AddButton(1, buttonText)
dialog.EnableBackButton(true)
dialog.Show()
While True
dlgMsg = wait(0, dialog.GetMessagePort())
If type(dlgMsg) = "roMessageDialogEvent"
If dlgMsg.isButtonPressed()
If dlgMsg.GetIndex() = 1
exit while
End If
Else If dlgMsg.isScreenClosed()
exit while
End If
End If
End While
End Function