Index: src/station_gui.cpp =================================================================== --- src/station_gui.cpp 2007-12-02 15:29:48.000000000 +0100 +++ src/station_gui.cpp 2007-12-03 19:35:58.000000000 +0100 @@ -632,6 +632,21 @@ } } + +enum StationWidgets { + STATION_WIDGET_CLOSEBOX = 0, + STATION_WIDGET_CARGOPANEL = 3, + STATION_WIDGET_ACCEPTSPANEL = 5, + STATION_WIDGET_RATINGSPANEL = 6, + STATION_WIDGET_CENTERMAP = 7, + STATION_WIDGET_SWITCH, + STATION_WIDGET_RENAME, + STATION_WIDGET_TRAIN = 10, + STATION_WIDGET_ROAD, + STATION_WIDGET_AIRPLANE, + STATION_WIDGET_SHIP, +}; + static const Widget _station_view_expanded_widgets[] = { { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 236, 0, 13, STR_300A_0, STR_018C_WINDOW_TITLE_DRAG_THIS}, @@ -710,11 +725,11 @@ } SetVScrollCount(w, num); - w->SetWidgetDisabledState( 9, st->owner != _local_player); - w->SetWidgetDisabledState(10, !(st->facilities & FACIL_TRAIN)); - w->SetWidgetDisabledState(11, !(st->facilities & FACIL_TRUCK_STOP) && !(st->facilities & FACIL_BUS_STOP)); - w->SetWidgetDisabledState(12, !(st->facilities & FACIL_AIRPORT)); - w->SetWidgetDisabledState(13, !(st->facilities & FACIL_DOCK)); + w->SetWidgetDisabledState(STATION_WIDGET_RENAME, st->owner != _local_player); + w->SetWidgetDisabledState(STATION_WIDGET_TRAIN, !(st->facilities & FACIL_TRAIN)); + w->SetWidgetDisabledState(STATION_WIDGET_ROAD, !(st->facilities & FACIL_TRUCK_STOP) && !(st->facilities & FACIL_BUS_STOP)); + w->SetWidgetDisabledState(STATION_WIDGET_AIRPLANE, !(st->facilities & FACIL_AIRPORT)); + w->SetWidgetDisabledState(STATION_WIDGET_SHIP, !(st->facilities & FACIL_DOCK)); SetDParam(0, st->index); SetDParam(1, st->facilities); @@ -819,11 +834,11 @@ case WE_CLICK: switch (e->we.click.widget) { - case 7: + case STATION_WIDGET_CENTERMAP: ScrollMainWindowToTile(GetStation(w->window_number)->xy); break; - case 8: + case STATION_WIDGET_SWITCH: SetWindowDirty(w); /* toggle height/widget set */ @@ -838,24 +853,24 @@ SetWindowDirty(w); break; - case 9: + case STATION_WIDGET_RENAME: SetDParam(0, w->window_number); ShowQueryString(STR_STATION, STR_3030_RENAME_STATION_LOADING, 31, 180, w, CS_ALPHANUMERAL); break; - case 10: { /* Show a list of scheduled trains to this station */ + case STATION_WIDGET_TRAIN: { /* Show a list of scheduled trains to this station */ const Station *st = GetStation(w->window_number); ShowVehicleListWindow(st->owner, VEH_TRAIN, (StationID)w->window_number); break; } - case 11: { /* Show a list of scheduled road-vehicles to this station */ + case STATION_WIDGET_ROAD: { /* Show a list of scheduled road-vehicles to this station */ const Station *st = GetStation(w->window_number); ShowVehicleListWindow(st->owner, VEH_ROAD, (StationID)w->window_number); break; } - case 12: { /* Show a list of scheduled aircraft to this station */ + case STATION_WIDGET_AIRPLANE: { /* Show a list of scheduled aircraft to this station */ const Station *st = GetStation(w->window_number); /* Since oilrigs have no owners, show the scheduled aircraft of current player */ PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner; @@ -863,7 +878,7 @@ break; } - case 13: { /* Show a list of scheduled ships to this station */ + case STATION_WIDGET_SHIP: { /* Show a list of scheduled ships to this station */ const Station *st = GetStation(w->window_number); /* Since oilrigs/bouys have no owners, show the scheduled ships of current player */ PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner;