diff --git a/Source/Engine/UI/GUI/Common/TextBoxBase.cs b/Source/Engine/UI/GUI/Common/TextBoxBase.cs index ae7990633..f2492ac55 100644 --- a/Source/Engine/UI/GUI/Common/TextBoxBase.cs +++ b/Source/Engine/UI/GUI/Common/TextBoxBase.cs @@ -284,10 +284,11 @@ namespace FlaxEngine.GUI } /// - /// Sets the text. + /// Sets the text (forced, even if user is editing it). /// /// The value. - protected void SetText(string value) + [NoAnimate] + public void SetText(string value) { // Prevent from null problems if (value == null) @@ -319,6 +320,18 @@ namespace FlaxEngine.GUI } } + /// + /// Sets the text as it was entered by user (focus, change value, defocus). + /// + /// The value. + [NoAnimate] + public void SetTextAsUser(string value) + { + Focus(); + SetText(value); + Defocus(); + } + /// /// Gets length of the text /// @@ -1005,7 +1018,8 @@ namespace FlaxEngine.GUI /// public override void OnMouseMove(Vector2 location) { - // Check if user is selecting + base.OnMouseMove(location); + if (_isSelecting) { // Find char index at current mouse location @@ -1019,6 +1033,9 @@ namespace FlaxEngine.GUI /// public override bool OnMouseDown(Vector2 location, MouseButton button) { + if (base.OnMouseDown(location, button)) + return true; + if (button == MouseButton.Left && _text.Length > 0) { Focus(); @@ -1055,6 +1072,9 @@ namespace FlaxEngine.GUI /// public override bool OnMouseUp(Vector2 location, MouseButton button) { + if (base.OnMouseUp(location, button)) + return true; + if (button == MouseButton.Left) { OnSelectingEnd(); @@ -1084,6 +1104,8 @@ namespace FlaxEngine.GUI /// public override bool OnCharInput(char c) { + if (base.OnCharInput(c)) + return true; Insert(c); return true; }