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/waypoint_gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/waypoint_gui.cpp') diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index cc35f129a..e08066dfe 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -52,14 +52,14 @@ public: this->CreateNestedTree(desc); if (this->vt == VEH_TRAIN) { - this->nested_array[WAYPVW_SHOW_VEHICLES]->SetDataTip(STR_TRAIN, STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP); - this->nested_array[WAYPVW_CENTERVIEW]->tool_tip = STR_WAYPOINT_VIEW_CENTER_TOOLTIP; - this->nested_array[WAYPVW_RENAME]->tool_tip = STR_WAYPOINT_VIEW_CHANGE_WAYPOINT_NAME; + this->GetWidget(WAYPVW_SHOW_VEHICLES)->SetDataTip(STR_TRAIN, STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP); + this->GetWidget(WAYPVW_CENTERVIEW)->tool_tip = STR_WAYPOINT_VIEW_CENTER_TOOLTIP; + this->GetWidget(WAYPVW_RENAME)->tool_tip = STR_WAYPOINT_VIEW_CHANGE_WAYPOINT_NAME; } this->FinishInitNested(desc, window_number); this->flags4 |= WF_DISABLE_VP_SCROLL; - NWidgetViewport *nvp = (NWidgetViewport *)this->nested_array[WAYPVW_VIEWPORT]; + NWidgetViewport *nvp = this->GetWidget(WAYPVW_VIEWPORT); nvp->InitializeViewport(this, this->wp->xy, ZOOM_LVL_MIN); this->OnInvalidateData(0); -- cgit v1.2.3-54-g00ecf