LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does a Text Box not respond properly to a tab char?

In CVI 7.1, a Text Boxe does not appear to respond properly when sent a tab char. It displays a little box (unknown character). If operated from the keyboard, a text box moves 4 columns when ctrl-tab is entered. This is not exactly like having tab stops, but better than displaying an unknown char symbol.

I need to display tab delimited data ascii files in text boxes.

Is this a bug in the text box control, or is this a request for new capability? Does this need to be fixed and an update sent out?
0 Kudos
Message 1 of 12
(7,016 Views)
Hi,

I just tried this out on my machine and also could not see the tab spacing in the textbox. I also did not see the funny rectangular character you reported. If you can send me a small sample application, I'm planning on making a report of this to our developers and for them to see a sample of your code. Thanks!
Jeremy L.
National Instruments
0 Kudos
Message 2 of 12
(6,986 Views)
While it would be nice to get this fixed, I implemented a workaround, by brute force scanning all these tab delimited strings into a bunch of string variables, one line at a time, then concatenating them into a string with fixed width fields for each, then writing the new string to the textbox.

Apparently the reason I saw little boxes, was that I had set the Text Box font to Courier, as a fixed width font. Thinking about it, earlier when it had the default metafont selected, there were no little boxes representing the tab, just blanks.

Anyway, it would be nice if a Text Box had tab stops, and properly responded to a tab character in a string written to it.
0 Kudos
Message 3 of 12
(6,984 Views)
Okay, that explains why I couldn't see it. I will go ahead and make a report of this to our developers. In the meantime, that's probably the only feasible workaround. If I find another way, I'll be sure to post it as a knowledgebase. Thanks for your input, and my apologies for the inconvenience.
Jeremy L.
National Instruments
0 Kudos
Message 4 of 12
(6,972 Views)
Just to mention it, this problem has been around at least from CVI 7.0.
0 Kudos
Message 5 of 12
(6,910 Views)
Variations of this problem have been around since Moses, or at least since 3.x.x I have never been able to simply write a string containing tabs to a textBox and have it format correctly. I have had to replace tabs (as Jeremy L. said) with embedded spaces.
0 Kudos
Message 6 of 12
(6,860 Views)
Ryykker,

Thanks for the info. Yes, that is what I ended up doing, parsing the string, placing space chars in the right places. Not elegant, but it works.
0 Kudos
Message 7 of 12
(6,856 Views)
you say it - I've also been working around this since the 3.x days,
using my own formatting functions to create lines which would look reasonable in text-boxes.
anyways, it would be much better if text boxes had a convenient tab-handling.
so I'll vote for an improvement, too 🙂
--
Once the game is over, the king and the pawn go back into the same box.
0 Kudos
Message 8 of 12
(6,841 Views)
Hello,
 
why does the TextBox in CVI8.1 doesnt show a rectangle box or any other character?
The tab character will not be displayed. sprintf(x, "Mean\t\n\0")
 
 
Grüsse aus Deutschland

(GMT +01:00)
0 Kudos
Message 9 of 12
(6,461 Views)
Hi Dubin,

The reason that the tab character isn't showing up is because the TextBox in CVI does not have proper support for tab characters (\t).  You will usually see either a blank space or a rectangle depending on the character set used by your current font, but it will not insert a tab.  The only way to do this is to use space characters to simulate the tab as other people on this forum mentioned.  This has been filed to R&D, and we are looking at implementing this in future versions of CVI.
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 10 of 12
(6,434 Views)