您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ utf8str_to_wstring函数代码示例

51自学网 2021-06-03 09:24:22
  C++
这篇教程C++ utf8str_to_wstring函数代码示例写得很实用,希望能帮到您。

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

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

示例1: getSelectedIds

void LLFloaterGesture::onCopyPasteAction(const LLSD& command){	std::string command_name  = command.asString();	// since we select this comman inventory item had  already arrived .	if("copy_gesture" == command_name)	{		uuid_vec_t ids;		getSelectedIds(ids);		// make sure that clopboard is empty		LLInventoryClipboard::instance().reset();		for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)		{			LLInventoryItem* item = gInventory.getItem(*it);			if(item  && item->getInventoryType() == LLInventoryType::IT_GESTURE)			{				LLInventoryClipboard::instance().add(item->getUUID());			}		}	}	else if ("paste" == command_name)	{		LLInventoryClipboard& clipbord = LLInventoryClipboard::instance();		LLDynamicArray<LLUUID> ids;		clipbord.retrieve(ids);		if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))			return;		LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);		llassert(gesture_dir);		LLPointer<GestureCopiedCallback> cb = new GestureCopiedCallback(this);		for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)		{			LLInventoryItem* item = gInventory.getItem(*it);			if(gesture_dir && item && item->getInventoryType() == LLInventoryType::IT_GESTURE)			{				LLStringUtil::format_map_t string_args;				string_args["[COPY_NAME]"] = item->getName();				LL_DEBUGS("Gesture")<< "Copying gesture " << item->getName() << "  "<< item->getUUID() << " into "										<< gesture_dir->getName() << "  "<< gesture_dir->getUUID() << LL_ENDL;				copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(), 						gesture_dir->getUUID(), getString("copy_name", string_args), cb);			}		}		clipbord.reset();	}	else if ("copy_uuid" == command_name)	{		gClipboard.copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID());	}}
开发者ID:Katharine,项目名称:kittyviewer,代码行数:50,


示例2: onClickGetKey

//staticvoid LLFloaterAvatarList::onClickGetKey(void *userdata){	LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata; 	LLScrollListItem *item = self->mAvatarList->getFirstSelected();	if (NULL == item) return;	LLUUID agent_id = item->getUUID();	char buffer[UUID_STR_LENGTH];		/*Flawfinder: ignore*/	agent_id.toString(buffer);	gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer));}
开发者ID:fractured-crystal,项目名称:SingularityViewer,代码行数:15,


示例3: LLColor4

void LLManip::renderXYZ(const LLVector3 &vec) {	const S32 PAD = 10;	std::string feedback_string;	LLVector3 camera_pos = LLViewerCamera::getInstance()->getOrigin() + LLViewerCamera::getInstance()->getAtAxis();	S32 window_center_x = gViewerWindow->getWorldViewRectScaled().getWidth() / 2;	S32 window_center_y = gViewerWindow->getWorldViewRectScaled().getHeight() / 2;	S32 vertical_offset = window_center_y - VERTICAL_OFFSET;		gGL.pushMatrix();	{		LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga");		gViewerWindow->setup2DRender();		const LLVector2& display_scale = gViewerWindow->getDisplayScale();		gGL.scalef(display_scale.mV[VX], display_scale.mV[VY], 1.f);		gGL.color4f(0.f, 0.f, 0.f, 0.7f);		imagep->draw(			window_center_x - 115, 			window_center_y + vertical_offset - PAD, 			235,			PAD * 2 + 10, 			LLColor4(0.f, 0.f, 0.f, 0.7f) );	}	gGL.popMatrix();	gViewerWindow->setup3DRender();	{		LLFontGL* font = LLFontGL::getFontSansSerif();		LLLocale locale(LLLocale::USER_LOCALE);		LLGLDepthTest gls_depth(GL_FALSE);		// render drop shadowed text		feedback_string = llformat("X: %.3f", vec.mV[VX]);		hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE);		feedback_string = llformat("Y: %.3f", vec.mV[VY]);		hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE);				feedback_string = llformat("Z: %.3f", vec.mV[VZ]);		hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE);		// render text on top		feedback_string = llformat("X: %.3f", vec.mV[VX]);		hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE);		gGL.diffuseColor3f(0.5f, 1.f, 0.5f);		feedback_string = llformat("Y: %.3f", vec.mV[VY]);		hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE);				gGL.diffuseColor3f(0.5f, 0.5f, 1.f);		feedback_string = llformat("Z: %.3f", vec.mV[VZ]);		hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE);	}}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:56,


示例4: LLEmbeddedItemSegment

	LLEmbeddedItemSegment(S32 pos, LLUIImagePtr image, LLPointer<LLInventoryItem> inv_item, LLTextEditor& editor)	:	LLTextSegment(pos, pos + 1),		mImage(image),		mLabel(utf8str_to_wstring(inv_item->getName())),		mItem(inv_item),		mEditor(editor),// [SL:KB] - Patch: UI-Notecards | Checked: 2010-09-12 (Catznip-2.1.2d) | Added: Catznip-2.1.2d		mContextMenu(NULL),// [/SL:KB]		mHasMouseHover(false)	{		mStyle = new LLStyle(LLStyle::Params().font(LLFontGL::getFontSansSerif()));		mToolTip = inv_item->getName() + '/n' + inv_item->getDescription();	}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:15,


示例5: utf8str_to_wstring

void LLHUDText::addLine(const std::string &text_utf8,                        const LLColor4& color,                        const LLFontGL::StyleFlags style,                        const LLFontGL* font){    LLWString wline = utf8str_to_wstring(text_utf8);    if (!wline.empty())    {        // use default font for segment if custom font not specified        if (!font)        {            font = mFontp;        }        typedef boost::tokenizer<boost::char_separator<llwchar>, LLWString::const_iterator, LLWString > tokenizer;        LLWString seps(utf8str_to_wstring("/r/n"));        boost::char_separator<llwchar> sep(seps.c_str());        tokenizer tokens(wline, sep);        tokenizer::iterator iter = tokens.begin();        while (iter != tokens.end())        {            U32 line_length = 0;            do            {                F32 max_pixels = HUD_TEXT_MAX_WIDTH_NO_BUBBLE;                S32 segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels, wline.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);                LLHUDTextSegment segment(iter->substr(line_length, segment_length), style, color, font);                mTextSegments.push_back(segment);                line_length += segment_length;            }            while (line_length != iter->size());            ++iter;        }    }}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:36,


示例6: prearrangeList

void LLComboBox::updateSelection(){	if(mSuppressAutoComplete) {		return;	}	LLWString left_wstring = mTextEntry->getWText().substr(0, mTextEntry->getCursor());	// user-entered portion of string, based on assumption that any selected    // text was a result of auto-completion	LLWString user_wstring = mHasAutocompletedText ? left_wstring : mTextEntry->getWText();	std::string full_string = mTextEntry->getText();	// go ahead and arrange drop down list on first typed character, even	// though we aren't showing it... some code relies on prearrange	// callback to populate content	if( mTextEntry->getWText().size() == 1 )	{		prearrangeList(mTextEntry->getText());	}	if (mList->selectItemByLabel(full_string, FALSE))	{		mTextEntry->setTentative(FALSE);		mLastSelectedIndex = mList->getFirstSelectedIndex();	}	else if (mList->selectItemByPrefix(left_wstring, FALSE))	{		LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel());		LLWString wtext = left_wstring + selected_item.substr(left_wstring.size(), selected_item.size());		mTextEntry->setText(wstring_to_utf8str(wtext));		mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size());		mTextEntry->endSelection();		mTextEntry->setTentative(FALSE);		mHasAutocompletedText = TRUE;		mLastSelectedIndex = mList->getFirstSelectedIndex();	}	else // no matching items found	{		mList->deselectAllItems();		mTextEntry->setText(wstring_to_utf8str(user_wstring)); // removes text added by autocompletion		mTextEntry->setTentative(mTextEntryTentative);		mHasAutocompletedText = FALSE;		mLastSelectedIndex = -1;	}}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:45,


示例7: utf8str_to_wstring

void LLTextBox::setWrappedText(const LLStringExplicit& in_text, F32 max_width){	if (max_width < 0.0)	{		max_width = (F32)getRect().getWidth();	}	LLWString wtext = utf8str_to_wstring(in_text);	LLWString final_wtext;	LLWString::size_type  cur = 0;;	LLWString::size_type  len = wtext.size();	while (cur < len)	{		LLWString::size_type end = wtext.find('/n', cur);		if (end == LLWString::npos)		{			end = len;		}				LLWString::size_type runLen = end - cur;		if (runLen > 0)		{			LLWString run(wtext, cur, runLen);			LLWString::size_type useLen =				mFontGL->maxDrawableChars(run.c_str(), max_width, runLen, TRUE);			final_wtext.append(wtext, cur, useLen);			cur += useLen;		}		if (cur < len)		{			if (wtext[cur] == '/n')			{				cur += 1;			}			final_wtext += '/n';		}	}	std::string final_text = wstring_to_utf8str(final_wtext);	setText(final_text);}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:45,


示例8: llformat

//Staticvoid LLPanelGroupGeneral::onCopyURI(void* data){	LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data;	if(self)	{		LLNameEditor* key_edit = self->getChild<LLNameEditor>("groupkey_");		if(key_edit)		{			std::string URI = llformat("secondlife:///app/group/%s/about", key_edit->getText().c_str());			gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(URI));			LLSD args;			args["URI"] = URI;			LLNotifications::instance().add("CopyGroupURI", args);		}	}}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:19,


示例9: mPrearrangeCallback

void LLComboBox::updateSelection(){	if(mSuppressAutoComplete) {		return;	}		LLWString left_wstring = mTextEntry->getWText().substr(0, mTextEntry->getCursor());	// user-entered portion of string, based on assumption that any selected    // text was a result of auto-completion	LLWString user_wstring = mTextEntry->hasSelection() ? left_wstring : mTextEntry->getWText();	std::string full_string = mTextEntry->getText();	// go ahead and arrange drop down list on first typed character, even	// though we aren't showing it... some code relies on prearrange	// callback to populate content	if( mTextEntry->getWText().size() == 1 )	{		if (mPrearrangeCallback)		{			mPrearrangeCallback( this, mCallbackUserData );		}	}	if (mList->selectItemByLabel(full_string, FALSE))	{		mTextEntry->setTentative(FALSE);	}	else if (!mList->selectItemByPrefix(left_wstring, FALSE))	{		mList->deselectAllItems();		mTextEntry->setText(wstring_to_utf8str(user_wstring));		if (!mSuppressTentative) mTextEntry->setTentative(mTextEntryTentative);	}	else	{		LLWString selected_item = utf8str_to_wstring(mList->getSelectedItemLabel());		LLWString wtext = left_wstring + selected_item.substr(left_wstring.size(), selected_item.size());		mTextEntry->setText(wstring_to_utf8str(wtext));		mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size());		mTextEntry->endSelection();		mTextEntry->setTentative(FALSE);	}}
开发者ID:PixelTomsen,项目名称:SingularityViewer,代码行数:43,


示例10: utf8str_to_wstring

// Add the input uuid to the LL clipboard// Convert the uuid to string and concatenate that string to the system clipboard if legitbool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType type){	bool res = false;	if (src.notNull())	{		res = true;		if (LLAssetType::lookupIsAssetIDKnowable(type))		{			LLWString source = utf8str_to_wstring(src.asString());			res = addToClipboard(source, 0, source.size());		}		if (res)		{			mObjects.push_back(src);			mGeneration++;		}	}	return res;}
开发者ID:Belxjander,项目名称:Kirito,代码行数:21,


示例11: onClickCopyObjKey

void LLPanelPermissions::onClickCopyObjKey(void* data){	//NAMESHORT - Was requested on the forums, was going to integrate a textbox with the ID, but due to lack of room on the floater,	//We now have a copy button :>	//Madgeek - Hacked together method to copy more than one key, separated by comma.	std::string output;	std::string separator = gSavedSettings.getString("PhoenixCopyObjKeySeparator");	for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();		iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)	{		LLSelectNode* selectNode = *iter;		LLViewerObject* object = selectNode->getObject();		if (object)		{			if (!output.empty()) output.append(separator);			output.append(object->getID().asString());		}	}	if (!output.empty()) gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(output));}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:20,


示例12: handle_copy_uuid

// staticvoid LLFloaterExploreSounds::handle_copy_uuid(void* user_data){	LLFloaterExploreSounds* floater = (LLFloaterExploreSounds*)user_data;	LLScrollListCtrl* list = floater->getChild<LLScrollListCtrl>("sound_list");	LLUUID selection = list->getSelectedValue().asUUID(); // Single item only	LLSoundHistoryItem item = floater->getItem(selection);	if(item.mID.isNull()) return;	if (item.mOwnerID == gAgent.getID())	{		gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(item.mAssetID.asString()));	}	else	{		LLChat chat;		chat.mSourceType = CHAT_SOURCE_SYSTEM;		chat.mText = llformat("Can't copy UUIDs you don't own.");		LLFloaterChat::addChat(chat);	}}
开发者ID:AGoodPerson,项目名称:Ascent,代码行数:21,


示例13: copyToClipboard

void LLPanelWearing::copyToClipboard(){	std::string text;	std::vector<LLSD> data;	mCOFItemsList->getValues(data);	for(std::vector<LLSD>::const_iterator iter = data.begin(); iter != data.end();)	{		LLSD uuid = (*iter);		LLViewerInventoryItem* item = gInventory.getItem(uuid);		iter++;		if (item != NULL)		{			// Append a newline to all but the last line			text += iter != data.end() ? item->getName() + "/n" : item->getName();		}	}	LLClipboard::instance().copyToClipboard(utf8str_to_wstring(text),0,text.size());}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:21,


示例14: getProperSelectionStart

void DOHexEditor::copy(){	if(!canCopy()) return;	std::string text;	if(mInData)	{		U32 start = getProperSelectionStart();		U32 end = getProperSelectionEnd();		for(U32 i = start; i < end; i++)			text.append(llformat("%02X", mValue[i]));	}	else	{		U32 start = getProperSelectionStart();		U32 end = getProperSelectionEnd();		for(U32 i = start; i < end; i++)			text.append(llformat("%c", mValue[i]));	}	LLWString wtext = utf8str_to_wstring(text);	gClipboard.copyFromSubstring(wtext, 0, wtext.length());}
开发者ID:AGoodPerson,项目名称:Ascent,代码行数:22,


示例15: rlvGetItemNameFromObjID

// Checked: 2011-05-26 (RLVa-1.3.1c) | Added: RLVa-1.3.1cvoid RlvFloaterBehaviours::onBtnCopyToClipboard() const{	std::ostringstream strRestrictions;	strRestrictions << RlvStrings::getVersion() << "/n";	const RlvHandler::rlv_object_map_t* pObjects = gRlvHandler.getObjectMap();	for (RlvHandler::rlv_object_map_t::const_iterator itObj = pObjects->begin(), endObj = pObjects->end(); itObj != endObj; ++itObj)	{		strRestrictions << "/n" << rlvGetItemNameFromObjID(itObj->first) << ":/n";		const rlv_command_list_t* pCommands = itObj->second.getCommandList();		for (rlv_command_list_t::const_iterator itCmd = pCommands->begin(), endCmd = pCommands->end(); itCmd != endCmd; ++itCmd)		{			std::string strOption; LLUUID idOption;			if ( (itCmd->hasOption()) && (idOption.set(itCmd->getOption(), FALSE)) && (idOption.notNull()) )			{				LLAvatarName avName;				if (gObjectList.findObject(idOption))					strOption = rlvGetItemNameFromObjID(idOption, true);				else if (LLAvatarNameCache::get(idOption, &avName))					strOption = (!avName.getAccountName().empty()) ? avName.getAccountName() : avName.getDisplayName();				else if (!gCacheName->getGroupName(idOption, strOption))					strOption = itCmd->getOption();			}			strRestrictions << "  -> " << itCmd->asString();			if ( (!strOption.empty()) && (strOption != itCmd->getOption()) )				strRestrictions << "  [" << strOption << "]";			if (RLV_RET_SUCCESS != itCmd->getReturnType())				strRestrictions << "  (" << RlvStrings::getStringFromReturnCode(itCmd->getReturnType()) << ")";			strRestrictions << "/n";		}	}	LLWString wstrRestrictions = utf8str_to_wstring(strRestrictions.str());	gClipboard.copyFromSubstring(wstrRestrictions, 0, wstrRestrictions.length());}
开发者ID:HanHeld,项目名称:SingularityViewerFeb2016,代码行数:39,


示例16: llceil

//.........这里部分代码省略.........	switch (halign)	{	case LEFT:		break;	case RIGHT:	  	cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), 0, length) * sScaleX));		break;	case HCENTER:	    cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), 0, length) * sScaleX)) / 2;		break;	default:		break;	}	cur_render_y = cur_y;	cur_render_x = cur_x;	F32 start_x = cur_x;	F32 inv_width = 1.f / mFontBitmapCachep->getBitmapWidth();	F32 inv_height = 1.f / mFontBitmapCachep->getBitmapHeight();	const S32 LAST_CHARACTER = LLFont::LAST_CHAR_FULL;	BOOL draw_ellipses = FALSE;	if (use_ellipses && halign == LEFT)	{		// check for too long of a string		if (getWidthF32(wstr.c_str(), 0, max_chars) * sScaleX > scaled_max_pixels)		{			// use four dots for ellipsis width to generate padding			const LLWString dots(utf8str_to_wstring(std::string("....")));			scaled_max_pixels = llmax(0, scaled_max_pixels - llround(getWidthF32(dots.c_str())));			draw_ellipses = TRUE;		}	}	// Remember last-used texture to avoid unnecesssary bind calls.	LLImageGL *last_bound_texture = NULL;	for (i = begin_offset; i < begin_offset + length; i++)	{		llwchar wch = wstr[i];		// Handle embedded characters first, if they're enabled.		// Embedded characters are a hack for notecards		const embedded_data_t* ext_data = use_embedded ? getEmbeddedCharData(wch) : NULL;		if (ext_data)		{			LLImageGL* ext_image = ext_data->mImage;			const LLWString& label = ext_data->mLabel;			F32 ext_height = (F32)ext_image->getHeight() * sScaleY;			F32 ext_width = (F32)ext_image->getWidth() * sScaleX;			F32 ext_advance = (EXT_X_BEARING * sScaleX) + ext_width;			if (!label.empty())			{				ext_advance += (EXT_X_BEARING + getFontExtChar()->getWidthF32( label.c_str() )) * sScaleX;			}			if (start_x + scaled_max_pixels < cur_x + ext_advance)
开发者ID:NanaYngvarrdottir,项目名称:Virtual-Reality-Viewer,代码行数:67,


示例17: utf8str_to_wstring

void LLFontGL::addEmbeddedChar( llwchar wc, LLImageGL* image, const std::string& label ) const{	LLWString wlabel = utf8str_to_wstring(label);	addEmbeddedChar(wc, image, wlabel);}
开发者ID:NanaYngvarrdottir,项目名称:Virtual-Reality-Viewer,代码行数:5,


示例18: llformat

void LLFloaterSellLandUI::refreshUI(){	LLParcel* parcelp = mParcelSelection->getParcel();	if (!parcelp) return;	LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image");	snapshot->setImageAssetID(mParcelSnapshot);	getChild<LLUICtrl>("info_parcel")->setValue(parcelp->getName());	getChild<LLUICtrl>("info_size")->setTextArg("[AREA]", llformat("%d", mParcelActualArea));	std::string price_str = getChild<LLUICtrl>("price")->getValue().asString();	bool valid_price = false;	valid_price = (price_str != "") && LLTextValidate::validateNonNegativeS32(utf8str_to_wstring(price_str));	if (valid_price && mParcelActualArea > 0)	{		F32 per_meter_price = 0;		per_meter_price = F32(mParcelPrice) / F32(mParcelActualArea);		std::string type_currency = LLGridManager::getInstance()->getCurrency();		getChild<LLUICtrl>("price_per_m")->setTextArg("[CUR]", type_currency);		getChild<LLUICtrl>("price_per_m")->setTextArg("[PER_METER]", llformat("%0.2f", per_meter_price));		getChildView("price_per_m")->setVisible(TRUE);		setBadge("step_price", BADGE_OK);	}	else	{		getChildView("price_per_m")->setVisible(FALSE);		if ("" == price_str)		{			setBadge("step_price", BADGE_NOTE);		}		else		{			setBadge("step_price", BADGE_ERROR);		}	}	if (mSellToBuyer)	{		getChild<LLUICtrl>("sell_to")->setValue("user");		getChildView("sell_to_agent")->setVisible(TRUE);		getChildView("sell_to_select_agent")->setVisible(TRUE);	}	else	{		if (mChoseSellTo)		{			getChild<LLUICtrl>("sell_to")->setValue("anyone");		}		else		{			getChild<LLUICtrl>("sell_to")->setValue("select");		}		getChildView("sell_to_agent")->setVisible(FALSE);		getChildView("sell_to_select_agent")->setVisible(FALSE);	}	// Must select Sell To: Anybody, or User (with a specified username)	std::string sell_to = getChild<LLUICtrl>("sell_to")->getValue().asString();	bool valid_sell_to = "select" != sell_to &&		("user" != sell_to || mAuthorizedBuyer.notNull());	if (!valid_sell_to)	{		setBadge("step_sell_to", BADGE_NOTE);	}	else	{		setBadge("step_sell_to", BADGE_OK);	}	bool valid_sell_objects = ("none" != getChild<LLUICtrl>("sell_objects")->getValue().asString());	if (!valid_sell_objects)	{		setBadge("step_sell_objects", BADGE_NOTE);	}	else	{		setBadge("step_sell_objects", BADGE_OK);	}	if (valid_sell_to && valid_price && valid_sell_objects)	{		getChildView("sell_btn")->setEnabled(TRUE);	}	else	{		getChildView("sell_btn")->setEnabled(FALSE);	}}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:94,


示例19: sendChatFromViewer

void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate){	sendChatFromViewer(utf8str_to_wstring(utf8text), type, animate);}
开发者ID:Apelsin,项目名称:EffervescenceViewer,代码行数:4,


示例20: copyURLToClipboard

void LLUrlAction::copyURLToClipboard(std::string url){	LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(url));}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:4,


示例21: utf8str_to_wstring

LLWString LLControlGroup::getWString(const LLString& name){	return utf8str_to_wstring(getString(name));}
开发者ID:Boy,项目名称:netbook,代码行数:4,


示例22: utf8str_to_wstring

void LLFixedBuffer::addLine(const std::string& utf8line){	LLWString wstring = utf8str_to_wstring(utf8line);	addWLine(wstring);}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:5,


示例23: utf8str_to_wstring

void LLUIString::updateWResult() const{	mNeedsWResult = false;	mWResult = utf8str_to_wstring(getUpdatedResult());}
开发者ID:jimjesus,项目名称:kittyviewer,代码行数:6,


示例24: llmax

// static void LLTracker::renderBeacon(LLVector3d pos_global, 							 const LLColor4& color, 							 LLHUDText* hud_textp, 							 const std::string& label ){	sCheesyBeacon = gSavedSettings.getBOOL("CheesyBeacon");	LLVector3d to_vec = pos_global - gAgent.getCameraPositionGlobal();	F32 dist = (F32)to_vec.magVec();	F32 color_frac = 1.f;	if (dist > 0.99f * LLViewerCamera::getInstance()->getFar())	{		color_frac = 0.4f;	//	pos_global = gAgent.getCameraPositionGlobal() + 0.99f*(LLViewerCamera::getInstance()->getFar()/dist)*to_vec;	}	else	{		color_frac = 1.f - 0.6f*(dist/LLViewerCamera::getInstance()->getFar());	}	LLColor4 fogged_color = color_frac * color + (1 - color_frac)*gSky.getFogColor();	F32 FADE_DIST = 3.f;	fogged_color.mV[3] = llmax(0.2f, llmin(0.5f,(dist-FADE_DIST)/FADE_DIST));	LLVector3 pos_agent = gAgent.getPosAgentFromGlobal(pos_global);	LLGLSTracker gls_tracker; // default - TEXTURE + CULL_FACE + LIGHTING + GL_BLEND + GL_ALPHA_TEST	LLGLDisable cull_face(GL_CULL_FACE);	LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);			glMatrixMode(GL_MODELVIEW);	glPushMatrix();		glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]);				draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color);		gGL.color4fv(fogged_color.mV);		const U32 BEACON_VERTS = 256;		const F32 step = 1024.0f/BEACON_VERTS;				LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis();		F32 t = gRenderStartTime.getElapsedTimeF32();		F32 dr = dist/LLViewerCamera::getInstance()->getFar();				for (U32 i = 0; i < BEACON_VERTS; i++)		{			F32 x = x_axis.mV[0];			F32 y = x_axis.mV[1];						F32 z = i * step;			F32 z_next = (i+1)*step;					F32 a = pulse_func(t, z);			F32 an = pulse_func(t, z_next);						LLColor4 c_col = fogged_color + LLColor4(a,a,a,a);			LLColor4 col_next = fogged_color + LLColor4(an,an,an,an);			LLColor4 col_edge = fogged_color * LLColor4(a,a,a,0.0f);			LLColor4 col_edge_next = fogged_color * LLColor4(an,an,an,0.0f);						a *= 2.f;			a += 1.0f+dr;						an *= 2.f;			an += 1.0f+dr;					gGL.begin(LLVertexBuffer::TRIANGLE_STRIP);			gGL.color4fv(col_edge.mV);			gGL.vertex3f(-x*a, -y*a, z);			gGL.color4fv(col_edge_next.mV);			gGL.vertex3f(-x*an, -y*an, z_next);						gGL.color4fv(c_col.mV);			gGL.vertex3f(0, 0, z);			gGL.color4fv(col_next.mV);			gGL.vertex3f(0, 0, z_next);						gGL.color4fv(col_edge.mV);			gGL.vertex3f(x*a,y*a,z);			gGL.color4fv(col_edge_next.mV);			gGL.vertex3f(x*an,y*an,z_next);						gGL.end();		}									//gCylinder.render(1000);	glPopMatrix();	std::string text;	text = llformat( "%.0f m", to_vec.magVec());	LLWString wstr;	wstr += utf8str_to_wstring(label);	wstr += '/n';	wstr += utf8str_to_wstring(text);	hud_textp->setFont(LLFontGL::sSansSerif);//.........这里部分代码省略.........
开发者ID:Nora28,项目名称:imprudence,代码行数:101,


示例25: utf8str_to_wstring

// staticLLRect LLNotifyBox::getNotifyTipRect(const std::string &utf8message){	LLWString message = utf8str_to_wstring(utf8message);	S32 message_len = message.length();	const S32 NOTIFY_WIDTH = gSavedSettings.getS32("NotifyBoxWidth");	// Make room for the icon area.	const S32 text_area_width = NOTIFY_WIDTH - HPAD * 4 - 32;	const llwchar* wchars = message.c_str();	const llwchar* start = wchars;	const llwchar* end;	S32 total_drawn = 0;	bool done = false;	S32 line_count;	for (line_count = 2; !done; ++line_count)	{		for (end = start; *end != 0 && *end != '/n'; end++);		if (*end == 0)		{			end = wchars + message_len;			done = true;		}				for (S32 remaining = end - start; remaining;)		{			S32 drawn = sFont->maxDrawableChars(start, (F32)text_area_width, remaining, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);			if (0 == drawn)			{				drawn = 1;  // Draw at least one character, even if it doesn't all fit. (avoids an infinite loop)			}			total_drawn += drawn; 			start += drawn;			remaining -= drawn;			if (total_drawn < message_len)			{				if (wchars[ total_drawn ] != '/n')				{					// wrap because line was too long					line_count++;				}			}			else			{				done = true;			}		}		total_drawn++;	// for '/n'		start = ++end;	}	const S32 MIN_NOTIFY_HEIGHT = 72;	const S32 MAX_NOTIFY_HEIGHT = 600;	S32 notify_height = llceil((F32) (line_count+1) * sFont->getLineHeight());	if (gOverlayBar)	{		notify_height += gOverlayBar->getBoundingRect().mTop;	}	else	{		// *FIX: this is derived from the padding caused by the		// rounded rects, shouldn't be a const here.		notify_height += 10;  	}	notify_height += VPAD;	notify_height = llclamp(notify_height, MIN_NOTIFY_HEIGHT, MAX_NOTIFY_HEIGHT);	const S32 RIGHT = gNotifyBoxView->getRect().getWidth();	const S32 LEFT = RIGHT - NOTIFY_WIDTH;	// Make sure it goes slightly offscreen	return LLRect(LEFT, notify_height-1, RIGHT, -1);}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:80,


示例26: childSetValue

// Update controls based on current settingsvoid LLPrefsAscentChat::refresh(){    //Chat --------------------------------------------------------------------------------    // time format combobox    LLComboBox* combo = getChild<LLComboBox>("time_format_combobox");    if (combo)    {        combo->setCurrentByIndex(mTimeFormat);    }    // date format combobox    combo = getChild<LLComboBox>("date_format_combobox");    if (combo)    {        combo->setCurrentByIndex(mDateFormat);    }    childSetValue("AscentInstantMessageResponseAnyone",  mIMResponseAnyone);    childSetValue("AscentInstantMessageResponseFriends", mIMResponseFriends);    childSetValue("AscentInstantMessageResponseMuted",   mIMResponseMuted);    childSetValue("AscentInstantMessageShowOnTyping",    mIMShowOnTyping);    childSetValue("AscentInstantMessageShowResponded",   mIMShowResponded);    childSetValue("AscentInstantMessageResponseRepeat",  mIMResponseRepeat);    childSetValue("AscentInstantMessageResponseItem",    mIMResponseItem);    LLWString auto_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("AscentInstantMessageResponse") );    LLWStringUtil::replaceChar(auto_response, '^', '/n');    LLWStringUtil::replaceChar(auto_response, '%', ' ');    childSetText("im_response", wstring_to_utf8str(auto_response));    //Text Options ------------------------------------------------------------------------    combo = getChild<LLComboBox>("SpellBase");    if (combo != NULL)     {        combo->removeall();        std::vector<std::string> names = glggHunSpell->getDicts();        for (int i = 0; i < (int)names.size(); i++)         {            combo->add(names[i]);        }        combo->setSimple(gSavedSettings.getString("SpellBase"));    }    combo = getChild<LLComboBox>("EmSpell_Avail");    if (combo != NULL)     {        combo->removeall();        combo->add("");        std::vector<std::string> names = glggHunSpell->getAvailDicts();        for (int i = 0; i < (int)names.size(); i++)         {            combo->add(names[i]);        }        combo->setSimple(std::string(""));    }    combo = getChild<LLComboBox>("EmSpell_Installed");    if (combo != NULL)     {        combo->removeall();        combo->add("");        std::vector<std::string> names = glggHunSpell->getInstalledDicts();        for (int i = 0; i < (int)names.size(); i++)         {            combo->add(names[i]);        }        combo->setSimple(std::string(""));    }    childSetEnabled("KeywordsList",        mKeywordsOn);    childSetEnabled("KeywordsInChat",      mKeywordsOn);    childSetEnabled("KeywordsInIM",        mKeywordsOn);    childSetEnabled("KeywordsChangeColor", mKeywordsOn);    childSetEnabled("KeywordsColor",       mKeywordsOn);    childSetEnabled("KeywordsPlaySound",   mKeywordsOn);    childSetEnabled("KeywordsSound",       mKeywordsOn);    childSetValue("KeywordsOn",          mKeywordsOn);    childSetValue("KeywordsList",        mKeywordsList);    childSetValue("KeywordsInChat",      mKeywordsInChat);    childSetValue("KeywordsInIM",        mKeywordsInIM);    childSetValue("KeywordsChangeColor", mKeywordsChangeColor);    LLColorSwatchCtrl* colorctrl = getChild<LLColorSwatchCtrl>("KeywordsColor");    colorctrl->set(LLColor4(mKeywordsColor),TRUE);    childSetValue("KeywordsPlaySound",   mKeywordsPlaySound);    childSetValue("KeywordsSound",       mKeywordsSound);//.........这里部分代码省略.........
开发者ID:samiam123,项目名称:SingularityViewer,代码行数:101,



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


C++ utfrune函数代码示例
C++ utf8length函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。