Announcement

Collapse
No announcement yet.

SEditableText has no border

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SEditableText has no border

    In Slate code for Editor Plugin, I have two SAssignNew, but SEditableText after second SAssignNew does not have border and the background has a Gray color

    Click image for larger version

Name:	UE4Editor_2018-05-07_17-20-29_001.png
Views:	253
Size:	134.9 KB
ID:	1472337


    why does SEditableText have no border and does not have a white background color?



    In .h file

    Code:
    TSharedPtr< SEditableText > TextWidgetForCopy;

    Code:
    SAssignNew(ToolkitWidget, SBorder)
            .HAlign(HAlign_Left)  //  .HAlign(HAlign_Fill) // HAlign_Left  // .MaxWidth(90.0f) // .Padding(0, 60, 40, 10)  // .AutoHeight()    
            .Padding(25)
            .IsEnabled_Static(&Locals::IsWidgetEnabled)
            [
                SNew(SVerticalBox)
                + SVerticalBox::Slot()
                .AutoHeight()           // .ColorAndOpacity(FLinearColor::White)
                .HAlign(HAlign_Center)
                .Padding(5)
                [
                    SNew(STextBlock)
                    .AutoWrapText(true)
                    .Text(LOCTEXT("HelperLabel", "Select Static Mesh and Actor with InstancedStaticMesh"))
                ]
                + SVerticalBox::Slot()
                    .HAlign(HAlign_Left)
                    .AutoHeight()
                    [
                        Locals::MakeButton(LOCTEXT("FirstButton", "Convert Static Mesh in Instance"), FVector(0, 0, Factor))
                    ]
                + SVerticalBox::Slot()
                    .HAlign(HAlign_Left)
                    .AutoHeight()
                    .Padding(20)
                    [
                        SNew(SHorizontalBox)
                        + SHorizontalBox::Slot()
                        .AutoWidth()
                        [
                            SNew(SButton)
                            .Text(LOCTEXT("LeftButtonLabel", "Clone Static mesh"))
                            .OnClicked(this, &FeditorModeEdModeToolkit::OnButtonClick2)
                        ]
                        + SHorizontalBox::Slot()
                            .AutoWidth()
                            .Padding(20, 0, 20, 0)
                            [
                                SNew(STextBlock)
                                .Text(FText::FromString("number of copies"))
                            ]
                        + SHorizontalBox::Slot()
                            .AutoWidth()
                            .HAlign(HAlign_Left)
                            [
                                SAssignNew(TextWidgetForCopy, SEditableText)
                                .Text(LOCTEXT("numCopy", "10"))
                                .OnTextChanged(this, &FeditorModeEdModeToolkit::OnChatTextChanged)
                                .ColorAndOpacity(FLinearColor(1.f, 1.f, 1.f, 0.9f))
    
                            ]
                        + SHorizontalBox::Slot()
    ....

    does this code reset the styles? How can I set style for SEditableText ?


    Code:
    SAssignNew(TextWidgetForCopy, SEditableText)
    Plugin for HISM and ISMC https://www.unrealengine.com/marketp...nstance-editor

    #2
    Try to set a background with alpha 1.f:
    Code:
    SNew(SEditableTextBox)
                        .IsReadOnly(false)
                        .Text(FText::FromString(Column))
                        .BackgroundColor(FSlateColor(FLinearColor(0.5f,0.5f,0.5f)))
                        .Font(FEditorStyle::GetFontStyle(TEXT("BoldFont")))
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      #3
      Originally posted by BrUnO XaVIeR View Post
      Try to set a background with alpha 1.f:
      Code:
      SNew(SEditableTextBox)
      .IsReadOnly(false)
      .Text(FText::FromString(Column))
      .BackgroundColor(FSlateColor(FLinearColor(0.5f,0.5f,0.5f)))
      .Font(FEditorStyle::GetFontStyle(TEXT("BoldFont")))
      You propose to use SNew instead of SAssignNew. But I need access to the function GetText () from the class SEditableText. I need the GetText () function for SEditableText. And I do not know how to get access to this function without SAssignNew. If I use .BackgroundColor (FSlateColor (FLinearColor (0.5f, 0.5f, 0.5f))) so
      Code:
      SAssignNew (TextWidgetForCopy, SEditableText)
      .Text (LOCTEXT ("numCopy", "10"))
      .OnTextChanged (this, & FeditorModeEdModeToolkit :: OnChatTextChanged)
      .ColorAndOpacity (FLinearColor (1.f, 1.f, 1.f, 0.9f))
      .BackgroundColor (FSlateColor (FLinearColor (0.5f, 0.5f, 0.5f))))
      The compiler reports a C2039 error: .BackgroundColor is not a member of SEditableText::FArguments
      Last edited by Babush61; 05-07-2018, 11:45 AM.
      Plugin for HISM and ISMC https://www.unrealengine.com/marketp...nstance-editor

      Comment


        #4
        You are using "SEditableText" class...
        That has no SBorder widget.

        use TextBox instead.
        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment


          #5
          You should use "SEditableTextBox" instread of "SEditableText", here is the difference between these two widgets. Wish help to you.

          Comment

          Working...
          X