WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Slider with 2 labels (https://forum.worldviz.com/showthread.php?t=5822)

iva 08-18-2016 09:16 AM

Slider with 2 labels
 
Hey guys,

I am trying to make a slider that has 2 labels, like this:

Very uncertain -------------------[]---- Very certain

I am using vizinfo, but I don't think this is an option. Anyone has a suggestion how to do it in an elegant way? Thank you!

Jeff 08-19-2016 08:23 AM

Are you using the vizinfo panel for other GUI elements or just the slider and text? Panels from the vizdlg library support custom GUI layouts.

iva 08-25-2016 08:20 AM

I am using it for other elements, too. It would be kind of a weird switch to use vizdlg just for the slider i think...

Jeff 08-28-2016 01:21 AM

You can customize a vizinfo panel by adding vizdlg panels to it:

Code:

import viz
import vizinfo
import vizdlg

viz.go()

dojo = viz.addChild('dojo.osgb')

info = vizinfo.InfoPanel('InfoPanel with custom layout')

info.addSeparator()
textbox1 = info.addLabelItem('text box 1',viz.addTextbox())
textbox2 = info.addLabelItem('text box 2',viz.addTextbox())

info.addSection('vizdlg sub-panel with 3 elements in a row')
row = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_BOTTOM,background=False,border=False)
text1 = row.addItem(viz.addText('Very uncertain'))
slider = row.addItem(viz.addSlider())
text2 = row.addItem(viz.addText('Very certain'))
info.addItem(row)



All times are GMT -7. The time now is 11:56 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC