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


C++ CCheckBox::setOnCheckListener方法代码示例

本文整理汇总了C++中CCheckBox::setOnCheckListener方法的典型用法代码示例。如果您正苦于以下问题:C++ CCheckBox::setOnCheckListener方法的具体用法?C++ CCheckBox::setOnCheckListener怎么用?C++ CCheckBox::setOnCheckListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCheckBox的用法示例。


在下文中一共展示了CCheckBox::setOnCheckListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onEnter

void CSignLayer::onEnter()
{
	BaseLayer::onEnter();

	//签到grid的cell
	m_cell = (CLayout*)(m_ui->findWidgetById("Cell"));
	m_cell->retain();
    m_ui->removeChild(m_cell);

	m_gridView = (CGridView*)m_ui->findWidgetById("scroll");
	m_gridView->setDirection(eScrollViewDirectionVertical);	
	m_gridView->setCountOfCell(0);
	m_gridView->setSizeOfCell(m_cell->getContentSize());
	m_gridView->setAnchorPoint(ccp(0,0));
	m_gridView->setColumns(5);
	m_gridView->setAutoRelocate(false);
	m_gridView->setDeaccelerateable(true);
	m_gridView->setDataSourceAdapter(this,ccw_datasource_adapter_selector(CSignLayer::gridviewDataSource));
	m_gridView->reloadData();


	m_signLay = (CLayout*)(m_ui->findWidgetById("Sign"));


	//退出
	CButton* pClose = CButton::create("common/back.png", "common/back.png");
	pClose->getSelectedImage()->setScale(1.1f);
	pClose->setPosition(VLEFT+50, VTOP-50);
	pClose->setOnClickListener(this,ccw_click_selector(CSignLayer::onClose));
	this->addChild(pClose, 999);

	//book
	CCheckBox* pBook = (CCheckBox*)(m_ui->findWidgetById("book"));
	pBook->setOnCheckListener(this,ccw_check_selector(CSignLayer::showHeroBook));

	//按钮补签
	CButton* pResign = (CButton*)m_ui->findWidgetById("buqian_btn");
	pResign->setOnClickListener(this, ccw_click_selector(CSignLayer::onBtnResignDay));

	//按钮签到
	CButton* pSign = (CButton*)m_ui->findWidgetById("qiandao_btn");
	pSign->setOnClickListener(this, ccw_click_selector(CSignLayer::onBtnSignDay));

	GetTcpNet->registerMsgHandler(SignDataMsg,this, CMsgHandler_selector(CSignLayer::ProcessMsg));
	GetTcpNet->registerMsgHandler(SignReqMsg,this, CMsgHandler_selector(CSignLayer::ProcessMsg));
}
开发者ID:54993306,项目名称:Classes,代码行数:46,代码来源:SignLayer.cpp

示例2: onEnter

void CSmeltArmor::onEnter()
{
	BaseLayer::onEnter();

	//四个选择框
	for (unsigned int i=0; i<4; ++i)
	{
		CCheckBox *checkBtn = (CCheckBox*)(m_pBaseInfo[i]->findWidgetById("check"));
		checkBtn->setOnCheckListener(this,ccw_check_selector(CSmeltArmor::onCheckAttr));
	}

	//选择武器
	CButton *select = (CButton*)(m_ui->findWidgetById("select"));
	select->setOnClickListener(this, ccw_click_selector(CSmeltArmor::onSelectItem));

	//洗练
	CButton *refine = (CButton*)(m_ui->findWidgetById("refine"));
	refine->setOnClickListener(this, ccw_click_selector(CSmeltArmor::onRefineItem));
	
	//初始化火
	initFire();

	//旋转圈
	CImageView *circleFire = (CImageView*)(m_ui->findWidgetById("fire_circle"));
	circleFire->setScale(1.95f);
	circleFire->runAction(CCRepeatForever::create(CCRotateBy::create(1.0f, 60)));
	circleFire->runAction(CCRepeatForever::create(CCSequence::createWithTwoActions(CCScaleTo::create(1.2f, 2.1f), CCScaleTo::create(1.2f, 1.95f))));


	GetTcpNet->registerMsgHandler(SmeltArmorMsg,this,CMsgHandler_selector(CSmeltArmor::proceesMessage));
	GetTcpNet->registerMsgHandler(SmeltDataRequestMsg,this,CMsgHandler_selector(CSmeltArmor::proceesMessage));

	CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_HERO, this, GameMsghandler_selector(CSmeltArmor::roleUpdate));
	
	CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_ITEM_DATA, this, GameMsghandler_selector(CSmeltArmor::updateStar));
}
开发者ID:54993306,项目名称:Classes,代码行数:36,代码来源:SmeltArmor.cpp


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