CComponents/CComponentsItem: add advanced version of kill()

kill() allows now paint with defined colors over rendered objects
without restore of background. It's similar to paintBackgroundBoxRel()
known from CFrameBuffer, but with possiblity to define color,
default color is 0 like before (empty background).
Items with parent bindings use the background color of its parent
as default, but can also be ignored.

This function can be useful before repaint of items and/or,
if required, to have a clean background inside item containers.
This commit is contained in:
2014-05-05 18:52:21 +02:00
parent 09e529741a
commit 6a2e701a7a
3 changed files with 34 additions and 6 deletions

View File

@@ -133,6 +133,22 @@ void CComponentsItem::hide(bool no_restore)
hideCCItem(no_restore);
}
//erase or paint over rendered objects
void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent)
{
if(bg_color || cc_parent == NULL){
CComponents::kill(bg_color);
return;
}
if (cc_parent){
if(bg_color || ignore_parent)
CComponents::kill(bg_color);
else
CComponents::kill(cc_parent->getColorBody());
}
}
//synchronize colors for forms
//This is usefull if the system colors are changed during runtime
//so you can ensure correct applied system colors in relevant objects with unchanged instances.