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/road_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/road_gui.cpp')
-rw-r--r-- | src/road_gui.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/road_gui.cpp b/src/road_gui.cpp index e7a06b8f3..38d15b00c 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -774,8 +774,8 @@ struct BuildRoadDepotWindow : public PickerWindowBase { this->LowerWidget(_road_depot_orientation + BRDW_DEPOT_NE); if ( _cur_roadtype == ROADTYPE_TRAM) { - this->nested_array[BRDW_CAPTION]->widget_data = STR_BUILD_DEPOT_TRAM_ORIENTATION_CAPTION; - for (int i = BRDW_DEPOT_NE; i <= BRDW_DEPOT_NW; i++) this->nested_array[i]->tool_tip = STR_BUILD_DEPOT_TRAM_ORIENTATION_SELECT_TOOLTIP; + this->GetWidget<NWidgetCore>(BRDW_CAPTION)->widget_data = STR_BUILD_DEPOT_TRAM_ORIENTATION_CAPTION; + for (int i = BRDW_DEPOT_NE; i <= BRDW_DEPOT_NW; i++) this->GetWidget<NWidgetCore>(i)->tool_tip = STR_BUILD_DEPOT_TRAM_ORIENTATION_SELECT_TOOLTIP; } this->FinishInitNested(desc, TRANSPORT_ROAD); @@ -887,8 +887,8 @@ struct BuildRoadStationWindow : public PickerWindowBase { BRSW_STATION_NW, WIDGET_LIST_END); - this->nested_array[BRSW_CAPTION]->widget_data = _road_type_infos[_cur_roadtype].picker_title[rs]; - for (uint i = BRSW_STATION_NE; i < BRSW_LT_OFF; i++) this->nested_array[i]->tool_tip = _road_type_infos[_cur_roadtype].picker_tooltip[rs]; + this->GetWidget<NWidgetCore>(BRSW_CAPTION)->widget_data = _road_type_infos[_cur_roadtype].picker_title[rs]; + for (uint i = BRSW_STATION_NE; i < BRSW_LT_OFF; i++) this->GetWidget<NWidgetCore>(i)->tool_tip = _road_type_infos[_cur_roadtype].picker_tooltip[rs]; this->LowerWidget(_road_station_picker_orientation + BRSW_STATION_NE); this->LowerWidget(_settings_client.gui.station_show_coverage + BRSW_LT_OFF); @@ -916,8 +916,8 @@ struct BuildRoadStationWindow : public PickerWindowBase { /* 'Accepts' and 'Supplies' texts. */ StationCoverageType sct = (this->window_class == WC_BUS_STATION) ? SCT_PASSENGERS_ONLY : SCT_NON_PASSENGERS_ONLY; - int top = this->nested_array[BRSW_LT_ON]->pos_y + this->nested_array[BRSW_LT_ON]->current_y + WD_PAR_VSEP_NORMAL; - NWidgetCore *back_nwi = this->nested_array[BRSW_BACKGROUND]; + int top = this->GetWidget<NWidgetBase>(BRSW_LT_ON)->pos_y + this->GetWidget<NWidgetBase>(BRSW_LT_ON)->current_y + WD_PAR_VSEP_NORMAL; + NWidgetBase *back_nwi = this->GetWidget<NWidgetBase>(BRSW_BACKGROUND); int right = back_nwi->pos_x + back_nwi->current_x; int bottom = back_nwi->pos_y + back_nwi->current_y; top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, sct, rad, false) + WD_PAR_VSEP_NORMAL; |