725 views
in GUI Development by

Hello,

i am struggling on managing popups. I want to create a popup handler class or something to handle creation and stacking of popups. I have following requierments for popups:

  • Stacking Priority: Error popups must be on top, then warning and then others
  • If an error occurs some popups should not be opened anymore
  • Popups should only be created by the handler to avoid chaos
  • Popups can be created by DeviceDriver/Middleware
  • Usage of generic popups with text property (the text to display can come from the middleware)
My first try was to put the popup handler into the Device class, but there it is not possible to call PresentDialog() method nor to call methods from application. 
Without using a generic popup it is possible to use signal-slot functionality to tell the application to open a specific popup. But it is not possible to pass an argument via signal. Therefore i have no idea how to get the text after popup creation. 
Is there a recommanded way how to fulfill all requierements?
 
Kind regards,
Jonas

1 Answer

0 votes
by
 
Best answer

Hi Jonas,

putting the popup handler into the device class is not recommended - please try to keep a clear separation between the device interface (that represents your underlying device or middleware) and the GUI application itself.

In your case, let me recommend the usage of System Events and System Event Handler:

The device class detects a certain system state (e.g. error state triggered by the middleware) and stores the provided error code or error message. A System Event is used to inform the GUI about the new system state or error situation.

The root class of the GUI application contains a System Event Handler that reacts on the new system state or error situation by presenting the popup dialog on top of the current GUI. If additional information is needed, the device class can be accessed to get the current error code or some error messages.

Does this help?

Best regards,

Manfred Schweyer.

by
Thanks for your answer. I think this is what i was looking for. I did not know, that some context can be provided by a system event.
by

Yes of course, the context is very helpful to bundle some data together with the system event. I only described the simple system event mechanism.

For other users searching for these topics let me refer to the chapters Provide data together with a System Event and Evaluate values passed with the System Event.

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...