本文整理汇总了C++中TAttribute::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ TAttribute::Get方法的具体用法?C++ TAttribute::Get怎么用?C++ TAttribute::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAttribute
的用法示例。
在下文中一共展示了TAttribute::Get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppendKeyBindingToToolTip
/** Appends the key binding to the end of the provided ToolTip */
static FText AppendKeyBindingToToolTip( const TAttribute<FText> ToolTip, TWeakPtr< const FUICommandInfo> Command )
{
TSharedPtr<const FUICommandInfo> CommandPtr = Command.Pin();
if( CommandPtr.IsValid() && CommandPtr->GetActiveChord()->IsValidChord() )
{
FFormatNamedArguments Args;
Args.Add( TEXT("ToolTipDescription"), ToolTip.Get() );
Args.Add( TEXT("Keybinding"), CommandPtr->GetInputText() );
return FText::Format( NSLOCTEXT("ToolBar", "ToolTip + Keybinding", "{ToolTipDescription} ({Keybinding})"), Args );
}
else
{
return ToolTip.Get();
}
}
示例2: BeginSection
void FMenuBuilder::BeginSection( FName InExtensionHook, const TAttribute< FText >& InHeadingText )
{
check(CurrentSectionExtensionHook == NAME_None && !bSectionNeedsToBeApplied);
ApplyHook(InExtensionHook, EExtensionHook::Before);
// Do not actually apply the section header, because if this section is ended immediately
// then nothing ever gets created, preventing empty sections from ever appearing
bSectionNeedsToBeApplied = true;
CurrentSectionExtensionHook = InExtensionHook;
CurrentSectionHeadingText = InHeadingText.Get();
// Do apply the section beginning if we are in developer "show me all the hooks" mode
if (FMultiBoxSettings::DisplayMultiboxHooks.Get())
{
ApplySectionBeginning();
}
ApplyHook(InExtensionHook, EExtensionHook::First);
}
示例3: SNew
TSharedRef< class SToolTip > FDocumentation::CreateToolTip(const TAttribute<FText>& Text, const TSharedPtr<SWidget>& OverrideContent, const FString& Link, const FString& ExcerptName) const
{
TSharedPtr< SDocumentationToolTip > DocToolTip;
if ( !Text.IsBound() && Text.Get().IsEmpty() )
{
return SNew( SToolTip );
}
if ( OverrideContent.IsValid() )
{
SAssignNew( DocToolTip, SDocumentationToolTip )
.DocumentationLink( Link )
.ExcerptName( ExcerptName )
[
OverrideContent.ToSharedRef()
];
}
else
{
SAssignNew( DocToolTip, SDocumentationToolTip )
.Text( Text )
.DocumentationLink( Link )
.ExcerptName( ExcerptName );
}
return SNew( SToolTip )
.IsInteractive( DocToolTip.ToSharedRef(), &SDocumentationToolTip::IsInteractive )
// Emulate text-only tool-tip styling that SToolTip uses when no custom content is supplied. We want documentation tool-tips to
// be styled just like text-only tool-tips
.BorderImage( FCoreStyle::Get().GetBrush("ToolTip.BrightBackground") )
.TextMargin(FMargin(11.0f))
[
DocToolTip.ToSharedRef()
];
}
示例4: PassThroughAttribute
static FText PassThroughAttribute( TAttribute< FString > InString )
{
return FText::FromString( InString.Get( TEXT("") ) );
}
示例5: GetPIENotifyText
static FString GetPIENotifyText(TAttribute<FGraphAppearanceInfo> Appearance, FString DefaultText)
{
FString OverrideText = Appearance.Get().PIENotifyText;
return OverrideText.Len() ? OverrideText : DefaultText;
}
示例6: BuildMultiBlockWidget
/**
* Builds this MultiBlock widget up from the MultiBlock associated with it
*/
void SToolBarButtonBlock::BuildMultiBlockWidget(const ISlateStyle* StyleSet, const FName& StyleName)
{
struct Local
{
/** Appends the key binding to the end of the provided ToolTip */
static FText AppendKeyBindingToToolTip( const TAttribute<FText> ToolTip, TWeakPtr< const FUICommandInfo> Command )
{
TSharedPtr<const FUICommandInfo> CommandPtr = Command.Pin();
if( CommandPtr.IsValid() && CommandPtr->GetActiveChord()->IsValidChord() )
{
FFormatNamedArguments Args;
Args.Add( TEXT("ToolTipDescription"), ToolTip.Get() );
Args.Add( TEXT("Keybinding"), CommandPtr->GetInputText() );
return FText::Format( NSLOCTEXT("ToolBar", "ToolTip + Keybinding", "{ToolTipDescription} ({Keybinding})"), Args );
}
else
{
return ToolTip.Get();
}
}
};
TSharedRef< const FMultiBox > MultiBox( OwnerMultiBoxWidget.Pin()->GetMultiBox() );
TSharedRef< const FToolBarButtonBlock > ToolBarButtonBlock = StaticCastSharedRef< const FToolBarButtonBlock >( MultiBlock.ToSharedRef() );
// Allow the block to override the action's label and tool tip string, if desired
TAttribute<FText> ActualLabel;
if (ToolBarButtonBlock->LabelOverride.IsSet())
{
ActualLabel = ToolBarButtonBlock->LabelOverride;
}
else
{
ActualLabel = ToolBarButtonBlock->GetAction()->GetLabel();
}
// Add this widget to the search list of the multibox
if (MultiBlock->GetSearchable())
OwnerMultiBoxWidget.Pin()->AddSearchElement(this->AsWidget(), ActualLabel.Get());
TAttribute<FText> ActualToolTip;
if (ToolBarButtonBlock->ToolTipOverride.IsSet())
{
ActualToolTip = ToolBarButtonBlock->ToolTipOverride;
}
else
{
ActualToolTip = ToolBarButtonBlock->GetAction()->GetDescription();
}
// If a key is bound to the command, append it to the tooltip text.
TWeakPtr<const FUICommandInfo> Action = ToolBarButtonBlock->GetAction();
ActualToolTip = TAttribute< FText >::Create( TAttribute< FText >::FGetter::CreateStatic( &Local::AppendKeyBindingToToolTip, ActualToolTip, Action ) );
// If we were supplied an image than go ahead and use that, otherwise we use a null widget
TSharedRef< SWidget > IconWidget =
SNew( SImage )
.Visibility( this, &SToolBarButtonBlock::GetIconVisibility, false )
.Image( this, &SToolBarButtonBlock::GetIconBrush );
TSharedRef< SWidget > SmallIconWidget =
SNew( SImage )
.Visibility( this, &SToolBarButtonBlock::GetIconVisibility, true )
.Image( this, &SToolBarButtonBlock::GetSmallIconBrush );
// Create the content for our button
TSharedRef< SWidget > ButtonContent =
SNew(SHorizontalBox)
.AddMetaData<FTagMetaData>(FTagMetaData(TutorialHighlightName))
+ SHorizontalBox::Slot()
.FillWidth(1)
.VAlign(VAlign_Center)
[
SNew( SVerticalBox )
// Icon image
+ SVerticalBox::Slot()
.AutoHeight()
.HAlign( HAlign_Center ) // Center the icon horizontally, so that large labels don't stretch out the artwork
[
IconWidget
]
+ SVerticalBox::Slot().AutoHeight()
.HAlign( HAlign_Center )
[
SmallIconWidget
]
// Label text
+ SVerticalBox::Slot().AutoHeight()
.HAlign( HAlign_Center ) // Center the label text horizontally
[
SNew( STextBlock )
//.........这里部分代码省略.........
示例7: SetText
void SAssetSearchBox::SetText(const TAttribute< FText >& InNewText)
{
InputText->SetText(InNewText);
PreCommittedText = InNewText.Get();
}