2024-11-30 03:02 PM
Hi,
Just another point I am stuck on and coudn't find a solution.
I created a specific keypad as a custom container, to use it under several views. Initially it is hidden. I can show it by using keypad.setVisible(1) in those xxView.cpp's whenever necessary. BUT, I coud not find a way to hide it by pressing a button which is contained in that custom container.
(I don't want to construct this keypad in a Modal Window, because in that case I will need to create (and program) the exact same window with many buttons under every view.)
Any suggestion?
Thanks.
Solved! Go to Solution.
2024-12-02 06:12 AM
I have tried what you have done.
The issue is that you do not invalidate after.
So TouchGFX knows that it needs to invalidate the button because it has been clicked so there are some animation for it, but it doesn't know it has to invalidate the rest of the custom container.
Simply add invalidate(); in your ESC_Pressed() function.
Regards,
2024-12-02 05:27 AM
Hello @NGune.1
You can call setVisible(False) from within a custom container and it will set that whole custom container invisible.
Please find attached an example of that.
Please tell me if that solves your question or if I misunderstood the issue.
Regards,
2024-12-02 05:56 AM
Hi @GaetanGodart ,
Thank you for your reply and example code.
I have a container, called keypad and an "ESC" Button (a flex button) in this container. In the designer I defined an interaction; which calls the virtual function "ESC_Pressed()".
After looking at the example code you sent, In my code I tried:
void keypad::ESC_Pressed()
{
setVisible(false);
}
This is hiding the "ESC Button" only. I need to hide the entire container. So, unfortunately this didn't solve:(
2024-12-02 06:12 AM
I have tried what you have done.
The issue is that you do not invalidate after.
So TouchGFX knows that it needs to invalidate the button because it has been clicked so there are some animation for it, but it doesn't know it has to invalidate the rest of the custom container.
Simply add invalidate(); in your ESC_Pressed() function.
Regards,
2024-12-02 06:56 AM
Yes, you are right:) I added invalidate(), after setVisible(false) in my function and now it works, it hides entire container as required.
Many thanks.
2024-12-02 06:57 AM
My pleasure, I am glad it fixed your issue!
Regards,