LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Window TopPosition Problem

I have a problem with the positioning of the frontpanel when I change the 'Windows Appearance' settings from default to customized settings. There is a small strip (few pixels) above the windows titlebar where the desktop background appears. The VI changes the FP.Winbounds upperleftposition to 0,0. Changing back the settings to default the positioning is without that gap. I tested this on 2 PCs with windows XP SP2 and LV PDS 8.6 and 8.6.1 respectively. Any help is appreciated.

 

Jörn

Message Edited by JohnHighlander on 04-27-2009 05:41 AM
Message Edited by JohnHighlander on 04-27-2009 05:42 AM
Download All
0 Kudos
Message 1 of 9
(4,002 Views)
Strange I have a FPBounds with 0,0 in the upper left and it works correctly. 
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 9
(3,971 Views)

Hi Jörn,

 

I've tried your VI and have the same appearence on my computer (LV 8.6.1 and WinXP) and have the same appearence.

Do you use any further toolbar, like a widget tool or somthing that maybe has a higher priority on th screen?

 

Regards Martin

#############################################
There is no place like 127.0.0.1
#############################################
0 Kudos
Message 3 of 9
(3,938 Views)

I see the same issue with LV 8.6 on XP.  What is odd is it seems to go to 0,0 then jump down.

 

I copied and pasted your code into a new VI, no problem.  It went to 0,0 and stayed there.

0 Kudos
Message 4 of 9
(3,929 Views)

I played around something and tested with a main and a sub VI according the attached project. These are still very simple. Nevertheless I was wondering if there is something wrong with the code or maybe wrong properties I used. Anyway, I found out the gap has the size of the frame which is surrounding the panel of the main vi. Is there something I must set to get rid of this frame ?. I did not found any property for it

 

Thanks for your reply so far,

 

Jörn

0 Kudos
Message 5 of 9
(3,919 Views)

Strange things happen. I've tried your test VIs again, the first shows the problem, the seccond with the event handler does'nt.

But it seems to be no difference between those 2 VIs...

 

Greetings Martin

#############################################
There is no place like 127.0.0.1
#############################################
0 Kudos
Message 6 of 9
(3,781 Views)

Thanks for the reminder. Playing around is good, rtfm is better....


In the helpfile we can read the following regarding the Front Panel Window Open Property:
National Instruments recommends you use the Front Panel Open method instead of this property to open the front panel window.
Use the Front Panel Open method to set the state of the window when you display it. Use the Front Panel Window State property for more accurate information about the current state of the window. Use the Front Panel:Close method to close the window.

I did not spent attention to this fact during the converting process from LV 7.1.1 to LV 8.6 (by the way the 'Open Panel.vi' in the victl.llb is NOT marked as legacy in LV 8.6 and I used it since LV 4, for VI open/close handling, so that change was not in my focus).

Anyway, I updated the project for comparing the old and new methods/properties. What I found for RUNTIME is, that it works now without any gap with the Front Panel Open method. For my projects it is the solution.

Unfortunately there is still a strange thing. After closing the VIs two things can happen depending of the windows appearance settings:
1. Lets say the windows appearance settings are default. You let the main vi run, position to 0,0 and close afterwards. The position is 0,0 without gap. You close the VI now. Go to the project explorer and reopen again. The VI appears but with the gap again.
2. Lets say the windows appearance settings are custom e.g. without toolbar, title etc. Do as before, After stopping the main vi it jumps down and the gap appears.

 

best regards,

 

Jörn

Message Edited by JohnHighlander on 05-13-2009 04:32 AM
0 Kudos
Message 7 of 9
(3,767 Views)

You thought that was the end of the story, of course it's not...
For the Demoproject it seemed to work. Doing the same in my bigger applications it went wrong. What happens ?. Returning from a sub GUI vi to the calling VI always gives the gap again. Why ?. What I did in the past to realize nested GUI VI's is the following: I have a main VI as a platform to call programmlogic VI's and a main gui VI. The main gui VI calls sub gui VI's and so on. By calling the sub gui vi you have frequently the need to close the calling gui vi's front panel. That means the following way now with methods : FPwindow:Close - Call sub vi - End sub vi - FPwindow:open of calling vi.
Doing this the gap appears just after reopen. Check this in the updated project
I see two ways to solve this.
1. Close Main - Call  Sub VI  - OpenMain - Repos
You have to reposition after FPwindow:open of calling vi
or
2. Hide Main - Call  Sub VI -Unhide Main
you simply do not close the FP but Hide-Unhide.

As long as you have no need to close the FP, hide-unhide is the way to go. Unfortunately in more complex GUIs you have the need to calculate and set the windows position and size before you place and size FP controls. In these situations you are forced to reposition twice: before FPwindow.Open and afterwards. I could not find anything about this in the knwon issues list but I think it belongs to.

 

thanks for you patience

 

Jörn

0 Kudos
Message 8 of 9
(3,751 Views)

Hi Folks,

 

I think I have an answer. It is a visual illusion to the eye.

 

The VI Properties under Window Appearance are set to custom, and hiding the toolbar at runtime. Now, since the VI is only running once, the VI moves to 0,0 with no toolbar, as expected, and without the gap.

Since the VI is only running once, after it stops running, the VI will shift down and the menu will come back up. If you throw a while loop around the code to keep the VI running, you will clearly see what is happening.

 

I have attached the modified VI to look at it.

I hope that solved the mystery of the gapp around the frontpanel.

 

Kind regards Martin

#############################################
There is no place like 127.0.0.1
#############################################
0 Kudos
Message 9 of 9
(3,645 Views)