Modal Pop-Up How-To?

The simplest way I’ve found to do this is:

  1. Create a modal dialog with opaque background as described here.
  2. Create a Client Boolean tag called ‘modal’.
  3. Create your docked window, then create a container the full size of the docked window and move it to the top of the z-order. Set the container’s Opaque property to false and bind it’s Visibility property to the modal Client tag. In the container’s mouseClicked, mousePressed and mouseReleased’ events enter pass to consume the mouse clicks.
  4. When you open and close your popup make sure you set and clear the modal tag.

This should ensure you can still see all controls under the popup but cannot click on any of them. I also like to put a tint on the popup background and container to focus attention on the popup.

2 Likes