LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

force machine events

Solved!
Go to solution

Hello,

 

I started working with new advanced techniques, like spawning clone floating windows, setting parent levels and save/load these configurations. I know that labview doesn't have the parent funcionallity embedded, so I use usr32.dll commands.  

My application consist of a main window which spawns several different controls, in form of specialized front panel VI's, and also spawns containers, which can be used to organize these controls as parents. I can save/load all these configurations, including window positions.

 

The problem is: FP.winBounds doesn't update its values when its parent had moved.

If the user spanws a control window inside a container, then move the container without moving the window control, FP.winBounds doesn't update. If the user saves the configuration at this point, the position values for this particular control window will be saved wrong. 

 

I understand that this property is updated only when the front panel window of the control window changes, ie, when the user moves or resizes it, much like a user event control.

 

My question is: Can I force labVIEW to update this value with something similar to signaling property?

 

Thanks in advance,

 

Giovanno

0 Kudos
Message 1 of 5
(3,030 Views)

I don't know of a way to force such a change, no.

 

I have a program with 8-10 different windows, and I save them when the user quits, and restore them on next run.

 

I use FP.PanelBounds, not FP.WinBounds.  I have no such trouble.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 5
(3,007 Views)

I can't say I tried anything like this myself, but here are a couple of immediate options which come to mind:

 

  1. Read the window positions directly using the Windows API (I'm guessing GetWindowRect is what you want).
  2. Use the API to move all the windows and then move them back, which should hopefully trigger LV to update its property.

___________________
Try to take over the world!
0 Kudos
Message 3 of 5
(2,962 Views)
Solution
Accepted by topic author Giovanno

Turned out that the problem was easier that I thought. I used a case to write in the position variable only when the graph window was moving and the container, no. It probably would fail if the user could move both windows at the same time, but I believe that it will never happen 😛

 

Thanks for the help!

0 Kudos
Message 4 of 5
(2,932 Views)

Oh yeah parent child stuff can be fun.  Here's a few of the experiments I've done

 

Inserting Notepad into a front panel and controlling it.

 

http://screencast.com/t/LjlkYzTWKr8J

http://forums.ni.com/t5/LabVIEW/How-to-run-an-exe-as-a-window-inside-a-VI/m-p/3113729#M893102

 

Creating a "Multi Panel Interface" with spawning VIs, and tabs.

 

http://screencast.com/t/P9SJ1anR

https://lavag.org/topic/17046-multi-panel-interface/

 

I never actually used it on a production program but I always wante to clean it up and release something official.

0 Kudos
Message 5 of 5
(2,871 Views)