WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-15-2016, 01:27 PM
Eugene Eugene is offline
Member
 
Join Date: Jun 2016
Posts: 6
Drag and drop Panels

Hi Jeff,

I've created a few panels and would like to allow the user to relocate the panel using the mouse. Similar to moving a window. May I know how can I do that in vizard?

Thanks.

Eugene
Reply With Quote
  #2  
Old 09-16-2016, 04:41 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Are you referring to a vizinfo panel? There is no built-in way to do this. I'm not sure if the viz.pick command will work with objects added to viz.ORTHO, like the panel. I'll check and update here if there is a way. It maybe necessary to calculate if a mouse click is within a panel's bounds. You could try the following:

1) Calculate the panel bounds using the node.getBoundingBox method.
2) Handle the mouse down event and determine if the mouse position is inside the panel bounds.
3) Enable an update function that sets the panel position every frame based on the mouse position. The panel position takes screen coordinates and you can get the mouse position in screen coordinates.
4) Disable the update function when the mouse up event occurs.
Reply With Quote
  #3  
Old 09-16-2016, 07:58 AM
Eugene Eugene is offline
Member
 
Join Date: Jun 2016
Posts: 6
Hi Jeff,

I'm using the vizdlg.panel() and vizdlg.TabPanel(). Would it be different?

Eugene
Reply With Quote
  #4  
Old 09-20-2016, 06:45 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
No, you would have to follow the same steps.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag and drop amith Vizard 1 01-04-2012 04:30 PM
use wii to drag and drop objects in vizard amith Vizard 0 12-29-2011 07:50 AM


All times are GMT -7. The time now is 03:16 AM.


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