LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different Screen Resolutions - What is the best method?

Solved!
Go to solution

Hello,


I know this question had been asked a thousand times before, but what's the best and more reliable way to deal with different screen resolutions?

I read many posts about that and tested about everything: single methods, combinations, let labview scale my objects, scale them by myself, etc. One alternative that I found was to design the front panel for the lower screen resolution, let labview scale objects (graphs, tab controls and decorations) as window increases or decreases, and lock "groups of indicators, controls and texts" to prevent them from rescaling and overlapping each other. Nevertheless, if I lock these "groups" they don't move to the right place as window resize. Then, I put these "groups" inside clusters and tried to adjust the position via property node, but it was not possible because the "groups" inside the clusters were locked!

After all these tests, I realized that the best way to handle different screen resolutions is to have a main VI that detects the current screen resolution and load the right VI for that resolution. The problem is that I have to have one VI for each screen resolution (created one-by-one) and if I want to upgrade the code I have to do the same task for all VIs.

Since I've already done all the VIs (for different screen resolutions), I could get the sizes and positions of all objects via property nodes and create a kind of "cluster" that after detecting the current screen resolution, would adjust all the objects. But I have several decorations in the front panel and I can't get information via property node of them.


Does anyone has a perfect solution for this issue without having to create different, one-by-one, VIs for each screen resolution?

Thanks.
Dan07.
Message 1 of 23
(6,150 Views)

The best way to handle different screen resolutions is to make the VI scaleable. Select "VI Properties" -> "Windows Size", and set the "Minimum panel size" to the smallest resolution or less! (Maybe (800x600?). Scale front panel using splitters and groups.  I've made an example for you.

Message 2 of 23
(6,129 Views)

As sandal says, learn about splitter bars and panes.  I ignored this feature for a long time, but once I learned how to use it I started to make all my UI's fully resizable.  There's a short demo on youtube.

 

-- James

Message 3 of 23
(6,110 Views)

Sandal,

 

Your example with splitters and groups works great. Using splitters is possible to use "Scale Object with Pane" for all objects in the front panel, and using groups make them resize together, or not, inside each splitter. Great!

 

But, my front panel has a Tab Control with four tabs, and everything (graphs, indicators, controls, decorations, etc.) is in the tabs. Is it possible to keep the Tab Control and use splitters inside each tab?

 

Thanks.

 

Dan07.

0 Kudos
Message 4 of 23
(6,087 Views)

It is tricky to scale a tab, but it is possible.. You need two tab controls, some spiltters and coding. Have a look at the example Smiley Happy

Message 5 of 23
(6,051 Views)

@dan07 wrote:

But, my front panel has a Tab Control with four tabs, and everything (graphs, indicators, controls, decorations, etc.) is in the tabs. Is it possible to keep the Tab Control and use splitters inside each tab?



Tab controls and splitters("panes") aren't very integrated unfortunately.  I've been using subpanels in places where I used to use Tabs, with splitters inside the subVIs inserted into the subpanel.

0 Kudos
Message 6 of 23
(6,031 Views)

Good afternoon,

Not to lose resolution to open in another PC, follow this link and let the two check box marked. Any questions please contact us.

How Do I Undo the Set To Current Window Size Button in VI Properties?

http://digital.ni.com/public.nsf/allkb/1E9D1EE60BE8624B86256E75004DEDCF?OpenDocument


Sincerely,

Mauro Vera
Applications Engineer
National Instruments
0 Kudos
Message 7 of 23
(6,009 Views)

Sandal

 

Thanks for the example. I put two new red dials into the same tab of the Graph. I grouped them and they are not resizing as I resize the window (I don't want them resizing). Nevertheless, they are moving from the original place. How do I prevent these new dials from moving as I resize the window? Find VI attached.

 

 

 

drjdpowel

 

Subpanels are great, but I would prefer to keep everything into one main VI because I have a "References Cluster" (strict type def) that is populated with real references as the main VI runs. Then, I have several copies of this "References Cluster" into many SubVIs, allowing changes in objects placed into the main VI. If I "split" my main VI into several VIs and use them as Subpanels of a new main VI, I would have to find a way to populate my "References Clusters" with all the real references of VI 1, then all the real references of VI 2, and so on. I hope you understood what I said.

 

Thanks.

 

Dan07.

0 Kudos
Message 8 of 23
(5,995 Views)
Solution
Accepted by topic author dan07

Thw way you can prevent the control to move when you are scaling, is to group the controls with "something" that is placed outside of the frontpanel. In the example I am giving you now, you can see that I have grouped the stop button, and the "red dials" with a "dot" to the left side of the front panel.

0 Kudos
Message 9 of 23
(5,971 Views)

dan07 wrote: 

Subpanels are great, but I would prefer to keep everything into one main VI because I have a "References Cluster" (strict type def) that is populated with real references as the main VI runs. Then, I have several copies of this "References Cluster" into many SubVIs, allowing changes in objects placed into the main VI.


Ah, that is a problem then.

 

You (and others interested in this) should "kudo" the idea Tab Controls with Splitter Bars so that hopefully we will eventually be able to use splitter bars inside tab controls.

 

-- James

0 Kudos
Message 10 of 23
(5,963 Views)