I want to implement code for update the curren screen to another screen when an event occur.
So i need to find out that which screen is displayed currently. if that perticuler screen is current screen then only i have to update to new screen otherwise not.
So please tell me about how to find which screen is display as current screen. means which parameter(variable) to follow?
Below I post a code how I change or update the screen.
//This is one slot method which is atteched with PushButton
//Here I update current screen with Menu screen
// Create a new instance of the Menu Dialog
var Application::MenuDialog menu = new Application::MenuDialog;
// Present the Menu Dialog now.
Owner.PresentDialog( menu, null, null, null, null, null, null, null, null, false );
the following articles address your application cases:
Identify the active Dialogs and avoid race conditions.
Enumerate and search for existing Dialogs.
Does it help you?
if I understood you correctly, you want to exchange data between two tasks, right? If yes, this is an aspect which depends on your used OS. Embedded Wizard itself does not rely/expect any OS.
Usually to exchange data between two tasks you use an interprocess communication service, e.g. message queue or pipe. In such case the extern task posts a message to one end of the message queue and the GUI task peeks the message from the other end. The GUI task will need to interpret the content of the peeked message and accordingly trigger an action in the GUI application.
In simple cases you can implement the task communication by using global variables shared by both tasks. In such case, the extern tasks sets the variable and the GUI task reads the variable. This requires the GUI task to poll the variable repeatedly. In all cases, you poll the variable or you read data from the message queue within the main loop.
To trigger an action within the GUI, the recommended approach would be to use a Device Driver class. The GUI task calls some Trigger method of the Device Driver and feeds so the message to the GUI application. Within the Device Driver you can implement the Trigger method to use e.g. the System Event object to broadcast the event to all interesting System Event Handler.
Does it answer your question?
please see my original answer. It refers the articles to query and enumerate existing dialogs. Especially the method FindCurrentDialog() returns what I understood you are looking for.
maybe, what you want to achieve is to query the current dialog from the foreign task? If yes, the problem here is, you can't access GUI code from a foreign task. You will always need a kind of interprocess communication. Anyway, the idea how to do this could be:
Step1. Implement a new method (e.g. IsHomeDialogActive()) within your Application component. For example:
var Core::Group dialog = FindCurrentDialog();
// Test whether the current dialog is a special one (e.g. HomeDialog)
if ((SomeUnit::HomeDialog)dialog != null )
Step 2. Implement interprocess communication between the both tasks. The idea here, the foreign task asks the GUI task 'is home dialog active'. The GUI task invokes the method IsHomeDialogActive() in context of the root object and returns the value back to the foreign task.
Important: since the method IsHomeDialogActive() is used from the outside of the GUI application (from the GUI task), Embedded Wizard will consider it as not needed by the application itself and eliminate it. You have to supress this by setting the attribute Generator of the method brick to the value true.
Does this answer address your application case?
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!