LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I disable a button on a popup and enable it later?

I need to delay my users from clicking on a button too soon.  My vision is to load the panel with the button disabled, start at timer, and then enable the "OK" button after the timer expires. 
 
1) Is this possible on a "standard" popup?
2) If I have to create a custom panel for this, how do I prevent any intervention with the calling panel?
 
 
0 Kudos
Message 1 of 5
(3,521 Views)
Hi.

Answers to your questions:
  1. I don't see how. You don't have a panel handle for a standard popup, and you don't have access to the control id's.
  2. Try this:
    hPanel = LoadPanel(...);
    InstallPopup(hPanel); // in place of DisplayPanel()

    and proceed as you describe in your vision.

Regards,
Colin.

Message Edited by cdk52 on 06-22-2006 10:36 AM

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

There is a need to add a slight caveat here...

The InstallPopup function blocks input to any panel in the same program thread from which it was called. It does not do so globally for all threads in a program.

I use this particular behavior to allow an Abort button to always be available on my main panel even when I have custom dialogs installed as popups.

On the other hand, if you use the SDK MessageBox function, it can be set to be application modal and will block all input to any panel/window associated with the calling program. It's just not as flexible as doing custom popups and is really only useful for confirmations and a few other things.

 

Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 3 of 5
(3,481 Views)
That sounds interesting.  Where can I get the SDK MessageBox?
0 Kudos
Message 4 of 5
(3,477 Views)
The SDK is the System Development Kit that is released by Microsoft that provides APIs to Windows functions. However, you can't just go download a copy from Microsoft and expect it to work with CVI. The CVI version has specially modified header files and other tweaks for use in the CVI environment.
 
To get the SDK functions, you need to purchase the CVI full development system. The full development system is a good investment IMO, mainly because of the SDK but also because of NI reports and a few other goodies you don't get in the standard version.
 
Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 5 of 5
(3,471 Views)