Jump to content

Tab Sizing <> Controls size with tab


Recommended Posts

*Disclaimer* So far from a full implementation, but I wanted to get this into the wild to let you all have fun with it.

I ran into a situation that pissed me off recently.

I had a tab control that had a different graph on each tab. This tab was in a pane that I wanted to be re-size-able.

Since LabVIEW does such a shitty job at helping us with this, I made a 'Brat VI' to help me with the process.

Attached you will find the Brat and a piece of demo code.

Basic assumption and requirements

*Tab is not set to auto-grow (I don't handle shrinking tab and auto grown will cause tab to not maintain size w/ pane)

*Tab is set to size with pane

* Types of controls that are resized are currently limited, string, graphs, sub-panels, decorations, boolean (because I use the 'Many Cast' design pattern, adding more is not a difficult task)

* Because this maintained sizing will only work while the VI is running, the Brat is bi-modal in a "Use cached Margins" or "use Saved margins" mode (see video for rational)

============

Basic operation and program flow ---> http://screencast.com/t/jqxWeqwxHcY

Beyond getting started & caveats ---> http://screencast.com/t/iCDdQgPhJuDs

How it would look & more features ---> http://screencast.com/t/S7Pm47JiD

More features and use cases ---> http://screencast.com/t/W4uhAQY4HpbE

How to start from scratch ---> http://screencast.com/t/JVOrc503

Tab Resize Tool (2).zip

============

Comments and ideas are welcome (but only if they come w/ good suggestions as well)

~The Captain Was Here

PS ManyCast Design Pattern (used within) http://lavag.org/top...sts/#entry77999

Link to comment

Comments and ideas are welcome (but only if they come w/ good suggestions as well)

Well, we discussed it here in the past, although I have to admit I never had the need to use something exactly like this in a production app, so all the stuff there is just quick and dirty experiments.

I haven't looked at the entire discussion there now, but if memory serves, the two interesting points you can find there are the basic difference in calculation (it was the ratio of the control relative to the panel as opposed to constant margins, although I'm not sure what the implications of each are) and that there is an example of a generic (but undocumented) resizing method (which is probably the same code LV uses when the user manually resizes a control).

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.