OpenTTD Source 20241224-master-gf74b0cf984
date_gui.h File Reference

Functions related to the graphical selection of a date. More...

Go to the source code of this file.

Typedefs

typedef void SetDateCallback(const Window *w, TimerGameEconomy::Date date, void *data)
 Callback for when a date has been chosen.
 

Functions

void ShowSetDateWindow (Window *parent, int window_number, TimerGameEconomy::Date initial_date, TimerGameEconomy::Year min_year, TimerGameEconomy::Year max_year, SetDateCallback *callback, void *callback_data)
 Create the new 'set date' window.
 

Detailed Description

Functions related to the graphical selection of a date.

Definition in file date_gui.h.

Typedef Documentation

◆ SetDateCallback

typedef void SetDateCallback(const Window *w, TimerGameEconomy::Date date, void *data)

Callback for when a date has been chosen.

Parameters
wthe window that sends the callback
datethe date that has been chosen

Definition at line 21 of file date_gui.h.

Function Documentation

◆ ShowSetDateWindow()

void ShowSetDateWindow ( Window parent,
int  window_number,
TimerGameEconomy::Date  initial_date,
TimerGameEconomy::Year  min_year,
TimerGameEconomy::Year  max_year,
SetDateCallback callback,
void *  callback_data 
)

Create the new 'set date' window.

Parameters
window_numbernumber for the window
parentthe parent window, i.e. if this closes we should close too
initial_datethe initial date to show
min_yearthe minimum year to show in the year dropdown
max_yearthe maximum year (inclusive) to show in the year dropdown
callbackthe callback to call once a date has been selected
callback_dataextra callback data

Definition at line 216 of file date_gui.cpp.

References _set_date_desc, CloseWindowByClass(), and WC_SET_DATE.

Referenced by TimetableWindow::OnClick().