WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Old 05-04-2008, 03:05 AM
xingxing xingxing is offline
Join Date: Feb 2008
Location: Sydney
Posts: 9
Send a message via MSN to xingxing
table issues

Hi farshizzo.
Could you please help me out again? thanks in advance.

several weeks ago, you taught me how to make a pop-up table in Vizard. and you said it was an undocumented module. I tried to get a space to put a picture link so that I can show the table I want but I failed. My table is like the following:

(input field)
Attrbute 1 Attrbute 5
(input field) (input field)
Attrbute 2 Attrbute 6
(input field) (input field)
Attrbute 3
(input field)
Attrbute 4
(input field)

(accept butten) (infer butten) (cancel butten)

I need to make this table dragable and the size can be changed like a normal window in WinXP because I need to put it on the left side of the screen. and also I need it transparent so that I can see the avatars behind it. In addition , how can I make a screen shot in Vizard? I really need to make it reach my requirement. So please help me out.
If someone else can help me this, I also appreciate it. Thanks a lot.
Reply With Quote
Old 05-05-2008, 06:56 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
When you post on the forum you can attach images. Just click the Manage Attachments button and it will allow you to upload an image from your computer.

The vizdlg module does not have built-in support for dragging/resizing. You can make the background of the dialog semi-transparent by using the following code:
You can take a screenshot of your Vizard world by pressing CTRL+F9. It will create a timestamped bmp image in your script directory.
Reply With Quote
Old 05-06-2008, 05:38 AM
xingxing xingxing is offline
Join Date: Feb 2008
Location: Sydney
Posts: 9
Send a message via MSN to xingxing

Click image for larger version

Name:	xingxing-tablesample.JPG
Views:	1520
Size:	130.5 KB
ID:	237

Thanks for help. The table I want is like this one. In addition, if the table cannot be dragable and resizable, I just wanna put it on the left side of the screen. How can I do this? I think it's like manually set the position value. Could you please tell me the solution? Thank you.
Reply With Quote
Old 05-07-2008, 09:55 AM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
You can use the setPosition() command on your panel to place it on the left side of the screen. By default the panel is aligned to its upper left corner, so you can place it on the left side of the screen by using the following code:
Reply With Quote
Old 05-08-2008, 06:26 PM
xingxing xingxing is offline
Join Date: Feb 2008
Location: Sydney
Posts: 9
Send a message via MSN to xingxing
Thank you very much. I tried that background attribute and it's ok. The setPosition one which I tried, it's not working. I know I may put it in the wrong position but because the form is using vizdlg. I see that link function and it can only link it to leftcenter of the whole picture. And actually only part of the table can be seen in the screen by that link function. I still cannot put it on the leftupper corner of the screen so that I can see the entire table in the screen. I just put my code here. Could you please tell me where I should put it?
In addition, the textbox is still not transparent though the table background is. Is is possible also make the textbox transparent? Since I tried that background which textbox doesn't have, could you please also tell me how I can do this?

Thank you.

Here is my code.
#######################form starts here
import viz

import vizdlg

class MyForm(vizdlg.Dialog):
	def __init__(self,**kw):
		#Initialize base class

#		#Add row to dialog content section

		#Add a subgroup containing slider/textbox
		group0 = vizdlg.Panel(background=False)

		#Add row for textbox to subgroup
		row = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=6)

		row.addItem(viz.addText('Character No.'))
		self.textbox0 = row.addItem(viz.addTextbox())
		#Add group to dialog content section

		#Add a new subgroup containing other textboxes ( coded by me )
#		group1 = vizdlg.Panel()

		#Add row for textboxes
		row1 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
		self.textbox1 = row1.addItem(viz.addTextbox())
		row2 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
		row2.addItem(viz.addText('Given name'))
		self.textbox2 = row2.addItem(viz.addTextbox())
		row3 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
		self.textbox3 = row3.addItem(viz.addTextbox())
		#Add a new row
		row4 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
		row4.addItem(viz.addText('Date of Birth'))
		self.textbox4 = row4.addItem(viz.addTextbox())
		row5 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
		row5.addItem(viz.addText('Country of Birth'))
		self.textbox5 = row5.addItem(viz.addTextbox())
		row6 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
		row6.addItem(viz.addText('City of Birth'))
		self.textbox6 = row6.addItem(viz.addTextbox())

		#Add group to dialog content section

		#Add a new subgroup containing other textboxes ( coded by me )
		group2 = vizdlg.Panel()

		#Add row for textboxes
		row7 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
		row7.addItem(viz.addText('Passport No.'))
		self.textbox7 = row7.addItem(viz.addTextbox())
		row8 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
		self.textbox8 = row8.addItem(viz.addTextbox())
		row9 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
		row9.addItem(viz.addText('Employment State'))
		self.textbox9 = row9.addItem(viz.addTextbox())
		#Add the row to subgroup

		#Add a new row
		row0 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False)
		row0.addItem(viz.addText('Criminal History'))
		self.checkbox = row0.addItem(viz.addCheckbox())
		#Add the row to subgroup

		#Add group to dialog content section

		#Hide cancel button
		#Rename accept button to 'submit'

import viztask

def FormTask():

	#Create input form
	form = MyForm(title='Personal Details',background=False)
#	form.background.alpha(0.1)
#	form.setPosition(10,500)
	#Link form to center of screen,form)

	while True:
		#Wait for 'p' key to be pressed
		yield viztask.waitKeyDown('p')
		#TODO: Pause simulation
		#Display form
		if form.accepted:
			#User pressed 'Submit', process data
			form_data = open('personal_details_form_'+str(form.textbox0.get()),'w')
			data = 'Character No. : ' + form.textbox0.get() + '\n' + 'Surame : ' + form.textbox1.get() + '\n' + 'Given name : ' + form.textbox2.get() + '\n' + 'Sex : ' + form.textbox3.get() + '\n' + 'Date of Birth : ' + form.textbox4.get() + '\n' + 'Country of Birth : ' + form.textbox5.get() + '\n' + 'City of Birth : ' + form.textbox6.get() + '\n' + 'Passport No. : ' + form.textbox7.get() + '\n' + 'Purpose : ' + form.textbox8.get() + '\n' + 'Employment State : ' + form.textbox9.get() + '\n'
		#TODO: Resume simulation
	#Remove form when completely finished with it
viztask.schedule( FormTask() )

###################form ends here

Last edited by xingxing; 05-08-2008 at 06:35 PM.
Reply With Quote
Old 05-09-2008, 12:21 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
The setPosition is not doing anything because it is being overwritten by the link you created with it. Try the following code to place your form on the left side of the screen.
form = MyForm(title='Personal Details',background=False,align=vizdlg.ALIGN_LEFT_TOP),form,offset=[10,-10,0])
Reply With Quote

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
Read file....many issues Uttama_vizard Vizard 9 07-08-2008 02:16 PM
Mirror issues Frank Verberne Vizard 2 04-08-2008 10:37 AM
avatar head texture issues rconrey Vizard 3 11-17-2004 04:05 PM

All times are GMT -7. The time now is 07:45 AM.

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