• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ cegui::ListboxTextItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: partButton

	bool WorkshopState::partButton(const CEGUI::EventArgs & e) {
		if(typeid(CEGUI::WindowEventArgs) == typeid(e)) {
			const CEGUI::WindowEventArgs & wea = dynamic_cast<const CEGUI::WindowEventArgs &>(e);
			_lastSelectedPart = wea.window->getName().c_str();
			Logic::GameManager * gameManager = Logic::GameManager::GetInstance();
			if(gameManager->getWorkshopInfo()->containsPart(_lastSelectedPart)) {
				_parts->resetList();
				Logic::WorkshopInfo::PartInfo & info = gameManager->getWorkshopInfo()->findPart(_lastSelectedPart);
				Logic::WorkshopInfo::ComponentInfoVector::iterator i = info.components.begin();
				Logic::WorkshopInfo::ComponentInfoVector::iterator end = info.components.end();
				CEGUI::ListboxTextItem * item = 0;
				for(unsigned int j = 0; i != end; ++i, ++j) {
					_parts->addRow();
					item = new CEGUI::ListboxTextItem(i->name);
					item->setSelectionColours(CEGUI::colour(0.0f, 0.6f, 0.0f));
					item->setSelectionBrushImage("MultiColumnSelector", "Selector");
					_parts->setItem(item, 0, j);
					item = new CEGUI::ListboxTextItem(
						(i->buyed ? (i->selected ? "Selected": "") : Ogre::StringConverter::toString(i->cost))
					);
					item->setSelectionColours(CEGUI::colour(0.0f, 0.6f, 0.0f));
					item->setSelectionBrushImage("MultiColumnSelector", "Selector");
					_parts->setItem(item, 1, j);
				}
				_properties->setText("");
				_money->setText(gameManager->getMoneyAsString());
				showDialogPanel();
			}
		}
		return true;
	}
开发者ID:gorkinovich,项目名称:DefendersOfMankind,代码行数:31,代码来源:WorkshopState.cpp


示例2: UpdateCanSaleMCLDate

bool UpdateCanSaleMCLDate(const CEGUI::EventArgs& e)
{
	AHdata& ah = GetInst(AHdata);
	AHdata::vecOrderRaw listOR = ah.m_CanSaleOrder;//可出售列表
	CEGUI::MultiColumnList* mcl = WMCL(WEArgs(e).window);
	if(!mcl)
		return false;
	mcl->resetList();
	AHdata::vecOrderRaw::iterator it = listOR.begin();
	for (uint i = 0 ; i < listOR.size() ; ++i,++it)
	{
		mcl->addRow();
		CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(ToCEGUIString(AppFrame::GetText("AU_104")),it->id);//第二个参数与订单ID关联
		lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
		mcl->setItem(lti,0,i);

		lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(it->price));
		lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
		mcl->setItem(lti,1,i);

		lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(it->cnt));
		lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
		mcl->setItem(lti,2,i);
	}
	return true;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:26,代码来源:Auction.cpp


示例3: Update

  void SettingComboBox::Update()
  {
    CEGUI::Combobox* box = getComboBoxW();

    if (settings.GetSize())
    {
      csRef<Setting> setting = settings.Get(0);
      if (setting->IsValid())
      {
        if (setting->IsDefault())
          box->getEditbox()->setText("Default");
        else
          box->getEditbox()->setText(GetKey(setting->GetAsString().c_str()));
      }
    }

    if (box->getItemCount() == 0)
    {
      Values::const_iterator it = values.begin();
      for (size_t i = 0; it != values.end(); it++, i++)
      {
        CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem(it->first.c_str(), (CEGUI::uint)i);
        item->setTextColours(CEGUI::colour(0.f, 0.f, 0.f)); 
        box->getDropList()->addItem(item);
      }
    }
  }
开发者ID:GameLemur,项目名称:Crystal-Space,代码行数:27,代码来源:settingcombobox.cpp


示例4: logEvent

	void GameLoggerWindow::logEvent(const CeGuiString& text, const CEGUI::colour color)
	{
		CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem(text);
		item->setTextColours(color);
		mLog->addItem(item);
		mLog->ensureItemIsVisible(item);
	}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:7,代码来源:GameLoggerWindow.cpp


示例5: 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,代码来源:


示例6: outputConsoleText

void DeveloperConsole::outputConsoleText(const CEGUI::String& text, CEGUI::Colour color) {
    CEGUI::Listbox* listbox = static_cast<CEGUI::Listbox*>(mConsoleWindow->getChild("History"));
    
    CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem(text);
    item->setTextColours(color);
    listbox->addItem(item);
    listbox->ensureItemIsVisible(item);
}
开发者ID:Naftoreiclag,项目名称:VS8C,代码行数:8,代码来源:DeveloperConsole.cpp


示例7: listDir

void
MenuState::createGUI()
{
  //Limpiar interfaz del estado anterior-------------------
  CEGUI::Window* sheet=CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow();

  //-------------------------------------------------------
  CEGUI::Window* sheetBG =  CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticImage","backgroundMenu");
  sheetBG->setPosition(CEGUI::UVector2(cegui_reldim(0),cegui_reldim(0)));
  sheetBG->setSize( CEGUI::USize(cegui_reldim(1),cegui_reldim(1)));
  sheetBG->setProperty("Image","BackgroundImageMenu");
  sheetBG->setProperty("FrameEnabled","False");
  sheetBG->setProperty("BackgroundEnabled", "False");


  CEGUI::ListboxTextItem* itm;


  CEGUI::Listbox* editBox = static_cast<CEGUI::Listbox*> (CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Listbox","listbox"));
  editBox->setSize(CEGUI::USize(CEGUI::UDim(0.6,0),CEGUI::UDim(0.6,0)));
  editBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0.20, 0),CEGUI::UDim(0.10, 0)));

  const CEGUI::Image* sel_img = &CEGUI::ImageManager::getSingleton().get("TaharezLook/MultiListSelectionBrush");
  
  std::vector<string> files = listDir("./data/Levels/*"); // ./Para directorio actual ./Carpeta/* para otra carpeta
  for(unsigned int i=0;i<files.size();i++){
    string aux=files[i];
    if(Ogre::StringUtil::endsWith(aux,".txt")){
      cout << "================ File: " << aux <<"================"<< endl;
      _recorridos.push_back(aux);
      string file=Ogre::StringUtil::split(aux,"/")[3];
      cout<<"File: " << file << endl;
      file=Ogre::StringUtil::replaceAll(file,".txt","");
      cout<<"File: " << file << endl;
      itm = new CEGUI::ListboxTextItem(file,0);
      itm->setFont("DickVanDyke-28");
      itm->setTextColours(CEGUI::Colour(0.0,0.8,0.5));
      itm->setSelectionBrushImage(sel_img);
      editBox->addItem(itm);
    }
    
  }
  //---------------------------------------------------

  CEGUI::Window* playButton = CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Button","playButton");
  playButton->setText("[font='DickVanDyke'] Start");
  playButton->setSize(CEGUI::USize(CEGUI::UDim(0.25,0),CEGUI::UDim(0.07,0)));
  playButton->setPosition(CEGUI::UVector2(CEGUI::UDim(0.4,0),CEGUI::UDim(0.8,0)));
  playButton->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&MenuState::playB,this));

  sheetBG->addChild(playButton);
  sheetBG->addChild(editBox);
  sheet->addChild(sheetBG);

}
开发者ID:RubenCardos,项目名称:CrackShot,代码行数:55,代码来源:MenuState.cpp


示例8: addServerView

void ServerList::addServerView(Server *s)
{
    unsigned int row = m_listeServeurs->addRow();
    CEGUI::ListboxTextItem *item = new CEGUI::ListboxTextItem("", 0);
    for(size_t i=0;i<6;++i)
    {
        item = new CEGUI::ListboxTextItem("", 0);
        item->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
        item->setUserData(s);
        m_listeServeurs->setItem(item, i, row);
    }
    updateServer(s);
}
开发者ID:xabufr,项目名称:meteor-falls,代码行数:13,代码来源:ServerList.cpp


示例9: actualize_list

bool EntityCreator::actualize_list(const CEGUI::EventArgs& args)
{
	list_box_->resetList();
	CEGUI::ListboxTextItem* item;
	CEGUI::Colour col{1.f, .5f, .1f};
	for(auto& ent : registered_entities_)
	{
		item = new CEGUI::ListboxTextItem(ent);
		item->setTextColours(Console::ORANGE_TEXT);
		item->setSelectionBrushImage("AlfiskoSkin/GenericBrush");
		item->setSelectionColours(Console::BLUE_TEXT);
		list_box_->addItem(item);
	}

	return true;
}
开发者ID:Dzejrou,项目名称:tdt,代码行数:16,代码来源:EntityCreator.cpp


示例10: print

void GameLog::print(const std::string& msg)
{
	CEGUI::ListboxTextItem* text;
	if(log_->getItemCount() >= log_history_)
	{
		text = (CEGUI::ListboxTextItem*)log_->getListboxItemFromIndex(0);
		text->setAutoDeleted(false);
		log_->removeItem(text);
		text->setAutoDeleted(true);
		text->setText(msg);
	}
	else
		text = new CEGUI::ListboxTextItem(msg);
	text->setTextColours(CEGUI::Colour{0.f, 1.f, 0.f});
	log_->addItem(text);
	//log_->getVertScrollbar()->scrollForwardsByStep();
	log_->getVertScrollbar()->setScrollPosition(log_->getVertScrollbar()->getDocumentSize());
}
开发者ID:halbich,项目名称:DK,代码行数:18,代码来源:GameLog.cpp


示例11: ResetHairColorDateOnHairChanged

void ResetHairColorDateOnHairChanged()
{
    CEGUI::WindowManager& mgr = GetWndMgr();
    CEGUI::Combobox* hairColor = WComboBox(mgr.getWindow(CREATEROLE_SEL_HAIRCOLOR_CCB));
    if(hairColor)
    {
        hairColor->resetList();
        //清空发色类型文本
        hairColor->getEditbox()->setText("");
        for(short i = 0 ; i < CREvent::GetHairColorNum(CREvent::GetSelectSex(),(WORD)CREvent::GetHair()) ; ++i)
        {
            CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(i));
            lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
            lti->setID(i);//ID和HairColorIndex关联
            hairColor->addItem(lti);
        }
    }
}
开发者ID:,项目名称:,代码行数:18,代码来源:


示例12: ListDrives

void GUISystem::FolderSelector::UpdateFolderList()
{
    if (!mCurrentPath.empty() && !boost::filesystem::is_directory(mCurrentPath))
    {
        ocWarning << "Current path '" << mCurrentPath << "' is an incorrect directory; using current directory";
        mCurrentPath = boost::filesystem::current_path<boost::filesystem::path>().directory_string();
    }

    if (!boost::istarts_with(mCurrentPath, mRootPath))
    {
        mCurrentPath = mRootPath;
    }

    mFolders.clear();
    if (mCurrentPath.empty())
    {
        // if the path is empty it means we're listing drives
        ListDrives(mFolders);
    }
    else
    {
        ListDirectoryContent(mCurrentPath, mFolders);
    }
    Containers::sort(mFolders.begin(), mFolders.end());

    if (IsStringValid(mCurrentPath)) mPathBox->setText(utf8StringToCEGUI(GetRelativePath(mCurrentPath)));
    else mPathBox->setText("!INVALID-PATH!");

    mFolderList->resetList();

    for (vector<string>::iterator it = mFolders.begin(); it != mFolders.end(); ++it)
    {
        CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem(utf8StringToCEGUI(*it));
        item->setSelectionBrushImage("Vanilla-Images", "GenericBrush");
        item->setID(it - mFolders.begin());
        mFolderList->addItem(item);
    }
}
开发者ID:trietptm,项目名称:Ocerus,代码行数:38,代码来源:FolderSelector.cpp


示例13: addToLog

void CSimulatorWindowHandler::addToLog(const std::string &text)
{
    unsigned int historySize = 7;
    unsigned int shortHistorySize = 3;
    std::ostringstream message;
    // If there's text then add it
    if(text.size()) {
        message << m_simulator->getReferee()->getMinute() << "' - " << text.c_str();
        // Add the Editbox text to the history Listbox
        CEGUI::ListboxTextItem* logItem;
        if(m_logHistoryList->getItemCount() == historySize) {
            /* We have reached the capacity of the Listbox so re-use the first Listbox item.
               This code is a little crafty.  By default the ListboxTextItem is created with
               the auto-delete flag set to true, which results in its automatic deletion when
               removed from the Listbox.  So we change that flag to false, extract the item
               from the Listbox, change its text, put the auto-delete flag back to true, and
               finally put the item back into the Listbox. */
            logItem = static_cast<CEGUI::ListboxTextItem*>(m_logHistoryList->getListboxItemFromIndex(0));
            logItem->setAutoDeleted(false);
            m_logHistoryList->removeItem(logItem);
            logItem->setAutoDeleted(true);
            logItem->setText((CEGUI::utf8*)message.str().c_str());
        } else {
            // Create a new listbox item
            logItem = new CEGUI::ListboxTextItem((CEGUI::utf8*)message.str().c_str());
        }
        m_logHistoryList->addItem(logItem);
        m_logHistoryList->ensureItemIsVisible(m_logHistoryList->getItemCount());

        if(m_logHistoryListShort->getItemCount() == shortHistorySize) {
            logItem = static_cast<CEGUI::ListboxTextItem*>(m_logHistoryListShort->getListboxItemFromIndex(0));
            logItem->setAutoDeleted(false);
            m_logHistoryListShort->removeItem(logItem);
            logItem->setAutoDeleted(true);
            logItem->setText((CEGUI::utf8*)message.str().c_str());
        } else {
            logItem = new CEGUI::ListboxTextItem((CEGUI::utf8*)message.str().c_str());
        }
        m_logHistoryListShort->addItem(logItem);
        m_logHistoryListShort->ensureItemIsVisible(m_logHistoryListShort->getItemCount());
    }
}
开发者ID:dividio,项目名称:projectfootball,代码行数:42,代码来源:CSimulatorWindowHandler.cpp


示例14: ResetDataBySexSelChanged

void ResetDataBySexSelChanged()
{
    CEGUI::WindowManager& mgr = GetWndMgr();
    CEGUI::Combobox* SelFac = WComboBox(mgr.getWindow(CREATEROLE_SEL_FAC_CCB));
    uint SelSex = (uint)CREvent::GetSelectSex();
    if(SelFac)
    {
        SelFac->resetList();
        //更改性别后,修改默认Face和HairStyle时,对应修改文本显示
        SelFac->getEditbox()->setText(CEGUI::PropertyHelper::intToString(0));
        for(short i = 0 ; i < CREvent::GetFaceNum(SelSex) ; ++i)
        {
            CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(i));
            lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
            lti->setID(i);//ID和FacIndex关联
            if(0==i)		//更改性别后,修改默认Face和HairStyle时,对应修改ItemList选中状态
                lti->setSelected(true);
            SelFac->addItem(lti);
        }
    }
    CEGUI::Combobox* SelHair = WComboBox(mgr.getWindow(CREATEROLE_SEL_HAIR_CCB));
    if(SelHair)
    {
        SelHair->resetList();
        //更改性别后,修改默认Face和HairStyle时,对应修改文本显示
        SelHair->getEditbox()->setText(CEGUI::PropertyHelper::intToString(0));
        for(short i = 0 ; i < CREvent::GetHairNum(SelSex) ; ++i)
        {
            CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(i));
            lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
            lti->setID(i);// ID和HairIndex关联
            if(0 == i)//更改性别后,修改默认Face和HairStyle时,对应修改ItemList选中状态
                lti->setSelected(true);
            SelHair->addItem(lti);
        }
    }
}
开发者ID:,项目名称:,代码行数:37,代码来源:


示例15: UpdatePerMCLDate

bool UpdatePerMCLDate(const CEGUI::EventArgs& e)
{
	AHdata& ah = GetInst(AHdata);
	//AHdata::listSubOrderRaw listSubOR = ah.m_AgentOrder;
	AHdata::MapSubOrderRaw mapSubOR = ah.m_AgentOrder;
	CEGUI::MultiColumnList* mcl = WMCL(WEArgs(e).window);
	if(!mcl)
		return false;
	mcl->resetList();

	AHdata::MapSubOrderRaw::iterator it = mapSubOR.begin();
	for (int i = 0 ; it != mapSubOR.end(); ++it,++i)
	{
		mcl->addRow();
		CEGUI::ListboxTextItem* lti = NULL;
		lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(it->first),it->first);//控件ID与订单ID关联
		lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
		mcl->setItem(lti,0,i);
		
		AH::SubOrderRaw& mapOr = it->second;
		if(mapOr.type == AH::OT_BUY)
			lti = new CEGUI::ListboxTextItem(ToCEGUIString(AppFrame::GetText("AU_104")));
		else if(mapOr.type == AH::OT_SELL)
			lti = new CEGUI::ListboxTextItem(ToCEGUIString(AppFrame::GetText("AU_105")));
		lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
		mcl->setItem(lti,1,i);

		lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(mapOr.cnt));
		lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
		mcl->setItem(lti,2,i);

		lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(mapOr.price));
		lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
		mcl->setItem(lti,3,i);

		/////////////////////////////////////////////////
		// zhaohang  2010/5/12 
		// 时间UI未处理
		/////////////////////////////////////////////////
		uint subtime = mapOr.gentime / 60 / 60;
		lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(subtime));
		lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
		mcl->setItem(lti,4,i);
	}
	return false;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:46,代码来源:Auction.cpp


示例16: updateServer

void ServerList::updateServer(Server *s)
{
    size_t rows = m_listeServeurs->getRowCount();
    int row = -1;
    for(size_t i=0;i<rows;++i)
    {
        if(m_listeServeurs->getItemAtGridReference(CEGUI::MCLGridRef(i, 0))->getUserData() == s)
        {
            row = i;
            break;
        }
    }
    if(row != -1)
    {
        CEGUI::ListboxTextItem *item;
        item = (CEGUI::ListboxTextItem*)m_listeServeurs->getItemAtGridReference(CEGUI::MCLGridRef(row, 0));
        item->setText(s->nom);

        item = (CEGUI::ListboxTextItem*)m_listeServeurs->getItemAtGridReference(CEGUI::MCLGridRef(row, 1));
        item->setText(s->ip);

        std::string joueurs = boost::lexical_cast<std::string>(s->nombre_joueurs_connectes);
        joueurs += "/";
        joueurs += boost::lexical_cast<std::string>(s->nombre_joueurs_max);
        item = (CEGUI::ListboxTextItem*)m_listeServeurs->getItemAtGridReference(CEGUI::MCLGridRef(row, 2));
        item->setText(joueurs);

        item = (CEGUI::ListboxTextItem*)m_listeServeurs->getItemAtGridReference(CEGUI::MCLGridRef(row, 3));
        item->setText(s->carte_jouee);

        item = (CEGUI::ListboxTextItem*)m_listeServeurs->getItemAtGridReference(CEGUI::MCLGridRef(row, 4));
        item->setText(boost::lexical_cast<std::string>(0));

        item = (CEGUI::ListboxTextItem*)m_listeServeurs->getItemAtGridReference(CEGUI::MCLGridRef(row, 5));
        item->setText((s->passwd) ?"OUI":"NON");
        m_listeServeurs->handleUpdatedItemData();
    }
}
开发者ID:xabufr,项目名称:meteor-falls,代码行数:38,代码来源:ServerList.cpp


示例17: list

int FileWindow::list(const TCHAR* dir)
{
   typedef std::basic_string<TCHAR> tc_string;
   typedef std::list< tc_string >   tc_string_list;

   _pFileList->resetList();
   _pSelectBox->setText("");
   _pOkButton->setEnabled(false);

   if (dir[0] == 0) {
      _cwd = _T("C:");
   } else {
      size_t i = 1;
      while (dir[i] != 0) { ++i; }
      while (0 < i) {
         if (dir[i-1] != _T('\\') && dir[i-1] != _T('/')) {
            break;
         }
         --i;
      }
      _cwd.assign(dir, i);
   }

   {
      char* s = ::bootes::lib::util::TChar::T2C(_cwd.c_str());
      _pDirBox->setText(s);
      delete s;
   }

   WIN32_FIND_DATA find;
   HANDLE hFind;
   {
      tc_string query = _cwd + _T("\\*");
      hFind = FindFirstFile(query.c_str(), &find);
      if (hFind == INVALID_HANDLE_VALUE) {
         return -1;
      }
   }

   tc_string_list files, dirs;
   for (BOOL found = TRUE; found; found=FindNextFile(hFind, &find)) {
      tc_string name(find.cFileName);
      if (name.compare(_T(".")) == 0) { continue; }

      if ((find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
         name += _T('\\');
         dirs.push_back(name);
      } else if ((find.dwFileAttributes & FILE_ATTRIBUTE_NORMAL) != 0) {
         continue;
      } else {
         std::list< tc_string >::iterator i;
         for (i = _exts.begin(); i != _exts.end(); ++i) {
            tc_string& e = *i;
            if (name.size() < e.size()) { continue; }
            if (name.compare(name.size() - e.size(), e.size(), e) == 0) { break; }
         }
         if (i == _exts.end()) { continue; }
         files.push_back(name);
      }
   }
   FindClose(hFind);


   int id = 0;
   intptr_t data = 1; //dir
   void* pdata = reinterpret_cast< void* >(data);
   for (tc_string_list::iterator i = dirs.begin(); i != dirs.end(); ++i) {
      char* name = ::bootes::lib::util::TChar::T2C(i->c_str());
      CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem(name, id++, pdata);
      item->setSelectionColours(CEGUI::ColourRect(CEGUI::colour(1.0f, 0.0f, 0.0f)));
      _pFileList->addItem(item);
      delete name;
   }

   data = 0; //file
   pdata = reinterpret_cast< void* >(data);
   for (tc_string_list::iterator i = files.begin(); i != files.end(); ++i) {
      char* name = ::bootes::lib::util::TChar::T2C(i->c_str());
      CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem(name, id++, pdata);
      _pFileList->addItem(item);
      delete name;
   }

   return id;
}
开发者ID:dai1975,项目名称:BootesDances,代码行数:85,代码来源:FileWindow.cpp


示例18: SetCreateRoleInitProperty

void SetCreateRoleInitProperty(CEGUI::Window* pgWnd)
{
    if(!pgWnd)
        return;
    CEGUI::Combobox* SelCountry = WComboBox(pgWnd->getChildRecursive(CREATEROLE_SEL_COUNTRY_CCB));
    if(SelCountry)
    {
        SelCountry->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,CEGUI::SubscriberSlot(OnCountryChanged));
        SelCountry->setReadOnly(true);
        CCountryList::MapCountryList* mapCL = CCountryList::GetCountryList();
        for(uint cnt = 0; cnt < mapCL->size(); ++cnt)
        {
            const char* ctName = CCountryList::GetCountryName((BYTE)cnt+1);
            if(ctName)
            {
                CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(ToCEGUIString(ctName));
                lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
                lti->setID(cnt+1);//ID和国家ID关联
                if(cnt == 0)
                    lti->setSelected(true);//设置国家默认值
                SelCountry->addItem(lti);
            }
        }
        //根据国家默认值,设置显示文本
        SelCountry->getEditbox()->setText(ToCEGUIString(CCountryList::GetCountryName(0+1)));//加一是因为data/CountryList.xml配置造成
        /***********************************************************************/
        /* zhaohang fix 2010-9-3
        /***********************************************************************/
        CREvent::SetSelectCountry(1);//逻辑上的国家默认值
    }
    CEGUI::Combobox* selHair = WComboBox(pgWnd->getChildRecursive(CREATEROLE_SEL_HAIR_CCB));
    if(selHair)
    {
        selHair->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,CEGUI::SubscriberSlot(OnHairChanged));
        selHair->setReadOnly(true);
    }
    CEGUI::Combobox* selHairColor = WComboBox(pgWnd->getChildRecursive(CREATEROLE_SEL_HAIRCOLOR_CCB));
    if(selHairColor)
    {
        selHairColor->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,CEGUI::SubscriberSlot(OnHairColorChanged));
        selHairColor->setReadOnly(true);
    }
    CEGUI::Combobox* selFac = WComboBox(pgWnd->getChildRecursive(CREATEROLE_SEL_FAC_CCB));
    if(selFac)
    {
        selFac->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,CEGUI::SubscriberSlot(OnFacChanged));
        selFac->setReadOnly(true);
    }
    CEGUI::Combobox* selSex = WComboBox(pgWnd->getChildRecursive(CREATEROLE_SEL_SEX_CCB));
    if(selSex)
    {
        CEGUI::ListboxTextItem* itm1  = new CEGUI::ListboxTextItem(ToCEGUIString(CREATEROLE_SEX_MALE));
        itm1->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
        itm1->setID(0);//用ID和性别关联
        selSex->addItem(itm1);
        CEGUI::ListboxTextItem* itm2 = new CEGUI::ListboxTextItem(ToCEGUIString(CREATEROLE_SEX_FAMALE));
        itm2->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
        itm2->setID(1);//用ID和性别关联
        selSex->addItem(itm2);
        //注册事件
        selSex->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,CEGUI::SubscriberSlot(OnSexChanged));
        selSex->setReadOnly(true);
    }
}
开发者ID:,项目名称:,代码行数:64,代码来源:


示例19: enter

void GameState::enter()
{
	mInput = InputManager::getSingletonPtr();
	mRoot = Ogre::Root::getSingletonPtr();
	if (mRoot != StateManager::getSingletonPtr()->GetRoot())
		return;
	mScenMgr = mRoot->getSceneManager("Scene");
	if (mScenMgr->hasCamera("GameCam"))
		mCam = new Camera("GameCam", mScenMgr, mRoot->getAutoCreatedWindow(), mScenMgr->getCamera("GameCam"));
	else
		mCam = new Camera("GameCam", mScenMgr, mRoot->getAutoCreatedWindow());
	mCam->getOgreCam()->getViewport()->setBackgroundColour(Ogre::ColourValue::Black);
	mGui = GUIManager::getSingleton();
	mPhysics = new Physics(mScenMgr);



	mExit = false;
	if (!CEGUI::FontManager::getSingleton().isDefined("DejaVuSans-10"))
		CEGUI::FontManager::getSingleton().createFromFile("DejaVuSans-10.font");
	// set up the GUI
	auto font = &CEGUI::FontManager::getSingleton().get("DejaVuSans-10");
	mGUIRoot = mGui->LoadGUIsheet("GameLayout.layout");
	mGUIRoot->getChild("Quit")->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GameState::GoToIntro, this));
	mGUIRoot->getChild("BuildSkeleton")->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GameState::BuildSkeleton, this));
	CEGUI::ToggleButton* checkbox = static_cast<CEGUI::ToggleButton*> (mGUIRoot->getChild("skeleton Setting/Checkbox"));
	checkbox->setSelected(true);
	mGUIRoot->getChild("skeleton Setting/Checkbox")->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&GameState::HideSettings, this));
	// add the drop box options
	CEGUI::Combobox* ArmList = static_cast<CEGUI::Combobox*>(mGUIRoot->getChild("Settings Box/Arm Combobox"));
	ArmList->setReadOnly(true);
	ArmList->setSelection(0, 10);
	ArmList->activate();
	
	CEGUI::ListboxTextItem* ArmN = new CEGUI::ListboxTextItem("No Arms", 0);
	ArmN->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	ArmN->setFont(font);
	ArmList->addItem(ArmN);
	auto ArmS = new CEGUI::ListboxTextItem("Short Arms", 1);
	ArmS->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	ArmList->addItem(ArmS);
	auto ArmL = new CEGUI::ListboxTextItem("Long Arms", 2);
	ArmL->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	ArmList->addItem(ArmL);


	CEGUI::Combobox* LegList = static_cast<CEGUI::Combobox*>(mGUIRoot->getChild("Settings Box/Leg Combobox"));
	auto LegU = new CEGUI::ListboxTextItem("Uninverted Legs", 0);
	LegU->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	LegU->setFont(font);
	LegList->addItem(LegU);
	auto LegI = new CEGUI::ListboxTextItem("Inverted Legs", 1);
	LegI->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	LegI->setFont(font);
	LegList->addItem(LegI);

	CEGUI::Combobox* TorsoList = static_cast<CEGUI::Combobox*>(mGUIRoot->getChild("Settings Box/Torso Combobox"));
	auto TorsoU = new CEGUI::ListboxTextItem("Upright", 0);
	TorsoU->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	TorsoU->setFont(font);
	TorsoList->addItem(TorsoU);
	auto TorsoH = new CEGUI::ListboxTextItem("Horizontal", 1);
	TorsoH->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	TorsoH->setFont(font);
	TorsoList->addItem(TorsoH);

	CEGUI::Combobox* NeckList = static_cast<CEGUI::Combobox*>(mGUIRoot->getChild("Settings Box/Neck Combobox"));
	auto NeckL = new CEGUI::ListboxTextItem("Long Neck", 0);
	NeckL->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	NeckL->setFont(font);
	NeckList->addItem(NeckL);
	auto NeckS = new CEGUI::ListboxTextItem("Short Neck", 1);
	NeckS->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	NeckS->setFont(font);
	NeckList->addItem(NeckS);

	CEGUI::Combobox* TailList = static_cast<CEGUI::Combobox*>(mGUIRoot->getChild("Settings Box/Tail Combobox"));
	auto TailN = new CEGUI::ListboxTextItem("No Tail", 0);
	TailN->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	TailN->setFont(font);
	TailList->addItem(TailN);
	auto TailS = new CEGUI::ListboxTextItem("Short Tail", 1);
	TailS->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	TailS->setFont(font);
	TailList->addItem(TailS);
	auto TailL = new CEGUI::ListboxTextItem("Long Tail", 2);
	TailL->setSelectionBrushImage("TaharezLook/MultiListSelectionBrush");
	TailL->setFont(font);
	TailList->addItem(TailL);

	//ArmList->setVisible(true);
	//LegList->setVisible(true);
	//TorsoList->setVisible(true);
	//NeckList->setVisible(true);
	//TailList->setVisible(true);

}
开发者ID:nathn123,项目名称:FYP,代码行数:97,代码来源:GameState.cpp


示例20: updateDebugRTTWindow

	//---------------------------------------------------------------------
	void CompositorDemo_FrameListener::updateDebugRTTWindow(void)
	{
		// Clear listbox
		mDebugRTTListbox->resetList();
		// Clear imagesets
		mDebugRTTStaticImage->setProperty("Image", "");
		for (ImageSetList::iterator isIt = mDebugRTTImageSets.begin();
			isIt != mDebugRTTImageSets.end(); ++isIt)
		{
			CEGUI::ImagesetManager::getSingleton().destroyImageset(*isIt);
		}
		mDebugRTTImageSets.clear();
		Ogre::set<Ogre::String>::type uniqueTextureNames;
		// Add an entry for each render texture for all active compositors
		Ogre::Viewport* vp = mMain->getRenderWindow()->getViewport(0);
		Ogre::CompositorChain* chain = Ogre::CompositorManager::getSingleton().getCompositorChain(vp);
		Ogre::CompositorChain::InstanceIterator it = chain->getCompositors();
		while (it.hasMoreElements())
		{
			Ogre::CompositorInstance* inst = it.getNext();
			if (inst->getEnabled())
			{
				Ogre::CompositionTechnique::TextureDefinitionIterator texIt =
					inst->getTechnique()->getTextureDefinitionIterator();
				while (texIt.hasMoreElements())
				{
					Ogre::CompositionTechnique::TextureDefinition* texDef = texIt.getNext();

					// Get instance name of texture (NB only index 0 if MRTs for now)
					const Ogre::String& instName = inst->getTextureInstanceName(texDef->name, 0);
					// Create CEGUI texture from name of OGRE texture
					CEGUI::Texture* tex = mMain->getGuiRenderer()->createTexture(instName.c_str());
					// Create imageset
					// Note that if we use shared textures in compositor, the same texture name
					// will occur more than once, so we have to cater for this
					if (uniqueTextureNames.find(instName) == uniqueTextureNames.end())
					{
						CEGUI::Imageset* imgSet =
							CEGUI::ImagesetManager::getSingleton().createImageset(
								instName.c_str(), tex);
						mDebugRTTImageSets.push_back(imgSet);
						imgSet->defineImage((CEGUI::utf8*)"RttImage",
							CEGUI::Point(0.0f, 0.0f),
							CEGUI::Size(tex->getWidth(), tex->getHeight()),
							CEGUI::Point(0.0f,0.0f));


						CEGUI::ListboxTextItem *item = new CEGUI::ListboxTextItem(texDef->name.c_str(), 0, imgSet);
						item->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");
						item->setSelectionColours(CEGUI::colour(0,0,1));
						mDebugRTTListbox->addItem(item);

						uniqueTextureNames.insert(instName);
					}

				}

			}

		}



	}
开发者ID:JangoOs,项目名称:kbengine_ogre_demo,代码行数:65,代码来源:CompositorDemo_FrameListener.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cegui::MultiColumnList类代码示例发布时间:2022-05-31
下一篇:
C++ cegui::ListboxItem类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap