Jump to content

Mouse Wheel Scroll Event


Recommended Posts

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

Link to comment
  • 5 months later...

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

Link to comment
  • 6 months later...
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:

Link to comment
  • 11 months later...

Join the conversation

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

Guest
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.