11-05-2009 11:33 AM
Solved! Go to Solution.
11-05-2009 07:11 PM
11-05-2009 10:50 PM
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.
11-06-2009 08:25 AM
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.
11-06-2009 08:31 AM
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.
11-06-2009 08:54 AM
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
11-06-2009 09:11 AM
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.