本文整理汇总了C++中CCTableViewCell::removeAllChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ CCTableViewCell::removeAllChildren方法的具体用法?C++ CCTableViewCell::removeAllChildren怎么用?C++ CCTableViewCell::removeAllChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCTableViewCell
的用法示例。
在下文中一共展示了CCTableViewCell::removeAllChildren方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tableCellAtIndex
CCTableViewCell* MainLayerZhuangBeiBody::tableCellAtIndex(CCTableView *table, unsigned int idx)
{
CCString *string = CCString::createWithFormat("%d", idx);
CCTableViewCell *cell = NULL; //table->dequeueCell();
if (cell == NULL)
{
cell = new CCTableViewCell();
cell->autorelease();
}
else
{
cell->removeAllChildren();
}
//
CCMenuItemImage *itemImage = CCMenuItemImage::create(
itemFiles[idx].c_str()
,itemFiles_select[idx].c_str()
, this, SEL_MenuHandler(&MainLayerZhuangBeiBody::menuItemClicked));
CCMenu* menu = CCMenu::create();
cell->addChild(menu, 0, TAG_MENU);
menu->setPosition(CCPointZero);
menu->addChild(itemImage, 0, idx);
itemImage->setPosition(ccp(itemImage->getContentSize().width/2, itemImage->getContentSize().height/2));
return cell;
}
示例2: tableCellAtIndex
CCTableViewCell* MainLayerHerosBaseBody::tableCellAtIndex(CCTableView *table, unsigned int idx)
{
CCString *string = CCString::createWithFormat("%d", idx);
CCTableViewCell *cell = table->dequeueCell();
if (cell == NULL)
{
cell = new CCTableViewCell();
cell->autorelease();
}
else
{
cell->removeAllChildren();
}
cell->addChild(getItemContentByIndex(idx),0,TAG_BaseBody_TABLE_ITEM);
//CCLog("CCTableViewCell one");
// }
// else
// {
// //CCLog("refreshItem one");
// CCNode* temp = cell->getChildByTag(TAG_BaseBody_TABLE_ITEM);
// refreshItem(temp,idx);
// }
return cell;
}
示例3: tableCellAtIndex
CCTableViewCell* TanSuoLayer::tableCellAtIndex(CCTableView *table, unsigned int idx)
{
CCTableViewCell *cell = table->dequeueCell();
if (cell != NULL)
{
cell->removeAllChildren();
}
else
{
cell = new CCTableViewCell();
cell->autorelease();
}
if (table->getParent() != NULL)
{
CCSize cellSize = tableCellSizeForIndex(table, idx);
Profession profId = mHeros.at(idx)->getCurrentProperty().profession;
//head Profession 1-10
BaseSprite *headImg = BaseSprite::create(ImageManager::getManager()->getImageData_ProfessionHead(profId).getCurrentImageFile());
cell->addChild(headImg);
headImg->setPosition(ccp(cellSize.width/2, 92));
//menu
FXScrollMenu *menu = FXScrollMenu::create(
table->getParent()->convertToWorldSpace(table->getPosition()), table->getViewSize());
cell->addChild(menu, 1);
menu->setPosition(ccp(0,0));
CCMenuItemImage *item = CCMenuItemImage::create(
"renxing_renwu_touxiang.png",
"renxing_renwu_touxiang_select.png",
"renxing_renwu_touxiang_select.png",
this, menu_selector(TanSuoLayer::menuItemClicked_JieFenHeroSelect));
menu->addChild(item, 0, profId);
m_lMenuItemList.push_back(item);
item->setPosition(headImg->getPosition());
//name
CCLabelTTF *nameLabel = CCLabelTTF::create(BaseActorPropertyParser::getParser()->getExtraProerty(profId).nameInChinese.c_str()
, fontStr_kaiti, m_nFontSize);
cell->addChild(nameLabel);
nameLabel->setPosition(ccp(headImg->getPositionX()
, headImg->getPositionY()-headImg->getContentSize().height/2-nameLabel->getContentSize().height/2));
nameLabel->setColor(ccc3(195, 145, 96));
}
return cell;
}
示例4: tableCellAtIndex
CCTableViewCell* IOSStoreLayer::tableCellAtIndex(CCTableView *table, unsigned int idx)
{
CCTableViewCell *cell = table->dequeueCell();
if (cell)
{
cell->removeAllChildren();
}
else
{
cell = new CCTableViewCell;
cell->autorelease();
}
//根据标签来初创建不同的cell
CCSprite* pDaoju = NULL;
if (table->getTag() == kaibaoxiang_node_tableview_tag)
{
if (idx >= 0 && (int)idx < m_iBaoxiangCellCount)
{
pDaoju = this->createCellSpr(idx, &m_baoxiangInfoVector.at(idx));
}
}
else
{
if (idx >= 0 && (int)idx < m_iBuyStarCellCount)
{
pDaoju = this->createCellSpr(idx, &m_buystarInfoVector.at(idx));
}
}
if (pDaoju)
{
pDaoju->setPosition(CCPointZero);
if (idx == 0)
{
pDaoju->setPosition(ccp(10, 0));
}
pDaoju->setAnchorPoint(ccp(0,0));
cell->addChild(pDaoju);
}
return cell;
}
示例5: tableCellAtIndex
CCTableViewCell* MainLayerZhuangBeiBaseBody::tableCellAtIndex(CCTableView *table, unsigned int idx)
{
CCString *string = CCString::createWithFormat("%d", idx);
CCTableViewCell *cell = table->dequeueCell();
if (cell == NULL)
{
cell = new CCTableViewCell();
cell->autorelease();
}
else
{
cell->removeAllChildren();
}
if (table != mTableView) return cell;
cell->addChild(getItemContentByIndex(idx),0,TAG_EquipBaseBody_TABLE_ITEM);
return cell;
}