Data Structures | Typedefs | Enumerations | Functions

# station_gui.h File Reference

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

`#include "command_type.h"`
`#include "station_type.h"`
`#include "tilearea_type.h"`
`#include "window_type.h"`
`#include "cargo_type.h"`
`#include <set>`

Go to the source code of this file.

## Data Structures
class | CargoSorter
class | CargoDataEntry
| A cargo data entry representing one possible row in the station view window's top part. More...
## Typedefs
typedef std::set < CargoDataEntry *, CargoSorter > | CargoDataSet
## Enumerations
enum | StationViewWidgets { SVW_CAPTION = 0, SVW_SORT_ORDER = 1, SVW_SORT_BY = 2, SVW_GROUP = 3, SVW_GROUP_BY = 4, SVW_WAITING = 5, SVW_SCROLLBAR = 6, SVW_ACCEPTLIST = 7, SVW_RATINGLIST = 7, SVW_LOCATION = 8, SVW_RATINGS = 9, SVW_ACCEPTS = 9, SVW_RENAME = 10, SVW_TRAINS = 11, SVW_ROADVEHS, SVW_SHIPS, SVW_PLANES, SVW_DEPARTURES }
| 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 }
| Types of cargo to display for station coverage. More...
enum | SortOrder { SO_DESCENDING, SO_ASCENDING }
enum | CargoSortType { ST_AS_GROUPING, ST_COUNT, ST_STATION_STRING, ST_STATION_ID, ST_CARGO_ID }
## Functions
int | DrawStationCoverageAreaText (int left, int right, int top, StationCoverageType sct, int rad, bool supplies)
| Calculates and draws the accepted or supplied cargo around the selected tile(s).
void | CheckRedrawStationCoverage (const Window *w)
| Check whether we need to redraw the station coverage text.
void | ShowSelectStationIfNeeded (CommandContainer cmd, TileArea ta)
| Show the station selection window when needed.
void | ShowSelectWaypointIfNeeded (CommandContainer cmd, TileArea ta)
| Show the waypoint 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 CargoSortType

Enumerator:

  ST_AS_GROUPING | by the same principle the entries are being grouped
  ST_COUNT | by amount of cargo
  ST_STATION_STRING | by station name
  ST_STATION_ID | by station id
  ST_CARGO_ID | by cargo id

Definition at line 64 of file station_gui.h.

enum StationCoverageType

Types of cargo to display for station coverage.

Enumerator:

  SCT_PASSENGERS_ONLY | Draw only passenger class cargos.
  SCT_NON_PASSENGERS_ONLY | Draw all non-passenger class cargos.
  SCT_ALL | Draw all cargos.

Definition at line 45 of file station_gui.h.

enum StationViewWidgets

Enum for StationView, referring to _station_view_widgets and _station_view_expanded_widgets.

Enumerator:

  SVW_CAPTION | Caption of the window.
  SVW_SORT_ORDER | 'Sort order' button
  SVW_SORT_BY | 'Sort by' button
  SVW_GROUP | label for "group by"
  SVW_GROUP_BY | 'Group by' button
  SVW_WAITING | List of waiting cargo.
  SVW_SCROLLBAR | Scrollbar.
  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_SHIPS | List of scheduled ships button.
  SVW_PLANES | List of scheduled planes button.
  SVW_DEPARTURES | 'Departures' button

Definition at line 23 of file station_gui.h.

## Function Documentation

void CheckRedrawStationCoverage | ( | const Window * | w | ) |

Check whether we need to redraw the station coverage text.

If it is needed actually make the window for redrawing.

Parameters:

  | w | the window to check.

Definition at line 122 of file station_gui.cpp.

References TileHighlightData::dirty, and Window::SetDirty().

Referenced by BuildRoadStationWindow::OnTick(), BuildRailStationWindow::OnTick(), BuildDocksStationWindow::OnTick(), and BuildAirportWindow::OnTick().

int DrawStationCoverageAreaText | ( | int | left,
|  | int | right,
|  | int | top,
|  | StationCoverageType | sct,
|  | int | rad,
|  | bool | supplies |
| ) |  |  |

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

Parameters:

  | left | x position where the string is to be drawn
  | right | the right most position to draw on
  | top | 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 88 of file station_gui.cpp.

References CC_PASSENGERS, DrawCargoListText(), GetAcceptanceAroundTiles(), GetProductionAroundTiles(), IsCargoInClass(), MapSize(), TileHighlightData::pos, SCT_ALL, SCT_NON_PASSENGERS_ONLY, SCT_PASSENGERS_ONLY, SetBit(), TileHighlightData::size, TILE_SIZE, and TileVirtXY().

Referenced by BuildRoadStationWindow::OnPaint(), BuildRailStationWindow::OnPaint(), BuildDocksStationWindow::OnPaint(), and BuildAirportWindow::OnPaint().

void ShowSelectStationIfNeeded | ( | CommandContainer | cmd,
|  | TileArea | ta |
| ) |  |  |

Show the station selection window when needed.

If not, build the station.

Parameters:

  | cmd | Command to build the station.
  | ta | Area to build the station in

Definition at line 2115 of file station_gui.cpp.

Referenced by BuildDocksToolbarWindow::OnPlaceObject(), PlaceAirport(), PlaceRail_Station(), and PlaceRoadStop().

void ShowSelectWaypointIfNeeded | ( | CommandContainer | cmd,
|  | TileArea | ta |
| ) |  |  |

Show the waypoint selection window when needed.

If not, build the waypoint.

Parameters:

  | cmd | Command to build the waypoint.
  | ta | Area to build the waypoint in

Definition at line 2125 of file station_gui.cpp.

Referenced by BuildRailToolbarWindow::OnPlaceMouseUp().