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


C++ ListboxTextItem::setTextColours方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: USize


//.........这里部分代码省略.........
  text2->setSize(CEGUI::USize(CEGUI::UDim(0.25,0),CEGUI::UDim(0.06,0)));
  text2->setPosition(CEGUI::UVector2(CEGUI::UDim(0.15,0),CEGUI::UDim(0.46,0)));
  text2->setProperty("FrameEnabled","False");
  text2->setProperty("BackgroundEnabled", "False");
  text2->setProperty("HorzFormatting", "LeftAligned");

  CEGUI::ToggleButton* cb = static_cast<CEGUI::ToggleButton*> (CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Checkbox","CBAutoReload"));
  cb->setPosition(CEGUI::UVector2(CEGUI::UDim(0.08,0),CEGUI::UDim(0.52,0)));

  CEGUI::Window* resetButton = CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Button","resetButton");
  resetButton->setText("[font='DickVanDyke'] Reset Records ");
  resetButton->setSize(CEGUI::USize(CEGUI::UDim(0.23,0),CEGUI::UDim(0.07,0)));
  resetButton->setXPosition(UDim(0.40f, 0.0f));
  resetButton->setYPosition(UDim(0.85f, 0.0f));
  resetButton->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&IntroState::resetRecords,this));

  CEGUI::Window* configButton = CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Button","configButton");
  configButton->setText("[font='DickVanDyke'] Restore Config ");
  configButton->setSize(CEGUI::USize(CEGUI::UDim(0.23,0),CEGUI::UDim(0.07,0)));
  configButton->setXPosition(UDim(0.40f, 0.0f));
  configButton->setYPosition(UDim(0.77f, 0.0f));
  configButton->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&IntroState::resetConfig,this));

  CEGUI::Window* text3 = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText","FullscreenText");
  text3->setText("[font='DickVanDyke'] Fullscreen");
  text3->setSize(CEGUI::USize(CEGUI::UDim(0.25,0),CEGUI::UDim(0.06,0)));
  text3->setPosition(CEGUI::UVector2(CEGUI::UDim(0.15,0),CEGUI::UDim(0.57,0)));
  text3->setProperty("FrameEnabled","False");
  text3->setProperty("BackgroundEnabled", "False");
  text3->setProperty("HorzFormatting", "LeftAligned");

  CEGUI::ToggleButton* cbFullscreen = static_cast<CEGUI::ToggleButton*> (CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Checkbox","CBFullscreen"));
  cbFullscreen->setPosition(CEGUI::UVector2(CEGUI::UDim(0.08,0),CEGUI::UDim(0.62,0)));
  cbFullscreen->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,CEGUI::Event::Subscriber(&IntroState::tbFullscreenChanged,this));

  CEGUI::Window* text4 = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText","ResolutionText");
  text4->setText("[font='DickVanDyke'] Resolution");
  text4->setSize(CEGUI::USize(CEGUI::UDim(0.25,0),CEGUI::UDim(0.06,0)));
  text4->setPosition(CEGUI::UVector2(CEGUI::UDim(0.5,0),CEGUI::UDim(0.35,0)));
  text4->setProperty("FrameEnabled","False");
  text4->setProperty("BackgroundEnabled", "False");
  text4->setProperty("HorzFormatting", "LeftAligned");

  


  CEGUI::Listbox* lbRes = static_cast<CEGUI::Listbox*> (CEGUI::WindowManager::getSingleton().createWindow("OgreTray/Listbox","lbRes"));
  lbRes->setSize(CEGUI::USize(CEGUI::UDim(0.3,0),CEGUI::UDim(0.3,0)));
  lbRes->setPosition(CEGUI::UVector2(CEGUI::UDim(0.5, 0),CEGUI::UDim(0.40, 0)));
  lbRes->subscribeEvent(Listbox::EventSelectionChanged,CEGUI::Event::Subscriber(&IntroState::changeResolution,this));
  
  const CEGUI::Image* sel_img = &CEGUI::ImageManager::getSingleton().get("TaharezLook/MultiListSelectionBrush");
  
  CEGUI::ListboxTextItem* itm;
  itm = new CEGUI::ListboxTextItem("800x600",0);
  itm->setFont("DickVanDyke-28");
  itm->setTextColours(CEGUI::Colour(0.0,0.8,0.5));
  itm->setSelectionBrushImage(sel_img);
  lbRes->addItem(itm);
  
  CEGUI::ListboxTextItem* itm2;
  itm2 = new CEGUI::ListboxTextItem("1200x800",1);
  itm2->setFont("DickVanDyke-28");
  itm2->setTextColours(CEGUI::Colour(0.0,0.8,0.5));
  itm2->setSelectionBrushImage(sel_img);
  lbRes->addItem(itm2);

  CEGUI::ListboxTextItem* itm3;
  itm3 = new CEGUI::ListboxTextItem("1920x1020",2);
  itm3->setFont("DickVanDyke-28");
  itm3->setTextColours(CEGUI::Colour(0.0,0.8,0.5));
  itm3->setSelectionBrushImage(sel_img);
  lbRes->addItem(itm3);
    
  

  sheetBG->addChild(text4);
  sheetBG->addChild(lbRes);
  sheetBG->addChild(cb);
  sheetBG->addChild(text2);
  sheetBG->addChild(cbFullscreen);
  sheetBG->addChild(text3);
  sheetBG->addChild(sbText);
  sheetBG->addChild(sb);
  sheetBG->addChild(applyButton);
  sheetBG->addChild(backButton);
  sheetBG->addChild(resetButton);
  sheetBG->addChild(configButton);
  sheetBG->addChild(text);
  sheet->addChild(sheetBG);
    

  if(_fullscreen){
    cbFullscreen->setSelected(true);
  }else{
    cbFullscreen->setSelected(false);
  }

  return true;
}
开发者ID:RubenCardos,项目名称:CrackShot,代码行数:101,代码来源:IntroState.cpp


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