mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
CComponentsItem: move function isAdded() to CComponentsItem class
Origin commit data
------------------
Branch: ni/coolstream
Commit: 3438b23f68
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-10-19 (Sat, 19 Oct 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -244,6 +244,8 @@ class CComponentsItem : public CComponents
|
||||
virtual void setParent(CComponentsItem *parent){cc_parent = parent;};
|
||||
///returns pointer to the form object in which this item is embedded.
|
||||
virtual CComponentsItem * getParent(){return cc_parent;};
|
||||
///property: returns true if item is added to a form
|
||||
virtual bool isAdded(CComponentsItem *parent_frm = NULL);
|
||||
|
||||
///abstract: paint item, arg: do_save_bg see paintInit() above
|
||||
virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES) = 0;
|
||||
|
@@ -165,14 +165,6 @@ int CComponentsForm::getCCItemId(CComponentsItem* cc_Item)
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool CComponentsForm::isAdded(CComponentsItem* cc_item)
|
||||
{
|
||||
bool ret = false;
|
||||
if (getCCItemId(cc_item) != -1)
|
||||
ret = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int CComponentsForm::genIndex()
|
||||
{
|
||||
int count = v_cc_items.size();
|
||||
|
@@ -69,8 +69,6 @@ class CComponentsForm : public CComponentsItem
|
||||
virtual void clearCCItems();
|
||||
virtual void cleanCCForm();
|
||||
virtual void setAppendOffset(const int &h_offset, const int& v_offset){append_h_offset = h_offset; append_v_offset = v_offset;};
|
||||
///property: returns true, if item already added to form
|
||||
virtual bool isAdded(CComponentsItem *cc_item);
|
||||
};
|
||||
|
||||
class CComponentsIconForm : public CComponentsForm
|
||||
|
@@ -133,7 +133,7 @@ void CSignalBar::initSBarScale()
|
||||
sb_scale->setColorBody(col_body);
|
||||
|
||||
//add scale object to container
|
||||
if(!isAdded(sb_scale))
|
||||
if(!sb_scale->isAdded())
|
||||
addCCItem(sb_scale);
|
||||
|
||||
}
|
||||
@@ -158,7 +158,7 @@ void CSignalBar::initSBarValue()
|
||||
sb_vlbl->setColorBody(col_body);
|
||||
|
||||
//add value label object to container
|
||||
if (!isAdded(sb_vlbl))
|
||||
if (!sb_vlbl->isAdded())
|
||||
addCCItem(sb_vlbl);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ void CSignalBar::initSBarName()
|
||||
sb_lbl->setColorBody(col_body);
|
||||
|
||||
//add name label object to container
|
||||
if (!isAdded(sb_lbl))
|
||||
if (!sb_lbl->isAdded())
|
||||
addCCItem(sb_lbl);
|
||||
}
|
||||
|
||||
|
@@ -206,12 +206,12 @@ void CSampleClass::showSNR()
|
||||
signalbox = new CSignalBox(10, 100, 500, 38, frontend);
|
||||
// signalbox->setCornerRadius(0); //optional
|
||||
// signalbox->setColorBody(COL_BLACK); //optional
|
||||
signalbox->setColorBody(COL_MENUHEAD_PLUS_0);
|
||||
signalbox->setColorBody(COL_MENUHEAD_PLUS_0);q
|
||||
signalbox->doPaintBg(false);
|
||||
//if you want to add the object to a CC-Container (e.g. CComponentsWindow()), remove this line:
|
||||
signalbox->paint(false);
|
||||
//and add this lines:
|
||||
// if (!isAdded(signalbox))
|
||||
// if (!ignalbox->isAdded())
|
||||
// addCCItem(signalbox);
|
||||
//Note: signal box objects deallocate together with the CC-Container!
|
||||
}
|
||||
|
@@ -232,12 +232,12 @@ void CComponentsWindow::initCCWItems()
|
||||
initBody();
|
||||
|
||||
//add header, body and footer items only one time
|
||||
if (!isAdded(ccw_head))
|
||||
if (!ccw_head->isAdded())
|
||||
addCCItem(ccw_head);
|
||||
if (!isAdded(ccw_body))
|
||||
if (!ccw_body->isAdded())
|
||||
addCCItem(ccw_body);
|
||||
if (ccw_footer)
|
||||
if (!isAdded(ccw_footer))
|
||||
if (!ccw_footer->isAdded())
|
||||
addCCItem(ccw_footer);
|
||||
}
|
||||
|
||||
|
@@ -151,3 +151,12 @@ int CComponentsItem::getItemType()
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
//returns true if current item is added to a form
|
||||
bool CComponentsItem::isAdded(CComponentsItem *parent_frm)
|
||||
{
|
||||
if (cc_parent)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user