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


C++ FText类代码示例

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


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

示例1: HandleOnTextCommitted

void UJavascriptGraphTextPropertyEditableTextBox::HandleOnTextCommitted(const FText& InText)
{
	FName TableId = NAME_None;
	FString Key;
	FTextInspector::GetTableIdAndKey(InText, TableId, Key);
	MyTextProperty.TableId = TableId;
	MyTextProperty.Namespace = FTextInspector::GetNamespace(InText).Get(FString());
	MyTextProperty.Key = FTextInspector::GetKey(InText).Get(FString());
	MyTextProperty.Value = InText.ToString();

	OnTextCommitted.Broadcast(MyTextProperty);
}
开发者ID:ncsoft,项目名称:Unreal.js-core,代码行数:12,代码来源:JavascriptGraphTextPropertyEditableTextBox.cpp

示例2: ProjectChanged

static void ProjectChanged(const FText& NewText, ETextCommit::Type CommitType, FGuid TargetGuid)
{
	FOneSkyLocalizationTargetSetting* Settings = FOneSkyLocalizationServiceModule::Get().AccessSettings().GetSettingsForTarget(TargetGuid, true);
	int32 NewProjectId = INDEX_NONE;	// Default to -1
	FString StringId = NewText.ToString();
	// Don't allow this to be set to a non-numeric value.
	if (StringId.IsNumeric())
	{
		NewProjectId = FCString::Atoi(*StringId);
	}
	FOneSkyLocalizationServiceModule::Get().AccessSettings().SetSettingsForTarget(TargetGuid, NewProjectId, Settings->OneSkyFileName);
}
开发者ID:AndyHuang7601,项目名称:EpicGames-UnrealEngine,代码行数:12,代码来源:OneSkyLocalizationServiceProvider.cpp

示例3: OnTextCommitted

void SSessionLauncherDeployRepositorySettings::OnTextCommitted( const FText& InText, ETextCommit::Type CommitInfo)
{
	if (CommitInfo == ETextCommit::OnEnter)
	{
		ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();

		if(SelectedProfile.IsValid())
		{
			SelectedProfile->SetPackageDirectory(InText.ToString());
		}
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:12,代码来源:SSessionLauncherDeployRepositorySettings.cpp

示例4: GetCaption

void UMaterialExpressionSpriteTextureSampler::GetCaption(TArray<FString>& OutCaptions) const
{
    OutCaptions.Add(TEXT("Paper2D Sprite"));

    if (!SlotDisplayName.IsEmpty())
    {
        OutCaptions.Add(SlotDisplayName.ToString());
    }

    if (bSampleAdditionalTextures)
    {
        FNumberFormattingOptions NoCommas;
        NoCommas.UseGrouping = false;
        const FText SlotDesc = FText::Format(LOCTEXT("SpriteSamplerTitle_AdditionalSlot", "Additional Texture #{0}"), FText::AsNumber(AdditionalSlotIndex, &NoCommas));
        OutCaptions.Add(SlotDesc.ToString());
    }
    else
    {
        OutCaptions.Add(LOCTEXT("SpriteSamplerTitle_BasicSlot", "Source Texture").ToString());
    }
}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:21,代码来源:MaterialExpressionSpriteTextureSampler.cpp

示例5: GetSpriteBeingEdited

void FSpriteEditorViewportClient::DrawBoundsAsText(FViewport& InViewport, FSceneView& View, FCanvas& Canvas, int32& YPos)
{
	FNumberFormattingOptions NoDigitGroupingFormat;
	NoDigitGroupingFormat.UseGrouping = false;

	UPaperSprite* Sprite = GetSpriteBeingEdited();
	FBoxSphereBounds Bounds = Sprite->GetRenderBounds();

	const FText DisplaySizeText = FText::Format(LOCTEXT("BoundsSize", "Approx. Size: {0}x{1}x{2}"),
		FText::AsNumber((int32)(Bounds.BoxExtent.X * 2.0f), &NoDigitGroupingFormat),
		FText::AsNumber((int32)(Bounds.BoxExtent.Y * 2.0f), &NoDigitGroupingFormat),
		FText::AsNumber((int32)(Bounds.BoxExtent.Z * 2.0f), &NoDigitGroupingFormat));

	Canvas.DrawShadowedString(
		6,
		YPos,
		*DisplaySizeText.ToString(),
		GEngine->GetSmallFont(),
		FLinearColor::White);
	YPos += 18;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:21,代码来源:SpriteEditorViewportClient.cpp

示例6: MakeText

void FSlateDrawElement::MakeText( FSlateWindowElementList& ElementList, uint32 InLayer, const FPaintGeometry& PaintGeometry, const FText& InText, const FSlateFontInfo& InFontInfo, const FSlateRect& InClippingRect,ESlateDrawEffect::Type InDrawEffects, const FLinearColor& InTint )
{
	FSlateDrawElement& DrawElt = ElementList.AddUninitialized();
	DrawElt.ElementType = ET_Text;
	DrawElt.Position = PaintGeometry.DrawPosition;
	DrawElt.Size = PaintGeometry.DrawSize;
	DrawElt.ClippingRect = InClippingRect;
	DrawElt.DataPayload.SetTextPayloadProperties( InText.ToString(), InFontInfo, InTint );
	DrawElt.Layer = InLayer;
	DrawElt.DrawEffects = InDrawEffects;
	DrawElt.Scale = PaintGeometry.DrawScale;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:12,代码来源:DrawElements.cpp

示例7: GetSchema

FText UEdGraphPin::GetDisplayName() const
{
	FText DisplayName = FText::GetEmpty();
	auto Schema = GetSchema();
	if (Schema)
	{
		DisplayName = Schema->GetPinDisplayName(this);
	}
	else
	{
		DisplayName = (!PinFriendlyName.IsEmpty()) ? PinFriendlyName : FText::FromString(PinName);

		bool bShowNodesAndPinsUnlocalized = false;
		GConfig->GetBool( TEXT("Internationalization"), TEXT("ShowNodesAndPinsUnlocalized"), bShowNodesAndPinsUnlocalized, GEditorSettingsIni );
		if (bShowNodesAndPinsUnlocalized)
		{
			return FText::FromString(DisplayName.BuildSourceString());
		}
	}
	return DisplayName;
}
开发者ID:johndpope,项目名称:UE4,代码行数:21,代码来源:EdGraphPin.cpp

示例8: MakeShareable

bool FProjectManager::LoadProjectFile( const FString& InProjectFile )
{
	// Try to load the descriptor
	FText FailureReason;
	TSharedPtr<FProjectDescriptor> Descriptor = MakeShareable(new FProjectDescriptor());
	if(Descriptor->Load(InProjectFile, FailureReason))
	{
		// Create the project
		CurrentProject = Descriptor;
		return true;
	}
	
#if PLATFORM_IOS
    FString UpdatedMessage = FString::Printf(TEXT("%s\n%s"), *FailureReason.ToString(), TEXT("For troubleshooting, please go to https://docs.unrealengine.com/latest/INT/Platforms/iOS/GettingStarted/index.html"));
    FailureReason = FText::FromString(UpdatedMessage);
#endif
	UE_LOG(LogProjectManager, Error, TEXT("%s"), *FailureReason.ToString());
	FMessageDialog::Open(EAppMsgType::Ok, FailureReason);
    
	return false;
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:21,代码来源:ProjectManager.cpp

示例9: SetDisplayName

void UMovieSceneNameableTrack::SetDisplayName(const FText& NewDisplayName)
{
	if (NewDisplayName.EqualTo(DisplayName))
	{
		return;
	}

	SetFlags(RF_Transactional);
	Modify();

	DisplayName = NewDisplayName;
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:12,代码来源:MovieSceneNameableTrack.cpp

示例10: OnLoadError

void FWebBrowserHandler::OnLoadError(CefRefPtr<CefBrowser> Browser,
	CefRefPtr<CefFrame> Frame,
	CefLoadHandler::ErrorCode InErrorCode,
	const CefString& ErrorText,
	const CefString& FailedUrl)
{
	// Don't display an error for downloaded files.
	if (InErrorCode == ERR_ABORTED)
		return;

	// Display a load error message.
	FFormatNamedArguments Args;
	Args.Add(TEXT("FailedUrl"), FText::FromString(FailedUrl.c_str()));
	Args.Add(TEXT("ErrorText"), FText::FromString(ErrorText.c_str()));
	Args.Add(TEXT("ErrorCode"), FText::AsNumber(InErrorCode));
	FText ErrorMsg = FText::Format(LOCTEXT("WebBrowserLoadError", "Failed to load URL {FailedUrl} with error {ErrorText} ({ErrorCode})."), Args);
	FString ErrorHTML = TEXT("<html><body bgcolor=\"white\"><h2>")
						+ ErrorMsg.ToString()
						+ TEXT("</h2></body></html>");
	Frame->LoadString(*ErrorHTML, FailedUrl);
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:21,代码来源:WebBrowserHandler.cpp

示例11: UpdateSuggestionHelper

void UpdateSuggestionHelper(const FText & CategoryLabel, const TArray<FSearchEntry> & Elements, TArray<TSharedPtr< FSearchEntry > > & OutSuggestions)
{
	if (Elements.Num())
	{
		OutSuggestions.Add(MakeShareable(FSearchEntry::MakeCategoryEntry(CategoryLabel.ToString())));
	}

	for (uint32 i = 0; i < (uint32)Elements.Num(); ++i)
	{
		OutSuggestions.Add(MakeShareable(new FSearchEntry(Elements[i])));
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:12,代码来源:SSuperSearch.cpp

示例12: ExecuteExportAsCSV

void FAssetTypeActions_CurveTable::ExecuteExportAsCSV(TArray< TWeakObjectPtr<UObject> > Objects)
{
	IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();

	void* ParentWindowWindowHandle = nullptr;

	IMainFrameModule& MainFrameModule = FModuleManager::LoadModuleChecked<IMainFrameModule>(TEXT("MainFrame"));
	const TSharedPtr<SWindow>& MainFrameParentWindow = MainFrameModule.GetParentWindow();
	if ( MainFrameParentWindow.IsValid() && MainFrameParentWindow->GetNativeWindow().IsValid() )
	{
		ParentWindowWindowHandle = MainFrameParentWindow->GetNativeWindow()->GetOSWindowHandle();
	}

	for (auto ObjIt = Objects.CreateConstIterator(); ObjIt; ++ObjIt)
	{
		auto CurTable = Cast<UCurveTable>((*ObjIt).Get());
		if (CurTable)
		{
			const FText Title = FText::Format(LOCTEXT("CurveTable_ExportCSVDialogTitle", "Export '{0}' as CSV..."), FText::FromString(*CurTable->GetName()));
			const FString CurrentFilename = (CurTable->ImportPath.IsEmpty()) ? TEXT("") : FReimportManager::ResolveImportFilename(CurTable->ImportPath, CurTable);
			const FString FileTypes = TEXT("Curve Table CSV (*.csv)|*.csv");

			TArray<FString> OutFilenames;
			DesktopPlatform->SaveFileDialog(
				ParentWindowWindowHandle,
				Title.ToString(),
				(CurrentFilename.IsEmpty()) ? TEXT("") : FPaths::GetPath(CurrentFilename),
				(CurrentFilename.IsEmpty()) ? TEXT("") : FPaths::GetBaseFilename(CurrentFilename) + TEXT(".csv"),
				FileTypes,
				EFileDialogFlags::None,
				OutFilenames
				);

			if (OutFilenames.Num() > 0)
			{
				FFileHelper::SaveStringToFile(CurTable->GetTableAsCSV(), *OutFilenames[0]);
			}
		}
	}
}
开发者ID:a3pelawi,项目名称:UnrealEngine,代码行数:40,代码来源:AssetTypeActions_CurveTable.cpp

示例13: Identical_Implementation

bool UTextProperty::Identical_Implementation(const FText& ValueA, const FText& ValueB, uint32 PortFlags)
{
	if (ValueA.IsCultureInvariant() != ValueB.IsCultureInvariant() || ValueA.IsTransient() != ValueB.IsTransient())
	{
		//A culture variant text is never equal to a culture invariant text
		//A transient text is never equal to a non-transient text
		return false;
	}

	if (ValueA.IsCultureInvariant() == ValueB.IsCultureInvariant() || ValueA.IsTransient() == ValueB.IsTransient())
	{
		//Culture invariant text don't have a namespace/key so we compare the source string
		//Transient text don't have a namespace/key or source so we compare the display string
		return FTextInspector::GetDisplayString(ValueA) == FTextInspector::GetDisplayString(ValueB);
	}

	if (GIsEditor)
	{
		return FTextInspector::GetSourceString(ValueA)->Compare(*FTextInspector::GetSourceString(ValueB), ESearchCase::CaseSensitive) == 0;
	}
	else
	{
		return	FTextInspector::GetNamespace(ValueA) == FTextInspector::GetNamespace(ValueB) &&
			FTextInspector::GetKey(ValueA) == FTextInspector::GetKey(ValueB);
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:26,代码来源:TextProperty.cpp

示例14: LOCTEXT

void UMaterialGraphSchema::GetCommentAction(FGraphActionMenuBuilder& ActionMenuBuilder, const UEdGraph* CurrentGraph) const
{
	if (!ActionMenuBuilder.FromPin)
	{
		const bool bIsManyNodesSelected = CurrentGraph ? (FMaterialEditorUtilities::GetNumberOfSelectedNodes(CurrentGraph) > 0) : false;
		const FText CommentDesc = LOCTEXT("CommentDesc", "New Comment");
		const FText MultiCommentDesc = LOCTEXT("MultiCommentDesc", "Create Comment from Selection");
		const FText CommentToolTip = LOCTEXT("CommentToolTip", "Creates a comment.");
		const FText MenuDescription = bIsManyNodesSelected ? MultiCommentDesc : CommentDesc;
		TSharedPtr<FMaterialGraphSchemaAction_NewComment> NewAction(new FMaterialGraphSchemaAction_NewComment(TEXT(""), MenuDescription, CommentToolTip.ToString(), 0));
		ActionMenuBuilder.AddAction( NewAction );
	}
}
开发者ID:johndpope,项目名称:UE4,代码行数:13,代码来源:MaterialGraphSchema.cpp

示例15: OnAxisMappingNameCommitted

void FAxisMappingsNodeBuilder::OnAxisMappingNameCommitted(const FText& InName, ETextCommit::Type CommitInfo, const FMappingSet MappingSet)
{
	const FScopedTransaction Transaction(LOCTEXT("RenameAxisMapping_Transaction", "Rename Axis Mapping"));

	FName NewName = FName(*InName.ToString());

	TSharedPtr<IPropertyHandleArray> AxisMappingsArrayHandle = AxisMappingsPropertyHandle->AsArray();

	for (int32 Index = 0; Index < MappingSet.Mappings.Num(); ++Index)
	{
		MappingSet.Mappings[Index]->GetChildHandle(GET_MEMBER_NAME_CHECKED(FInputAxisKeyMapping, AxisName))->SetValue(NewName);
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:13,代码来源:InputSettingsDetails.cpp


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