Modal windows and the ShowGraphic() function
- Last UpdatedJul 22, 2024
- 3 minute read
If you have opened a modal pop-up window using the ShowGraphic() script function, the system cannot execute the rest of the script. Close the window to allow the system to execute the rest of the script.
If you have opened multiple modal pop-up windows, you cannot click or close the modal window stacked in the middle of the modal chain. The system will maintain the modal chain to allow pending or unprocessed scripts to process before the graphic can close. Attempts to close a window beneath a modal window are blocked.
The following examples 1 and 2 illustrate modal window behavior using the ShowGraphic() function.
The following example 3 illustrates a specific scenario of working with modal windows with the same identity name using the ShowGraphic() function while the Graphic Cache memory feature is enabled.
Example 1: Modeless Symbol1 (S1) opens modeless Symbol2 (S2) using a ShowGraphic() script function. Modeless graphic S2 opens modal Symbol3 (S3) using a ShowGraphic script function. In this scenario:
-
S2 cannot complete its script and close (HideSelf) until S3 closes.
-
You cannot close S2 using the close window button.
-
You cannot close S2 using a HideGraphic (S2) script function from another window until the modal graphic S3 closes and the S2 script completes.
-
You cannot close S2 using a ShowGraphic (S2) script function with the same Identity until the modal graphic S3 closes and the S2 script completes.
-
You can close S1 using a HideGraphic (S1) script function from another window because the subsequent graphic S2 is modeless.
Example 2: Modeless Symbol1 (S1) opens modal Symbol2 (S2) using a ShowGraphic() script function. Modal graphic S2 opens modal Symbol3 (S3) using a ShowGraphic script function. In this scenario:
-
S1 cannot complete its script and close (HideSelf) until S2 closes.
-
S2 cannot complete its script and close (HideSelf) until S3 closes.
-
You cannot close S1 or S2 using the close window buttons.
-
You cannot close S2 using a HideGraphic (S2) script function from another window until the modal graphic S3 closes.
-
You cannot close S1 using a HideGraphic (S1) script function from another window until the modal graphic S2 closes.
-
You cannot close S2 using a ShowGraphic (S2) script function with the same Identity until the modal graphic S3 closes.
-
You cannot close S1 using a ShowGraphic (S1) script function with the same Identity until the modal graphic S2 closes.
-
You can close S3 using a HideGraphic script function from another window, or by using the close window button if enabled.
Although you can close a graphic by opening another graphic with the same Identity, effectively replacing the original graphic, we recommend that you don't use the same Identity as a graphic opened with ShowGraphic in a modal dialog.
Example 3: With the Graphic Cache memory feature enabled, a ShowSymbol (SS) has a button to show graphic Symbol1 (S1) (modal), and another button to show graphic Symbol1 (S1) (modeless). S1 is configured to open Symbol2 (S2) with the ShowGraphic() function. In this scenario:
-
Click show graphic button S1(modeless) to open pop-up S1. Click the ShowGraphic() button in S1 to open pop-up S2 with title "Graphic01".
-
User can enter input into S2.
-
With the pop-up open, click the show graphic button S1(modal). Pop-up S1 will open. Click the ShowGraphic() button in S1. Pop-up S2 will open with the title "Graphic01". The already open Graphic01 pop-up window will be replaced.
-
With the Graphic Cache memory feature enabled, S1 cannot change from being modal to SS to being modeless to SS.
-
User cannot enter input to S2.
-
Alternatively, close S2 opened from modeless S1, then open modal S1, and click the ShowGraphic() button to open S2, "Graphic01".
-
User can enter input to S2.
For more information about example 3, see Behavior of ShowGraphic windows with the same identity.