10-24-2013 12:08 PM
In our lab all our test stations have 1280x1024 resoultion monitors. In the "other lab" all the test station monitors are 1440x900 resoultion.
Now I am tasked with making my programs run on the test stations in the other lab. I have tried setting the options "maintain proportions of windows for different monitor resoultions" and "Scale all object on front panel as the windows resizes" and of course neither one of these options really does what I would expect it to do.
What is the best way to make programs fit different monitor resoultions?
10-24-2013 12:11 PM
10-24-2013 12:17 PM
One possibility is to create the front panel at 1280x900 (minimum width x minimum height) and center the windows on the monitors. The surrounding space can be left blank. Then nothing changes when you switch monitors. Of course this assumes you can make the FP look reasonable in the smaller space and that the empty perimeter space is acceptable.
Another option is to create two "front panel" VIs, one for each monitor size. Use the Display >> All monitors property node to identify which system is running and call the appropriate VI.
Of course as soon as you implement a solution at least one group will change to another size monitors.
Lynn
10-24-2013 04:03 PM
I find that using sets of splitters, breaking the UI up into sections helps just as the linked article talks about. I have some UI's that have 20 or more seperate panes. It can be confusing at times having things resize, or move as the UI resizes but when it works and it can be deployed on any monitor without an issue it makes all the time spent worth it.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-24-2013 05:28 PM
I resize the Front Panel when the program start to fit the monitor resolution. After that, I use the "SBE_Determine If Screen Resized.vi" from TomBrass (http://forums.ni.com/t5/LabVIEW/Resizing-controls-on-a-tab-control-within-a-pane/td-p/1520244 ). This vi is very useful if you don't want to monopolize the CPU with the "Panel Resize" event.
10-24-2013 06:01 PM - edited 10-24-2013 06:02 PM
@J-M wrote:
I resize the Front Panel when the program start to fit the monitor resolution. After that, I use the "SBE_Determine If Screen Resized.vi" from TomBrass (http://forums.ni.com/t5/LabVIEW/Resizing-controls-on-a-tab-control-within-a-pane/td-p/1520244 ). This vi is very useful if you don't want to monopolize the CPU with the "Panel Resize" event.
I don't like this function for a couple reasons. First for the example you don't need any custom code to handle the window resizing, just use a couple splitters. Even if you did need to handle the resize, you only resize after the mouse is up after the resize which is not how normal Windows programs work they resize as the mouse moves. So I modified the VI to resize objects as you resize the window. Then because doing this can generate 100 events very quickly, I use a boolean in a shift register to make sure that we only handle the resize event if there is no new resize events after 0ms. This essentially makes a lossy queue and handles the last resize event.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-25-2013 09:27 AM
Hooovahh,
Could you save your vi in LV2010 or LV2009 (better for me)?
10-25-2013 09:29 AM
I don't have 2010 installed so I can't open it to see if the back save broke anything but it is attached.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-25-2013 10:24 AM - edited 10-25-2013 10:33 AM
Use C#?
The whole "you can do it in LabVIEW" mantra from NI with regards to this topic gets very old, very fast. I can also draw a windows GUI by creating lines and points and drawing the GUI myself on a very low level if I wanted but that was abstracted away a long time ago. In my opinion, the panes are almost more of a work around, not a solution. But, you can solve the resize problem with them, so I can't truly say they aren't a solution. Just a time consuming one.
I don't have lots of advice on this topic, and it is one that often frustrates me (and many other developers). Panes can get you what you need as others have mentioned above, but it takes some playing around to get the panes in the right spots and all the stick to top, bottom etc settings correct. System font size vs control size is a whole other beast. If anyone has a good solution for this I'd be happy to hear it.
10-25-2013 10:40 AM - edited 10-25-2013 10:40 AM
A lot of good ideas here, thanks to all who replied. Most of what I see are solutions for resizing a running program. I am not really so concerned about that at this time.
This program in particular has a tab control and two of the tabs contain chart indicators one tab has a bunch of gauges.
What I would almost like is first a way to determine screen resolution, then select (show/hide) one of two or three panels with properly sized controls and indicators.
For now I have decided to go with the solution johnsold provided.
I feel it was the best compromise the least work to implement.
I don't want to mark this solved as it has raised some good discussions and ideas.