Public Member Functions | Private Member Functions | Private Attributes

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)
 Construct 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 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.
Waypointwp
 Waypoint displayed by the window.

Detailed Description

GUI for accessing waypoints and buoys.

Definition at line 38 of file waypoint_gui.cpp.


Constructor & Destructor Documentation

WaypointWindow::WaypointWindow ( const WindowDesc desc,
WindowNumber  window_number 
) [inline]

Construct the window.

Parameters:
desc The description of the window.
window_number The window number, in this case the waypoint's ID.

Definition at line 62 of file waypoint_gui.cpp.

References Window::CreateNestedTree(), Window::FinishInitNested(), Window::flags4, SpecializedStation< Waypoint, true >::Get(), GetCenterTile(), NWidgetViewport::InitializeViewport(), OnInvalidateData(), Window::owner, BaseStation::owner, OWNER_NONE, SetDataTip(), BaseStation::string_id, VEH_SHIP, VEH_TRAIN, vt, wp, and ZOOM_LVL_VIEWPORT.


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(), OnResize(), and WaypointWindow().

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 100 of file waypoint_gui.cpp.

References _ctrl_pressed, CS_ALPHANUMERAL, GetCenterTile(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, MAX_LENGTH_STATION_NAME_CHARS, 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 127 of file waypoint_gui.cpp.

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

Referenced by WaypointWindow().

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 149 of file waypoint_gui.cpp.

References CMD_MSG, CMD_RENAME_WAYPOINT, DoCommandP(), and Window::window_number.

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 138 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 95 of file waypoint_gui.cpp.

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


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