Data Structures | Functions | Variables

# departures_gui.cpp File Reference

Scheduled departures from a station. More...

`#include "stdafx.h"`
`#include "debug.h"`
`#include "gui.h"`
`#include "textbuf_gui.h"`
`#include "strings_func.h"`
`#include "window_func.h"`
`#include "vehicle_func.h"`
`#include "string_func.h"`
`#include "window_gui.h"`
`#include "timetable.h"`
`#include "vehiclelist.h"`
`#include "company_base.h"`
`#include "date_func.h"`
`#include "departures_gui.h"`
`#include "station_base.h"`
`#include "vehicle_gui_base.h"`
`#include "vehicle_base.h"`
`#include "vehicle_gui.h"`
`#include "order_base.h"`
`#include "settings_type.h"`
`#include "core/smallvec_type.hpp"`
`#include "date_type.h"`
`#include "company_type.h"`
`#include "departures_func.h"`
`#include "cargotype.h"`
`#include "table/sprites.h"`
`#include "table/strings.h"`

Go to the source code of this file.

## Data Structures
struct | DeparturesWindow< Twaypoint >
## Functions
void | ShowStationDepartures (StationID station)
| Shows a window of scheduled departures for a station.
void | ShowWaypointDepartures (StationID waypoint)
| Shows a window of scheduled departures for a station.
## Variables
static const NWidgetPart | _nested_departures_list []
static WindowDesc | _departures_desc (WDP_AUTO, 260, 246, WC_DEPARTURES_BOARD, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_departures_list, lengthof(_nested_departures_list))
static uint | cached_date_width = 0
| The cached maximum width required to display a date.
static uint | cached_status_width = 0
| The cached maximum width required to show the status field.
static uint | cached_date_arrow_width = 0
| The cached width of the red/green arrows that may be displayed alongside times.
static bool | cached_date_display_method
| Whether the above cached values refers to original (d,m,y) dates or the 24h clock.
static bool | cached_arr_dep_display_method
| Whether to show departures and arrivals on a single line.

## Detailed Description

Scheduled departures from a station.

Definition in file departures_gui.cpp.

## Function Documentation

void ShowStationDepartures | ( | StationID | station | ) |

Shows a window of scheduled departures for a station.

Parameters:

  | station | the station to show a departures window for

Definition at line 338 of file departures_gui.cpp.

Referenced by StationViewWindow::OnClick().

void ShowWaypointDepartures | ( | StationID | waypoint | ) |

Shows a window of scheduled departures for a station.

Parameters:

  | station | the station to show a departures window for

Definition at line 347 of file departures_gui.cpp.

Referenced by WaypointWindow::OnClick().

## Variable Documentation

const NWidgetPart _nested_departures_list[]`[static]`

Initial value:

     {
      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_CLOSEBOX, COLOUR_GREY),
        NWidget(WWT_CAPTION, COLOUR_GREY, DW_WIDGET_CAPTION), SetDataTip(STR_DEPARTURES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
        NWidget(WWT_SHADEBOX, COLOUR_GREY),
        NWidget(WWT_STICKYBOX, COLOUR_GREY),
      EndContainer(),

      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_MATRIX, COLOUR_GREY, DW_WIDGET_LIST), SetMinimalSize(0, 0), SetFill(1, 0), SetResize(1, 1),
        NWidget(NWID_VSCROLLBAR, COLOUR_GREY, DW_WIDGET_SCROLLBAR),
      EndContainer(),

      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_PANEL, COLOUR_GREY), SetMinimalSize(0, 12), SetResize(1, 0), SetFill(1, 1), EndContainer(),
        NWidget(WWT_TEXTBTN, COLOUR_GREY, DW_SHOW_ARRS), SetMinimalSize(6, 12), SetFill(0, 1), SetDataTip(STR_DEPARTURES_ARRIVALS, STR_DEPARTURES_ARRIVALS_TOOLTIP),
        NWidget(WWT_TEXTBTN, COLOUR_GREY, DW_SHOW_DEPS), SetMinimalSize(6, 12), SetFill(0, 1), SetDataTip(STR_DEPARTURES_DEPARTURES, STR_DEPARTURES_DEPARTURES_TOOLTIP),
        NWidget(WWT_TEXTBTN, COLOUR_GREY, DW_SHOW_VIA), SetMinimalSize(11, 12), SetFill(0, 1), SetDataTip(STR_DEPARTURES_VIA_BUTTON, STR_DEPARTURES_VIA_TOOLTIP),
        NWidget(WWT_TEXTBTN, COLOUR_GREY, DW_SHOW_TRAINS), SetMinimalSize(14, 12), SetFill(0, 1), SetDataTip(STR_TRAIN, STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP),
        NWidget(WWT_TEXTBTN, COLOUR_GREY, DW_SHOW_ROADVEHS), SetMinimalSize(14, 12), SetFill(0, 1), SetDataTip(STR_LORRY, STR_STATION_VIEW_SCHEDULED_ROAD_VEHICLES_TOOLTIP),
        NWidget(WWT_TEXTBTN, COLOUR_GREY, DW_SHOW_SHIPS), SetMinimalSize(14, 12), SetFill(0, 1), SetDataTip(STR_SHIP, STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP),
        NWidget(WWT_TEXTBTN, COLOUR_GREY, DW_SHOW_PLANES),  SetMinimalSize(14, 12), SetFill(0, 1), SetDataTip(STR_PLANE, STR_STATION_VIEW_SCHEDULED_AIRCRAFT_TOOLTIP),
        NWidget(WWT_RESIZEBOX, COLOUR_GREY),
      EndContainer(),
    }

Definition at line 41 of file departures_gui.cpp.