From 116c77c342d0f628235a7f5dbacfbb5bc3fb0829 Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 19 Sep 2009 11:31:12 +0000 Subject: (svn r17572) -Codechange: Use the Window::GetWidget() function to access nested widgets through the nested_array. --- src/industry_gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/industry_gui.cpp') 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(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(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(widget)->pos_y - WD_FRAMERECT_TOP) / this->resize.step_height; uint16 p; if (!IsInsideMM(y, 0, this->vscroll.GetCapacity())) return; -- cgit v1.2.3-70-g09d2