2019-11-05 07:37 AM
void MainScreenView::setVacuumPositionPercentBoxClickHandler(const BoxWithBorder& b, const ClickEvent& evt)
{
// When target vacuum position box is clicked, display modal keypad with numericals
targetPercentModalWindow.setVisible(true);
targetPercentModalWindow.invalidate();
keyboard.setPosition(410, 100, 320, 240);
add(keyboard);
}
This is the code where I make the modal window visible and draw the keyboard.
Solved! Go to Solution.
2019-11-05 01:39 PM
You've answered your own question :) You're adding the keyboard every time you click that box.
You only need to add a Drawable to the root container of a view ONCE.
/Martin
2019-11-05 01:39 PM
You've answered your own question :) You're adding the keyboard every time you click that box.
You only need to add a Drawable to the root container of a view ONCE.
/Martin
2019-11-05 02:09 PM
Where would I find the root container for my modal window?
2019-11-05 02:15 PM
Also, I want to resuse my modal keyboard many times throughout the project. Would I use a custom container to get the job done?
Thank you.
2019-11-05 02:19 PM
Yes, you could use a custom container for that. And in that case you can add() drawables to that container.
/Martin
2019-11-05 02:20 PM
Okay! I will give this a try tomorrow and see if I have success. It's already past 5 in New Jersey. Thanks for your help Martin.
2019-11-05 11:33 PM
No problem! let me know how you do!