77 views
in GUI Development by
Hello EW Team,

I have an ESC button on my GUI which takes you the last screen that was displayed using Dismissdialog(). However in one case I want a refreshed version of the screen that is already in the stack, so that if i press escape the information is updated on it. Please let me know how can I do that.

Best Regards, Mariam

1 Answer

0 votes
by
 
Best answer

Hello Mariam,

you will need to access the affected dialog and perform the desired operation on it. Two possibilities exist:

1. By using the methods Enumerate and search for existing Dialogs you can search for the dialog.

2. In the last screen add a variable to refer the preceding dialog. When presenting the dialog assign the current dialog to this variable.

I hope it helps you further.

Best regards

Paul Banach

by
Hi, I need further help. So lets say I have dialog1 and I goto Dialog2 using PresentDialog(); So now somewhere inside a function in dialog2 I want to update the dialog1. So at this point while i am debugging when dialog2 is activated. I see Owner is Dialog1. So can I call something like  Owner.InvalidateViewState(); should this update dialog2?

P.S. I tried this and it does not work. after calling Owner.InvalidateViewState(); from inside dialog 2, if i go back to dialog1 using dismissDialog(); the dialog1 is not updated, its the same.

I am not sure I am totally wrong or there is a better way to do it. Please help. I could not find any related EW example for version 10 for using enumeration functions etc.
by

Hello Mariam,

without knowing your implementation, difficult to say what is wrong. An idea:

When you invoke InvalidateViewState() for the dialog 1, the method UpdateViewState() in this dialog is executed after a short delay. Does the method perform all the updates you expect? To verify it, you can add trace statement to the method and log its execution.

Possibly, executing UpdateViewState() is not sufficient in your case. Please check, what should be updated in dialog 1 and where is the code to perform this update?

I could not find any related EW example for version 10 for using enumeration functions etc.

Please take a look at the chapter Enumerate and search for existing Dialogs. It describes the available methods and shows few examples with two of them.

Nevertheless, you found that the Owner of dialog 2 is dialog 1. That means you present dialog 2 in context of dialog 1. You can therefore access the dialog 1 via Owner inside dialog 2.

In this case your approach works. In most typical application cases, however, you present the dialogs inside some common owner component. In this case when dialog 1 presents dialog 2, perform the presentation in context of the Owner of dialog 1:

// Inside dialog 1
Owner.PresentDialog( dialog2, ... );

Then being in dialog 2 you can invoke the method Owner.GetDialogAtIndex(1) which should return the dialog preceding the actual dialog. Other approach would be to invoke Owner.FindDialogByClass( Unit::Dialog1Class ). Replace Unit::Dialog1Class by the real class name of the GUI component implementing the dialog 1.

I hope it helps you further.

Best regards

Paul Banach

by
Thanks :) your reply helped me find where I was wrong. Its working now

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

...