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


C++ Listbox::resetList方法代码示例

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


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

示例1: OnUpdateTwitter

//新品推荐
bool OnUpdateTwitter(const CEGUI::EventArgs& e)
{
    CEGUI::Window* twitter = WEArgs(e).window;
    CEGUI::Listbox*  lb = WListBox(twitter->getChildRecursive(SHOPCITY_TWITTER_CHILDLISTBOX_NAME));
#ifdef _DEBUG
    OutputDebugStr(lb->getName().c_str());
    OutputDebugStr("\n");
    OutputDebugStr(twitter->getChildAtIdx(0)->getName().c_str());
    OutputDebugStr("n");
#endif
    //清空
    lb->resetList();

    //由索引关联商城类型
    SCGData::eSCType eCityType = GetShopCityTypeByTabContentSelIndex();
    SCGData* dt = GetInst(ShopCityMsgMgr).GetShopCityGoodsData();
    //新品推荐显示
    SCGData::MapNewestA& resdta = dt->GetNewestVec();
    SCGData::VecGDPTA& vecDTA = resdta[eCityType];
    for(uint i = 0 ; i < vecDTA.size() ; ++i)
    {
        CGoodsList::tagGoods2* ptg2 = CGoodsList::GetProperty(vecDTA[i].index);
        if(ptg2)
        {
            string str  = ptg2->BaseProperty.strName.c_str();
            //CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(str.c_str(),vecDTA[i].index);//索引关联Item ID
            CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(ToCEGUIString(str.c_str()),vecDTA[i].index);//索引关联Item ID
            lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
            lb->addItem(lti);
        }
    }
    return true;
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例2: SetWorldList

/***********************************************************
set the list of available worlds
***********************************************************/
void ChooseWorldGUI::SetWorldList(const std::vector<LbaNet::WorldDesc> &list)
{
	_wlist = list;

	try
	{
		CEGUI::Listbox * lb = static_cast<CEGUI::Listbox *> (
				CEGUI::WindowManager::getSingleton().getWindow("ChooseWorldList"));
		if(lb)
		{
			lb->resetList();

			std::vector<LbaNet::WorldDesc>::const_iterator it = _wlist.begin();
			std::vector<LbaNet::WorldDesc>::const_iterator end = _wlist.end();
			for(int cc=0; it != end; ++it, ++cc)
			{
				MyListItemCW * item = new MyListItemCW(it->WorldName);
				lb->addItem(item);
				if(cc == _selectedworld)
					lb->setItemSelectState(item, true);
			}
		}
	}
	catch(CEGUI::Exception &ex)
	{
		LogHandler::getInstance()->LogToFile(std::string("Exception init the world list: ") + ex.getMessage().c_str());
		_root = NULL;
	}
}
开发者ID:Rincevent,项目名称:lbanet,代码行数:32,代码来源:ChooseWorldGUI.cpp

示例3: ClearList

/***********************************************************
clear the list
***********************************************************/
void CommunityBox::ClearList(const std::string & listname)
{
	if(listname == "online")
	{
		CEGUI::Listbox * lb = static_cast<CEGUI::Listbox *> (
			CEGUI::WindowManager::getSingleton().getWindow("Community/onlinelist"));
		lb->resetList();
		_onlines.clear();
	}

	if(listname == "IRC")
	{
		CEGUI::Listbox * lb = static_cast<CEGUI::Listbox *> (
			CEGUI::WindowManager::getSingleton().getWindow("Community/IRClist"));
		lb->resetList();
	}
}
开发者ID:leloulight,项目名称:lbanet,代码行数:20,代码来源:CommunityBox.cpp

示例4: ReturnButton

	bool MenuState::ReturnButton(const CEGUI::EventArgs &e)
	{
		wmgr->getWindow("LIGHTCYCLEMENU/MainMenu")->show();
		wmgr->getWindow("LIGHTCYCLEMENU/Lobby")->hide();
		wmgr->getWindow("LIGHTCYCLEMENU/Credits")->hide();
		wmgr->getWindow("LIGHTCYCLEMENU/ReturnButton")->hide();
		wmgr->getWindow("LIGHTCYCLEMENU/Name/Text")->hide();
		wmgr->getWindow("LIGHTCYCLEMENU/Name/EditBox")->hide();
		wmgr->getWindow("LIGHTCYCLEMENU/IP/Text")->hide();
		wmgr->getWindow("LIGHTCYCLEMENU/IP/EditBox")->hide();
		wmgr->getWindow("LIGHTCYCLEMENU/ContinueButton")->hide();

		CEGUI::Listbox *chatBox = static_cast<CEGUI::Listbox*>(wmgr->getWindow("LIGHTCYCLEMENU/Lobby/ListBox"));
		chatBox->resetList();
		CEGUI::Listbox *nameBox = static_cast<CEGUI::Listbox*>(wmgr->getWindow("LIGHTCYCLEMENU/Lobby/Participants"));
		nameBox->resetList();
		wmgr->getWindow("LIGHTCYCLEMENU/Lobby/EditBox")->setText("");

		if(LC::Client::getSingletonPtr()->is_connected())
		{
			boost::shared_ptr<boost::asio::io_service::strand> strand(
				new boost::asio::io_service::strand(*TheApplication.getIOService()));

			if(m_IsHost)
			{
				strand->post(boost::bind(&Server::write_server_close_message, LC::Server::getSingletonPtr()));
			}

			strand->post(boost::bind(&Client::write_disconnect_message, LC::Client::getSingletonPtr()));

			// Need to make sure these ^ messages are sent before any call to TheApplication.ResetIOService()
			//  is made.
		}

		m_IsHost = TheApplication.setHost(false);

		return true;
	}
开发者ID:Grogist,项目名称:LightCycle,代码行数:38,代码来源:MenuState.cpp

示例5: SetTeleportList

/***********************************************************
set the list of people begin online
***********************************************************/
void TeleportBox::SetTeleportList(const std::map<std::string, TPInfo> &_lists)
{
    CEGUI::Listbox * lb = static_cast<CEGUI::Listbox *> (
        CEGUI::WindowManager::getSingleton().getWindow("TeleportList"));

	lb->resetList();
	_tplist = _lists;
	std::map<std::string, TPInfo>::const_iterator it = _lists.begin();
	std::map<std::string, TPInfo>::const_iterator end = _lists.end();
	for(; it != end; ++it)
	{
		lb->addItem(new MyTeleListItem(it->first));
	}
}
开发者ID:leloulight,项目名称:lbanet,代码行数:17,代码来源:TeleportBox.cpp

示例6: UpdateParticipants

	void MenuState::UpdateParticipants(std::vector<std::string> participants)
	{
		CEGUI::Listbox *participantsBox =
			static_cast<CEGUI::Listbox*>(wmgr->getWindow("LIGHTCYCLEMENU/Lobby/Participants"));
		participantsBox->resetList();
		std::string scores = ("LIGHTCYCLEGAME/Score/");
		std::vector<std::string>::iterator itr = participants.begin();
		int i = 1;
		for(itr, i; itr != participants.end(); ++itr, i++)
		{
			CEGUI::ListboxTextItem *newItem = 0;
			newItem = new CEGUI::ListboxTextItem(*itr, CEGUI::HTF_WORDWRAP_LEFT_ALIGNED);
			participantsBox->addItem(newItem);
		}
	}
开发者ID:Grogist,项目名称:LightCycle,代码行数:15,代码来源:MenuState.cpp

示例7: RunSuitePressed

bool MainGameScreen::RunSuitePressed(const CEGUI::EventArgs& pEventArgs)
{

    CEGUI::Spinner* SystemSpinner = static_cast<CEGUI::Spinner*> (GUI->getWindowManager()->getWindow("MainGameScreen/PathProfileWindow/SystemSpinner"));
    CEGUI::Spinner* SeedSpinner = static_cast<CEGUI::Spinner*> (GUI->getWindowManager()->getWindow("MainGameScreen/PathProfileWindow/SeedSpinner"));
    CEGUI::Spinner* SizeSpinner = static_cast<CEGUI::Spinner*> (GUI->getWindowManager()->getWindow("MainGameScreen/PathProfileWindow/SizeSpinner"));

	vector<int> Systems;
	Systems.push_back(SystemSpinner->getCurrentValue());

	GAME->getPath()->getTester()->CreateTestSuite(SeedSpinner->getCurrentValue(), SizeSpinner->getCurrentValue());
	GAME->getPath()->getTester()->RunPathTestSuites(Systems);

	GroupProfile* TestResults = GAME->getPath()->getTester()->getCurrentGroupProfile();

    CEGUI::Window* RawWindow = GUI->getWindowManager()->getWindow("MainGameScreen/PathProfileWindow/DataList");
	CEGUI::Listbox* DataListbox = (CEGUI::Listbox*) RawWindow;
	DataListbox->resetList();

	char buffer[64] ;
	CEGUI::ListboxTextItem* newItem;

	sprintf(buffer, "TotalPathSteps     %i", TestResults->TotalPathSteps);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);

	sprintf(buffer, "TotalPathLength    %f", TestResults->TotalPathLength);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);

	sprintf(buffer, "TotalGraphReads    %i", TestResults->TotalGraphReads);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);

	sprintf(buffer, "TotalNodesExpanded %i", TestResults->TotalNodesExpanded);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);

	sprintf(buffer, "TotalCacheHits     %i", TestResults->TotalCacheHits);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);

	sprintf(buffer, "TotalTimeCost      %i", TestResults->TotalTimeCost);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);

	sprintf(buffer, "GraphReadEfficency  %f", TestResults->GraphReadEfficency);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);

	sprintf(buffer, "NodeSearchEfficency %f", TestResults->NodeSearchEfficency);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);

	sprintf(buffer, "CacheEfficency      %f", TestResults->CacheEfficency);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);

	sprintf(buffer, "TimeCostEfficency   %f", TestResults->TimeCostEfficency);
	newItem = new CEGUI::ListboxTextItem(buffer);
	DataListbox->addItem(newItem);
}
开发者ID:Ackak,项目名称:Khazad,代码行数:62,代码来源:MainGameScreen.cpp


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