Norm Kirchner Posted January 21, 2004 Report Share Posted January 21, 2004 I just realized that it would be very useful to be able to capture the mouse scroll event. Anyone have a good starting point? -Norm Quote Link to comment
Michael Aivaliotis Posted January 23, 2004 Report Share Posted January 23, 2004 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. Quote Link to comment
JackHamilton Posted January 23, 2004 Report Share Posted January 23, 2004 Norm, There is a Mouse Scroll wheel VI on www.labuseful.com. It reports if the mouse is a scroll wheel type and reports the scrolls. Regards Quote Link to comment
Norm Kirchner Posted January 26, 2004 Author Report Share Posted January 26, 2004 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 Quote Link to comment
Khalid Posted June 29, 2004 Report Share Posted June 29, 2004 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 Quote Link to comment
skywalkerxp Posted June 29, 2004 Report Share Posted June 29, 2004 That works! Download File:post-19-1088520083.vi Quote Link to comment
Mike Ashe Posted December 30, 2004 Report Share Posted December 30, 2004 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: Quote Link to comment
Mike Ashe Posted December 7, 2005 Report Share Posted December 7, 2005 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. Quote Link to comment
Khalid Posted December 7, 2005 Report Share Posted December 7, 2005 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 Quote Link to comment
Mike Ashe Posted December 8, 2005 Report Share Posted December 8, 2005 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. Quote Link to comment
Norm Kirchner Posted December 9, 2005 Author Report Share Posted December 9, 2005 Sorry for dying off on this thread. I'll be posting my code for both scrolling on an array AND listbox's Just harass me after the new year when I get my PC back. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.