diff options
author | alberth <alberth@openttd.org> | 2009-09-19 11:31:12 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-09-19 11:31:12 +0000 |
commit | 116c77c342d0f628235a7f5dbacfbb5bc3fb0829 (patch) | |
tree | d2dd74828426b0c82b4dab368e6aff5ff71f3bad /src/misc_gui.cpp | |
parent | 9d7fe9bd8688f2d4123dc98e2b222a5be70b306f (diff) | |
download | openttd-116c77c342d0f628235a7f5dbacfbb5bc3fb0829.tar.xz |
(svn r17572) -Codechange: Use the Window::GetWidget() function to access nested widgets through the nested_array.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 544c35d84..8af441fd0 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -416,7 +416,7 @@ struct AboutWindow : public Window { this->InitNested(&_about_desc); this->counter = 5; - this->text_position = this->nested_array[AW_FRAME]->pos_y + this->nested_array[AW_FRAME]->current_y; + this->text_position = this->GetWidget<NWidgetBase>(AW_FRAME)->pos_y + this->GetWidget<NWidgetBase>(AW_FRAME)->current_y; } virtual void SetStringParameters(int widget) const @@ -468,8 +468,8 @@ struct AboutWindow : public Window { this->counter = 5; this->text_position--; /* If the last text has scrolled start a new from the start */ - if (this->text_position < (int)(this->nested_array[AW_FRAME]->pos_y - lengthof(_credits) * this->line_height)) { - this->text_position = this->nested_array[AW_FRAME]->pos_y + this->nested_array[AW_FRAME]->current_y; + if (this->text_position < (int)(this->GetWidget<NWidgetBase>(AW_FRAME)->pos_y - lengthof(_credits) * this->line_height)) { + this->text_position = this->GetWidget<NWidgetBase>(AW_FRAME)->pos_y + this->GetWidget<NWidgetBase>(AW_FRAME)->current_y; } this->SetDirty(); } @@ -1188,7 +1188,7 @@ void QueryString::DrawEditBox(Window *w, int wid) int top; int bottom; if (w->widget == NULL) { - const NWidgetCore *wi = w->nested_array[wid]; + const NWidgetBase *wi = w->GetWidget<NWidgetBase>(wid); assert((wi->type & WWT_MASK) == WWT_EDITBOX); |