So I’ve just hit a minor roadblock which is mostly just a decorative problem, But there doesn’t appear to be any way to clear a textbox upon clicking on it. I tried wrapping it with a button but unfortunately it didn’t work due to it also having clickable surface.
Does anyone know the secrets of editable textboxes or will I just have to find another way?
For more information, I’m using it to create save files. I could have the box empty and place text somewhere else to inform the player but surely there is a way…
Set text would be fine but there’s no event to tie it to.
Editable textboxes only support events on edit/commitment of change.
Also just in case anybody reads this searching for extra info on these textboxes, The commit event triggers twice unless you handle it properly, It’ll trigger once on focus lost and once on pressing enter. So pressing enter will do both as it drops focus when pressed.
EDIT: It just occurred to me I never actually checked what the edit event actually does… Perhaps by edit it means just focusing it. Else what would be the point of having two events that do the same…
Update: Not surprisingly still not useful for my problem.
In my level BP a created the menu widget on begin play, added it to the viewport, set the game input mode Game and UI, and set show mouse cursor to true.
Oh, I didn’t even consider overrides.
That’s exactly what I was trying to do.
Thanks vivalabugz.
EDIT: I couldn’t actually get it to work how I wanted. I’d have needed to copy half of my code for the main widget into it to get it to work how I wanted. I did managed to find a solution that was n behavior settings. Select all text on focus.
Yeah I set it to select all. I didn’t make it delete the text, but as the player types in anything it’ll delete it anyway because its all selected.
Would’ve preferred to get your solution to work but honestly I kinda hit a wall with it. My scroll box wasn’t sorting it in any way at all despite using the exact same nodes I used for creating multiple buttons for loading save data.
So I tried getting the editable textbox focus thing to work in my main widget but it turns out that focus node is widget wide and there is no individual like that. I thought maybe going from buttons to widgetswitcher+box/editable would trigger it but it doesn’t.
Through trying to sort all that out I found another bug in my loading lists of gamesaves though so more knowledge gained at least.
The reason I made the textbox its own widget was because I assumed the focus was for the widget it was being called on. I havent tested it with more than one. Maybe you could try using a grid panel and adding textboxes to your grid as a way to sort them out, if Im understanding you right.
Yeah, I’m not entirely sure why the scrollbox didn’t want to line it up the textbox as it did with my save widgets, maybe there’s some kind of issue with adding different widget types into a scroll box through your widget in the first place. Honestly it’d probably take me days of playing around with it to work out why it was being weird.
Grid probably would fix the issue but there shouldn’t have been one in the first place.
Anyway, Thanks for the ideas. Perhaps I can get it working at a later date.