本文整理汇总了C++中CButton::getUserTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::getUserTag方法的具体用法?C++ CButton::getUserTag怎么用?C++ CButton::getUserTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::getUserTag方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onClick
void CProgressBarBasicTest::onClick(Ref* pSender)
{
CButton* pButton = (CButton*) pSender;
if( pButton->getUserTag() == 1 )
{
m_pProgressBar->setValue(m_pProgressBar->getValue() + 10);
}
else if( pButton->getUserTag() == 2 )
{
m_pProgressBar->setValue(m_pProgressBar->getValue() - 5);
}
else if( pButton->getUserTag() == 3 )
{
if( m_pProgressBar->getDirection() == eProgressBarDirectionLeftToRight )
{
m_pProgressBar->setDirection(eProgressBarDirectionRightToLeft);
}
else
{
m_pProgressBar->setDirection(eProgressBarDirectionLeftToRight);
}
}
else if( pButton->getUserTag() == 4 )
{
m_pProgressBar->startProgress(100, 5.0f);
}
else if( pButton->getUserTag() == 5 )
{
m_pProgressBar->stopProgress();
}
}
示例2: onClick
void CExpandableListViewBasicTest::onClick(CCObject* pSender)
{
CButton* pButton = (CButton*) pSender;
pListView->collapse(pButton->getUserTag());
pListView->reloadData();
}
示例3: event_btn_gv
void Bagui::event_btn_gv(Ref* pSender)
{
CButton *btn = (CButton*)pSender;
int id = btn->getUserTag();
CCLOG("id = %d", id);
}
示例4: event_btn_click
void Recomebineui::event_btn_click(Ref* pSender)
{
CButton *btn = (CButton*)pSender;
int id = btn->getUserTag();
CCLOG("id = %d", id);
}
示例5: buttonClick
void ViewScene::buttonClick(CCObject* pSender){
CCLog("ViewScene::buttonClick");
CButton* pBtn = (CButton*)pSender;
selectDeleteNote = pBtn->getUserTag();
//delete function
CCSprite* backgroundImg = CCSprite::create("strangedesign/Dlg_background.png");
PopCancelLayer* dialog = PopCancelLayer::create("strangedesign/Dlg_background.png");
dialog->setContentSize(backgroundImg->getContentSize());
dialog->addButton("strangedesign/Dlg_delete_button.png","strangedesign/Dlg_delete_button_down.png","Y",0);
dialog->setCallBackFunc(this,callfuncN_selector(ViewScene::dlgCallback));
CCDirector::sharedDirector()->getRunningScene()->addChild(dialog,10,1001);
}
示例6: buttonLongClick
bool MainScene::buttonLongClick(CCObject* pSender, CCTouch* pTouch){
// long press enter edit UI
CCSprite* backgroundIMG = CCSprite::create("strangedesign/Dlg_background.png");
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
PopCancelLayer* exitDialog = PopCancelLayer::create("strangedesign/Dlg_background.png");
CCSize originSize = CCSizeMake(winSize.width*0.75,winSize.height*0.5);
exitDialog->setContentSize(backgroundIMG->getContentSize());
//exitDialog->setTitle("Setting",50);
//exitDialog->setContentText("Setting Loose or tight!",60,100,150);
exitDialog->setCallBackFunc(this,callfuncN_selector(MainScene::dlgCallBack));
exitDialog->addButton("strangedesign/Dlg_delete_button.png","strangedesign/Dlg_delete_button_down.png","Y",0);
exitDialog->addButton("strangedesign/Dlg_edit_button.png","strangedesign/Dlg_edit_button_down.png","N",1);
// exitDialog->addButton("strangedesign/Dlg_cancel_button.png","strangedesign/Dlg_cancel_button_down.png","N",2);
CCDirector::sharedDirector()->getRunningScene()->addChild(exitDialog,100,TAG_SETTING_LAYER);
CButton* pButton = (CButton*)pSender;
int idx = pButton->getUserTag();
longClickSelectUnitID = unit_ids.at(idx);
return true;
}
示例7: onClick
void CTableViewBindingDataAndVertical::onClick(Ref* pSender)
{
CButton* pButton = (CButton*) pSender;
pText->setString(m_vDatas[pButton->getUserTag()].c_str());
}
示例8: onClick
void CListViewOperateTest::onClick(Ref* pSender)
{
CButton* pButton = (CButton*) pSender;
switch(pButton->getUserTag())
{
case 1:
{
CLayout* pLayout = CLayout::create();
pLayout->setContentSize(Size(480, 30));
/*
CColorView* pColor = CColorView::create(Color4B(128, 0, 0, 255));
pColor->setContentSize(Size(478, 28));
pColor->setPosition(Point(480/2, 30/2));
pLayout->addChild(pColor);
*/
CButton* pButton = CButton::createWith9Sprite(Size(150, 25),
"sprite9_btn1.png", "sprite9_btn2.png");
pButton->setPosition(Vec2(480 /2, 30 /2));
char str[64] = {0};
sprintf(str, "%d", last_add_idx);
pButton->initText(str, "", 20);
pLayout->addChild(pButton);
last_add_idx++;
m_pListView->insertNodeAtLast(pLayout);
m_pListView->reloadData();
}
break;
case 2:
{
CLayout* pLayout = CLayout::create();
pLayout->setContentSize(Size(480, 30));
/*
CColorView* pColor = CColorView::create(Color4B(0, 128, 0, 255));
pColor->setContentSize(Size(478, 28));
pColor->setPosition(Point(480/2, 30/2));
pLayout->addChild(pColor);
*/
CButton* pButton = CButton::createWith9Sprite(Size(150, 25),
"sprite9_btn1.png", "sprite9_btn2.png");
pButton->setPosition(Vec2(480 /2, 30 /2));
char str[64] = {0};
sprintf(str, "%d", last_add_idx);
pButton->initText(str, "", 20);
pLayout->addChild(pButton);
last_add_idx++;
m_pListView->insertNodeAtFront(pLayout);
m_pListView->reloadData();
}
break;
case 3:
{
m_pListView->removeLastNode();
m_pListView->reloadData();
}
break;
case 4:
{
m_pListView->removeFrontNode();
m_pListView->reloadData();
}
break;
default:
break;
}
}
示例9: buttonClick
void MainScene::buttonClick(CCObject* pSender){
CButton* pButton = (CButton*)pSender;
int idx = pButton->getUserTag();
string id = unit_ids.at(idx); // 将顺序数字转化成数据库中的id
CCDirector::sharedDirector()->replaceScene(WallSingleScene::scene(id));
}