From 581b9c770136d5193b0959d55bed748891b47cee Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 5 Jun 2014 15:29:04 +0200 Subject: [PATCH] CComponentsForm: add methode killCCItems() This methode is an equivalent version of CComponentsItem::kill() and allows to erase all items inside of a container at once. --- src/gui/components/cc_frm.cpp | 7 +++++++ src/gui/components/cc_frm.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 2fbd8aae2..ed86f7c62 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -362,3 +362,10 @@ void CComponentsForm::hide(bool no_restore) //hide body hideCCItem(no_restore); } + +//erase or paint over rendered objects +void CComponentsForm::killCCItems(const fb_pixel_t& bg_color, bool ignore_parent) +{ + for(size_t i=0; ikill(bg_color, ignore_parent); +} diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index fc5b21dcd..a642a7aa6 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -50,6 +50,11 @@ class CComponentsForm : public CComponentsItem void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); void hide(bool no_restore = false); + + ///same like CComponentsItem::kill(), but erases all embedded items inside of parent at once, this = parent + ///NOTE: Items always have parent bindings to "this" and use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color! + virtual void killCCItems(const fb_pixel_t& bg_color, bool ignore_parent); + virtual void addCCItem(CComponentsItem* cc_Item); virtual void addCCItem(const std::vector &cc_items); virtual void insertCCItem(const uint& cc_item_id, CComponentsItem* cc_Item);