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/industry_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/industry_gui.cpp')
-rw-r--r-- | src/industry_gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 7dd1c5a6f..29066ee4b 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -934,7 +934,7 @@ public: this->BuildSortIndustriesList(); this->InitNested(desc, 0); - this->vscroll.SetCapacity(this->nested_array[IDW_INDUSTRY_LIST]->current_y / this->resize.step_height); + this->vscroll.SetCapacity(this->GetWidget<NWidgetBase>(IDW_INDUSTRY_LIST)->current_y / this->resize.step_height); } ~IndustryDirectoryWindow() @@ -980,7 +980,7 @@ public: { switch (widget) { case IDW_DROPDOWN_ORDER: { - Dimension d = GetStringBoundingBox(this->nested_array[widget]->widget_data); + Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data); d.width += padding.width + WD_SORTBUTTON_ARROW_WIDTH * 2; // Doubled since the word is centered, also looks nice. d.height += padding.height; *size = maxdim(*size, d); @@ -1026,7 +1026,7 @@ public: break; case IDW_INDUSTRY_LIST: { - int y = (pt.y - this->nested_array[widget]->pos_y - WD_FRAMERECT_TOP) / this->resize.step_height; + int y = (pt.y - this->GetWidget<NWidgetBase>(widget)->pos_y - WD_FRAMERECT_TOP) / this->resize.step_height; uint16 p; if (!IsInsideMM(y, 0, this->vscroll.GetCapacity())) return; |