本文整理汇总了C++中CCheckBox::isChecked方法的典型用法代码示例。如果您正苦于以下问题:C++ CCheckBox::isChecked方法的具体用法?C++ CCheckBox::isChecked怎么用?C++ CCheckBox::isChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCheckBox
的用法示例。
在下文中一共展示了CCheckBox::isChecked方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onClick
void CCheckBoxBasicTest::onClick(CCObject* pSender)
{
CCheckBox* pCheckBox = (CCheckBox*) pSender;
if( pCheckBox->isChecked() )
{
m_pText->setString("checked");
}
else
{
m_pText->setString("unchecked");
}
}
示例2: checkBoxClick
void ViewScene::checkBoxClick(CCObject* pSender){
CCheckBox* pCheckBox = (CCheckBox*) pSender;
int userTag = pCheckBox->getUserTag();
if (pCheckBox->isChecked())
{
dltList.push_back(userTag);
}else{
std::vector<int>::iterator pos = std::find(dltList.begin(),dltList.end(),userTag);
if (pos != dltList.end())
{
dltList.erase(pos);
}
}
}
示例3: onRefineItem
void CSmeltArmor::onRefineItem(CCObject* pSender)
{
//检查货币是否足够
CLabel *money = (CLabel *)(m_ui->findWidgetById("money"));
int iCost = atoi(money->getString());
if(m_iStrengthType==0)
{
if(!CheckCoin(iCost))
{
//ShowPopTextTip(GETLANGSTR(205));
CShowToBuyResource* pShow = CShowToBuyResource::create();
pShow->showToBuyResourceByType(ShowBuyResourceCoin);
return;
}
}
else
{
if(!CheckGold(iCost))
{
//ShowPopTextTip(GETLANGSTR(203));
CShowToBuyResource* pShow = CShowToBuyResource::create();
pShow->showToBuyResourceByType(ShowBuyResourceGold);
return;
}
}
vector<int> checkVec;
if(m_iStrengthType != 0)
{
for (unsigned int i=0; i<4; ++i)
{
CCheckBox* pCheckBtn = (CCheckBox*)(m_pBaseInfo[i]->findWidgetById("check"));
if (pCheckBtn->isChecked())
{
checkVec.push_back(pCheckBtn->getTag());
}
}
}
if (m_armor.id>0)
{
CPlayerControl::getInstance().sendSmeltArmor(m_armor.id, checkVec);
}
}
示例4: onCheckAttr
void CSmeltArmor::onCheckAttr(CCObject *pSender, bool bChecked)
{
int checknum =0;
int iShowCount = 0;
for (unsigned int i=0; i<4; ++i)
{
CCheckBox* pCheckBtn = (CCheckBox*)(m_pBaseInfo[i]->findWidgetById("check"));
if (pCheckBtn->isChecked())
{
checknum++;
}
if(m_pBaseInfo[i]->isVisible())
{
iShowCount++;
}
setYellowBgState(pCheckBtn, pCheckBtn->isChecked());
}
//如果选中了四个,则屏蔽掉一个,提示不能全选
if(checknum>=iShowCount && pSender!=nullptr)
{
CCheckBox* pCheck = (CCheckBox*)pSender;
pCheck->setEnabled(false);
pCheck->setChecked(false);
pCheck->setEnabled(true);
setYellowBgState(pCheck, false);
ShowPopTextTip(GETLANGSTR(1182));
return;
}
if (checknum==0)
{
CCSprite *coin = (CCSprite *)(m_ui->findWidgetById("coin"));
coin->setVisible(true);
m_coin = 0;
switch (m_armor.quality)
{
case 1:
m_coin =10000;
break;
case 2:
m_coin =20000;
break;
case 3:
m_coin =40000;
break;
case 4:
m_coin =80000;
break;
case 5:
m_coin =160000;
break;
default:
break;
}
m_diamond = 0;
CCSprite *diamond = (CCSprite *)(m_ui->findWidgetById("diamond"));
diamond->setVisible(false);
CLabel *money = (CLabel *)(m_ui->findWidgetById("money"));
money->setString(ToString(m_coin));
//检查货币数量
if(!CheckCoin(atoi(money->getString())))
{
money->setColor(RGB_RED);
}
else
{
money->setColor(RGB_WHITE);
}
showFireWithType(0);
}
else
{
CCSprite *coin = (CCSprite *)(m_ui->findWidgetById("coin"));
coin->setVisible(false);
CCSprite *diamond = (CCSprite *)(m_ui->findWidgetById("diamond"));
diamond->setVisible(true);
CLabel *money = (CLabel *)(m_ui->findWidgetById("money"));
money->setString(ToString(100*checknum));
//检查货币数量
if(!CheckGold(atoi(money->getString())))
{
money->setColor(RGB_RED);
}
else
{
money->setColor(RGB_WHITE);
}
m_coin = 0;
m_diamond = 100*checknum;
showFireWithType(1);
//.........这里部分代码省略.........