Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

DeparturesWindow< Twaypoint > Struct Template Reference

Inheritance diagram for DeparturesWindow< Twaypoint >:
Window ZeroedMemoryAllocator

Public Member Functions

 DeparturesWindow (const WindowDesc *desc, WindowNumber window_number)
virtual void UpdateWidgetSize (int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
 Update size and resize step of a widget in the window.
virtual void SetStringParameters (int widget) const
 Initialize string parameters for a widget.
virtual void OnClick (Point pt, int widget, int click_count)
 A click with the left mouse button has been made on the window.
virtual void OnTick ()
 Called once per (game) tick.
virtual void OnPaint ()
 The window must be repainted.
virtual void DrawWidget (const Rect &r, int widget) const
 Draw the contents of a nested widget.
virtual void OnResize ()
 Called after the window got resized.

Protected Member Functions

virtual uint GetMinWidth () const
virtual void DrawDeparturesListItems (const Rect &r) const
 Draws a list of departures.
void DeleteDeparturesList (DepartureList *list)
 Deletes this window's departure list.

Static Protected Member Functions

static void RecomputeDateWidth ()

Protected Attributes

StationID station
 The station whose departures we're showing.
DepartureListdepartures
 The current list of departures from this station.
DepartureListarrivals
 The current list of arrivals from this station.
uint entry_height
 The height of an entry in the departures list.
uint tick_count
 The number of ticks that have elapsed since the window was created. Used for scrolling text.
int calc_tick_countdown
 The number of ticks to wait until recomputing the departure list. Signed in case it goes below zero.
bool show_types [4]
 The vehicle types to show in the departure list.
bool departure_types [3]
 The types of departure to show in the departure list.
uint min_width
 The minimum width of this window.
Scrollbarvscroll

Detailed Description

template<bool Twaypoint = false>
struct DeparturesWindow< Twaypoint >

Definition at line 81 of file departures_gui.cpp.


Member Function Documentation

template<bool Twaypoint = false>
virtual void DeparturesWindow< Twaypoint >::DrawWidget ( const Rect r,
int  widget 
) const [inline, virtual]

Draw the contents of a nested widget.

Parameters:
r Rectangle occupied by the widget.
widget Number of the widget to draw.
Note:
This method may not change any state, it may only use drawing functions.

Reimplemented from Window.

Definition at line 318 of file departures_gui.cpp.

References DeparturesWindow< Twaypoint >::DrawDeparturesListItems(), and DW_WIDGET_LIST.

template<bool Twaypoint = false>
virtual void DeparturesWindow< Twaypoint >::OnPaint (  )  [inline, virtual]

The window must be repainted.

Note:
This method should not change any state, it should only use drawing functions.

Reimplemented from Window.

Definition at line 304 of file departures_gui.cpp.

References _settings_client, DeparturesWindow< Twaypoint >::arrivals, GUISettings::departure_show_both, Window::DisableWidget(), Window::DrawWidgets(), DW_SHOW_ARRS, DW_SHOW_DEPS, Window::EnableWidget(), ClientSettings::gui, SmallVector< T, S >::Length(), GUISettings::max_departures, min(), and Scrollbar::SetCount().

template<bool Twaypoint = false>
virtual void DeparturesWindow< Twaypoint >::OnResize (  )  [inline, virtual]

Called after the window got resized.

For nested windows with a viewport, call NWidgetViewport::UpdateViewportCoordinates.

Reimplemented from Window.

Definition at line 327 of file departures_gui.cpp.

References DW_WIDGET_LIST, Scrollbar::GetCapacity(), MAT_COL_START, and Scrollbar::SetCapacityFromWidget().

template<bool Twaypoint = false>
virtual void DeparturesWindow< Twaypoint >::SetStringParameters ( int  widget  )  const [inline, virtual]

Initialize string parameters for a widget.

Calls to this function are made during initialization to measure the size (that is as part of InitNested()), during drawing, and while re-initializing the window. Only for widgets that render text initializing is requested.

Parameters:
widget Widget number.

Reimplemented from Window.

Definition at line 159 of file departures_gui.cpp.

References DW_WIDGET_CAPTION, SpecializedStation< Station, false >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, SetDParam(), and DeparturesWindow< Twaypoint >::station.

template<bool Twaypoint = false>
virtual void DeparturesWindow< Twaypoint >::UpdateWidgetSize ( int  widget,
Dimension size,
const Dimension padding,
Dimension fill,
Dimension resize 
) [inline, virtual]

Update size and resize step of a widget in the window.

After retrieval of the minimal size and the resize-steps of a widget, this function is called to allow further refinement, typically by computing the real maximal size of the content. Afterwards, size is taken to be the minimal size of the widget and resize is taken to contain the resize steps. For the convenience of the callee, padding contains the amount of padding between the content and the edge of the widget. This should be added to the returned size.

Parameters:
widget Widget number.
size Size of the widget.
padding Recommended amount of space between the widget content and the widget edge.
fill Fill step of the widget.
resize Resize step of the widget.

Reimplemented from Window.

Definition at line 149 of file departures_gui.cpp.

References DW_WIDGET_LIST, and DeparturesWindow< Twaypoint >::entry_height.


The documentation for this struct was generated from the following file: