WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-24-2016, 06:44 AM
Martina Martina is offline
Member
 
Join Date: Feb 2016
Posts: 2
vizdlg Panel Size

Hi,

I'm looking to get the size of an auto-scaled vizdlg Panel (I need its length and height). Is there a way to do this?

Best,
Martina
Reply With Quote
  #2  
Old 03-25-2016, 08:45 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,455
I'm not sure but will look into it. Can you post example code you're using to scale the panel?
Reply With Quote
  #3  
Old 03-27-2016, 10:22 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,455
Use the Panel.getBoundingBox method to get the panel dimensions:

Code:
import viz
import vizshape
import vizdlg

viz.go()

myPanel = vizdlg.Panel(align=viz.ALIGN_LEFT_BOTTOM)
row = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_BOTTOM,border=False,background=False,margin=0)
row.addItem(viz.addText('Textbox'))
textbox = row.addItem(viz.addTextbox())
myPanel.addItem(row)

circle = vizshape.addCircle(parent=viz.ORTHO,scale=[20,20,1],color=viz.RED)

def showPanelDimensions():
	box = myPanel.getBoundingBox()
	width = box.width
	height = box.height
	print width,height
	circle.setPosition([width,height,0])

myPanel.setPanelScale(2)
showPanelDimensions()
Reply With Quote
Reply

Tags
vizdlg

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
Draw order of vizinfo Panel mape2k Vizard 2 10-08-2015 02:59 PM
Changes in vizdlg or vizact in Vizard 5? mape2k Vizard 2 12-10-2014 05:58 AM
Problem Vizdlg panel draw order Chapre Vizard 1 05-17-2011 02:29 PM
vizdlg Panel: Add and remove disbeat Vizard 2 02-08-2011 12:44 PM
vizdlg dialog components on a single panel Chapre Vizard 3 11-20-2010 02:47 PM


All times are GMT -7. The time now is 05:29 PM.


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