LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Different font size on multiline table label

Solved!
Go to solution

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");

 

0 Kudos
Message 1 of 8
(4,656 Views)

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

0 Kudos
Message 2 of 8
(4,643 Views)
Solution
Accepted by gtoph

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

0 Kudos
Message 3 of 8
(4,633 Views)

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

 

 

0 Kudos
Message 4 of 8
(4,624 Views)

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:

 

 

Message Edited by Roberto Bozzolo on 01-29-2009 09:14 AM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 8
(4,607 Views)

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

Download All
0 Kudos
Message 6 of 8
(3,493 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 7 of 8
(3,475 Views)

Hi RoberoBozzolo,

 

Thanks for the help and I also do agree to post new threads in future.Smiley Happy

I have just added as it is a Font related discussion and to get a quick and best solution as i did.:)

 

Thanks,

Kiran

 

 

 

 

 

 

 

 

0 Kudos
Message 8 of 8
(3,451 Views)