# ExtraViewportWindow Class Reference

Inheritance diagram for ExtraViewportWindow:

## Public Member Functions
| ExtraViewportWindow (const WindowDesc *desc, int window_number, TileIndex tile)
virtual void | SetStringParameters (int widget) const
| Initialize string parameters for a widget.
virtual void | OnPaint ()
| The window must be repainted.
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 | OnResize ()
| Called after the window got resized.
virtual void | OnScroll (Point delta)
| Handle the request for (viewport) scrolling.
virtual void | OnMouseWheel (int wheel)
| The mouse wheel has been turned.
virtual void | OnInvalidateData (int data=0)
| Some data on this window has become invalid.

## Detailed Description

Definition at line 61 of file viewport_gui.cpp.

## Member Function Documentation

virtual void ExtraViewportWindow::OnClick | ( | Point | pt,
|  | int | widget,
|  | int | click_count |
| ) |  |  | `[inline, virtual]`

A click with the left mouse button has been made on the window.

Parameters:

  | pt | the point inside the window that has been clicked.
  | widget | the clicked widget.
  | click_count | Number of fast consecutive clicks at same position

Reimplemented from Window.

Definition at line 104 of file viewport_gui.cpp.

References ViewportData::dest_scrollpos_x, ViewportData::dest_scrollpos_y, FindWindowById(), ViewportData::follow_vehicle, INVALID_VEHICLE, ViewportData::scrollpos_x, ViewportData::scrollpos_y, Window::viewport, ViewPort::virtual_height, and ViewPort::virtual_width.

virtual void ExtraViewportWindow::OnInvalidateData | ( | int | data = `0` | ) | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | data | information about the changed data.

Reimplemented from Window.

Definition at line 156 of file viewport_gui.cpp.

References HandleZoomMessage(), and Window::viewport.

virtual void ExtraViewportWindow::OnMouseWheel | ( | int | wheel | ) | `[inline, virtual]`

The mouse wheel has been turned.

Parameters:

  | wheel | the amount of movement of the mouse wheel.

Reimplemented from Window.

Definition at line 151 of file viewport_gui.cpp.

virtual void ExtraViewportWindow::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 99 of file viewport_gui.cpp.

References Window::DrawWidgets().

virtual void ExtraViewportWindow::OnResize | ( |  | ) | `[inline, virtual]`

Called after the window got resized.

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

Reimplemented from Window.

Definition at line 132 of file viewport_gui.cpp.

References NWidgetViewport::UpdateViewportCoordinates(), and Window::viewport.

virtual void ExtraViewportWindow::OnScroll | ( | Point | delta | ) | `[inline, virtual]`

Handle the request for (viewport) scrolling.

Parameters:

  | delta | the amount the viewport must be scrolled.

Reimplemented from Window.

Definition at line 140 of file viewport_gui.cpp.

References ViewportData::dest_scrollpos_x, ViewportData::dest_scrollpos_y, IsPtInWindowViewport(), ScaleByZoom(), ViewportData::scrollpos_x, ViewportData::scrollpos_y, and Window::viewport.

virtual void ExtraViewportWindow::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 89 of file viewport_gui.cpp.

References SetDParam().

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

- src/viewport_gui.cpp