06-30-2010 03:20 PM
A version of solution is to only scroll to the end if you're already at the end.
You can get the current scroll position, scroll to infinity, check scroll pos and compare to see if you were at the end (slightly messy, but it's a solution).
If you were, scroll to infinity again after adding the new text, else scroll back. ^^
/Y
06-30-2010 03:55 PM
Darren, I've always fixed this issue by "snapping" the scroll bar to the bottom if the user moves the scroll position from earlier in the buffer to within one screen's worth of the bottom. My logic is to turn off the auto-scrolling once the user moves the bar and keep position off until the user brings the bar within X number of lines of the bottom. This is trivial to do with listboxes, more difficult with string controls (but still doable, of course).
06-30-2010 07:01 PM
I wondered if my excitement over my solution was a little premature. Oh well - at least I got to play with LabVIEW for a little while today. 😃
07-01-2010 12:19 PM
Here's your max scroll position (scripting required):
07-06-2010 08:37 AM
A version of solution is to only scroll to the end if you're already at the end.
You can get the current scroll position, scroll to infinity, check scroll pos and compare to see if you were at the end (slightly messy, but it's a solution).
If you were, scroll to infinity again after adding the new text, else scroll back. ^^
/Y
This is what I do and it works pretty well. The only issue is that you can sometimes see the text box changing positions to do this test. It looks like the text box is flickering. You can defer panel updates to prevent this from happening (I don't know if you can defer updates to a specific control). So defer panel updates, do the comparison, set your position, and then re-enable panel updates.
07-06-2010 08:44 AM
@mike_nrao wrote:
Here's your max scroll position (scripting required):
If you would use "quotient and remainder" instead of "divide", you would not need to go "orange" for part of the code and would lose the red dots as a bonus. 😉 (add a +1 or something slightly more fancy if you are worried about truncation)
07-07-2010 08:18 AM
That's a great Nugget Darren!
I used to get the string length and use that value for the scroll position. I never thought of using infinity!
Now why is this not a standard option for LabVIEW? You should be able to right-click and select "Scroll to Bottom" or similar wording. After all, most of the time we are interested at the latest text and want to read along as new text is refreshed into the display.
Was this idea already proposed? I should check.
RayR
07-07-2010 09:54 AM
@Ray.R wrote:
After all, most of the time we are interested at the latest text and want to read along as new text is refreshed into the display.
An alternative I typically use is to append the new line (log, etc) to the beginning of the string and keep the indicator as-is, scrolled to the origin. Now the newest data is always on top and the older data scrolls off the bottom of the indicator. No property nodes needed. 😄
07-07-2010 01:33 PM
That won't work well (scroll at top) if you are looking at the entire (multipage) log text and the text is received over a serial port. 🙂
03-07-2011 02:17 PM
Yes I know, I am very late with a reaction.
Strange that those little things you use for a long time is not known (at least not in this thread) by others.
I always use a -1 as a input for the scrollpos to get me to the latest position.
You also get the coercion dot here because the input is U32