how to trigger modal in all screens from the model
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-24 2:54 PM
Hi there Touchgfx team!
I have about 15 different screens. I also have a modal that says "battery critical level". I know how to propagate a notification from the model to the view to trigger this modal.
My question is: is there an easy way to do this for 15 different screens? or everytime I need to override the notification function in each screen?
Thanks a lot in advance
Solved! Go to Solution.
- Labels:
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-31 2:56 AM
@JPabl.1 Ah, sorry...forgot assets are also a must. try this one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-25 12:53 AM
Hi @JPabl.1 , one solution could be a new screen, just with that warning message window and transparent background and transition to that. Then back to original screen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-25 10:24 AM
Hi @ferro , thanks for the reply.
I think that might work if the modal were just a single screen, but the UI requirements is for it to pop up on top of the current screen, like this:
From your answer it seems the only way will be to the same on all screens?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-25 1:01 PM - edited ‎2024-10-25 1:13 PM
Hi @JPabl.1
but the UI requirements is for it to pop up on top of the current screen
Yes, and that is exactly what will happen. But I forgot one important detail.
Before transitioning to the warning screen, You must set the size of the default background box, named __background, injected automatically by Gfx Designer ( I suppose you use screen Base clasess) to the size of your modal widget. In that case, the previous screen content stays as it is ( in frame buffers).
From your answer it seems the only way will be to the same on all screens?
If you could rephrase that please, do not inderstand what you mean.
I've just remembered this post
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-28 5:47 AM
So you mean just doing
__background.setWidth(150);
__background.setHeight(150);
__background.invalidate();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-28 7:02 AM
Hi @JPabl.1 , yes, do this in the warning modal message screen, the one you want to transitioned to. In constructor or ::setupScreen ().
But now, I am not sure this works for modal widget. I use this technique with a plain container on a screen - to mimic a modal widget. But modal widget blures the background, i guess ?
What about creating a class with all possible (modal) messages and let all screens inherit from that. Minimal writing and, most importantly, easy maintenance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-28 10:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-30 9:18 AM
How can I run that project? I get :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-31 2:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-31 10:54 AM
That will do the trick, thanks a lot!
