LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Mouse Wheel Scroll issue

Hi, I want to create simple mouse wheel scroll functionality for array control. I was looking for ready made solutions but the are not working or are just too complex. I'm truly surprised by the fact that this is not built in feature of array controls 😕

 Anyway, I prepared the example where I use "fixed" index for "Index Values" array property. Idealy it would be to read Index Values, increment/decrement it and write Index Values back, but I don't know why Index Values are always 0 inside the event case 😞 I don't know why it is reset each time the event is triggered. What am I doing wrong? How to properly read/write Index Valuse inside the event?

Scroll Zonk.png

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
Message 1 of 5
(3,762 Views)

Hello Michał,

 

I see this behaviour too, but when the scrollbar is invisible, it does as expected. Strange...

Greets, Dave
0 Kudos
Message 2 of 5
(3,718 Views)

When the VI is not running the scroll wheel works as expected on the array. When the VI is running, using the scroll wheel seems to always set the scrollbar to the top (Index Value 0). That seem unexpected, but that is why you read 0 inside the event structure.

As Dave noted, without scrollbar it seems to behave as expected. 

It looks as if setting the IndexVal sets updates the scrollbar visually, but internally the stored position is still 0?

0 Kudos
Message 3 of 5
(3,709 Views)

I'm not seeing the issue in LabVIEW 2014.

 

I think there should be one change made to the VI.  Because of the way the index value and shift register are a U32, you are running into a roll over  (or roll under?) situation when you are at 0.  When you subtract 1, ideally it would go to -1 and then be coerced to 0.  But the U32 rolls under and jumps back to ~4 billion, which is then coerced to 4billion.  Your index value indicator shows up as a really large number, but the actual control stays at 0.  I would change that shift register and constants to an I32 so 0 minus 1 can become -1, then get coerced back to 0.  That or add special code so that if the shift register is already 0, you cannot subtract 1 from it.

 

Also, if you happen to manually type in a value to the index display, but then scroll, it will jump to another index based on the value in the index register, not what the current value of the array index is now.

 

0 Kudos
Message 4 of 5
(3,696 Views)

I know this thread is super old, but I just ran into this same issue and wanted to document the workaround somewhere. You have to disable the built-in mouse wheel support in the front panel array's properties. If you don't disable it, every time you try to scroll it'll reset the array index to 0 for some reason. I wrote something similar, I've attached the code below.

Download All
Message 5 of 5
(3,348 Views)