当前位置: 首页>>代码示例>>C++>>正文


C++ CButton::getUserTag方法代码示例

本文整理汇总了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();
	}
}
开发者ID:110440,项目名称:Tui-x,代码行数:31,代码来源:ProgressBarTest.cpp

示例2: onClick

void CExpandableListViewBasicTest::onClick(CCObject* pSender)
{
	CButton* pButton = (CButton*) pSender;

	pListView->collapse(pButton->getUserTag());
	pListView->reloadData();
}
开发者ID:cl0uddajka,项目名称:cocoswidget,代码行数:7,代码来源:ExpandableListViewTest.cpp

示例3: event_btn_gv

void Bagui::event_btn_gv(Ref* pSender)
{
	CButton *btn = (CButton*)pSender;
	int id = btn->getUserTag();

	CCLOG("id = %d", id);
}
开发者ID:110440,项目名称:Tui-x,代码行数:7,代码来源:Bagui.cpp

示例4: event_btn_click

void Recomebineui::event_btn_click(Ref* pSender)
{
	CButton *btn = (CButton*)pSender;
	int id = btn->getUserTag();

	CCLOG("id = %d", id);
}
开发者ID:110440,项目名称:Tui-x,代码行数:7,代码来源:Recombineui.cpp

示例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);


}
开发者ID:echenonline,项目名称:writing,代码行数:15,代码来源:ViewScene.cpp

示例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;
}
开发者ID:echenonline,项目名称:writing,代码行数:21,代码来源:MainScene.cpp

示例7: onClick

void CTableViewBindingDataAndVertical::onClick(Ref* pSender)
{
	CButton* pButton = (CButton*) pSender;
	pText->setString(m_vDatas[pButton->getUserTag()].c_str());
}
开发者ID:Kudoo,项目名称:Tui-x,代码行数:5,代码来源:TableViewTest.cpp

示例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;
	}
}
开发者ID:Kudoo,项目名称:Tui-x,代码行数:67,代码来源:ListViewTest.cpp

示例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));
}
开发者ID:echenonline,项目名称:writing,代码行数:6,代码来源:MainScene.cpp


注:本文中的CButton::getUserTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。