WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-16-2010, 12:36 AM
Chapre Chapre is offline
Member
 
Join Date: Sep 2010
Posts: 36
Question vizdlg dialog components on a single panel

Hello, I'm working on GUI (graphic user interface), I'm using vizdlg.

Is it possible to add and show more than one vizdlg dialog component on a single panel (not one by one as in tabbed panel)?
Reply With Quote
  #2  
Old 11-16-2010, 10:51 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Yes, this is possible:
Code:
import viz
import vizdlg

viz.go()

myPanel = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_BOTTOM,padding=10)

ticker1 = vizdlg.TickerDialog(label='Ticker 1',range=(1,5,1))
ticker2 = vizdlg.TickerDialog(label='Ticker 2',range=(1,5,1))

ticker1.visible(1)
ticker2.visible(1)

myPanel.addItem(ticker1)
myPanel.addItem(ticker2)

viz.link(viz.CenterCenter,myPanel,offset=(-150,50,0))

#handle accept button events
def onTicker1Accept():
    viz.logNotice('ticker 1 value is: ',ticker1.value)

vizact.onbuttondown(ticker1.accept,onTicker1Accept)

def onTicker2Accept():
	viz.logNotice('ticker 2 value is: ',ticker2.value)

vizact.onbuttondown(ticker2.accept,onTicker2Accept)
Reply With Quote
  #3  
Old 11-17-2010, 02:54 PM
Chapre Chapre is offline
Member
 
Join Date: Sep 2010
Posts: 36
Thank you Jeff, that exactly what I wanted; one last thing, can make a single "accept button" and "cancel button" for all dialog components in the panel?
Reply With Quote
  #4  
Old 11-20-2010, 02:47 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could remove all the existing buttons and add your own:
Code:
import viz
import vizdlg

viz.go()

myPanel = vizdlg.Panel(layout=vizdlg.LAYOUT_VERT_CENTER)

tickerPanel = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_BOTTOM,padding=10,border=False)
ticker1 = vizdlg.TickerDialog(label='Ticker 1',range=(1,5,1))
ticker2 = vizdlg.TickerDialog(label='Ticker 2',range=(1,5,1))
tickerPanel.addItem(ticker1)
tickerPanel.addItem(ticker2)

ticker1.visible(1)
ticker2.visible(1)

#remove separators and buttons
ticker1_Items = ticker1.getItems()
ticker1.removeItem(ticker1_Items[1])
ticker1.removeItem(ticker1_Items[2])
ticker2_Items = ticker2.getItems()
ticker2.removeItem(ticker2_Items[1])
ticker2.removeItem(ticker2_Items[2])

buttonPanel = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,spacing=15,border=False)
accept = viz.addButtonLabel('Accept')
cancel = viz.addButtonLabel('Cancel')
buttonPanel.addItem(accept)
buttonPanel.addItem(cancel)

myPanel.addItem(tickerPanel)
myPanel.addItem(buttonPanel)

viz.link(viz.CenterCenter,myPanel,offset=(-150,50,0))

#handle accept button event
def onTickerAccept():
	viz.logNotice('ticker 1 value is: ',ticker1.value)
	viz.logNotice('ticker 2 value is: ',ticker2.value)
	
vizact.onbuttondown(accept,onTickerAccept)

Last edited by Jeff; 11-20-2010 at 04:27 PM.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
one panel over all windows Andy Vizard 5 04-11-2012 09:24 AM


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


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