本文整理汇总了C++中CCTableViewCell::getIdx方法的典型用法代码示例。如果您正苦于以下问题:C++ CCTableViewCell::getIdx方法的具体用法?C++ CCTableViewCell::getIdx怎么用?C++ CCTableViewCell::getIdx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCTableViewCell
的用法示例。
在下文中一共展示了CCTableViewCell::getIdx方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CCLog
void MallMarkets::menuItemCall2(CCObject *pSender)
{
CCTableViewCell *cell = (CCTableViewCell*)(((CCMenuItemImage*)pSender)->getParent()->getParent());
CCLog("getIdx: %d",cell->getIdx());
int amountNumber = this->coinNumber[cell->getIdx()];
char amount2[11];
sprintf(amount2, "%d",amountNumber);
string amount3 = amount2;
int price = this->coinListPrice[cell->getIdx()];
char tempPrice[10];
sprintf(tempPrice, "%d",price);
string priceString = tempPrice;
CCLog("price: %s",priceString.c_str());
string postData ;
string temp1 = "buy_method=2";
string temp2 = "&buy_amount=";
string temp3 = "&rmb=";
postData = temp1 + temp2 + amount3 + temp3 + priceString ;
CCLog("postData: %s",postData.c_str());
CCLog("returnData1: %s",this->returnDataBusiness.c_str());
/*PrizeMoneyChange acceptPrize;
acceptPrize.prizeID = this->coinID[cell->getIdx()];
acceptPrize.prizeName = this->coinName[cell->getIdx()];
acceptPrize.prizePrice = this->coinListPrice[cell->getIdx()];
CCDirector::sharedDirector()->pushScene(CCTransitionSlideInR::create(1, PrizeMoneyChange::scene()));*/
}
示例2: menuItemClicked_heroImg
void MainLayerHerosBaseBody::menuItemClicked_heroImg(CCObject* pSender)
{
CCTableViewCell *cell = (CCTableViewCell*)((CCMenuItemSprite*)pSender)->getParent()->getParent()->getParent();
int idx = cell->getIdx();
AddFriendUI *layer = AddFriendUI::create();
layer->ignoreAnchorPointForPosition(false);
layer->setAnchorPoint(CCPointZero);
layer->setPosition(CCPointZero);
layer->setProfessionId(mHerosVec[idx]->getActorType());
layer->setMenuShow(true,false);
CCDirector::sharedDirector()->getRunningScene()->addChild(layer,1024);
}
示例3: menuItemClicked_choseHero
void MainLayerHerosBaseBody::menuItemClicked_choseHero(CCObject* pSender)
{
BaseSprite* bg = (BaseSprite*)((CCMenuItemImage*)pSender)->getParent()->getParent();
CCTableViewCell* cell = (CCTableViewCell*)bg->getParent();
int idx = cell->getIdx();
if(mChoseHeroState[idx]>=1 && mChoseHeroState[idx]<=4)
{
mChoseHeroState[idx] = 0;
--mChoseNum;
// mTableView->reloadData();
for(int i=0; i!=mHerosVec.size(); ++i)
mTableView->updateCellAtIndex(i);
}
else if(mChoseHeroState[idx] == 0 && mChoseNum<3)
{
int temp[4] = {false};
int chessboard;
for(int i=0; i!=mChoseHeroState.size(); ++i)
if(mChoseHeroState[i]>=1 && mChoseHeroState[i]<=4)
temp[mChoseHeroState[i]-1] = true;
for(int i=0; i!=4; ++i)
if(! temp[i])
{
if(MyselfManager::getManager()->getMyZhuJueData()->getChessBoardPos() == i+1)
continue;
chessboard = i+1;
break;
}
mChoseHeroState[idx] = chessboard;
++mChoseNum;
// mTableView->reloadData();
for(int i=0; i!=mHerosVec.size(); ++i)
mTableView->updateCellAtIndex(i);
}
}
示例4: selectAtIndex
void MainLayerZhuangBeiBody::selectAtIndex(unsigned int index)
{
// 0 是第一个 所有装备
CCTableViewCell* currentCell = tableView->cellAtIndex(index);
CCTableViewCell* lastCell = tableView->cellAtIndex(selectedIndex);
//if (selectedIndex != index)
{
if (lastCell!=NULL)
{
CCMenuItemImage* itemImage = (CCMenuItemImage*)lastCell->getChildByTag(TAG_MENU)->getChildByTag(lastCell->getIdx());
int idx = itemImage->getTag();
itemImage->initWithNormalImage(
itemFiles[idx].c_str()
,itemFiles_select[idx].c_str()
,NULL, this, menu_selector(MainLayerZhuangBeiBody::menuItemClicked));
}
if (currentCell!=NULL)
{
CCMenuItemImage* itemImage = (CCMenuItemImage*)currentCell->getChildByTag(TAG_MENU)->getChildByTag(currentCell->getIdx());
int idx = itemImage->getTag();
itemImage->initWithNormalImage(
itemFiles_select[idx].c_str()
,itemFiles[idx].c_str()
,NULL, this, menu_selector(MainLayerZhuangBeiBody::menuItemClicked));
}
selectedIndex = index;
BaseLayer* content = createContentAtIndex(index);
if (selectedContaint)
{
selectedContaint->removeFromParent();
}
if (content)
{
container->addChild(content);
content->setPosition(ccp(0,0));
}
selectedContaint = content;
}
}
示例5: tableViewSubBtnCallback
void MainScene::tableViewSubBtnCallback(CCObject* pSender)
{
CCTableViewCell *cell = (CCTableViewCell*)(((CCMenuItemImage*)pSender)->getParent()->getParent());
CCLog("tableViewSubBtnCallback,%d",cell->getIdx());
// ((CCMenuItemImage*)pSender)->setScaleX(2);
}