From 3e94c23fa528a71f320ca3103d50e6ce40ed7f1b Mon Sep 17 00:00:00 2001 From: Nils Reid Date: Sat, 23 Jan 2021 23:34:44 +0100 Subject: Exposed find_next_valid_focus and find_prev_valid_focus. --- doc/classes/Control.xml | 14 ++++++++++++++ scene/gui/control.cpp | 2 ++ 2 files changed, 16 insertions(+) diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 533748aced..d94e495a5e 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -306,6 +306,20 @@ [/codeblocks] + + + + + Finds the next (below in the tree) [Control] that can receive the focus. + + + + + + + Finds the previous (above in the tree) [Control] that can receive the focus. + + diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index ad21c351d0..4aa9c31522 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2785,6 +2785,8 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("has_focus"), &Control::has_focus); ClassDB::bind_method(D_METHOD("grab_focus"), &Control::grab_focus); ClassDB::bind_method(D_METHOD("release_focus"), &Control::release_focus); + ClassDB::bind_method(D_METHOD("find_prev_valid_focus"), &Control::find_prev_valid_focus); + ClassDB::bind_method(D_METHOD("find_next_valid_focus"), &Control::find_next_valid_focus); ClassDB::bind_method(D_METHOD("get_focus_owner"), &Control::get_focus_owner); ClassDB::bind_method(D_METHOD("set_h_size_flags", "flags"), &Control::set_h_size_flags); -- cgit v1.2.3