# 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 | 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 60 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 98 of file viewport_gui.cpp.

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

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 151 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 144 of file viewport_gui.cpp.

References _settings_client, ClientSettings::gui, and GUISettings::scrollwheel_scrolling.

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 128 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 136 of file viewport_gui.cpp.

References ViewportData::dest_scrollpos_x, ViewportData::dest_scrollpos_y, 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 88 of file viewport_gui.cpp.

References SetDParam().

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

- src/viewport_gui.cpp