mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r17759) -Codechange [FS#3257]: Return focus to the parent window using the function designed for it.
This commit is contained in:
parent
59195a6f20
commit
f9733ac590
@ -162,22 +162,11 @@ struct OskWindow : public Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
case OSK_WIDGET_TEXT: {
|
case OSK_WIDGET_TEXT:
|
||||||
/* Find the edit box of the parent window and give focus to that */
|
/* Return focus to the parent widget and window. */
|
||||||
if (this->parent->widget != NULL) {
|
this->parent->SetFocusedWidget(this->text_btn);
|
||||||
const Widget *wi = this->parent->GetWidgetOfType(WWT_EDITBOX);
|
|
||||||
if (wi != NULL) this->parent->focused_widget = wi;
|
|
||||||
}
|
|
||||||
if (this->parent->nested_root != NULL) {
|
|
||||||
const NWidgetCore *nwid = dynamic_cast<const NWidgetCore *>(this->parent->nested_root->GetWidgetOfType(WWT_EDITBOX));
|
|
||||||
if (nwid != NULL) this->parent->nested_focus = nwid;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Give focus to parent window */
|
|
||||||
SetFocusedWindow(this->parent);
|
SetFocusedWindow(this->parent);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case OSK_WIDGET_BACKSPACE:
|
case OSK_WIDGET_BACKSPACE:
|
||||||
if (DeleteTextBufferChar(&this->qs->text, WKC_BACKSPACE)) this->InvalidateParent();
|
if (DeleteTextBufferChar(&this->qs->text, WKC_BACKSPACE)) this->InvalidateParent();
|
||||||
|
Loading…
Reference in New Issue
Block a user