10-28-2010 03:09 PM
5/10 EDIT: New version of Center FP on Top Level now works for proxy called VIs by effectively centering on the highest level visible VI.
If you said, 'Yes', stop reading and throw your computer away - technology isn't for you.
________________________________________________________________________
I end up using the following quite often when writing VIs that will be used in the development environment (by internal users or developers) as well as being built executables (other users).
Here is our trivial sample application:
We click 'Go' and something happens, we click 'Exit' and our program stops. Simple.
So first, we need a way to close the program down in the case of the built executable.
If the application type is 'Runtime System', the 'Exit Runtime Application' VI will exit LabVIEW, which closes our program. If not, the program will just stop as usual.
Typically, LabVIEW users expect a stop button for the VI. Runtime users don't expect this, and would expect to just close the window to stop their application.
My 'Set Control Visibility' VI takes a reference to my stop button (Exit) control and will set visibility of that control based on the application type being Runtime System or not. Now my LabVIEW users get their stop button while my windows application users can just close the VI and I handle the correct events to close down normally and exit - no confusing stop button.
I often will create informative dialog/configuration VIs that are shown as part of the program. It is desirable for these to be centered on the Top-Level VI. If I set the VI property (Window Run-Time Position), it centers the dialog on computer's screen. I want it centered on my application's UI.
If I drop the 'Center FP on Top-Level' VI, it will center the containing VI on the highest level caller's FP. Bingo.
________________________________________________________________________
Nothing life-changing, but I get asked for these more than occasionally, so I thought I would share.
I figure if I save 2 people 10 minutes, then this will have been worth my time.
As usual, LV 8.6 or later.
Evan Prothro
RF Systems Engineer | NI
02-23-2017 02:24 PM
In my opinion, a STOP button does not belong on the front panel of any serious program. Period. 😮
(A stop button has some use for simple forum examples but not for anything bigger)
For all my projects, I exclusively use the industry standard [X] in the upper right window corner, but I capture it with a filtering event and a conditional disable structure as follows
02-23-2017 02:36 PM
While I agree with you Christian, that's a serious bump for the old post.
02-23-2017 02:39 PM
Well, I have no idea why it showed up as unread on top of a page I opened. Assumed it was new..... 😄
02-23-2017 05:16 PM
I guess it's true - what's old is new again.
02-23-2017 07:02 PM
@altenbach wrote:
Well, I have no idea why it showed up as unread on top of a page I opened. Assumed it was new..... 😄
Looks to me like an old community document just got moved to this board.