WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   TickerDialog not showing (https://forum.worldviz.com/showthread.php?t=5101)

fordprefect 07-14-2014 08:30 AM

TickerDialog not showing
 
1 Attachment(s)
Servus,

I was in need of a number input option, ideally to be placed into menu. A progress bar was not precise enough for the range +/-50 and at least .5 precision. After trying a Textbox and fighting with input filtering I stumbled across the TickerDialog. Alas not possible to include it in the menu bar as it seems.
  • I'd very much like to see the TickerDialog functionality somehow added to the menu system. :o

Then I thought that it would not add too much clicking when I add it to a temporary panel. I tried the example with three dialogs on three different tabs of a TabPanel which works as it should. Though I want to be able to change e.g. all coordinates at the same time, so I tried a GridPanel. The size exceeds when adding TickerDialogs, but they ain't showing. Same with the normal panel. They won't show even if there is just one TickerDialog in use. :confused:
  • Please tell me where I go wrong
  • Or, if I'm not wrong, please fix it.

Thanks, Walter

Jeff 07-15-2014 05:12 PM

Vizconfig panels support text boxes that filter for float or int values. Would this work for you?

Code:

'''
Press F12 to toggle the visibility
of the configuration window
'''

import viz
import vizconfig
import vizinfo

viz.setMultiSample(4)
viz.fov(60)
viz.go()

vizinfo.InfoPanel()

gallery = viz.add('gallery.osgb')

value = 25.0

def getValue():
        return value
       
def setValue(v):
        value=v
       
#Create a configurable object
bc= vizconfig.BasicConfigurable('Enter a float value between (-50,50)')
bc.addFloatItem('float value',range=(-50,50),fset=setValue,fget=getValue)

#register the object so it will display in the configuration window
vizconfig.register(bc)


fordprefect 07-16-2014 02:39 AM

Hi Jeff,

thank you for pointing me to vizconfig.
:) It seems that I can put that to good use, though I'll have to rework my menu system...
:o My opinion is to prohibit unwanted user input rather than telling the user afterwards that I didn't like his input - meaning, I'd prefer that you can't enter letters or non-number special characters into a number (int, float) textbox at all.
:D what about that TickerDialog and Panels, though...?

Best Regards, Walter

fordprefect 07-16-2014 03:12 AM

vizconfig documentation
 
P.S.
On the vizconfig basics help page (with the local beta-3 as well as the online version Vizard5 Online Help) some methods are omitted:
  • addLabelItem
  • addBoolLabelItem

And another question, why are the additional examples and the screenshot now missing which were available in Vizard4 Online Help? Especially the screenshot gives a good idea what to expect, without having to run an example script.

Best Regards, Walter

fordprefect 07-16-2014 05:12 AM

one runtime and one editing feedback
 
P.P.S:

:o there seems to be an error in an error message; when you supply only one positional argument to addBoolLabelItem, the error reads:
TypeError: addBoolLabelItem() takes at least 1 argument (2 given) which should most likely be the other way round (at least 2 arguments and just 1 given)

:confused: and I suggest to add documentation strings to the BasicConfigurable.add* resources, to ease scripting (I use that tooltip feature in the IDE quite a lot). Pleeeeease...

Jeff 07-17-2014 06:13 PM

By default the visibility of the dialog components are turned off unless added to a TabPanel. When using a task function, you can use the show method to display the dialog and wait for a button event. The TickerDialog section has a short example. The following turns the visibility of the components on in a standard panel:

Code:

import viz
import vizdlg
viz.go()

# ticker dialog and standard panel
s1 = vizdlg.TickerDialog(label='Circle',units='pixels',range=(1,5,1),editable=True,border=False,background=False,margin=0)
s2 = vizdlg.TickerDialog(label='Crosshair',units='pixels',range=(1,5,1),editable=True,border=False,background=False,margin=0)
s3 = vizdlg.TickerDialog(label='Border',units='pixels',range=(1,5,1),editable=True,border=False,background=False,margin=0)
s1.visible(viz.ON)
s2.visible(viz.ON)
s3.visible(viz.ON)

row = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_BOTTOM,border=False,background=False,margin=0)
is1 = row.addItem(s1)
is2 = row.addItem(s2)
is3 = row.addItem(s3)

myPanel = vizdlg.Panel(align=vizdlg.ALIGN_CENTER)
myPanel.addItem(row)
viz.link(viz.CenterCenter, myPanel)

Thanks for the documentation comments and suggestions. Regarding the vizconfig docs, I'll make a note to add an updated image and some examples to the installation.

fordprefect 07-23-2014 12:47 AM

Solution confirmed
 
Hi Jeff,

thank you for the solution.

Of course I have to add that to me this seems to be inconsistent behaviour and confusing to the programmer. But now the solution is documented in this forum ;)

Again, thanks to you!
Best Regards, Walter


All times are GMT -7. The time now is 08:05 AM.

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