void UTextBlock::OnBindingChanged(const FName& Property) { Super::OnBindingChanged(Property); if ( MyTextBlock.IsValid() ) { static const FName TextProperty(TEXT("TextDelegate")); static const FName ColorAndOpacityProperty(TEXT("ColorAndOpacityDelegate")); static const FName ShadowColorAndOpacityProperty(TEXT("ShadowColorAndOpacityDelegate")); if ( Property == TextProperty ) { TAttribute<FText> TextBinding = OPTIONAL_BINDING(FText, Text); MyTextBlock->SetText(TextBinding); } else if ( Property == ColorAndOpacityProperty ) { TAttribute<FSlateColor> ColorAndOpacityBinding = OPTIONAL_BINDING(FSlateColor, ColorAndOpacity); MyTextBlock->SetColorAndOpacity(ColorAndOpacityBinding); } else if ( Property == ShadowColorAndOpacityProperty ) { TAttribute<FLinearColor> ShadowColorAndOpacityBinding = OPTIONAL_BINDING(FLinearColor, ShadowColorAndOpacity); MyTextBlock->SetShadowColorAndOpacity(ShadowColorAndOpacityBinding); } } }
void UEditableText::SynchronizeProperties() { Super::SynchronizeProperties(); TAttribute<FText> TextBinding = OPTIONAL_BINDING(FText, Text); TAttribute<FText> HintTextBinding = OPTIONAL_BINDING(FText, HintText); MyEditableText->SetText(TextBinding); MyEditableText->SetHintText(HintTextBinding); MyEditableText->SetIsReadOnly(IsReadOnly); MyEditableText->SetIsPassword(IsPassword); MyEditableText->SetColorAndOpacity(ColorAndOpacity); // TODO UMG Complete making all properties settable on SEditableText }
void UCheckBox::SynchronizeProperties() { Super::SynchronizeProperties(); MyCheckbox->SetStyle(&WidgetStyle); MyCheckbox->SetIsChecked( OPTIONAL_BINDING(ECheckBoxState, CheckedState) ); }
void UUserWidget::SynchronizeProperties() { Super::SynchronizeProperties(); // We get the GCWidget directly because MyWidget could be the fullscreen host widget if we've been added // to the viewport. TSharedPtr<SObjectWidget> SafeGCWidget = MyGCWidget.Pin(); if ( SafeGCWidget.IsValid() ) { TAttribute<FLinearColor> ColorBinding = OPTIONAL_BINDING(FLinearColor, ColorAndOpacity); TAttribute<FSlateColor> ForegroundColorBinding = OPTIONAL_BINDING(FSlateColor, ForegroundColor); SafeGCWidget->SetColorAndOpacity(ColorBinding); SafeGCWidget->SetForegroundColor(ForegroundColorBinding); } }
void UCheckBox::SetCheckedState(ECheckBoxState InCheckedState) { CheckedState = InCheckedState; if ( MyCheckbox.IsValid() ) { MyCheckbox->SetIsChecked(OPTIONAL_BINDING(ECheckBoxState, CheckedState)); } }
void UCheckBox::SetIsChecked(bool InIsChecked) { CheckedState = InIsChecked ? ECheckBoxState::Checked : ECheckBoxState::Unchecked; if ( MyCheckbox.IsValid() ) { MyCheckbox->SetIsChecked(OPTIONAL_BINDING(ECheckBoxState, CheckedState)); } }
void URichTextBlock::SynchronizeProperties() { Super::SynchronizeProperties(); TAttribute<FText> TextBinding = OPTIONAL_BINDING(FText, Text); MyRichTextBlock->SetText(TextBinding); Super::SynchronizeTextLayoutProperties( *MyRichTextBlock ); }
void UTextBlock::SynchronizeProperties() { Super::SynchronizeProperties(); TAttribute<FText> TextBinding = OPTIONAL_BINDING(FText, Text); TAttribute<FSlateColor> ColorAndOpacityBinding = OPTIONAL_BINDING(FSlateColor, ColorAndOpacity); TAttribute<FLinearColor> ShadowColorAndOpacityBinding = OPTIONAL_BINDING(FLinearColor, ShadowColorAndOpacity); MyTextBlock->SetText(TextBinding); MyTextBlock->SetFont(Font); MyTextBlock->SetColorAndOpacity(ColorAndOpacityBinding); MyTextBlock->SetShadowOffset(ShadowOffset); MyTextBlock->SetShadowColorAndOpacity(ShadowColorAndOpacityBinding); MyTextBlock->SetAutoWrapText(AutoWrapText); MyTextBlock->SetWrapTextAt(WrapTextAt != 0 ? WrapTextAt : TAttribute<float>()); MyTextBlock->SetMinDesiredWidth(MinDesiredWidth); MyTextBlock->SetLineHeightPercentage(LineHeightPercentage); MyTextBlock->SetMargin(Margin); MyTextBlock->SetJustification(Justification); }
void UTextBlock::SynchronizeProperties() { Super::SynchronizeProperties(); TAttribute<FText> TextBinding = OPTIONAL_BINDING(FText, Text); TAttribute<FSlateColor> ColorAndOpacityBinding = OPTIONAL_BINDING(FSlateColor, ColorAndOpacity); TAttribute<FLinearColor> ShadowColorAndOpacityBinding = OPTIONAL_BINDING(FLinearColor, ShadowColorAndOpacity); if ( MyTextBlock.IsValid() ) { MyTextBlock->SetText( TextBinding ); MyTextBlock->SetFont( Font ); MyTextBlock->SetColorAndOpacity( ColorAndOpacityBinding ); MyTextBlock->SetShadowOffset( ShadowOffset ); MyTextBlock->SetShadowColorAndOpacity( ShadowColorAndOpacityBinding ); MyTextBlock->SetMinDesiredWidth( MinDesiredWidth ); Super::SynchronizeTextLayoutProperties( *MyTextBlock ); } }
void UImage::SynchronizeProperties() { Super::SynchronizeProperties(); TAttribute<FSlateColor> ColorAndOpacityBinding = OPTIONAL_BINDING(FSlateColor, ColorAndOpacity); TAttribute<const FSlateBrush*> ImageBinding = OPTIONAL_BINDING_CONVERT(FSlateBrush, Brush, const FSlateBrush*, ConvertImage); MyImage->SetImage(ImageBinding); MyImage->SetColorAndOpacity(ColorAndOpacityBinding); MyImage->SetOnMouseButtonDown(BIND_UOBJECT_DELEGATE(FPointerEventHandler, HandleMouseButtonDown)); }
void UEditableTextBox::SynchronizeProperties() { Super::SynchronizeProperties(); TAttribute<FText> TextBinding = OPTIONAL_BINDING(FText, Text); TAttribute<FText> HintTextBinding = OPTIONAL_BINDING(FText, HintText); MyEditableTextBlock->SetStyle(&WidgetStyle); MyEditableTextBlock->SetText(TextBinding); MyEditableTextBlock->SetHintText(HintTextBinding); MyEditableTextBlock->SetIsReadOnly(IsReadOnly); MyEditableTextBlock->SetIsPassword(IsPassword); MyEditableTextBlock->SetMinimumDesiredWidth(MinimumDesiredWidth); MyEditableTextBlock->SetIsCaretMovedWhenGainFocus(IsCaretMovedWhenGainFocus); MyEditableTextBlock->SetSelectAllTextWhenFocused(SelectAllTextWhenFocused); MyEditableTextBlock->SetRevertTextOnEscape(RevertTextOnEscape); MyEditableTextBlock->SetClearKeyboardFocusOnCommit(ClearKeyboardFocusOnCommit); MyEditableTextBlock->SetSelectAllTextOnCommit(SelectAllTextOnCommit); MyEditableTextBlock->SetAllowContextMenu(AllowContextMenu); ShapedTextOptions.SynchronizeShapedTextProperties(*MyEditableTextBlock); }
void UProgressBar::SynchronizeProperties() { Super::SynchronizeProperties(); TAttribute< TOptional<float> > PercentBinding = OPTIONAL_BINDING_CONVERT(float, Percent, TOptional<float>, ConvertFloatToOptionalFloat); TAttribute<FSlateColor> FillColorAndOpacityBinding = OPTIONAL_BINDING(FSlateColor, FillColorAndOpacity); MyProgressBar->SetStyle(&WidgetStyle); MyProgressBar->SetBarFillType(BarFillType); MyProgressBar->SetPercent(bIsMarquee ? TOptional<float>() : PercentBinding); MyProgressBar->SetFillColorAndOpacity(FillColorAndOpacityBinding); }
void UMultiLineEditableText::SynchronizeProperties() { Super::SynchronizeProperties(); TAttribute<FText> HintTextBinding = OPTIONAL_BINDING(FText, HintText); MyMultiLineEditableText->SetText(Text); MyMultiLineEditableText->SetHintText(HintTextBinding); MyMultiLineEditableText->SetAllowContextMenu(AllowContextMenu); // MyMultiLineEditableText->SetIsReadOnly(IsReadOnly); // MyMultiLineEditableText->SetIsPassword(IsPassword); // MyMultiLineEditableText->SetColorAndOpacity(ColorAndOpacity); // TODO UMG Complete making all properties settable on SMultiLineEditableText Super::SynchronizeTextLayoutProperties(*MyMultiLineEditableText); }
void UBorder::SynchronizeProperties() { Super::SynchronizeProperties(); TAttribute<FLinearColor> ContentColorAndOpacityBinding = OPTIONAL_BINDING(FLinearColor, ContentColorAndOpacity); TAttribute<FSlateColor> BrushColorBinding = OPTIONAL_BINDING_CONVERT(FLinearColor, BrushColor, FSlateColor, ConvertLinearColorToSlateColor); TAttribute<const FSlateBrush*> ImageBinding = OPTIONAL_BINDING_CONVERT(FSlateBrush, Background, const FSlateBrush*, ConvertImage); MyBorder->SetBorderBackgroundColor(BrushColorBinding); MyBorder->SetColorAndOpacity(ContentColorAndOpacityBinding); MyBorder->SetBorderImage(ImageBinding); MyBorder->SetShowEffectWhenDisabled(bShowEffectWhenDisabled); MyBorder->SetOnMouseButtonDown(BIND_UOBJECT_DELEGATE(FPointerEventHandler, HandleMouseButtonDown)); MyBorder->SetOnMouseButtonUp(BIND_UOBJECT_DELEGATE(FPointerEventHandler, HandleMouseButtonUp)); MyBorder->SetOnMouseMove(BIND_UOBJECT_DELEGATE(FPointerEventHandler, HandleMouseMove)); MyBorder->SetOnMouseDoubleClick(BIND_UOBJECT_DELEGATE(FPointerEventHandler, HandleMouseDoubleClick)); }