Jump to content

Mouse Wheel Scroll Event


Recommended Posts

Posted

If you look at the advanced pallete in LV7 you will see the input device control subpallete. There is a VI that returns the scroll position.

I tried running this but could not get it to work. If we could get this to run I think we would be on our way to solve the problem of trapping the scroll button.

Posted

After sending the initial post I had some inspiration. I remembered the "User Input" set of VI's in LV7 and proceeded to do some creative work. I must have had more luck than Mike apparently because I came up with a very elegant solution. Unfortunately I can not post the code here, but I will attach an image of how I am implementing it, which might spark your creativity.

The long and the short of the functionality is I can now drop 1 VI into my program (external to any loop), Wire the reference to the array to be scrolled and another reference to a boolean that will signal the stop of the program (non latching). Once this is done, as shown in the photo, I have a front panel array which I can scroll with my mouse.

:thumbup:

-Norman J. Kirchner Jr.

Engineering Specialsits, Inc.

www.engspec.com

post-19-1075132090.jpg?width=400

  • 5 months later...
Posted

I am attaching a 7.0 VI which uses the mouse scroll-wheel to scroll through the listbox control. It scrolls the listbox contents only when the mouse is over the listbox, as expected. As it stands, this is a very specific example. When time permits I (or y'all) can make this more general to scroll through other similar controls.

The working principle in brief:

-check if mouse is over the listbox using the 'Mouse Enter' event,

-check scrolling, and direction,

-depending on the direction, update listbox (within the valid range),

-stop scrolling when mouse is moved away ('Mouse Leave' event).

Notifiers are used in a master-slave pattern to manage the events. And note that the VI's window-scrolling is disabled.

Hope this helps.

Regards,

Khalid Ansari

Download File:post-19-1088490696.vi

  • 6 months later...
Posted
I am attaching a 7.0 VI which uses the mouse scroll-wheel to scroll through the listbox control.  ..snip...  When time permits I (or y'all) can make this more general to scroll through other similar controls. 

1061[/snapback]

The generalized version would be very useful, especially if we could "register" a control reference with it and thereafter whenever the mouse was over that control we would get the scrolling effect.

I noted one funny behavior. If you move the mouse out of the listbox, scroll (the listbox does not move, good) and then move the mouse back into the listbox, you immediately get a scroll of one. It would be good if you flushed the previous scroll count when the mouse over event is detected for the control.

Looking forward to that generic version. :worship:

  • 11 months later...
Posted

Not a lot of activity on this thread for a while, but I note that the 12/07/05 digest of Info-LabVIEW has a thread going for scrolling trees and other controls. Just in time for me too, as I have a new need for this functionality.

Posted

Hi Michael,

With LabVIEW 8.0 supporting the mouse wheel for such controls, I guess there's not much point in us developing any tools for this anymore.

Regards,

-Khalid

Posted

Yes, for LabVIEW 8. I expect to be doing occasional work for clients who are sticking with 7.x or earlier for some time in the future. Nice to have backwards functionality, even if you have to substitute a work around for newer built ins.

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.