WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-17-2010, 03:43 AM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
Texbox deselecting

Hi All,

Im using a couple of textboxes in my code. The problem is that if you have one textbox selected you have to double click on another textbox/button to selected/press it. The first click deselecting the first textbox.

The people in my office are finding it really anoying, is there anything that i can do to change this. I am putting in some sort of tab ordering, but they want to single click between textboxes and buttons.

Any help would be good.

Thanks
Reply With Quote
  #2  
Old 08-18-2010, 12:28 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
When a textbox loses focus you could check to see if the mouse is over another textbox and make it active:
Code:
import viz
import vizdlg

viz.go()

panel = vizdlg.Panel(align=vizdlg.ALIGN_CENTER)

panel.addItem(viz.addText('Textbox1'))
textbox1 = panel.addItem(viz.addTextbox())

panel.addItem(viz.addText('Textbox2'))
textbox2 = panel.addItem(viz.addTextbox())

viz.link(viz.CenterCenter,panel)


def updateFocus():
	object = viz.pick(0,viz.SCREEN)
	if object == textbox1:
		textbox1.setFocus(viz.ON)
	elif object == textbox2:
		textbox2.setFocus(viz.ON)
		
vizact.onbuttonup(textbox1,updateFocus)
vizact.onbuttonup(textbox2,updateFocus)
Reply With Quote
  #3  
Old 08-18-2010, 04:23 PM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
Hi Jeff,

Ill try that first thing in the morning.

Thanks
Reply With Quote
  #4  
Old 08-26-2011, 02:02 PM
rage1 rage1 is offline
Member
 
Join Date: Aug 2011
Location: Switzerland
Posts: 2
textbox deselecting and radiobuttons

I'm creating a GUI and I had the same problem. Your approach worked quite well for the textboxes, but what do I have to do with radiobuttons after the textboxes?
Between the textboxes and the buttons is an invisible radiobutton, so none of them is selected. Could you give me a hint how to solve that case? Couldn't find a workaround yet..

Thanks, Rachel
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


All times are GMT -7. The time now is 08:07 PM.


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