
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can we style dialog boxes?
I'm in the process of rolling my own and want to check before I get too far into that.
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook
Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Can we style dialog boxes?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Can we style dialog boxes?
I'll add some more questions:
1. Can we set a totally custom, semi transparent background
2. Can we add more buttons/controls and style them to our specific need
3. Can we respond to key events in the dialog
4. How?
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook
Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Can we style dialog boxes?
sub showWrongMessage()
m.Message = createObject("RoSGNode","Dialog")
bg = createFullScreenBg()
m.Message.insertchild(bg,0)
m.Message.titleColor = "0xff0000ff"
m.Message.title = "TRY AGAIN"
m.Message.message = "You did something wrong:" + chr(10) + "* message on second line " + chr(10) + "* message on third line "
m.Message.buttons = ["OK"]
m.Message.observefield("buttonSelected","closeMessageonOK")
m.Message.observefield("wasClosed","DialogClosed")
m.top.dialog = m.Message
end sub
sub createFullScreenBg() As Object
bg = createObject("roSGNode", "Rectangle")
bg.height = 1080
bg.width = 1920
bg.color = "0x00000044"
return bg
end sub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Can we style dialog boxes?
You can create more buttons in the array and detect which button is pressed on the buttonSelected value. You could also create custom controls that you'd have to manage the navigation of. you should be able to manage all navigation and keypress handling with an onKeyEvent function in the parent scene.
I left out the two functions called by observers, but they should be fairly easy, lemme know if you need them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Can we style dialog boxes?
"This allows the appearance attributes of all the Button nodes in the dialog to be easily modified. Since the ButtonGroup node class is derived from the LayoutGroup node class, additional non-Button node children can also be added."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Can we style dialog boxes?
I have the same issue with how to set a button group inside a dialog box. Do you have any luck?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Can we style dialog boxes?
Here is an example of how I've set a button group in a dialog. Hopefully this is what you are looking for:
The code defines a dialog control in the XML:
<Dialog
id="ControlDialog"
visible="false"
/>
Then in the brs file, it accesses the control, creates a group of buttons and sets the focus bitmap:
m.top.ControlDialog = m.top.findNode("ControlDialog")
m.top.ControlDialog.buttonGroup.buttons = [tr("BUTTON1"), tr("BUTTON2"), tr("BUTTON3")]
m.top.ControlDialog.buttonGroup.focusBitmapUri="pkg:/images/Button_Blue_HD.9.png"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Can we style dialog boxes?
@RobMichThank you for your response, It's working. Is it possible to change the focused text color?. I tried with "focusedTextColor" like below. But no luck.
' optiondialog.focusedTextColor = "0xFFFFFFFF" 'nonexistent field ' optiondialog.ButtonGroup.focusedTextColor = "0xFFFFFFFF"
For the keyboard dialog box, the "focusedKeyColor" field is Works. But, It's only available for alphabet and digit. Is there any option available for focused text color in the dialog box?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Can we style dialog boxes?
@chaklasiyanikun wrote:@RobMichThank you for your response, It's working. Is it possible to change the focused text color?. I tried with "focusedTextColor" like below. But no luck.
' optiondialog.focusedTextColor = "0xFFFFFFFF" 'nonexistent field ' optiondialog.ButtonGroup.focusedTextColor = "0xFFFFFFFF"For the keyboard dialog box, the "focusedKeyColor" field is Works. But, It's only available for alphabet and digit. Is there any option available for focused text color in the dialog box?
Any Solution for this.