# station_gui.h File Reference

Contains enums and function declarations connected with stations GUI. More...

`#include "command_type.h"`

Go to the source code of this file.

## Enumerations
enum | StationViewWidgets { SVW_CLOSEBOX = 0, SVW_CAPTION = 1, SVW_WAITING = 3, SVW_ACCEPTLIST = 5, SVW_RATINGLIST = 5, SVW_LOCATION = 6, SVW_RATINGS = 7, SVW_ACCEPTS = 7, SVW_RENAME = 8, SVW_TRAINS = 9, SVW_ROADVEHS, SVW_PLANES, SVW_SHIPS, SVW_RESIZE }
| Enum for StationView, referring to _station_view_widgets and _station_view_expanded_widgets. More...
enum | StationCoverageType { SCT_PASSENGERS_ONLY, SCT_NON_PASSENGERS_ONLY, SCT_ALL }
## Functions
int | DrawStationCoverageAreaText (int sx, int sy, StationCoverageType sct, int rad, bool supplies)
| Calculates and draws the accepted or supplied cargo around the selected tile(s).
void | CheckRedrawStationCoverage (const Window *w)
void | ShowSelectStationIfNeeded (CommandContainer cmd, int w, int h)
| Show the station selection window when needed.

## Detailed Description

Contains enums and function declarations connected with stations GUI.

Definition in file station_gui.h.

## Enumeration Type Documentation

enum StationViewWidgets

Enum for StationView, referring to _station_view_widgets and _station_view_expanded_widgets.

Enumerator:

  SVW_CLOSEBOX | Close 'X' button.
  SVW_CAPTION | Caption of the window.
  SVW_WAITING | List of waiting cargo.
  SVW_ACCEPTLIST | List of accepted cargos.
  SVW_RATINGLIST | Ratings of cargos.
  SVW_LOCATION | 'Location' button
  SVW_RATINGS | 'Ratings' button
  SVW_ACCEPTS | 'Accepts' button
  SVW_RENAME | 'Rename' button
  SVW_TRAINS | List of scheduled trains button.
  SVW_ROADVEHS | List of scheduled road vehs button.
  SVW_PLANES | List of scheduled planes button.
  SVW_SHIPS | List of scheduled ships button.
  SVW_RESIZE | Resize button.

Definition at line 11 of file station_gui.h.

## Function Documentation

int DrawStationCoverageAreaText | ( | int | sx,
|  | int | sy,
|  | StationCoverageType | sct,
|  | int | rad,
|  | bool | supplies |
| ) |  |  |

Calculates and draws the accepted or supplied cargo around the selected tile(s).

Parameters:

  | sx | x position where the string is to be drawn
  | sy | y position where the string is to be drawn
  | sct | which type of cargo is to be displayed (passengers/non-passengers)
  | rad | radius around selected tile(s) to be searched
  | supplies | if supplied cargos should be drawn, else accepted cargos

Returns:
  Returns the y value below the string that was drawn

Definition at line 748 of file misc_gui.cpp.

References GetAcceptanceAroundTiles(), GetProductionAroundTiles(), MapSize(), and TILE_SIZE.

void ShowSelectStationIfNeeded | ( | CommandContainer | cmd,
|  | int | w,
|  | int | h |
| ) |  |  |

Show the station selection window when needed.

If not, build the station.

Parameters:

  | cmd | Command to build the station.
  | w | Width of the to-be-built station
  | h | Height of the to-be-built station

Definition at line 1252 of file station_gui.cpp.

References _settings_client, BringWindowToFrontById(), DoCommandP(), ClientSettings::gui, GUISettings::persistent_buildingtools, and StationJoinerNeeded().