guiConfirmRegistration: Set focus to text field (#8761)

master
ANAND 2019-08-07 22:45:46 +05:30 committed by SmallJoker
parent fa6bc699bc
commit 003af74213
1 changed files with 3 additions and 2 deletions

View File

@ -62,6 +62,7 @@ void GUIConfirmRegistration::removeChildren()
for (gui::IGUIElement *i : children_copy) for (gui::IGUIElement *i : children_copy)
i->remove(); i->remove();
} }
void GUIConfirmRegistration::regenerateGui(v2u32 screensize) void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
{ {
acceptInput(); acceptInput();
@ -119,6 +120,7 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
gui::IGUIEditBox *e = Environment->addEditBox(m_pass_confirm.c_str(), gui::IGUIEditBox *e = Environment->addEditBox(m_pass_confirm.c_str(),
rect2, true, this, ID_confirmPassword); rect2, true, this, ID_confirmPassword);
e->setPasswordBox(true); e->setPasswordBox(true);
Environment->setFocus(e);
} }
ypos += 60 * s; ypos += 60 * s;
@ -218,8 +220,7 @@ bool GUIConfirmRegistration::OnEvent(const SEvent &event)
if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST && isVisible()) { if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST && isVisible()) {
if (!canTakeFocus(event.GUIEvent.Element)) { if (!canTakeFocus(event.GUIEvent.Element)) {
dstream << "GUIConfirmRegistration: Not allowing focus " dstream << "GUIConfirmRegistration: Not allowing focus change."
"change."
<< std::endl; << std::endl;
// Returning true disables focus change // Returning true disables focus change
return true; return true;