WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Resizing/scaling panels (https://forum.worldviz.com/showthread.php?t=5372)

tokola 06-08-2015 10:51 AM

Resizing/scaling panels
 
1 Attachment(s)
Hi,

I am having the following problems while scaling a TabPanel:
1.Keeping its initial proportions. I've noticed that in my example (attached), setting the scale back to 1 does not reset the panel to its original size (use keys 'q' and 'w'). Might this be a combination of Tab and Grid panels or something else?
2. The included quad nodes in the GridPanel do not resize proportionally. Is this the expected behavior? Resizing them individually can be a pain.
3. How can I keep the panel in a fixed position in the window when resizing the window? Do I have to calculate the offset and change it on update (it it's not stuck on any of the corners or the center)?

Thanks!

tokola 06-13-2015 08:06 AM

Any update on this? Items 1 and 2 are still a problem. Item 3 has been replied in another thread by Jeff and appreciate it.

Thanks!

Jeff 06-15-2015 04:29 PM

I'll have to check with a developer for further assistance.

Jeff 06-26-2015 12:49 PM

1) There is a bug that involves the panel scaling and fontsize. This will be fixed in the next Vizard release. However, there is a workaround which is actually better than setting the font size. You can apply an additional scale to the "gridPanel", which will be relative to it's inherited scale from the parent tabPanel. So instead of changing the font size, do something like the following:

Code:

gridPanel.setPanelScale(1.75)
Below is an example:

Code:

import viz
import vizdlg
import vizact

viz.go()

tabPanel = vizdlg.TabPanel()
gridPanel = vizdlg.GridPanel()
tabPanel.addPanel('TEST',gridPanel,viz.ALIGN_LEFT_TOP)
gridPanel.setPanelScale(1.75)
rowText = viz.addText('TEXT')
gridPanel.addRow([rowText])
viz.link(viz.LeftTop,tabPanel,offset=(10,-10,0))

vizact.onkeydown('1',tabPanel.setPanelScale,1)
vizact.onkeydown('2',tabPanel.setPanelScale,2)

2) Yes, only GUI objects will scale with the panel scale. If you just want to have a textured quad you could add a textured checkbox and that will scale with the panel:

Code:

quad = viz.addCheckbox()
quad.setScale([3,3,1])
quad.disable()
quad.texture(viz.addTexture('lake3.jpg'))
gridPanel.addRow([quad])



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

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