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  StationListWidgets {
  SLW_CLOSEBOX = 0, SLW_LIST = 3, SLW_TRAIN = 6, SLW_TRUCK,
  SLW_BUS, SLW_AIRPLANE, SLW_SHIP, SLW_FACILALL,
  SLW_PAN_BETWEEN = 12, SLW_NOCARGOWAITING = 13, SLW_CARGOALL = 14, SLW_PAN_RIGHT = 15,
  SLW_SORTBY = 16, SLW_SORTDROPBTN = 17, SLW_PAN_SORT_RIGHT = 18, SLW_CARGOSTART = 19
}
 Enum for CompanyStations, referring to _company_stations_widgets. More...
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 for CompanyStations, referring to _company_stations_widgets.

Enumerator:
SLW_CLOSEBOX  Close 'X' button.
SLW_LIST  The main panel, list of stations.
SLW_TRAIN  'TRAIN' button - list only facilities where is a railroad station
SLW_FACILALL  'ALL' button - list all facilities
SLW_PAN_BETWEEN  Small panel between list of types of ficilities and list of cargo types.
SLW_NOCARGOWAITING  'NO' button - list stations where no cargo is waiting
SLW_CARGOALL  'ALL' button - list all stations
SLW_PAN_RIGHT  Panel right of list of cargo types.
SLW_SORTBY  'Sort by' button - reverse sort direction
SLW_SORTDROPBTN  Dropdown button.
SLW_PAN_SORT_RIGHT  Panel right of sorting options.
SLW_CARGOSTART  Widget numbers used for list of cargo types (not present in _company_stations_widgets).

Definition at line 11 of file station_gui.h.

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 36 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 757 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 1238 of file station_gui.cpp.

References BringWindowToFrontById(), DoCommandP(), and StationJoinerNeeded().


Generated on Fri Jan 9 19:02:00 2009 for openttd by  doxygen 1.5.6