Jump to content

Run-time resizing of VI


Recommended Posts

I'm trying to resize a Waveform Graph at runtime (as the main front panel is resized, in response to the Resize event), and I'm starting to think it's impossible. I see that the GObject Width and Height properties are read-only.

The "VI Properties->Window Size->Scale all objects on front panel as window resizes" does not produce acceptable results because if the user shrinks a window to be small and then enlarges it again, buttons, text, etc. start to overlap because they do not return to their original positions. I tried to protect sub-areas of the panel by putting them (e.g. aligned buttons) into tabs, but that automatic "scale all objects" evidently does a deep search to resize and does not respect tabs as protection.

I thought maybe I could utilize a splitter since the splitter seems to have nice resizing capabilities, but I then wanted to make the splitter invisible (to invoke it only at run-time) but that seemed to be impossible.

How can I intelligently rearrange VIs on my front panel, in order to accommodate different screen resolutions?

Link to comment

If all you need to resize on the front panel is one graph then right-click on that graph and set it to scale with the panel. In order to ensure that other controls stick in their correct position and/or relation to eachother you can group the controls and/or control where they stick by placing them in or outside the right quadrant of the scaling frame of the graph. If e.g. you want them to stick to the top of the scaling frame the group of controls need to have at least one element that is above the top of the resizing frame.

In cases where you have multiple objects that needs to resize the solution is splitters. You can adjust the thickness of the splitter - if it is only a couple of pixels it will in fact not even show when you are running the VI...It's often OK to have the splitter visible though, tells the user something about how the panel will behave.

Mads

QUOTE (Michael Malak @ May 27 2009, 12:26 AM)

I'm trying to resize a Waveform Graph at runtime (as the main front panel is resized, in response to the Resize event), and I'm starting to think it's impossible. I see that the GObject Width and Height properties are read-only.

The "VI Properties->Window Size->Scale all objects on front panel as window resizes" does not produce acceptable results because if the user shrinks a window to be small and then enlarges it again, buttons, text, etc. start to overlap because they do not return to their original positions. I tried to protect sub-areas of the panel by putting them (e.g. aligned buttons) into tabs, but that automatic "scale all objects" evidently does a deep search to resize and does not respect tabs as protection.

I thought maybe I could utilize a splitter since the splitter seems to have nice resizing capabilities, but I then wanted to make the splitter invisible (to invoke it only at run-time) but that seemed to be impossible.

How can I intelligently rearrange VIs on my front panel, in order to accommodate different screen resolutions?

Link to comment

QUOTE (Michael Malak @ May 26 2009, 06:26 PM)

I thought maybe I could utilize a splitter since the splitter seems to have nice resizing capabilities, but I then wanted to make the splitter invisible (to invoke it only at run-time) but that seemed to be impossible.

You can effectively make a splitter invisible by using the splitter from the Classic pallet and then making it the same color as the background. The Modern pallet splitter will have a 3D effect, the Classic is flat.

Tim

Link to comment

QUOTE (Jaromir Ludwin @ May 27 2009, 06:26 AM)

Yes, but how did you get Width and Height to be writeable properties? On my LabVIEW 8.2.1, the option "Change to Write" is grayed out. And the help for GObject Bounds:Height says "No" for "Settable when the VI is running".

Link to comment

QUOTE (Michael Malak @ May 27 2009, 12:26 PM)

Yes, but how did you get Width and Height to be writeable properties? On my LabVIEW 8.2.1, the option "Change to Write" is grayed out. And the help for GObject Bounds:Height says "No" for "Settable when the VI is running".

Use Property>Plot Area>Width|Height.

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