mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsForm: add virtual members to replace cc-item
This commit is contained in:
@@ -444,6 +444,8 @@ class CComponentsForm : public CComponentsItem
|
||||
virtual void addCCItem(CComponentsItem* cc_Item);
|
||||
virtual void insertCCItem(const uint& cc_item_id, CComponentsItem* cc_Item);
|
||||
virtual void removeCCItem(const uint& cc_item_id);
|
||||
virtual void replaceCCItem(const uint& cc_item_id, CComponentsItem* new_cc_Item);
|
||||
virtual void replaceCCItem(CComponentsItem* old_cc_Item, CComponentsItem* new_cc_Item);
|
||||
virtual int getCCItemId(CComponentsItem* cc_Item);
|
||||
virtual CComponentsItem* getCCItem(const uint& cc_item_id);
|
||||
virtual void paintCCItems();
|
||||
|
@@ -1585,6 +1585,27 @@ CComponentsItem* CComponentsForm::getCCItem(const uint& cc_item_id)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CComponentsForm::replaceCCItem(const uint& cc_item_id, CComponentsItem* new_cc_Item)
|
||||
{
|
||||
if (!v_cc_items.empty()){
|
||||
if (v_cc_items[cc_item_id]){
|
||||
delete v_cc_items[cc_item_id];
|
||||
v_cc_items[cc_item_id] = NULL;
|
||||
v_cc_items[cc_item_id] = new_cc_Item;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_CC
|
||||
else
|
||||
printf("CComponentsForm: %s replace cc_Item not possible, v_cc_items is empty\n", __FUNCTION__);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void CComponentsForm::replaceCCItem(CComponentsItem* old_cc_Item, CComponentsItem* new_cc_Item)
|
||||
{
|
||||
replaceCCItem(getCCItemId(old_cc_Item), new_cc_Item);
|
||||
}
|
||||
|
||||
void CComponentsForm::insertCCItem(const uint& cc_item_id, CComponentsItem* cc_Item)
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user