本文整理汇总了C++中mygui::UString::end方法的典型用法代码示例。如果您正苦于以下问题:C++ UString::end方法的具体用法?C++ UString::end怎么用?C++ UString::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mygui::UString
的用法示例。
在下文中一共展示了UString::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalcTextWidth
MyGUI::IntSize CalcTextWidth( MyGUI::UString text,string font ){
MyGUI::FontManager* pfm = MyGUI::FontManager::getInstancePtr();
MyGUI::IFont* pf = pfm->getByName(font);
MyGUI::IntSize size;
size.height = pf->getDefaultHeight();
if( pf ){
for( MyGUI::UString::iterator i=text.begin();i!=text.end();++i ){
MyGUI::GlyphInfo* pg = pf->getGlyphInfo(*i);
if( pg ){
size.width += (int)pg->width;
}
}
}
return size;
}
示例2: notifyTreeNodePrepare
void SampleLayout::notifyTreeNodePrepare(MyGUI::TreeControl* pTreeControl, MyGUI::TreeControl::Node* pNode)
{
if (pNode == pTreeControl->getRoot())
return;
pNode->removeAll();
/*#ifdef MYGUI_OGRE_PLATFORM
Ogre::Archive* pArchive = *(pNode->getData<Ogre::Archive*>());
MyGUI::UString strPath(getPath(pNode));
Ogre::StringVectorPtr Resources = pArchive->find(strPath + "*", false, true);
for (Ogre::StringVector::iterator Iterator = Resources->begin(); Iterator != Resources->end(); ++Iterator)
{
MyGUI::TreeControl::Node* pChild = new MyGUI::TreeControl::Node(*Iterator, "Folder");
pChild->setData(pArchive);
pNode->add(pChild);
}
Resources = pArchive->find(strPath + "*", false, false);
for (Ogre::StringVector::iterator Iterator = Resources->begin(); Iterator != Resources->end(); ++Iterator)
{
MyGUI::UString strName(*Iterator);
MyGUI::UString strExtension;
size_t nPosition = strName.rfind(".");
if (nPosition != MyGUI::UString::npos)
{
strExtension = strName.substr(nPosition + 1);
std::transform(strExtension.begin(), strExtension.end(), strExtension.begin(), tolower);
}
MyGUI::UString strImage;
if (strExtension == "png" || strExtension == "tif" || strExtension == "tiff" || strExtension == "jpg" || strExtension == "jpeg")
strImage = "Image";
else
if (strExtension == "mat" || strExtension == "material")
strImage = "Material";
else
if (strExtension == "layout")
strImage = "Layout";
else
if (strExtension == "ttf" || strExtension == "font" || strExtension == "fontdef")
strImage = "Font";
else
if (strExtension == "txt" || strExtension == "text")
strImage = "Text";
else
if (strExtension == "xml")
strImage = "XML";
else
if (strExtension == "mesh")
strImage = "Mesh";
else
if (strExtension == "htm" || strExtension == "html")
strImage = "HTML";
else
strImage = "Unknown";
MyGUI::TreeControl::Node* pChild = new MyGUI::TreeControl::Node(strName, strImage);
pChild->setPrepared(true);
pNode->add(pChild);
}
#else*/
PairFileInfo info = *(pNode->getData<PairFileInfo>());
// если папка, то добавляем детей
if (info.second.folder)
{
std::wstring path = info.first + L"/" + info.second.name;
common::VectorFileInfo result;
common::getSystemFileList(result, path, L"*.*");
for (common::VectorFileInfo::iterator item = result.begin(); item != result.end(); ++item)
{
if ((*item).name == L".." || (*item).name == L".")
continue;
if ((*item).folder)
{
MyGUI::TreeControl::Node* pChild = new MyGUI::TreeControl::Node((*item).name, "Folder");
pChild->setData(PairFileInfo(path, *item));
pNode->add(pChild);
}
else
{
MyGUI::UString strName((*item).name);
MyGUI::UString strExtension;
size_t nPosition = strName.rfind(".");
if (nPosition != MyGUI::UString::npos)
{
strExtension = strName.substr(nPosition + 1);
std::transform(strExtension.begin(), strExtension.end(), strExtension.begin(), tolower);
}
MyGUI::UString strImage;
if (strExtension == "png" || strExtension == "tif" || strExtension == "tiff" || strExtension == "jpg" || strExtension == "jpeg")
strImage = "Image";
else if (strExtension == "mat" || strExtension == "material")
strImage = "Material";
else if (strExtension == "layout")
strImage = "Layout";
else if (strExtension == "ttf" || strExtension == "font" || strExtension == "fontdef")
//.........这里部分代码省略.........