1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-01 19:09:09 +00:00

(svn r16516) -Codechange: Added click and drag handling for nested widgets.

This commit is contained in:
alberth
2009-06-04 14:07:05 +00:00
parent 1a4934ef07
commit b144a5451c
4 changed files with 156 additions and 82 deletions

View File

@@ -149,8 +149,14 @@ struct OskWindow : public Window {
switch (widget) {
case OSK_WIDGET_TEXT: {
/* Find the edit box of the parent window and give focus to that */
const Widget *wi = this->parent->GetWidgetOfType(WWT_EDITBOX);
if (wi != NULL) this->parent->focused_widget = wi;
if (this->parent->widget != NULL) {
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);