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


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

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


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

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

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


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