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


C++ mygui::UString类代码示例

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


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

示例1: notifyButtonPressed

	void Console::notifyButtonPressed(MyGUI::Widget* _sender, MyGUI::KeyCode _key, MyGUI::Char _char)
	{
		MyGUI::EditBox* edit = _sender->castType<MyGUI::EditBox>();
		size_t len = edit->getCaption().length();
		if ((_key == MyGUI::KeyCode::Backspace) && (len > 0) && (mAutocomleted))
		{
			edit->deleteTextSelection();
			len = edit->getCaption().length();
			edit->eraseText(len - 1);
		}

		MyGUI::UString command = edit->getCaption();
		if (command.length() == 0)
			return;

		for (MapDelegate::iterator iter = mDelegates.begin(); iter != mDelegates.end(); ++iter)
		{
			if (iter->first.find(command) == 0)
			{
				if (command == iter->first) break;
				edit->setCaption(iter->first);
				edit->setTextSelection(command.length(), iter->first.length());
				mAutocomleted = true;
				return;
			}
		}
		mAutocomleted = false;
	}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:28,代码来源:Console.cpp

示例2: executeCommand

bool CommandManager::executeCommand(const MyGUI::UString& _command)
{
	bool result = false;
	MyGUI::UString command = _command;
	size_t index = _command.find('.');
	MYGUI_LOG(Warning , "+++++:Menu Command apply :" << command << "+++++");
	if (index != MyGUI::UString::npos)
	{
		command = _command.substr(0, index);
		mData = _command.substr(index + 1);
	}

	MapDelegate::iterator iter = mDelegates.find(command);
	if (iter != mDelegates.end())
	{
		iter->second(command, result);
	}
	else
	{
		MYGUI_LOG(Warning, "Command '" << command << "' not found");
	}

	mData.clear();

	return result;
}
开发者ID:ruananswer,项目名称:RssDemo2013,代码行数:26,代码来源:CommandManager.cpp

示例3: updateActorTheme

void StatePanel::updateActorTheme(const MyGUI::UString& commandName, bool& result)
{
	std::string materialname = commandName.substr(commandName.find_first_of('_') + 1);
	Animation * anim = getActiveAnimation();
	if(anim != nullptr)
	{
		anim->upateActorTheme(materialname);
	}
}
开发者ID:dtbinh,项目名称:AncelApp,代码行数:9,代码来源:StatePanel.cpp

示例4: toNumber

inline NumberType toNumber(MyGUI::UString numberString)
{
	if (numberString.substr(0, 4).compare("true") == 0) return 1;
	else if (numberString.substr(0, 4).compare("false") == 0) return 0;

	std::istringstream converter(numberString);

	if (typeid(NumberType) == typeid(bool))
	{
		int result;
		return (converter >> result).fail() ? false : !!result;
	}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:12,代码来源:FlashValue.cpp

示例5: 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;
}
开发者ID:JohnCrash,项目名称:iRobot,代码行数:15,代码来源:SimpleUI.cpp

示例6: bind

void FlashControl::bind(const MyGUI::UString& funcName, FlashDelegate::IDelegate* callback)
{
	if (funcName.empty() || callback == 0)
		return;

	delegateMap[funcName] = callback;
}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:7,代码来源:FlashControl.cpp

示例7: convertProjectName

	MyGUI::UString EditorState::convertProjectName(const MyGUI::UString& _fileName)
	{
		size_t pos = mFileName.find_last_of("\\/");
		MyGUI::UString shortName = pos == MyGUI::UString::npos ? mFileName : mFileName.substr(pos + 1);
		addUserTag("ResourceName", shortName);

		size_t index = _fileName.find("|");
		if (index == MyGUI::UString::npos)
			return _fileName;

		MyGUI::UString fileName = _fileName.substr(0, index);
		MyGUI::UString itemIndexName = _fileName.substr(index + 1);
		size_t itemIndex = MyGUI::utility::parseValue<size_t>(itemIndexName);

		MyGUI::xml::Document doc;
		if (!doc.open(fileName))
			return _fileName;

		MyGUI::xml::ElementPtr root = doc.getRoot();
		if ((nullptr == root) || (root->getName() != "MyGUI"))
			return _fileName;

		if (root->findAttribute("type") == "Resource")
		{
			// берем детей и крутимся
			MyGUI::xml::ElementEnumerator element = root->getElementEnumerator();
			while (element.next("Resource"))
			{
				if (element->findAttribute("type") == "ResourceLayout")
				{
					if (itemIndex == 0)
					{
						// поменять на теги
						std::string resourceName = element->findAttribute("name");
						addUserTag("ResourceName", resourceName);
						return MyGUI::utility::toString(fileName, " [", resourceName, "]");
					}
					else
					{
						itemIndex --;
					}
				}
			}
		}

		return _fileName;
	}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:47,代码来源:EditorState.cpp

示例8:

		//--------------------------------------------------------------------------------
		void	Chat::Log(const MyGUI::UString& str, const MyGUI::UString& color)
		{
			Framework::System::Log::Debug(std::string("Chat: ") + str.asUTF8());

			mMessagesMutex.lock();

			mMessages.push_back(std::make_pair(str,color));

			mMessagesMutex.unlock();
		}
开发者ID:commodoremartin,项目名称:SkyrimOnline,代码行数:11,代码来源:Chat.cpp

示例9: addRecentFolder

	void RecentFilesManager::addRecentFolder(const MyGUI::UString& _folder)
	{
		MyGUI::UString folder(_folder);
		if (_folder.empty())
			folder = MyGUI::UString(common::getSystemCurrentFolder());

		mRecentFolders.insert(mRecentFolders.begin(), folder);

		checkArray(mRecentFolders, mMaxRecentFolders);
	}
开发者ID:dayongxie,项目名称:MyGUI,代码行数:10,代码来源:RecentFilesManager.cpp

示例10: setModeSaveLoadDialog

void EditorState::setModeSaveLoadDialog(bool _save, const MyGUI::UString& _filename)
{
	if (_save)
		mOpenSaveFileDialog->setDialogInfo(localise("Save"), localise("Save"));
	else
		mOpenSaveFileDialog->setDialogInfo(localise("Load"), localise("Load"));

	size_t pos = _filename.find_last_of(L"\\/");
	if (pos == MyGUI::UString::npos)
	{
		mOpenSaveFileDialog->setFileName(_filename);
	}
	else
	{
		mOpenSaveFileDialog->setCurrentFolder(_filename.substr(0, pos));
		mOpenSaveFileDialog->setFileName(_filename.substr(pos + 1));
	}

	mOpenSaveFileDialog->setVisible(true);
	mModeSaveDialog = _save;
}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:21,代码来源:EditorState.cpp

示例11: showMessages

void GroupMessage::showMessages()
{
	if (mWarningMessages.size())
	{
		MyGUI::UString warningMess;
		for (MyGUI::VectorString::iterator iter = mWarningMessages.begin(); iter != mWarningMessages.end(); ++iter)
		{
			if (warningMess.empty()) warningMess = warningMess + *iter;
			else warningMess = warningMess + "\n" + *iter;
		}
		if (!warningMess.empty())
			MyGUI::Message::createMessageBox("Message", localise("Warning"), warningMess, MyGUI::MessageBoxStyle::IconWarning | MyGUI::MessageBoxStyle::Ok);

		mWarningMessages.clear();
	}

	if (mErrorMessages.size())
	{
		MyGUI::UString errorMessages;
		for (MyGUI::VectorString::iterator iter = mErrorMessages.begin(); iter != mErrorMessages.end(); ++iter)
		{
			if (errorMessages.empty()) errorMessages = errorMessages + *iter;
			else errorMessages = errorMessages + "\n" + *iter;
		}
		if (!errorMessages.empty())
			MyGUI::Message::createMessageBox("Message", localise("Error"), errorMessages , MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Ok);

		mErrorMessages.clear();
	}
}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:30,代码来源:GroupMessage.cpp

示例12: editBoxUpdated

void SpaceShipDesignerGUI::editBoxUpdated(MyGUI::EditBox *widget)
{
    MyGUI::UString caption = widget->getCaption();
    if(widget->getName() == "SelectFloorFrom")
    {
        if(caption == "")
            mParent->enableSelectedFloorFrom(false);
        else
        {
            mParent->setSelectedFloorFrom(atoi(caption.asUTF8().c_str()));
        }
    }
    else if(widget->getName() == "SelectFloorTo")
    {
        if(caption == "")
            mParent->enableSelectedFloorTo(false);
        else
        {
            mParent->setSelectedFloorTo(atoi(caption.asUTF8().c_str()));
        }
    }
}
开发者ID:Gerold31,项目名称:SpaceCraft,代码行数:22,代码来源:SpaceShipDesignerGUI.cpp

示例13: setCaption

	void EditText::setCaption(const MyGUI::UString& _value)
	{
        if (mCaption != _value) {
            mCaption = _value;
            mTextOutDate = true;
        }
		
        if (mFont) {
            mFont->AllocateSymbols(_value.c_str());
        }

		if (nullptr != mNode)
			mNode->outOfDate(mRenderItem);
	}
开发者ID:andryblack,项目名称:sandbox,代码行数:14,代码来源:sb_mygui_edit_text.cpp

示例14: update

	void TextView::update(const MyGUI::UString& _text, const Sandbox::FontPtr& _font , MyGUI::Align _align, int _maxWidth)
	{
		
        m_font = _font;
		mViewSize.clear();
        mTextData.Clear();
        
        FontAlign align = ALIGN_LEFT;
        if (_align.isHCenter())
            align = ALIGN_CENTER;
        if (_align.isRight())
            align = ALIGN_RIGHT;
        
        mTextData.Fill(_text.c_str(), _font, _maxWidth, align);

		mViewSize = MyGUI::IntSize(mTextData.size.w,mTextData.size.h);
	}
开发者ID:andryblack,项目名称:sandbox,代码行数:17,代码来源:sb_mygui_text_view.cpp

示例15: showMessages

	void GroupMessage::showMessages()
	{
		if (mWarningMessages.size())
		{
			MyGUI::UString warningMess;
			for (VectorUString::const_iterator iter = mWarningMessages.begin(); iter != mWarningMessages.end(); ++iter)
			{
				if (warningMess.empty())
					warningMess = warningMess + *iter;
				else
					warningMess = warningMess + "\n" + *iter;
			}
			if (!warningMess.empty())
			{
				/*MyGUI::Message* message = */MessageBoxManager::getInstance().create(
					replaceTags("Warning"),
					warningMess,
					MyGUI::MessageBoxStyle::IconWarning | MyGUI::MessageBoxStyle::Ok);
			}

			mWarningMessages.clear();
		}

		if (mErrorMessages.size())
		{
			MyGUI::UString errorMessages;
			for (VectorUString::const_iterator iter = mErrorMessages.begin(); iter != mErrorMessages.end(); ++iter)
			{
				if (errorMessages.empty())
					errorMessages = errorMessages + *iter;
				else
					errorMessages = errorMessages + "\n" + *iter;
			}
			if (!errorMessages.empty())
			{
				/*MyGUI::Message* message = */MessageBoxManager::getInstance().create(
					replaceTags("Error"),
					errorMessages,
					MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Ok);
			}

			mErrorMessages.clear();
		}
	}
开发者ID:alexis-,项目名称:iwe,代码行数:44,代码来源:GroupMessage.cpp


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