Home
-- Search (roSearchScreen)
-- Options (roMessageDialog)
-- Hit 'Back' button here = does nothing
-- Option 1 (roMessageDialog)
-- Option 1 dialog closes
-- Options
-- Hit 'Back' button here
Home
Home
-- Search (roSearchScreen)
-- Options (roMessageDialog)
-- Option 1 (roMessageDialog)
-- Option 1 dialog closes
-- Option 2 (roMessageDialog)
-- Option 2 dialog closes
-- Hit 'Done'
-- Options dialog closes
-- Search
Home
Sub doSearchWindow()
port = CreateObject("roMessagePort")
searchScreen = CreateObject("roSearchScreen")
searchScreen.SetMessagePort(port)
history = CreateObject("roSearchHistory")
searchScreen.SetSearchTerms(history.GetAsArray())
searchScreen.Show()
while (true)
msg = wait(0, port)
if (type(msg) = "roSearchScreenEvent") then
if (msg.isScreenClosed()) then
return
else if (msg.isPartialResult()) then
' Unnecessary
else if (msg.isFullResult()) then
' Unnecessary
else if (msg.isCleared()) then
' Unnecessary
else if ((msg.isRemoteKeyPressed() AND msg.GetIndex() = 10) OR msg.isButtonInfo()) then
' Shows the first roMessageDialog for search filters
SearchOptionsDialog()
end if
end if
end while
End Sub
Function SearchOptionsDialog() as Integer
dialog = CreateObject("roMessageDialog")
port = CreateObject("roMessagePort")
dialog.SetMessagePort(port)
dialog.SetTitle("Search Options")
dialog.SetText("Some text")
dialog.EnableBackButton(false)
dialog.addButton(1, "Change Filter One")
dialog.addButton(2, "Change Filter Two")
dialog.addButton(3, "Done")
dialog.Show()
while true
dlgMsg = wait(0, dialog.GetMessagePort())
if (type(dlgMsg) = "roMessageDialogEvent") then
if (dlgMsg.isButtonPressed()) then
if (dlgMsg.GetIndex() = 1) then
ret = FilterOneClicked()
if (ret = "") then
' Do other stuff
end if
else if (dlgMsg.GetIndex() = 2) then
ret = FilterTwoClicked()
if (ret = "") then
' do other stuff
end if
else if (dlgMsg.GetIndex() = 3) then
dialog.Close()
exit while
end if
else if (dlgMsg.isScreenClosed()) then
dialog.Close()
exit while
else
exit while
end if
else
exit while
end if
end while
return 0
End Function
Function FilterOneClicked() as String
dialog = CreateObject("roMessageDialog")
port = CreateObject("roMessagePort")
dialog.SetMessagePort(port)
dialog.SetTitle("Filter One")
dialog.EnableBackButton(false)
dialog.addButton(1, "None")
dialog.Show()
toReturn = ""
while true
dlgMsg = wait(0, dialog.GetMessagePort())
if (type(dlgMsg) = "roMessageDialogEvent") then
if (dlgMsg.isButtonPressed()) then
if (dlgMsg.GetIndex() = 1) then
toReturn = ""
end if
exit while
else if (dlgMsg.isScreenClosed()) then
exit while
end if
end if
end while
dialog.Close()
return toReturn
End Function
Function FilterTwoClicked() as String
dialog = CreateObject("roMessageDialog")
port = CreateObject("roMessagePort")
dialog.SetMessagePort(port)
dialog.SetTitle("Filter Two")
dialog.EnableBackButton(false)
dialog.addButton(1, "None")
dialog.Show()
toReturn = ""
while true
dlgMsg = wait(0, dialog.GetMessagePort())
if (type(dlgMsg) = "roMessageDialogEvent") then
if (dlgMsg.isButtonPressed()) then
if (dlgMsg.GetIndex() = 1) then
toReturn = ""
end if
exit while
else if (dlgMsg.isScreenClosed()) then
exit while
end if
end if
end while
dialog.Close()
return toReturn
End Function
Sub doSearchWindow()
port = CreateObject("roMessagePort")
searchScreen = CreateObject("roSearchScreen")
searchScreen.SetMessagePort(port)
history = CreateObject("roSearchHistory")
searchScreen.SetSearchTerms(["test","west","best","lest","vest"] )
searchScreen.Show()
while (true)
msg = wait(0, port)
if (type(msg) = "roSearchScreenEvent") then
if (msg.isScreenClosed()) then
return
else if (msg.isPartialResult()) then
' Unnecessary
else if (msg.isFullResult()) then
' Unnecessary
else if (msg.isCleared()) then
' Unnecessary
else if ((msg.isRemoteKeyPressed() AND msg.GetIndex() = 10) OR msg.isButtonInfo()) then
' Shows the first roMessageDialog for search filters
SearchOptionsDialog()
end if
end if
end while
End Sub
Function SearchOptionsDialog() as Integer
dialog = CreateObject("roMessageDialog")
port = CreateObject("roMessagePort")
dialog.SetMessagePort(port)
dialog.SetTitle("Search Options")
dialog.SetText("Some text")
dialog.EnableBackButton(false)
dialog.addButton(1, "Change Filter One")
dialog.addButton(2, "Change Filter Two")
dialog.addButton(3, "Done")
dialog.Show()
while true
dlgMsg = wait(0, dialog.GetMessagePort())
if (type(dlgMsg) = "roMessageDialogEvent") then
if (dlgMsg.isButtonPressed()) then
if (dlgMsg.GetIndex() = 1) then
ret = FilterOneClicked()
if (ret = "") then
' Do other stuff
end if
else if (dlgMsg.GetIndex() = 2) then
ret = FilterTwoClicked()
if (ret = "") then
' do other stuff
end if
else if (dlgMsg.GetIndex() = 3) then
'dialog.Close()
return 0
end if
else if (dlgMsg.isScreenClosed()) then
return 0
exit while
else
exit while
end if
else
exit while
end if
end while
return 0
End Function
Function FilterOneClicked() as String
dialog = CreateObject("roMessageDialog")
port = CreateObject("roMessagePort")
dialog.SetMessagePort(port)
dialog.SetTitle("Filter One")
dialog.EnableBackButton(false)
dialog.addButton(1, "None")
dialog.Show()
toReturn = ""
while true
dlgMsg = wait(0, dialog.GetMessagePort())
if (type(dlgMsg) = "roMessageDialogEvent") then
if (dlgMsg.isButtonPressed()) then
if (dlgMsg.GetIndex() = 1) then
toReturn = ""
end if
return toreturn
else if (dlgMsg.isScreenClosed()) then
return toreturn
end if
end if
end while
dialog.Close()
return toReturn
End Function
Function FilterTwoClicked() as String
dialog = CreateObject("roMessageDialog")
port = CreateObject("roMessagePort")
dialog.SetMessagePort(port)
dialog.SetTitle("Filter Two")
dialog.EnableBackButton(false)
dialog.addButton(1, "None")
dialog.Show()
toReturn = ""
while true
dlgMsg = wait(0, dialog.GetMessagePort())
if (type(dlgMsg) = "roMessageDialogEvent") then
if (dlgMsg.isButtonPressed()) then
?"button pressed:";dlgmsg.getindex()
if (dlgMsg.GetIndex() = 1) then
toReturn = ""
end if
return toreturn
else if (dlgMsg.isScreenClosed()) then
?"screen closed"
return toreturn
end if
end if
end while
End Function
Sub doSearchWindow()
port = CreateObject("roMessagePort")
searchScreen = CreateObject("roSearchScreen")
searchScreen.SetMessagePort(port)
history = CreateObject("roSearchHistory")
searchScreen.SetSearchTerms(["test","west","best","lest","vest"] )
searchScreen.Show()
while (true)
msg = wait(0, port)
if (type(msg) = "roSearchScreenEvent") then
if (msg.isScreenClosed()) then
return
else if (msg.isPartialResult()) then
' Unnecessary
else if (msg.isFullResult()) then
' Unnecessary
else if (msg.isCleared()) then
' Unnecessary
else if ((msg.isRemoteKeyPressed() AND msg.GetIndex() = 10) OR msg.isButtonInfo()) then
' Shows the first roMessageDialog for search filters
while (SearchOptionsDialog() = 2)
end while
end if
end if
end while
End Sub
Function SearchOptionsDialog() as Integer
dialog = CreateObject("roMessageDialog")
port = CreateObject("roMessagePort")
dialog.SetMessagePort(port)
dialog.SetTitle("Search Options")
dialog.SetText("Some text")
dialog.EnableBackButton(false)
dialog.addButton(1, "Change Filter One")
dialog.addButton(2, "Change Filter Two")
dialog.addButton(3, "Done")
dialog.Show()
while true
dlgMsg = wait(0, dialog.GetMessagePort())
if (type(dlgMsg) = "roMessageDialogEvent") then
if (dlgMsg.isButtonPressed()) then
if (dlgMsg.GetIndex() = 1) then
dialog.Close()
ret = FilterOneClicked()
if (ret = "") then
' Do other stuff
end if
return 2
else if (dlgMsg.GetIndex() = 2) then
dialog.Close()
ret = FilterTwoClicked()
if (ret = "") then
' do other stuff
end if
return 2
else if (dlgMsg.GetIndex() = 3) then
'dialog.Close()
return 0
end if
else if (dlgMsg.isScreenClosed()) then
return 0
exit while
else
exit while
end if
else
exit while
end if
end while
return 0
End Function
Function FilterOneClicked() as String
dialog = CreateObject("roMessageDialog")
port = CreateObject("roMessagePort")
dialog.SetMessagePort(port)
dialog.SetTitle("Filter One")
dialog.EnableBackButton(false)
dialog.addButton(1, "None")
dialog.Show()
toReturn = ""
while true
dlgMsg = wait(0, dialog.GetMessagePort())
if (type(dlgMsg) = "roMessageDialogEvent") then
if (dlgMsg.isButtonPressed()) then
if (dlgMsg.GetIndex() = 1) then
toReturn = ""
end if
return toreturn
else if (dlgMsg.isScreenClosed()) then
return toreturn
end if
end if
end while
dialog.Close()
return toReturn
End Function
Function FilterTwoClicked() as String
dialog = CreateObject("roMessageDialog")
port = CreateObject("roMessagePort")
dialog.SetMessagePort(port)
dialog.SetTitle("Filter Two")
dialog.EnableBackButton(false)
dialog.addButton(1, "None")
dialog.Show()
toReturn = ""
while true
dlgMsg = wait(0, dialog.GetMessagePort())
if (type(dlgMsg) = "roMessageDialogEvent") then
if (dlgMsg.isButtonPressed()) then
?"button pressed:";dlgmsg.getindex()
if (dlgMsg.GetIndex() = 1) then
toReturn = ""
end if
return toreturn
else if (dlgMsg.isScreenClosed()) then
?"screen closed"
return toreturn
end if
end if
end while
End Function