Modal windows
Up to this point, closing one dialog opened another in its place. You can also create "modal" windows that pop up on top of the current window. Instead of publishing the NewDialog
event inside a button, such as with our Next button, we can publish the SpawnDialog
event.
Modal windows are usually a little bit smaller in size than normal windows so that the parent window can be seen in the background. Suppose we had a dialog called PopupDlg
; we could use the SpawnDialog
event to open it modally. Typically, modal windows have an OK button that publishes the EndDialog
event with a Value
of Return
. This allows them to be closed and have focus return to the parent window.
Here's what a button on InstallDlg
would look like if it were set to open PopupDlg
modally:
<Control Id="PopupButton" Type="PushButton" Text="Show Popup" Height="17" Width="56" X="245" Y="243" Default="yes"> <Publish Event="SpawnDialog" ...