GUI for time tabling. More...
#include "stdafx.h"
#include "command_func.h"
#include "gui.h"
#include "window_gui.h"
#include "window_func.h"
#include "textbuf_gui.h"
#include "strings_func.h"
#include "vehicle_base.h"
#include "string_func.h"
#include "gfx_func.h"
#include "company_func.h"
#include "date_func.h"
#include "date_gui.h"
#include "vehicle_gui.h"
#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
Go to the source code of this file.
Data Structures | |
struct | TimetableArrivalDeparture |
Container for the arrival/departure dates of a vehicle. More... | |
struct | TimetableWindow |
Enumerations | |
enum | TimetableViewWindowWidgets { TTV_CAPTION, TTV_ORDER_VIEW, TTV_TIMETABLE_PANEL, TTV_ARRIVAL_DEPARTURE_PANEL, TTV_SCROLLBAR, TTV_SUMMARY_PANEL, TTV_START_DATE, TTV_CHANGE_TIME, TTV_CLEAR_TIME, TTV_RESET_LATENESS, TTV_AUTOFILL, TTV_AUTOMATE, TTV_EXPECTED, TTV_SHARED_ORDER_LIST, TTV_ARRIVAL_DEPARTURE_SELECTION, TTV_AUTO_SELECTION, TTV_EXPECTED_SELECTION } |
Functions | |
void | SetTimetableParams (int param1, int param2, Ticks ticks) |
Set the timetable parameters in the format as described by the setting. | |
static void | SetArrivalDepartParams (int param1, int param2, Ticks ticks) |
Sets the arrival or departure string and parameters. | |
static bool | CanChangeTime (const Order *order) |
Check whether the order's time can be changed manually. | |
static bool | CanDetermineTimeTaken (const Order *order, bool travelling) |
Check whether it is possible to determine how long the order takes. | |
static void | FillTimetableArrivalDepartureTable (const Vehicle *v, VehicleOrderID start, bool travelling, TimetableArrivalDeparture *table, Ticks offset) |
Fill the table with arrivals and departures. | |
static void | ChangeTimetableStartCallback (const Window *w, DateTicks date) |
Callback for when a time has been chosen to start the time table. | |
void | ShowTimetableWindow (const Vehicle *v) |
Show the timetable for a given vehicle. | |
Variables | |
static const NWidgetPart | _nested_timetable_widgets [] |
static const WindowDesc | _timetable_desc (WDP_AUTO, 400, 130, WC_VEHICLE_TIMETABLE, WC_VEHICLE_VIEW, WDF_UNCLICK_BUTTONS|WDF_CONSTRUCTION, _nested_timetable_widgets, lengthof(_nested_timetable_widgets)) |
GUI for time tabling.
Definition in file timetable_gui.cpp.
Definition at line 31 of file timetable_gui.cpp.
static bool CanChangeTime | ( | const Order * | order | ) | [static] |
Check whether the order's time can be changed manually.
order | the order to check |
Definition at line 94 of file timetable_gui.cpp.
References Order::GetNonStopType(), and Order::IsType().
Referenced by TimetableWindow::OnPaint(), and TimetableWindow::OnQueryTextFinished().
static bool CanDetermineTimeTaken | ( | const Order * | order, | |
bool | travelling | |||
) | [static] |
Check whether it is possible to determine how long the order takes.
order | the order to check. | |
travelling | whether we are interested in the travel or the wait part. |
Definition at line 105 of file timetable_gui.cpp.
References Order::GetNonStopType(), Order::IsType(), Order::travel_time, and Order::wait_time.
Referenced by FillTimetableArrivalDepartureTable().
Callback for when a time has been chosen to start the time table.
window | the window related to the setting of the date | |
date | the actually chosen date |
Definition at line 183 of file timetable_gui.cpp.
References _date, _date_fract, CMD_MSG, CMD_SET_TIMETABLE_START, DAY_TICKS, DoCommandP(), and Window::window_number.
Referenced by TimetableWindow::OnClick().
static void FillTimetableArrivalDepartureTable | ( | const Vehicle * | v, | |
VehicleOrderID | start, | |||
bool | travelling, | |||
TimetableArrivalDeparture * | table, | |||
Ticks | offset | |||
) | [static] |
Fill the table with arrivals and departures.
v | Vehicle which must have at least 2 orders. | |
start | order index to start at | |
travelling | Are we still in the travelling part of the start order | |
table | Fill in arrival and departures including intermediate orders | |
offset | Add this value to result and all arrivals and departures |
Definition at line 126 of file timetable_gui.cpp.
References TimetableArrivalDeparture::arrival, CanDetermineTimeTaken(), TimetableArrivalDeparture::departure, OrderList::GetFirstOrder(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), INVALID_TICKS, Order::IsType(), Vehicle::list, Order::next, Vehicle::orders, Order::travel_time, and Order::wait_time.
Referenced by TimetableWindow::BuildArrivalDepartureList().
static void SetArrivalDepartParams | ( | int | param1, | |
int | param2, | |||
Ticks | ticks | |||
) | [static] |
Sets the arrival or departure string and parameters.
param1 | the first DParam to fill | |
param2 | the second DParam to fill | |
ticks | the number of ticks to 'draw' |
Definition at line 83 of file timetable_gui.cpp.
References _date, DAY_TICKS, and SetDParam().
Referenced by TimetableWindow::DrawWidget().
void SetTimetableParams | ( | int | param1, | |
int | param2, | |||
Ticks | ticks | |||
) |
Set the timetable parameters in the format as described by the setting.
param1 | the first DParam to fill | |
param2 | the second DParam to fill | |
ticks | the number of ticks to 'draw' |
Definition at line 63 of file timetable_gui.cpp.
References _settings_client, ClientSettings::gui, SetDParam(), GUISettings::time_in_minutes, and GUISettings::timetable_in_ticks.
Referenced by DrawOrderString(), and TimetableWindow::DrawWidget().
void ShowTimetableWindow | ( | const Vehicle * | v | ) |
Show the timetable for a given vehicle.
v | The vehicle to show the timetable for. |
Definition at line 731 of file timetable_gui.cpp.
References DeleteWindowById(), and Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index.
Referenced by VehicleViewWindow::OnClick(), and OrdersWindow::OnClick().