OpenTTD

Data Structures | Functions | Variables
waypoint_gui.cpp File Reference

Handling of waypoints gui. More...

`#include "stdafx.h"`
`#include "window_gui.h"`
`#include "gui.h"`
`#include "textbuf_gui.h"`
`#include "vehiclelist.h"`
`#include "vehicle_gui.h"`
`#include "viewport_func.h"`
`#include "strings_func.h"`
`#include "command_func.h"`
`#include "company_func.h"`
`#include "company_base.h"`
`#include "window_func.h"`
`#include "waypoint_base.h"`
`#include "widgets/waypoint_widget.h"`
`#include "table/strings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | WaypointWindow
| GUI for accessing waypoints and buoys. More...

## Functions
void | ShowWaypointWindow (const Waypoint *wp)
| Show the window for the given waypoint. More...

## Variables
static const NWidgetPart | _nested_waypoint_view_widgets []
| The widgets of the waypoint view. More...
static WindowDesc | _waypoint_view_desc (WDP_AUTO, "view_waypoint", 260, 118, WC_WAYPOINT_VIEW, WC_NONE, 0, _nested_waypoint_view_widgets, lengthof(_nested_waypoint_view_widgets))
| The description of the waypoint view. More...

## Detailed Description

Handling of waypoints gui.

Definition in file waypoint_gui.cpp.

## Function Documentation

## ◆ ShowWaypointWindow()

void ShowWaypointWindow | ( | const Waypoint * | wp | ) |

Show the window for the given waypoint.

Parameters

  wp | The waypoint to show the window for.

Definition at line 181 of file waypoint_gui.cpp.

References _waypoint_view_desc, and Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index.

## Variable Documentation

## ◆ _nested_waypoint_view_widgets

const NWidgetPart _nested_waypoint_view_widgets[]
| static

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_W_CAPTION), SetDataTip(STR_WAYPOINT_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(WWT_INSET, COLOUR_GREY), SetPadding(2, 2, 2, 2),
NWidget(NWID_VIEWPORT, COLOUR_GREY, WID_W_VIEWPORT), SetMinimalSize(256, 88), SetPadding(1, 1, 1, 1), SetResize(1, 1),
EndContainer(),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_W_CENTER_VIEW), SetMinimalSize(100, 12), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_BUTTON_LOCATION, STR_BUOY_VIEW_CENTER_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_W_RENAME), SetMinimalSize(100, 12), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_BUTTON_RENAME, STR_BUOY_VIEW_CHANGE_BUOY_NAME),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_W_SHOW_VEHICLES), SetMinimalSize(15, 12), SetDataTip(STR_SHIP, STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP),
NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(),
}
NWID_VIEWPORT
Nested widget containing a viewport.
Definition: widget_type.h:81
SetResize
static NWidgetPart SetResize(int16 dx, int16 dy)
Widget part function for setting the resize step.
Definition: widget_type.h:930
NWID_HORIZONTAL
Horizontal container.
Definition: widget_type.h:75
WID_W_CAPTION
Caption of window.
Definition: waypoint_widget.h:17
WWT_RESIZEBOX
Resize box (normally at bottom-right of a window)
Definition: widget_type.h:68
WWT_INSET
Pressed (inset) panel, most commonly used as combo box text area.
Definition: widget_type.h:51
WID_W_VIEWPORT
The viewport on this waypoint.
Definition: waypoint_widget.h:18
WWT_CLOSEBOX
Close box (at top-left of a window)
Definition: widget_type.h:69
WID_W_CENTER_VIEW
Center the main view on this waypoint.
Definition: waypoint_widget.h:19
WID_W_SHOW_VEHICLES
Show the vehicles visiting this waypoint.
Definition: waypoint_widget.h:21
SetPadding
static NWidgetPart SetPadding(uint8 top, uint8 right, uint8 bottom, uint8 left)
Widget part function for setting additional space around a widget.
Definition: widget_type.h:1046
WWT_DEFSIZEBOX
Default window size box (at top-right of a window, between WWT_SHADEBOX and WWT_STICKYBOX) ...
Definition: widget_type.h:65
SetDataTip
static NWidgetPart SetDataTip(uint32 data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1014
SetMinimalSize
static NWidgetPart SetMinimalSize(int16 x, int16 y)
Widget part function for setting the minimal size.
Definition: widget_type.h:947
WWT_PUSHTXTBTN
Normal push-button (no toggle button) with text caption.
Definition: widget_type.h:104
WWT_PANEL
Simple depressed panel.
Definition: widget_type.h:50
NWidget
static NWidgetPart NWidget(WidgetType tp, Colours col, int16 idx=-1)
Widget part function for starting a new &#39;real&#39; widget.
Definition: widget_type.h:1114
WID_W_RENAME
Rename this waypoint.
Definition: waypoint_widget.h:20
WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition: widget_type.h:61
EndContainer
static NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME, WWT_INSET, or WWT_PANEL).
Definition: widget_type.h:999
WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition: widget_type.h:66
SetFill
static NWidgetPart SetFill(uint fill_x, uint fill_y)
Widget part function for setting filling.
Definition: widget_type.h:983
WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition: widget_type.h:64

The widgets of the waypoint view.

Definition at line 148 of file waypoint_gui.cpp.

## ◆ _waypoint_view_desc

WindowDesc _waypoint_view_desc(WDP_AUTO, "view_waypoint", 260, 118, WC_WAYPOINT_VIEW, WC_NONE, 0, _nested_waypoint_view_widgets, lengthof(_nested_waypoint_view_widgets))
| static

The description of the waypoint view.

Referenced by ShowWaypointWindow().