10-13-2016 04:16 AM
Hello Labviewers
I have designed a huge Labview application developed with a monitor resolution of 1600 x 900. The various front panels are set up with the ‘maintain proportions…’ and ‘scale objects...’ options checked because this application is distributed to numerous stations with various monitor resolutions (higher or lower than the one I used).
The problem that I have is that the objects of my panels gets completely distorted the more I launch the panels from the main menu of the application. Another way to provoke this distortion is merely to click on the Maximize/Restore Down option on the top right of the panel’s window. The more I click back and forth the more distorted the objects get (see attached pdf). All tests made keeping the original resolution of 1600 x 900. Under another screen resolution the result is even worse…
This problem is not present if I untick the ‘scale objects…’ option but unfortunately because the application has to run on different screen resolutions I am kind of forced to keep it.
I do have 2 questions:
Question 1: how can I prevent this behavior to happen?
Question 2: is there a way to somehow restore the panel appearance to its original default when the panel was saved on disk? I am asking this because each time I rerun a panel from the main application’s menu, its appearance does not start with the saved-on-disk one but rather from the last –and already distorted one- kept somehow in memory (?) and that explains why it is getting worse and worse each time the panel is invoked.
Thanks so much for your help, I am kind of desperate here
Christophe
10-13-2016 04:28 AM
Hi Christophe,
easy solution: don't use "Scale objects with window"…
Not as easy solution:
- put your FP objects into separate panes
- set the panes to move/adapt with window size changes
- set selected FP objects to scale with the pane
Other solution:
- set FP object size/position with property nodes on your own
- calculate all those size/position values based on window size…
10-13-2016 06:36 AM
GerdW has already given some excellent advice - there seems to be issues around rounding/scaling objects automatically which can cause weird visual artifacts - the problem gets worse if you have no 'minimum' size.
The best way to handle this is to use panes/splitters - set some of the panes to have a fixed size (e.g. the buttons in the middle) and then have a pane for each graph which is 'fit to pane' so the graphs will resize for different resolutions. Set a minimum pane size which looks reasonable.
Another way is to have separate UI VIs for each screen resolution you want to support - for example you could have a 'small', 'medium', 'large' VI for 3 different resolutions.
10-13-2016 08:37 AM
@Sam_Sharp wrote:GerdW has already given some excellent advice - there seems to be issues around rounding/scaling objects automatically which can cause weird visual artifacts - the problem gets worse if you have no 'minimum' size.
Another way is to have separate UI VIs for each screen resolution you want to support - for example you could have a 'small', 'medium', 'large' VI for 3 different resolutions.
Tou got some great advice there! Sam's suggestion should be expanded to address different screen aspect ratios too!
Now I'm going to rip that UI apart - meaning no offense but I do need to be brief here.
1 Find a Graphic artist- those color schemes give me a headache
2 WAY too many elements and overlapped controls. Consider what Example screen 2 would look like if a single graph with stacked plots was used. (Incidentally, wouldn't that make the scaling issue problem scope a lot smaller?)
3 Call if date/time stops updating? you might want to rethink that object entirely
4 Use array and clusters for related controlls or at least group them so they are forced to maintain proportions with each other.
5 Use system fonts
10-13-2016 09:00 AM
@JÞB wrote:5 Use system fonts
I'd argue against that one.
System fonts have an annoying habit of changing size whenever Microsoft decides to change the OS. Think of how many times we've seen messages where people complain how their front panel no longer aligned because they developed on a Win XP machine and later deployed on a Win7 machine. National Instruments didn't help this either because they set up the default fonts to map through to the Windows system fonts.
It is much better to use a defined font that is common and standard sizes so that things will have the highest probability of looking consistent no matter what PC the application is deployed to.
And you're right about #1. Those color started hurting my eyes about 3 seconds after I opened that file.
10-13-2016 10:41 AM
I am still left with my original second question:
Lets imagine that the first time I enter into the VI, I feel like all objects are placed correctly. Is there a setting that would restore all objects to this original position the next time I will enter into the VI? Because really what my problem is, is that each time there is a slight shift/move/distortion relative to the previous time I entered into the panel and not relative to the initial position of the elements as they are saved on the hard drive with the VI
Thanks again so much for your insights
Christophe
10-13-2016 12:24 PM - edited 10-13-2016 12:27 PM
You could launch the VI dynamically as a clone/instance - that would probably reset the position as it was on disk when opened. That might work.
Still, I think it would be better to use splitters/panes appropriately. You *can* make (I know, because I've done it) user interfaces which can scale/resize for a wide variety of screen sizes - but you need to put in a bit of work to make it happen.
10-13-2016 01:24 PM
+1 for splitters, -10 for system fonts.
Design at minimum FP size that might happen and set it in Vi properties -> Window size. Save VI, try to resize, discard changes.
I prefer not to resize numerics (they do not resize vertically and labview gets confused), strings (bad experience with font size), or at least make sure they can resize only horizontally.
You can control these with properties of the pane and splitter (right click splitter): Splitter sizing -> Splitter sticks left/right/top/bottom, Pane sizing -> Origin sticks to Top/Bottom/Left/Right. Setting the splitter stick to right, for example, makes left pane grow any direction, and right pane - only vertically.
Also while resizing graph make sure panels, caption do not get outside of the border - they will move far away. Setting minimum FP size and fixed fonts helps prevent this.
Do you need to resize first FP? Place it in the center of the screen, make main indicator fonts large enough. It seems graphs are secondary here, so making them huge will not help - on big screen they will become main indicators, not center one Tank weight. Making huge buttons also will not help. Big red face is visible good enough.
For the second FP it seems all parts are the same, so you can make a single reentrant VI to display it.
It will be relatively easy to resize it automatically: graph - separate pane, fits to pane. Right part pane grow down, elements do not resize. Top part (3 panes), center one resizes horizontally.
In wrapping display VI put 3 splitters, 4 SubPanels in each pane and set Fit control to pane and Scale control with pane.
10-13-2016 01:30 PM - edited 10-13-2016 01:32 PM
Sketch of the second FP single VI
Edit: fixed font of everything.
10-14-2016 04:05 AM
Thank you Alexander and Sam,
@Alexander: I have tried to play with splitters and panes in my example 2 and could not reach a satisfactory display. Also I think I was not able to understand/follow all your explanations and could you tell me if you still use the ‘Maintain proportions’ (and Scale all objects) main settings in Window size? 3 splitters and 4 subpanels are not enough in my analysis for this example 2…
I totally agree with the Font story (Font style and size).
@Sam: the way I call the Vis that I present in my examples: Open Vi Reference (I tried with Options 0, 2, 😎 then Call By Reference. I have tried different options for Open Vi Reference but also with and without closing/reopening each time the Vi reference. Nothing helps… I cannot figure out how to reload the original positions of all objects…
Thanks
Christophe