UI Interest Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Fit Tab Control and Content to Pane

Hi Experts!

I've been wondering about how to do combine the "fit control to pane" tab control property and the tab control content. Most of my project based on subpanel rather than using tab controls, because positioning the Tab controls content at every panel resize event, is not a good and elegant solution.

Is there any workaround here?

BTW, this community is far the best!

Thank you guys for your good work and thaks for sharing it!

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 1 of 17
(18,028 Views)

See this Demo of dynamic tabs (reorder, detach…) as in modern  web browser

This is not really a workaround, just a demo how we have solves the problem with tabs and resizing "issue". Each tab is a subpanel so resizing is easy to manage.

Olivier

Message was edited by: Olivier Jourdan

Olivier Jourdan

Wovalab founder | DQMH Consortium board member | LinkedIn |

Stop writing your LabVIEW code documentation, use Antidoc
0 Kudos
Message 2 of 17
(4,260 Views)

This is a shortcoming yes. I've suggested a change here: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Fit-to-pane-Fit-to-tab/idi-p/932452

There is a workaround though:

I use two tab controls and splitters to achieve scalability for each page.

The tab controls have the same pages, but one is put in a pane where only its tabs are visible and its change events are transfered to the other tab control which is in a pane below and which does not show its tabs at all, but is set to fit to pane.

The content on the lower tab can then also be set to "fit to pane" and this will make them scale to the whole pane and cover the tab page, but you still have the tab functionality. If you set the border of the splitters OK and align the top path nicely so that its page edge is aligned with the splitter border things will look quite nice.

Here's a commented screen capture of one such app:

fit2panetab.PNG

Message 3 of 17
(4,260 Views)

Nice workaroud! That would be useful! Thaks!

Anyway is your app. based on STM? 

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 4 of 17
(4,260 Views)

Hello Mads, this is an excellent workarround (easier than mine).

As far as I understand, you are always limited to one object by tab. To be even more scalable, it should be interesting to replace the second tab (where the content is displayed) by a subpanel and insert dynamic VI following the selected tab.

Pro : you can insert splitter in your tab

Cons : it's a bit more complecated to develope

Olivier Jourdan

Wovalab founder | DQMH Consortium board member | LinkedIn |

Stop writing your LabVIEW code documentation, use Antidoc
0 Kudos
Message 5 of 17
(4,260 Views)

Thanks.

STM? No. It is based on a TCP/IP based client-server architecture we have made in-house.

0 Kudos
Message 6 of 17
(4,260 Views)

Few weeks ago, I had to develop a tcp/ip server - client app. Before that, I had no expericence about TCP/IP - LV programming. An NI Engineer suggested me the following links:

http://zone.ni.com/devzone/cda/tut/p/id/4095

http://zone.ni.com/devzone/cda/epd/p/id/2739

This is a very useful toolkit for TCP/IP. Take a look at!

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 7 of 17
(4,260 Views)

You are not limited to one object per tab, but it gets cumbersome if you want more than one of the objects on the page to scale (having buttons etc. together with a single plot (which is the scaling object) e.g is fine.

I've done other apps where I've used subpanels on the second tab. It is a bit more work due to the communication you then typically need to have between the top level VI and the subpanel VIs - so it would definitely be nicer to have better scaling options available instead...(anchoring?), but it does make it possible to produce nice GUIs.

0 Kudos
Message 8 of 17
(4,263 Views)

In the past, I have used an Xcontrol to hold multiple controls / splitters - then, used the single xcontrol on the tab. That way, I get the single object, nice scaling, whist having the ability to add fine grain control over which objects scale, which stay the same side, which stick to the top/left/right/bottom etc. It worked very well although takes a bit of effort as you need to make sure you expose enough events / properties / methods to make your xcontrol work for all the functions of the individual controls (my approach was for the xcontrol to generate a user event each time something happened so that the host app's event structure could handle them appropriately). Unfortunately I no longer have access to the source code for that project (as I now work for a different employer).

0 Kudos
Message 9 of 17
(4,263 Views)

One important detail when you are setting controls to be scaled/fit to pane on multiple pages of a tab control; you have to finish the settings on each page without ever scaling the pane(!).

If you go to one page, set a control there to scale/fit to pane, then test it before you go to another page and do the same - the previous controls will have lost their scale setting. I do not know if this is a bug, or if it is the other way around; that it is a bug that makes it possible to set multiple controls on different pages to scale. It is kind of strange.

0 Kudos
Message 10 of 17
(4,263 Views)