01-27-2009 03:30 PM
I have a feeling the answer is going to be it's not possible, but is there a way to have different sized text in the same column/row label? What I would like to do is have upto three lines of text, where the first line is bigger than the other two.... Perhaps some escape sequence in the text string.. something like:
SetTableRowAttribute (handle, control, 1, ATTR_LABEL_TEXT, "<\big>Line1\n<\little>Line2\n<\little>Line3");
Solved! Go to Solution.
01-28-2009 04:12 AM
Will your table be scrollable? If it is fixed, one approach might be to overlay Text Messages (with your larger text font setting) onto the Table control, positioned so they are just above the normal row/column labels that contain the standard font. Obviously, a non-starter if you need to scroll...
JR
01-28-2009 10:55 AM
Hi gtoph,
Unfortunately, there's no way to have different fonts in a single table cell.
JR's suggestion is a good one. I'll add my own, in case you do need to scroll the table, but you don't need to edit the text:
You can create and configure a control offscreen that has the look that you want (see attachment), then dump the control into an image using GetCtrlDisplayBitmap, set the cell type in your table to VAL_CELL_PICTURE, and then put your bitmap in the cell.
But of course, this will only work if you only need to display the text, and not edit it.
Luis
01-28-2009 11:42 AM
Actually I need to do this for the row label, not an actual cell. But I suppose the same principle could work if I just overlay the image/textbox ontop of the table. JR's idear might work as well... I was hoping it was going to be simple, so I'll have to see if they really want to do to the trouble of doing it. 🙂
01-29-2009 02:14 AM - edited 01-29-2009 02:14 AM
Another option I have used sometimes is to use a customized table to write column headers, placing it immediately above the data table; this option permits you also run-time customizations of the headers. Here a sample of what I mean:
12-02-2016 05:28 PM
Hi All,
I am a new bee here and found lot of solutions to the unknown things in Labwindows through this forum. Thank you all...:)
Recently, I have a requirement to Apply font changes using format specifiers in Popup box (Example: ConfirmPopup) of Labwindows as follows.
Popup Box======================
Line 1 : text Font is BOLD.
Line 2 : text Font color is Green.
Line 3 : text Font is normal.
Popup Box======================
My function looks like this..
void test_formatSpecifiers(void)
{
char buffer[1024];
sprintf (buffer, "\e[1m
Line 1 : Bold Line \n");sprintf (
buffer+strlen(buffer),
"\033[32;1m Line 2 : Green Line \033[0m\n");
sprintf (buffer
+strlen(buffer)
,
"\e[0m
Line 3 : Normal(UnBold) Line \n");
int res = ConfirmPopup("Testing Font - Format Specifiers", buffer);
}
I used the following weblinks to see more about format font specifiers.
https://gist.github.com/Sidnicious/2396238
http://stackoverflow.com/questions/29997096/bold-output-in-c
http://stackoverflow.com/questions/1961209/making-some-text-in-printf-appear-in-green-and-red
I tried this way to set the format specifiers to a Popup. But not working. Attaching the results and the sample project.
Even though these weblinks are for printing to console,please let me know whether there is a
way to get format font specifiers working in Popup Messages.
Any help here is appreciated.
Thanks,
Kiran
12-05-2016 01:59 AM
Hello Kiran,
I don't know of any way you can apply font attributes to text in a popup message; when I had to prompt messages with special formatting I resolved to use a regular CVI panel displayed with InstallPopup and wait for the user response before proceeding.
Having said this, please in the future try not to hijack existing discussions with unrelated questions, especially if like in this case they are several years old. You will get more visibility by creating a new discussion instead.
12-06-2016 11:48 PM - edited 12-06-2016 11:49 PM
Hi RoberoBozzolo,
Thanks for the help and I also do agree to post new threads in future.
I have just added as it is a Font related discussion and to get a quick and best solution as i did.:)
Thanks,
Kiran