LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

autoscroll jerky

Could someone please tell me what is wrong with my autoscroll code?  This code is based off one of the example posted here on NI website.  Not sure what is wrong with it but if you scroll toward the bottom of the page you'll notice it's bouncing up and down.  Another problem is if you hold down the scroll and drag, it's very jerky. Is there any way to smoothen this problem?
0 Kudos
Message 1 of 7
(3,052 Views)
FYI: This file was saved as v8.0.
0 Kudos
Message 2 of 7
(3,051 Views)

With respect to the individual behaviors:

 


lavalava wrote:
but if you scroll toward the bottom of the page you'll notice it's bouncing up and down. 

 

This is happening because at the end you're trying to set the scroll position beyond the last scroll position. When your loop comes around again it sets the scroll position back to the end, which causes the jerkiness. 

 


Another problem is if you hold down the scroll and drag, it's very jerky. Is there any way to smoothen this problem?

 

This is caused by the fact that you are trying to update the scroll position even though nothing is happening. When a user drags the scroll bar they're not using the scroll wheel, but you're constantly setting the scroll position programmatically, so your program is fighting what the user is trying to do. 

 

Other comments:

 

  • You have a greedy loop
  • What is the point of the shift register?
Message 3 of 7
(3,022 Views)


you can just ignore the shift register, you're right it can be done without.   I got this example off this site and they had it so...

 

how do I check when it gets to the last line?

 

 

0 Kudos
Message 4 of 7
(3,009 Views)

Perhaps it was a wiring translation error. Where is the original example? If anything, you should be casing out the update of the scroll position so that it only happens if the "Scrolling" value is non-zero. That would remove the "jerkyness" when the user uses the scroll thumb.

 

As for the number of lines, that's dependent on the size of the control, the font that you're using, and the amount of text that you have in the control, so it's something that you would need to calculate on your own. And no, I'm not aware of any sample code that does this, but that doesn't mean it doesn't exist. Try a search - it might turn something up. 

0 Kudos
Message 5 of 7
(2,998 Views)

I downloaded this example off sine.ni.com, sorry I couldn't find the link.  It was downloaded a while back and it's something I have been using until today my users expressed unhappiness

 

I'm not sure if I can cast out for non-zero value because the scroll number is either +/-, + is to go up and - is go down.  Try running it and put a probe on the scoll number line you'll see (the brown line).  Any other idea? 


Message Edited by lavalava on 11-10-2008 03:21 PM
0 Kudos
Message 6 of 7
(2,994 Views)

lavalava wrote:

I'm not sure if I can cast out for non-zero value because the scroll number is either +/-, + is to go up and - is go down.  Try running it and put a probe on the scoll number line you'll see (the brown line).  Any other idea?


Why not?

 

 

Message Edited by smercurio_fc on 11-10-2008 03:41 PM
0 Kudos
Message 7 of 7
(2,984 Views)