66 views
in GUI Development by
Hi Team,

I am  trying to implement a case that there are three screen(A,B ,C), all of them can switch to screen D. when back from screen D ,which screen(A,B,C) should be shown has been bothering me. Now .I add a global variable to record which screen(A, B, C) switch to screen D. Then, when returning from screen D, Display which one(A, B ,C) based on this variable.  

Is there any other good way? Please give me some suggestions, Thanks.

Best regards

Chris Zhao

1 Answer

0 votes
by

Hello Chris,

using variable to store the preceding dialog could work. The variable should be defined in the dialog D. Shortly before you switch to dialog D, the current dialog (A.B or C) initializes this variable with a value identifying the original dialog. When you want to return from the dialog D, just switch to the dialog which is identifying by the content of the variable. This approach requires some additional programming.

I would therefore recommend to try other approach. According to your description '... returning from screen D ...', the dialog D is subordinate to A, B or C. In such case, I would limit to perform the PresentDialog() operation. This will overlap the current dialog A, B or C by the new dialog D. When dismissing the dialog D (by DismissDialog()), the original dialog A, B, or C is restored automatically. For example, the implementation of dialog A, B or C could perform following code to present the dialog D in the same context (in the same owner) of the original dialog:

Owner.PresentDialog( dialog_D, null, null, null, null, null, null, null, null, false );

In dialog D perform following code to dismiss it and return to the original dialog:

Owner.DismissDialog( this, null, null, null, null, null, false );

Important: When overlapping multiple dialogs, the old dialog is still visible. The user will thus see the dialog A overlapped by D. If this is not desired, specify in the PresentDialog() explicitly the Hide transition to apply on the overlapped dialog:

Owner.PresentDialog( dialog_D, null, null, null, null, Effects::ShowHideCentered, null, null, null, false );

I hope it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...