本文整理汇总了C++中CLabel::setOnClickListener方法的典型用法代码示例。如果您正苦于以下问题:C++ CLabel::setOnClickListener方法的具体用法?C++ CLabel::setOnClickListener怎么用?C++ CLabel::setOnClickListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLabel
的用法示例。
在下文中一共展示了CLabel::setOnClickListener方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addTableCell
void CHandBookHeroLayer::addTableCell( unsigned int uIdx, CTableViewCell * pCell )
{
//先克隆外框条
CLayout *pLay = UICloneMgr::cloneLayout(m_pCellBlank);
//对应数据
AtlasIns *pAtlasIns = m_AtlasResponse.mutable_atlas_list()->Mutable(uIdx);
//赋值
for (unsigned int i=1; i<=10; i++)
{
CCNode *child = pLay->getChildByTag(i);
pLay->removeChild(child);
child->setTag(i);
pCell->addChild(child);
pCell->setTag(uIdx);
}
//1-活动底板
{
CImageView* pBoard = dynamic_cast<CImageView*>(pCell->getChildByTag(1));
pBoard->setTouchEnabled(true);
pBoard->setOnClickListener(this, ccw_click_selector(CHandBookHeroLayer::onClickBlank));
if ( uIdx==m_iSelectIndex )
{
pBoard->setTexture(CCTextureCache::sharedTextureCache()->addImage("handBook/bookbg_2.png"));
}
else
{
pBoard->setTexture(CCTextureCache::sharedTextureCache()->addImage("handBook/bookbg_1.png"));
}
}
//2-组合名字
{
CLabel* pLabel = dynamic_cast<CLabel*>(pCell->getChildByTag(2));
}
//3-//组合描述
{
CLabel* pLabel = dynamic_cast<CLabel*>(pCell->getChildByTag(3));
}
//4-礼品背景
//5-礼品
//10-文字
{
CImageView* pGiftBg = dynamic_cast<CImageView*>(pCell->getChildByTag(4));
CImageView* pGift = dynamic_cast<CImageView*>(pCell->getChildByTag(5));
CLabel* pLabel = dynamic_cast<CLabel*>(pCell->getChildByTag(10));
pLabel->setVisible(false);
pGift->stopAllActions();
//奖励领取标志 0未领取(不可领取),1未领取(可领取状态),2 已领取
switch (pAtlasIns->get_prize())
{
case 0:
{
pGiftBg->setShaderProgram(ShaderDataMgr->getShaderByType(ShaderStone));
pGift->setShaderProgram(ShaderDataMgr->getShaderByType(ShaderStone));
}break;
case 1:
{
pGiftBg->setShaderProgram(ShaderDataMgr->getShaderByType(ShaderDefault));
pGift->setShaderProgram(ShaderDataMgr->getShaderByType(ShaderDefault));
ResetAnchorPointAndKeepSamePos(pGift, CCPointCenter);
pGift->runAction(CCRepeatForever::create(CCSequence::createWithTwoActions(CCScaleTo::create(0.3f, 0.75f), CCScaleTo::create(0.3f, 0.7f))));
}break;
case 2:
{
pGiftBg->setVisible(false);
pGift->setVisible(false);
pLabel->setVisible(true);
}break;
default:
break;
}
}
//7-进度条
//8-进度数字
//9-进度图标
{
CProgressBar* pProgress = dynamic_cast<CProgressBar*>(pCell->getChildByTag(7));
CLabel* pLabel = dynamic_cast<CLabel*>(pCell->getChildByTag(8));
pLabel->setTouchEnabled(true);
pLabel->setOnClickListener(this, ccw_click_selector(CHandBookHeroLayer::onClickScoreIcon));
CImageView* pIcon = dynamic_cast<CImageView*>(pCell->getChildByTag(9));
pIcon->setTouchEnabled(true);
pIcon->setOnClickListener(this, ccw_click_selector(CHandBookHeroLayer::onClickScoreIcon));
}
//.........这里部分代码省略.........