decyL Posted December 19, 2005 Report Share Posted December 19, 2005 Hello. I'd like to use error (source,code,boolean) control as a GUI. I mean to use 'source' window to write test results to it. What I want to do is to create such VI that can write results line by line, and when the window is full to autoscroll the bar. I've tried to use property node for 'source' and text.scrollpos element, but it doesn;t work. Quote Link to comment
WMassey Posted December 20, 2005 Report Share Posted December 20, 2005 Hello. I'd like to use error (source,code,boolean) control as a GUI. I mean to use 'source' window to write test results to it. What I want to do is to create such VI that can write results line by line, and when the window is full to autoscroll the bar. I've tried to use property node for 'source' and text.scrollpos element, but it doesn;t work. It works for me. Download File:post-2800-1135038586.vi Quote Link to comment
decyL Posted December 20, 2005 Author Report Share Posted December 20, 2005 Ok. So this is only for scrolling. Could you tell me how to make the cursor to write one line under another? I've attached vi in which I tried to do this Download File:post-2956-1135082322.vi Quote Link to comment
WMassey Posted December 20, 2005 Report Share Posted December 20, 2005 Ok. So this is only for scrolling. Could you tell me how to make the cursor to write one line under another?I've attached vi in which I tried to do this You need to realize that each time your VI loops it replaces the text in the "Value" of the "source" so that at any time there is only the one number (using at most 2 ASCII characters) present. With only that one small bit of text in the text indicator, the text string is not long enough to wrap around enough to force the text box scrolling on and certainly not enough to cause there to be 29 or 30 lines of wrapped text as your example would seem to want As you probably suspect now, scroll position is not the same as cursor position. There is no cursor position control available to do what you want. The scroll control will only work if there are enough lines in the display to enable scrolling and even then you can only scroll down as far as there are lines available. Depending on word wrap to get you the number of lines that you want is a bad idea - where and when the wraps occur depend on the text indicator size and the font size - a real house of cards. :thumbdown: There are other characters you can insert into text strings that do break them into multiple lines such as your carriage return or line feed (a.k.a. new line) or the generic end-of-line character. Use one of them at the end of each line of text and build up an ever-increasing length of text and you'll end up with multiple lines and eventually the ability to set the scroll position Note however that if your text indicator is tall enough to hold, for example say 3 lines of text without scrolling, that you will not get a scroll bar and be able to set a scroll position until you get four lines of text. And, in this case, when you do get 4 lines of text you will only be able to select either scroll position #1 or position #0. When you add a 5th line of text then you'll then get the additional option of scroll position #2, a 6th line of text will give an additional scroll position #3 and so forth. If someone comes along and resizes your text box vertically so that it'll hold more or fewer lines of text then all these numbers will change. (It's beginning to look like that "house of cards" again if a change to the size of a front-panel object causes a change in the way that the code behaves.) If your only intent is to always have the last line of text showing then this won't matter; just wire a number equal to or greater than the number of lines in the display to the scroll position and the last line will always be displayed. See example. Download File:post-2800-1135094308.vi Quote Link to comment
decyL Posted December 21, 2005 Author Report Share Posted December 21, 2005 Ok. I see. Thanks for your input. Take care. 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.