mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-03 04:43:12 +00:00
(svn r16468) -Codechange: Use GetWidgetOfType() for finding an edit box.
This commit is contained in:
parent
101a6b3320
commit
e03376c239
@ -147,20 +147,16 @@ 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 */
|
/* Find the edit box of the parent window and give focus to that */
|
||||||
for (uint i = 0; i < this->parent->widget_count; i++) {
|
const Widget *wi = this->parent->GetWidgetOfType(WWT_EDITBOX);
|
||||||
Widget &wi = this->parent->widget[i];
|
if (wi != NULL) this->parent->focused_widget = wi;
|
||||||
if (wi.type == WWT_EDITBOX) {
|
|
||||||
this->parent->focused_widget = &wi;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Give focus to parent window */
|
/* 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