LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 06/28/2010

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 11 of 23
(2,907 Views)

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

0 Kudos
Message 12 of 23
(2,896 Views)

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

-Randy
-=--=-=-=-=-=-=-
Nothing like a good dose of LabVIEW to cure what ails ya'.
0 Kudos
Message 13 of 23
(2,879 Views)

Here's your max scroll position (scripting required):

17983iC3E60C08F1C51F0A

Message 14 of 23
(2,829 Views)


Yamaeda wrote:

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.

0 Kudos
Message 15 of 23
(2,750 Views)

 


@mike_nrao wrote:

Here's your max scroll position (scripting required):

17983iC3E60C08F1C51F0A


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)

 

0 Kudos
Message 16 of 23
(2,750 Views)

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

 

0 Kudos
Message 17 of 23
(2,696 Views)

 


@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. 😄

 

Message 18 of 23
(2,673 Views)

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

0 Kudos
Message 19 of 23
(2,649 Views)

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

 

Message 20 of 23
(2,292 Views)