2021-07-14 09:12 AM
I am aware of this discussion:
In my setup I made a custom container called messageBanner.
In its constructor, it creates and adds its widgets like this:
add(backGroundColorRed); // Solid box with color
add(backGroundColorBlue); // Solid box with color
add(backGroundColorGreen); // Solid box with color
add(bannerText); // Textbox with OneWildcard
add(actionButton); // FlexButton
the actionButton has a virtual function callback called onActionButtonClick
The default behaviour is to "dismiss" the messageBanner, which means to hide all the widgets and stop further touch events to be processed.
This seems to work, but I want to confirm if I am missing something.
// actionButton virtual function callback
void messageBanner::onActionButtonClick(void)
{
// Iterate and make everything not visible
Drawable* containerItem = this->getFirstChild();
while (nullptr != containerItem) {
containerItem->setVisible(false);
containerItem = containerItem->getNextSibling();
}
// Then make the container not touchable and refesh its display
this->setTouchable(false);
this->invalidate();
}
Questions:
Thanks for everyone's time...