Michael Malak Posted May 27, 2009 Report Share Posted May 27, 2009 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? Quote Link to comment
jdunham Posted May 28, 2009 Report Share Posted May 28, 2009 QUOTE (Michael Malak @ May 26 2009, 03: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.How can I intelligently rearrange VIs on my front panel, in order to accommodate different screen resolutions? I posted a similar example in http://forums.lavag.org/Next-Newbie-Q-Local-variable-for-an-array-t14082.html' target="_blank">this thread It's a little different but maybe you can get some ideas. Quote Link to comment
Jaromir Ludwin Posted May 28, 2009 Report Share Posted May 28, 2009 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) Would this be an answer for you? http://lavag.org/old_files/monthly_05_2009/post-11365-1243427027.png' target="_blank"> Quote Link to comment
Mads Posted May 28, 2009 Report Share Posted May 28, 2009 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? Quote Link to comment
Tim_S Posted May 28, 2009 Report Share Posted May 28, 2009 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 Quote Link to comment
Michael Malak Posted May 28, 2009 Author Report Share Posted May 28, 2009 QUOTE (Jaromir Ludwin @ May 27 2009, 06:26 AM) Would this be an answer for you? http://lavag.org/old_files/monthly_05_2009/post-11365-1243427027.png' target="_blank"> 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". Quote Link to comment
Francois Normandin Posted May 28, 2009 Report Share Posted May 28, 2009 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. Quote Link to comment
Michael Malak Posted May 28, 2009 Author Report Share Posted May 28, 2009 QUOTE (normandinf @ May 27 2009, 10:40 AM) Use Property>Plot Area>Width|Height. When I tried that yesterday, it only changed the size and location of the interior graphing area, leaving the visible Waveform Graph frame & scales where they were originally. Quote Link to comment
Francois Normandin Posted May 28, 2009 Report Share Posted May 28, 2009 QUOTE (Michael Malak @ May 27 2009, 02:48 PM) When I tried that yesterday, it only changed the size and location of the interior graphing area, leaving the visible Waveform Graph frame & scales where they were originally. http://lavag.org/old_files/post-10515-1243452782.vi'>Download File:post-10515-1243452782.vi (LV8.2) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.