UI Interest Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Way to have multiple text lines on Tab control page name

Hello,

Is there a solution to have on a Tab control, a page name which can accept multiple lines (like Cariage Return) ?

In my Tab control I have some big images & text, but the most your text is long, the most the page increases. It would be nice to minimize the size of the page (and Tab control) to have multiple lines (more edition options).

Tab Control with Image-Text.png

Anybody have an idea / solution ?

Best regards

Fred

Message 1 of 7
(10,340 Views)

You can't have tab page labels that contain carriage returns, any attempt to introduce one has it sanitized into a space character.
Therefore, you can't do this with traditional LabVIEW tools.

Suggestions:

  • Only show an image, and embed the text into the image
  • Set the tabs to Fixed Size, use images for the icon glyph and place classic simple string control over the the remaining tab area to host the tab label text. You'll need to programmatically handle the mouse click on the string control to change the selected tab page.
Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 2 of 7
(4,896 Views)

That's a nice Tab control.  Was it done using LabVIEW?  If so, how?

Thanks.

0 Kudos
Message 3 of 7
(4,896 Views)

Thanks for the quick response.

  • The "problem" with your first suggestion it that you loose the transparency of the image if you modify it.

  • For your second suggestion, did you mean somthing like that ?

Indicate wich Tab Page is Selected_v1.png

          This solution works good, and I will look to introduce it in my main VI. I've added a page named 0 to have only the string indicator on a specific page.

Thanks for the answer and tips..

Best regards

Fred

0 Kudos
Message 4 of 7
(4,896 Views)

Hello,

Yes that's a full LabVIEW Tab contol ..

You can do this by selecting : Menu-Edit-Import Picture to Clipboard (from your image directory), and then :

Add image to page.png

This way is similar to other control (for customisation). I recommand to you this page, where you can download (openiconslibrary, see link) many icons for your UI.

Other UI tips & triks are provided here.

I hope it will help, and I wish you magical Tab controls..

Best regards

Fred

Message 5 of 7
(4,896 Views)

Fred_A wrote:

  • The "problem" with your first suggestion it that you loose the transparency of the image if you modify it.

You only lose transparency if you use an image editor that does not support it or save to an image format that does not support it.

You can use the free Paint.Net editor to make PNG files and import them into LabVIEW with transparency. Just make sure you use the Import menu options because copy/paste from the System clipboard into LabVIEW will lose transparency.


Christina Rogers
Principal Product Owner, LabVIEW R&D
Message 6 of 7
(4,896 Views)

Your implementation isn't quite what I had in mind, but if it works for you then that's cool.

I meant to place the string control (borderless/transparent) in the space alongside each tab image. It would be floating above the tab, not a part of the tab, and each string would contain the text equivalent such as "Configuration", "Sequence", "Acquisition" etc. As it is a standard LabVIEW string it can contain text on more than one line:

tab_with_multiline_text_labels.png

(sorry it's not a snippet but the snippet tool seems to be losing the contained text in the string indicators?)

Brief description of code:

  • Use a single Event Case looking for Mouse Down on all four string indicators.
  • Ensure the nth character (here the 7th) is a numeric that represents the tab page it floats above.
  • Parse the numeric from the string control label text property, decrement one and use it to change the selected tab page.

The only downside is the string control isn't shifted in position when the tab page is selected. Consequently it doesn't look entirely 'attached' (which of course it isn't). This can be overcome by playing with the string control position properties for each selected/deselected tab page. A bit more effort, but if you want that polished look then it would be worth it.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 7 of 7
(4,896 Views)