|
#1
|
|||
|
|||
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)? |
#2
|
|||
|
|||
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) |
#3
|
|||
|
|||
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?
|
#4
|
|||
|
|||
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. |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
one panel over all windows | Andy | Vizard | 5 | 04-11-2012 09:24 AM |