TSharedRef<SWidget> UJavascriptTileView::RebuildWidget() { MyTileView = SNew(STileView< UObject* >) .SelectionMode(SelectionMode) .ListItemsSource(&Items) .ItemHeight(ItemHeight) .OnGenerateTile(BIND_UOBJECT_DELEGATE(STileView< UObject* >::FOnGenerateRow, HandleOnGenerateTile)) .OnSelectionChanged_Lambda([this](UObject* Object, ESelectInfo::Type SelectInfo){ OnSelectionChanged(Object, SelectInfo); }) .OnMouseButtonDoubleClick_Lambda([this](UObject* Object){ OnDoubleClick(Object); }) //.OnContextMenuOpening(this, &SSocketManager::OnContextMenuOpening) //.OnItemScrolledIntoView(this, &SSocketManager::OnItemScrolledIntoView) // .HeaderRow // ( // SNew(SHeaderRow) // .Visibility(EVisibility::Collapsed) // + SHeaderRow::Column(TEXT("Socket")) // ); ; return BuildDesignTimeWidget(MyTileView.ToSharedRef()); }
TSharedRef<SWidget> UPropertyEditor::RebuildWidget() { if (IsDesignTime()) { return BuildDesignTimeWidget(SNew(SBox) .HAlign(HAlign_Center) .VAlign(VAlign_Center) [ SNew(STextBlock) .Text(LOCTEXT("PropertyEditor", "PropertyEditor")) ]); } else { FPropertyEditorModule& EditModule = FModuleManager::Get().GetModuleChecked<FPropertyEditorModule>("PropertyEditor"); FDetailsViewArgs DetailsViewArgs(/*bUpdateFromSelection=*/ false, /*bLockable=*/ false, /*bAllowSearch=*/ false, /*InNameAreaSettings=*/ FDetailsViewArgs::HideNameArea, /*bHideSelectionTip=*/ true); View = EditModule.CreateDetailView(DetailsViewArgs); if (ObjectToInspect.IsValid()) { View->SetObject(ObjectToInspect.Get()); } View->OnFinishedChangingProperties().AddUObject(this, &UPropertyEditor::OnFinishedChangingProperties); return View.ToSharedRef(); } }
TSharedRef<SWidget> UBorder::RebuildWidget() { MyBorder = SNew(SBorder); if ( GetChildrenCount() > 0 ) { Cast<UBorderSlot>(GetContentSlot())->BuildSlot(MyBorder.ToSharedRef()); } return BuildDesignTimeWidget( MyBorder.ToSharedRef() ); }
TSharedRef<SWidget> USizeBox::RebuildWidget() { MySizeBox = SNew(SBox); if ( GetChildrenCount() > 0 ) { Cast<USizeBoxSlot>(GetContentSlot())->BuildSlot(MySizeBox.ToSharedRef()); } return BuildDesignTimeWidget( MySizeBox.ToSharedRef() ); }
TSharedRef<SWidget> UMenuAnchor::RebuildWidget() { MyMenuAnchor = SNew(SMenuAnchor) .Method(SMenuAnchor::UseCurrentWindow) .Placement(Placement) .OnGetMenuContent(BIND_UOBJECT_DELEGATE(FOnGetContent, HandleGetMenuContent)); if ( GetChildrenCount() > 0 ) { MyMenuAnchor->SetContent(GetContentSlot()->Content ? GetContentSlot()->Content->TakeWidget() : SNullWidget::NullWidget); } return BuildDesignTimeWidget( MyMenuAnchor.ToSharedRef() ); }
TSharedRef<SWidget> UCanvasPanel::RebuildWidget() { MyCanvas = SNew(SConstraintCanvas); for ( UPanelSlot* Slot : Slots ) { if ( UCanvasPanelSlot* TypedSlot = Cast<UCanvasPanelSlot>(Slot) ) { TypedSlot->Parent = this; TypedSlot->BuildSlot(MyCanvas.ToSharedRef()); } } return BuildDesignTimeWidget( MyCanvas.ToSharedRef() ); }
TSharedRef<SWidget> UWidgetSwitcher::RebuildWidget() { MyWidgetSwitcher = SNew(SWidgetSwitcher); for ( UPanelSlot* Slot : Slots ) { if ( UWidgetSwitcherSlot* TypedSlot = Cast<UWidgetSwitcherSlot>(Slot) ) { TypedSlot->Parent = this; TypedSlot->BuildSlot(MyWidgetSwitcher.ToSharedRef()); } } return BuildDesignTimeWidget( MyWidgetSwitcher.ToSharedRef() ); }
TSharedRef<SWidget> UVerticalBox::RebuildWidget() { MyVerticalBox = SNew(SVerticalBox); for ( UPanelSlot* Slot : Slots ) { if ( UVerticalBoxSlot* TypedSlot = Cast<UVerticalBoxSlot>(Slot) ) { TypedSlot->Parent = this; TypedSlot->BuildSlot(MyVerticalBox.ToSharedRef()); } } return BuildDesignTimeWidget( MyVerticalBox.ToSharedRef() ); }
TSharedRef<SWidget> UHorizontalBox::RebuildWidget() { MyHorizontalBox = SNew(SHorizontalBox); for ( UPanelSlot* PanelSlot : Slots ) { if ( UHorizontalBoxSlot* TypedSlot = Cast<UHorizontalBoxSlot>(PanelSlot) ) { TypedSlot->Parent = this; TypedSlot->BuildSlot(MyHorizontalBox.ToSharedRef()); } } return BuildDesignTimeWidget( MyHorizontalBox.ToSharedRef() ); }
TSharedRef<SWidget> UOverlay::RebuildWidget() { MyOverlay = SNew(SOverlay); for ( UPanelSlot* PanelSlot : Slots ) { if ( UOverlaySlot* TypedSlot = Cast<UOverlaySlot>(PanelSlot) ) { TypedSlot->Parent = this; TypedSlot->BuildSlot(MyOverlay.ToSharedRef()); } } return BuildDesignTimeWidget( MyOverlay.ToSharedRef() ); }
TSharedRef<SWidget> USpinBox::RebuildWidget() { MySpinBox = SNew(SSpinBox<float>) .Style(&WidgetStyle) .Font(Font) .ClearKeyboardFocusOnCommit(ClearKeyboardFocusOnCommit) .SelectAllTextOnCommit(SelectAllTextOnCommit) .OnValueChanged(BIND_UOBJECT_DELEGATE(FOnFloatValueChanged, HandleOnValueChanged)) .OnValueCommitted(BIND_UOBJECT_DELEGATE(FOnFloatValueCommitted, HandleOnValueCommitted)) .OnBeginSliderMovement(BIND_UOBJECT_DELEGATE(FSimpleDelegate, HandleOnBeginSliderMovement)) .OnEndSliderMovement(BIND_UOBJECT_DELEGATE(FOnFloatValueChanged, HandleOnEndSliderMovement)) ; return BuildDesignTimeWidget( MySpinBox.ToSharedRef() ); }
TSharedRef<SWidget> UWrapBox::RebuildWidget() { MyWrapBox = SNew(SWrapBox) .UseAllottedWidth(true); for ( UPanelSlot* Slot : Slots ) { if ( UWrapBoxSlot* TypedSlot = Cast<UWrapBoxSlot>(Slot) ) { TypedSlot->Parent = this; TypedSlot->BuildSlot(MyWrapBox.ToSharedRef()); } } return BuildDesignTimeWidget( MyWrapBox.ToSharedRef() ); }
TSharedRef<SWidget> UEditableText::RebuildWidget() { MyEditableText = SNew(SEditableText) .Style(&WidgetStyle) .Font(Font) .MinDesiredWidth(MinimumDesiredWidth) .IsCaretMovedWhenGainFocus(IsCaretMovedWhenGainFocus) .SelectAllTextWhenFocused(SelectAllTextWhenFocused) .RevertTextOnEscape(RevertTextOnEscape) .ClearKeyboardFocusOnCommit(ClearKeyboardFocusOnCommit) .SelectAllTextOnCommit(SelectAllTextOnCommit) .OnTextChanged(BIND_UOBJECT_DELEGATE(FOnTextChanged, HandleOnTextChanged)) .OnTextCommitted(BIND_UOBJECT_DELEGATE(FOnTextCommitted, HandleOnTextCommitted)) ; return BuildDesignTimeWidget( MyEditableText.ToSharedRef() ); }
TSharedRef<SWidget> UScrollBox::RebuildWidget() { MyScrollBox = SNew(SScrollBox) .Style(&WidgetStyle) .ScrollBarStyle(&WidgetBarStyle) .Orientation(Orientation) .ConsumeMouseWheel(ConsumeMouseWheel); for ( UPanelSlot* Slot : Slots ) { if ( UScrollBoxSlot* TypedSlot = Cast<UScrollBoxSlot>(Slot) ) { TypedSlot->Parent = this; TypedSlot->BuildSlot(MyScrollBox.ToSharedRef()); } } return BuildDesignTimeWidget( MyScrollBox.ToSharedRef() ); }
TSharedRef<SWidget> UAutoFolding::RebuildWidget() { //if (!b_DoOnce) //{ // TSharedPtr<SButton> btn = SNew(SButton); // b_DoOnce = !b_DoOnce; // return btn->AsShared(); //} MyAutoFolding = SNew(SAutoFolding); for (UPanelSlot* Slot : Slots) { if (UAutoFoldingSlot* TypedSlot = Cast<UAutoFoldingSlot>(Slot)) { TypedSlot->Parent = this; TypedSlot->BuildSlot(MyAutoFolding.ToSharedRef()); } } return BuildDesignTimeWidget(MyAutoFolding.ToSharedRef()); }
TSharedRef<SWidget> URetainerBox::RebuildWidget() { MyRetainerWidget = SNew(SRetainerWidget) .Phase(Phase) .PhaseCount(PhaseCount) #if STATS .StatId( FName( *FString::Printf(TEXT("%s [%s]"), *GetFName().ToString(), *GetClass()->GetName() ) ) ) #endif//STATS ; MyRetainerWidget->SetRetainedRendering(IsDesignTime() ? false : true); if ( GetChildrenCount() > 0 ) { MyRetainerWidget->SetContent(GetContentSlot()->Content ? GetContentSlot()->Content->TakeWidget() : SNullWidget::NullWidget); } return BuildDesignTimeWidget(MyRetainerWidget.ToSharedRef()); }
TSharedRef<SWidget> UMultiLineEditableText::RebuildWidget() { MyMultiLineEditableText = SNew(SMultiLineEditableText) .TextStyle(&WidgetStyle) .AllowContextMenu(AllowContextMenu) // .MinDesiredWidth(MinimumDesiredWidth) // .IsCaretMovedWhenGainFocus(IsCaretMovedWhenGainFocus) // .SelectAllTextWhenFocused(SelectAllTextWhenFocused) // .RevertTextOnEscape(RevertTextOnEscape) // .ClearKeyboardFocusOnCommit(ClearKeyboardFocusOnCommit) // .SelectAllTextOnCommit(SelectAllTextOnCommit) // .BackgroundImageSelected(BackgroundImageSelected ? TAttribute<const FSlateBrush*>(&BackgroundImageSelected->Brush) : TAttribute<const FSlateBrush*>()) // .BackgroundImageSelectionTarget(BackgroundImageSelectionTarget ? TAttribute<const FSlateBrush*>(&BackgroundImageSelectionTarget->Brush) : TAttribute<const FSlateBrush*>()) // .BackgroundImageComposing(BackgroundImageComposing ? TAttribute<const FSlateBrush*>(&BackgroundImageComposing->Brush) : TAttribute<const FSlateBrush*>()) // .CaretImage(CaretImage ? TAttribute<const FSlateBrush*>(&CaretImage->Brush) : TAttribute<const FSlateBrush*>()) .OnTextChanged(BIND_UOBJECT_DELEGATE(FOnTextChanged, HandleOnTextChanged)) .OnTextCommitted(BIND_UOBJECT_DELEGATE(FOnTextCommitted, HandleOnTextCommitted)) ; return BuildDesignTimeWidget( MyMultiLineEditableText.ToSharedRef() ); }
TSharedRef<SWidget> UEditableText::RebuildWidget() { FString FontPath = FPaths::GameContentDir() / Font.FontName.ToString(); if ( !FPaths::FileExists(FontPath) ) { FontPath = FPaths::EngineContentDir() / Font.FontName.ToString(); } MyEditableText = SNew(SEditableText) .Style(&WidgetStyle) .Font(FSlateFontInfo(FontPath, Font.Size)) .MinDesiredWidth(MinimumDesiredWidth) .IsCaretMovedWhenGainFocus(IsCaretMovedWhenGainFocus) .SelectAllTextWhenFocused(SelectAllTextWhenFocused) .RevertTextOnEscape(RevertTextOnEscape) .ClearKeyboardFocusOnCommit(ClearKeyboardFocusOnCommit) .SelectAllTextOnCommit(SelectAllTextOnCommit) .OnTextChanged(BIND_UOBJECT_DELEGATE(FOnTextChanged, HandleOnTextChanged)) .OnTextCommitted(BIND_UOBJECT_DELEGATE(FOnTextCommitted, HandleOnTextCommitted)) ; return BuildDesignTimeWidget( MyEditableText.ToSharedRef() ); }