WaypointWindow Struct Reference

GUI for accessing waypoints and buoys. More...

Inheritance diagram for WaypointWindow:
Window ZeroedMemoryAllocator

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)
 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.
Waypointwp
 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 91 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  )  [inline, virtual]

Some data on this window has become invalid.

Parameters:
data information about the changed data.

Reimplemented from Window.

Definition at line 113 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 134 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 123 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 86 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:

Generated on Thu Jan 20 22:59:10 2011 for OpenTTD by  doxygen 1.6.1