GUI for accessing waypoints and buoys. More...
Public Member Functions | |
WaypointWindow (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. | |
Waypoint * | wp |
Waypoint displayed by the window. |
GUI for accessing waypoints and buoys.
Definition at line 31 of file waypoint_gui.cpp.
WaypointWindow::WaypointWindow | ( | WindowDesc * | desc, | |
WindowNumber | window_number | |||
) | [inline] |
Construct the window.
desc | The description of the window. | |
window_number | The window number, in this case the waypoint's ID. |
Definition at line 55 of file waypoint_gui.cpp.
References Window::CreateNestedTree(), Window::FinishInitNested(), Window::flags, 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.
TileIndex WaypointWindow::GetCenterTile | ( | ) | const [inline, private] |
Get the center tile of the waypoint.
Definition at line 40 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.
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 93 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, BaseStation::owner, QSF_ENABLE_DEFAULT, QSF_LEN_IN_CHARS, ScrollMainWindowToTile(), SetDParam(), ShowExtraViewPortWindow(), ShowQueryString(), WID_W_CENTER_VIEW, WID_W_RENAME, WID_W_SHOW_VEHICLES, and wp.
virtual void WaypointWindow::OnInvalidateData | ( | int | data = 0 , |
|
bool | gui_scope = true | |||
) | [inline, virtual] |
Some data on this window has become invalid.
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 120 of file waypoint_gui.cpp.
References _local_company, GetCenterTile(), BaseStation::IsInUse(), BaseStation::owner, ScrollWindowToTile(), Window::SetWidgetDisabledState(), WID_W_RENAME, WID_W_SHOW_VEHICLES, and wp.
Referenced by WaypointWindow().
virtual void WaypointWindow::OnQueryTextFinished | ( | char * | str | ) | [inline, virtual] |
The query window opened from this window has closed.
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 142 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 131 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.
widget | Widget number. |
Reimplemented from Window.
Definition at line 88 of file waypoint_gui.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, SetDParam(), WID_W_CAPTION, and wp.