LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing window size

Solved!
Go to solution

Hello,

 I have created a VI using LV8.0... When I am running it in my computer display the size is OK. But when I am trying to run the VI in other computers and laptops whose display size is smaller, my VI's window doesn't fits the display... So i am unable to see all the controls and indicators.. Can anyone tell me how to change the window size so that it runs in all computers with a std size...

Regards

Nitzy

0 Kudos
Message 1 of 34
(9,620 Views)
Solution
Accepted by NitzZ

Nitzy,

 

you can configure your front panel elements to resize with the front panel. And you can configure your front panel to be maximized, meaning "a full screen application". These two settings together can solve your issue.

But please note that resizing is no "analog" process, so you propably encounter gaps and overlaps between your controls.

 

hope this helps,

Norbert 

 

[EDIT] Both settings can be found in the VI Settings (Ctrl + I). 

Message Edited by Norbert B on 05-14-2009 03:00 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 34
(9,613 Views)
go to file-->VI properties. You can set the options
Message 3 of 34
(9,605 Views)

Look at this Thread

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 4 of 34
(9,601 Views)

hello,

Thank you for your help... I am able to run my vi as i disired...

 

Regards

nitzy

0 Kudos
Message 5 of 34
(9,588 Views)

Hello Nitzy,

I am having similar issue since many months, and I have been doing what Norbert has suggested above - to set window size to maximum and maintain proportion of front panel objects. But I am getting everything overlapped or messed up when doing several restores/maximizes.

 

I am checking other threads also. But since you wrote "you are able to do it as desired" I am curious to know if your front panel is messed up or is fine.

 

Thanks.

Vaibhav
0 Kudos
Message 6 of 34
(9,387 Views)

Vaibhav,

 

resizing windows is not a trivial procedure; let's make an example:

 

Starting position: You have a panel with a width of 1000 pixels. In this panel, you have a control with a width of 250 pixels which is located at pixel 125 from the left border of the panel. Next (without any gap) to this control, you have another one placed with a width of 125 pixels. All controls in the pane should resize if the pane is resized.

 

First resize: You make the panel smaller, let's say to 500 pixels. The first control will be reduced to 125 pixels then. But the location is at 125/2 pixels. Since half pixels are not possible, LV has either to round up or down. Let's asume that .5-pixels are rounded down. So the control is located at pixel 62, it's right corner at pixel 62+125 = 187. The second control is reduced to 62 pixels, located at (125+250)/2=275/2=187.5 rounded down again to 187. So we got lucky, no gap or overlap. Now let's do a second resize.

 

Second resize: The new panel size is 780 pixel. This will be a factor of 780/500= 1.56. So the first control should resize to 125*1.56=195 pixels. The location will be 62*1.56=96.72 pixels. rounded, it propably will be 97 pixels. So the right border of control one is 97+195=292. The second control will be placed at 187*1.56=291.72. So if LV again rounds up, there will not be any overlap. But if LV rounds down, there will be. Same is true for gaps.

 

Additional restrictions: Many elements cannot be resized in such a manner. Each control having strings displayed cannot resize arbitrarily. This is most often the reason for having gaps and overlappings. 

 

Conclusion: If you need some "arbitrary" resizing, you have to implement an algorithm which solves the pixel-rounding issue and setting the sizes of all involved controls using VI Server. Please note that you have to take special care about strings, so a real arbitration is not possible.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 7 of 34
(9,378 Views)

Hi Norbert,

Thanks for the detailed explanation.

Yes, your calculations show very well the problem. But you know, because of this pixel round up or round down, in my case (or in any case for that matter), the overlapping happens after 2nd or 3rd resizing.

 

I do not need any such resizing by the user, indeed. But I did those resizing just to see the effects on different monitors.

 

I am, like others, experimenting with two different monitors -

1) on Laptop (max 1280 x 800, min 800 x 600)

2) on square monitor (max 1280 x 1024, min 800 x 600)

 

And both of these types have highest common ratio as 1280 x 800 (i.e.  the square monitor can be reduced from 1280x1024 to 1280x960 to 1280x800).

 

So I can make my application for this one resolution which is common to both the monitors and is also high resolution (meaning it will include my controls, which are many many). But then, while giving a demonstration on a projector screen (which may have small resolution) it can again disturb everything. Also, if I use 800x600 as my standard resolution, it will work for higher resolutions, but then I will have less space for my controls. 

 

From your calculations (and my past experiments), however, it seems that things don't go wrong just after the first resizing (which will be the case, since I don't want to allow user to be able to resize). And there will be only one resizing, at most and if at all, to make the front panel maximum according to the monitor.

 

So perhaps creating two different GUIs for two monitor types is a cool idea, and calling corresponding VI at the run time, as I saw in another thread (with slow performance). Or, just make program for 800x600 (or 1280x800) and run it on all monitors, with a little compromise with the control locations.

 

What do you suggest?

 

Vaibhav
0 Kudos
Message 8 of 34
(9,368 Views)

And yeah,

 

the string size could be one of the main reasons for control overlapping.

 

In this application I think I will not do arbitrary resizing, but am curious to know about that algorithm. Could you give me some example please?

 

In fact, I have an image control, to see video image, and the requirement is to show that video full screen, and all the smaller controls (like button, text, indicators) etc. should be over (in front of ) the full screen video.

This image control is on a tab control, and several pages of tab control have several controls which are displayed during different phases of the program.

so the basic requirement is to keep the video control in full screen mode ( I used "fit control to pane" from the image control's popup menu).

 

So resizing of the pane (tab control) according to the maximized window size, resizes and disturbs everything else.

 

Vaibhav
0 Kudos
Message 9 of 34
(9,365 Views)

Vaibhav,

 

the best example for resizing controls i am aware of are the full featured user interfaces installed with NI TestStand. They have a resize algorithm included which works very well. I think you can use this as a general guide on "how resizing can be done".

 

hope this helps,

Norbert

 

PS: Maybe you should consider a minimum size for the panel in order not to distort controls in an unwanted manner. It is better to have a scroll bar than to have controls which are not usable.... 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 34
(9,356 Views)