Jump to content

How to generate cursor drag event


Recommended Posts

I have a 3d plot with a cursor in it.

Depending on the cursor's x-position I want a certain calculation to be performed.

I already have an event structure to handle other controls on the front panel and now I want to have an event,

which is trigger when the cursor in the 3d graph is dragged/dropped. However I don't know how to make this.

Does anyone know how to do this?

thanks.

Link to comment
  • 2 weeks later...

I have a 3d plot with a cursor in it.

Depending on the cursor's x-position I want a certain calculation to be performed.

I already have an event structure to handle other controls on the front panel and now I want to have an event,

which is trigger when the cursor in the 3d graph is dragged/dropped. However I don't know how to make this.

Does anyone know how to do this?

thanks.

only x-position or also y-position?

Can you post an example of calculation?

ninou

Edited by Ninou
Link to comment

only x-position or also y-position?

Can you post an example of calculation?

ninou

Hi Ninou,

The calculation doesn't really matter.

Lets say I have an indicator on my frontpanel which displays the value of the x-position of the cursor.

The value of the indicator must be updated each time the cursors x-position changes.

This is just an illustrative scenario but the updating of the indicator must be done in an event-structure and not in a while loop.

here are the frontpanel and diagram:

diagram.jpg

frontpanel.jpg

Edited by wallage
Link to comment

I have temporarily solved the afore mentioned problem by adding a timeout trigger to the event structure.

The is fine as long as the 3d graph is not to complicated.

However if the graph is getting more complicated drawing the graph every time the timeout counter expires will be a great load on the CPU.

This was why I was looking for a better solution then using the timeout in the first place.

Link to comment

Hi Wallage,

you could use the "Mouse Up" event for the 3D Graph.

However, when I tested it with LV2009, it worked only with the Right-Click or Center-Click mouse button. The left button "Mouse Up" event doesn't get fired.

The Left-Click works only with the new OOP 3D Graph... if you've got LV2009.

<object id="scPlayer" width="756" height="524"> <param name="movie" value="http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/jingswfplayer.swf"></param>'>http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/jingswfplayer.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/FirstFrame.jpg&containerwidth=756&containerheight=524&content=http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/LeftClick.swf"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/"></param>'>http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/"></param> <embed src="http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/jingswfplayer.swf" quality="high" bgcolor="#FFFFFF" width="756" height="524" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/FirstFrame.jpg&containerwidth=756&containerheight=524&content=http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/LeftClick.swf" allowFullScreen="true" base="http://content.screencast.com/users/normandinf/folders/Jing/media/8ef0769a-5721-413b-848a-109c51b0f733/" scale="showall"></embed> </object>

Link to comment

Hi francois,

Thanks for you reply.

I have tried your suggestion but my program hangs up because the "mouse up" event is not handled in my other event structure.

Even when I add a new case which does handle a "mouse up" event.

Could this be because the "mouse up" event is also triggered when I press (and release) a button on the frontpanel?

The "change value" event for that button is triggered as well as the "mouse up" event.

2 events at the same time mich cause a hang up of the program?

best regards,

arjen

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.