x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to use OnTextCommitted from SEditableTextBox?

I'm trying to use an SEditableTextBox slate widget, and although it's easy enough to place one in, I can't find how to process the OnTextCommitted event. I can see that it uses a delegate type much like the SButton takes a delegate function, but how do I deal with the delegate type in my UI class and extract the committed FText?

Product Version: Not Selected
Tags:
more ▼

asked Aug 04 '14 at 04:44 PM in C++ Programming

avatar image

reynoldsa14
11 2 4 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The same way?

 OnTextCommitted.AddDynamic (this, &ASomeClass::SomeFunction);

Where this you place object you want to call the function, and 2nd argument is a pointer to function that you want to be called

more ▼

answered Aug 04 '14 at 05:54 PM

avatar image

Shadowriver
36.6k 931 169 1111

avatar image YannickLange Sep 28 '14 at 08:32 PM

I don't know if this answer is outdated but the code below works for me

 void SomeWidgetClass::Construct(const FArguments& args)
 {
     TSharedRef<SVerticalBox> VertBox = SNew(SVerticalBox);
     
     ChildSlot
     [
         VertBox
     ];
     
     VertBox->AddSlot()
         .AutoHeight()
         [
             + SHorizontalBox::Slot()
             .VAlign(VAlign_Center)
             [
                 SNew(SEditableTextBox)
                 .OnTextCommitted(FOnTextCommitted::CreateSP(this, &SomeWidgetClass::SetUserName))
             ]
         ];
 }
 
 void SomeWidgetClass::SetUserName(const FText& NewText, ETextCommit::Type TextType)
 {
     //This will be called once the user presses enter when using a SEditableTextBox
 }


avatar image reynoldsa14 Sep 28 '14 at 09:44 PM

I moved to using UMG rather than pure slate, but thanks for replying, anyway.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question