我有使用roPinEntryDialog
Roku機上的應用程序,就像這樣:是否可以顯示在roPinEntryDialog中輸入的數字?
function EnterCode() as Boolean
screen = CreateObject("roPinEntryDialog")
mp = CreateObject("roMessagePort")
screen.SetMessagePort(mp)
screen.SetNumPinEntryFields(8)
screen.SetTitle("Enter Code")
screen.AddButton(0, "Next")
screen.AddButton(1, "Cancel")
screen.Show()
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPinEntryDialogEvent"
print "Show Code: Index: ";msg.GetIndex();" Data: ";msg.GetData()
if msg.isScreenClosed()
return false
else if msg.isButtonPressed()
token=screen.Pin()
print "token: ";token
if msg.GetIndex() = 0 then return true
if msg.GetIndex() = 1 then return false
endif
endif
end while
end function
當我使用這個對話框,它顯示了輸入的數字爲星號。我試過使用,screen.SetSecureText(false)
,但不幸的是,這隻適用於文本框。有沒有辦法顯示輸入的數字?如果沒有,是否有另外的數字對話框,我應該嘗試這樣做?
謝謝!是的,不幸的是,在這個特殊的項目中,我無法使用SceneGraph。這就是我所需要的,我只是使用常規鍵盤並使用正則表達式進行驗證。謝謝! –