# WaypointWindow Struct Reference

GUI for accessing waypoints and buoys. More...

Inheritance diagram for WaypointWindow:

## Public Member Functions
| WaypointWindow (const WindowDesc *desc, WindowNumber window_number)
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 | OnInvalidateData (int data=0, bool gui_scope=true)
| Some data on this window has become invalid.
virtual void | OnResize ()
| Called after the window got resized.
virtual void | OnQueryTextFinished (char *str)
| The query window opened from this window has closed.
## Private Member Functions
TileIndex | GetCenterTile () const
| Get the center tile of the waypoint.
## Private Attributes
VehicleType | vt
| Vehicle type using the waypoint.
Waypoint * | wp
| Waypoint displayed by the window.

## Detailed Description

GUI for accessing waypoints and buoys.

Definition at line 38 of file waypoint_gui.cpp.

## Member Function Documentation

TileIndex WaypointWindow::GetCenterTile | ( |  | ) | const`[inline, private]`

Get the center tile of the waypoint.

Returns:
  The center tile if the waypoint exists, otherwise the tile with the waypoint name.

Definition at line 47 of file waypoint_gui.cpp.

References BaseStation::IsInUse(), VEH_TRAIN, wp, and BaseStation::xy.

Referenced by OnClick(), OnInvalidateData(), and OnResize().

virtual void WaypointWindow::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 95 of file waypoint_gui.cpp.

References _ctrl_pressed, CS_ALPHANUMERAL, GetCenterTile(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, MAX_LENGTH_STATION_NAME_CHARS, MAX_LENGTH_STATION_NAME_PIXELS, QSF_ENABLE_DEFAULT, QSF_LEN_IN_CHARS, ScrollMainWindowToTile(), SetDParam(), ShowExtraViewPortWindow(), ShowQueryString(), vt, and wp.

virtual void WaypointWindow::OnInvalidateData | ( | int | data = `0`,
|  | bool | gui_scope = `true` |
| ) |  |  | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | data | Information about the changed data.
  | gui_scope | Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See InvalidateWindowData() for details.

Reimplemented from Window.

Definition at line 122 of file waypoint_gui.cpp.

References _local_company, GetCenterTile(), BaseStation::IsInUse(), BaseStation::owner, OWNER_NONE, ScrollWindowToTile(), Window::SetWidgetDisabledState(), and wp.

virtual void WaypointWindow::OnQueryTextFinished | ( | char * | str | ) | `[inline, virtual]`

The query window opened from this window has closed.

Parameters:

  | str | the new value of the string, NULL if the window was cancelled or an empty string when the default button was pressed, i.e. StrEmpty(str).

Reimplemented from Window.

Definition at line 144 of file waypoint_gui.cpp.

References CMD_MSG, CMD_RENAME_WAYPOINT, and DoCommandP().

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

Called after the window got resized.

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

Reimplemented from Window.

Definition at line 133 of file waypoint_gui.cpp.

References GetCenterTile(), ScrollWindowToTile(), NWidgetViewport::UpdateViewportCoordinates(), Waypoint::UpdateVirtCoord(), Window::viewport, and wp.

virtual void WaypointWindow::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 90 of file waypoint_gui.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, SetDParam(), and wp.

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

- src/waypoint_gui.cpp