LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving MessagePopup

Solved!
Go to solution
Is there a way to move the MessagePopup panel? It always pops up in the middle of the screen. I would like it to pop up somewhere else.
0 Kudos
Message 1 of 7
(4,140 Views)

Hello Paul.

 

You will find two possible solutions to your problem in this thread.

 

Good luck.

 

Colin.

 

0 Kudos
Message 2 of 7
(4,119 Views)
Solution
Accepted by topic author Paul_Knight_Lockheed_Mart

Paul:

 

I take an approach similar to the one Eren Balci describes in the post mentioned by Colin.

 

Use the UI editor to create a panel which you'll use as your own popup window.

Add at least an OK button to your popup, but don't assign any callbacks to your popup's controls.

Use InstallPopup (not DisplayPanel) to display it. 

Wait for a commit event using GetUserEvent().

Use RemovePopup() to remove the popup.

Check which control generated the commit event and respond accordingly.

 

I have attached a sample program which implements a popup in this way.  You can set the popup's title and message, and you have a choice of displaying an OK and/or Cancel button.  You could extend the example to customize your popup even more at runtime.

 

The attached sample includes a calling routine which lets you select the popup's location, and whether or not to display the Cancel button.

You can use my popup as is in another one of your projects by doing these steps.

1. Copy MyPopup*.* to your project directory.

2. #include "MyPopup.h" in your .c file from which you'll call my popup.

3. Add MyPopup.c to your project. 

4. Call InstallMyPopup() from your .c file. 

 

0 Kudos
Message 3 of 7
(4,112 Views)

I was unable to get the MessagePopup panel to move using the Popup.prj.  It appears that there is no simple way to move MessagePopup.

I will have to create my only message panel which is straigth forward to do.

 

Thanks for your help.

0 Kudos
Message 4 of 7
(4,082 Views)

Paul:

 

Are you saying that the sample project I posted didn't work for you?  I tested it right out of the zip file I posted and it works just fine.

 

The sample I posted is MovePopup.prj, not Popup.prj, and it doesn't use MessagePopup.  It uses its own panel which I explained how you could use as is in your project.

0 Kudos
Message 5 of 7
(4,078 Views)

Sorry Al,

 

The project Popup.prj was from the thread Colin provide.

 

Your MovePopup.prj works fine. 

 You can achieve the same results using DisplayPanel and HidePanel, although it isn't as elegant of a solution as yours.

 

Paul

 

0 Kudos
Message 6 of 7
(4,071 Views)

Paul:

 

DisplayPanel and HidePanel don't make the window modal like a dialog box, so the user can ignore the popup.  Using InstallPopup and GetUserEvent forces the user to respond to the dialog box, even if it's just clicking OK.

0 Kudos
Message 7 of 7
(4,066 Views)