Extra viewport window. More...
#include "stdafx.h"
#include "landscape.h"
#include "window_gui.h"
#include "viewport_func.h"
#include "gfx_func.h"
#include "strings_func.h"
#include "zoom_func.h"
#include "window_func.h"
#include "tilehighlight_func.h"
#include "table/strings.h"
#include "table/sprites.h"
Go to the source code of this file.
Data Structures | |
class | ExtraViewportWindow |
Enumerations | |
enum | ExtraViewportWindowWidgets { EVW_CAPTION, EVW_VIEWPORT, EVW_ZOOMIN, EVW_ZOOMOUT, EVW_MAIN_TO_VIEW, EVW_VIEW_TO_MAIN } |
Widget numbers of the extra viewport window. More... | |
Functions | |
void | ShowExtraViewPortWindow (TileIndex tile) |
Show a new Extra Viewport window. | |
void | ShowExtraViewPortWindowForTileUnderCursor () |
Show a new Extra Viewport window. | |
Variables | |
static const NWidgetPart | _nested_extra_view_port_widgets [] |
static const WindowDesc | _extra_view_port_desc (WDP_AUTO, 300, 268, WC_EXTRA_VIEW_PORT, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_extra_view_port_widgets, lengthof(_nested_extra_view_port_widgets)) |
Extra viewport window.
Definition in file viewport_gui.cpp.
Widget numbers of the extra viewport window.
Definition at line 26 of file viewport_gui.cpp.
void ShowExtraViewPortWindow | ( | TileIndex | tile | ) |
Show a new Extra Viewport window.
tile | Tile to center the view on. INVALID_TILE means to use the center of main viewport. |
Definition at line 172 of file viewport_gui.cpp.
References FindWindowById().
Referenced by WaypointWindow::OnClick(), TownDirectoryWindow::OnClick(), TownViewWindow::OnClick(), StationViewWindow::OnClick(), CompanyStationsWindow::OnClick(), NewsWindow::OnClick(), IndustryDirectoryWindow::OnClick(), IndustryViewWindow::OnClick(), DepotWindow::OnClick(), CompanyWindow::OnClick(), and ShowExtraViewPortWindowForTileUnderCursor().
void ShowExtraViewPortWindowForTileUnderCursor | ( | ) |
Show a new Extra Viewport window.
Center it on the tile under the cursor, if the cursor is inside a viewport. If that fails, center it on main viewport center.
Definition at line 187 of file viewport_gui.cpp.
References INVALID_TILE, and ShowExtraViewPortWindow().
Referenced by ScenarioEditorToolbarWindow::OnKeyPress(), and MainToolbarWindow::OnKeyPress().
const NWidgetPart _nested_extra_view_port_widgets[] [static] |
{ NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY, EVW_CAPTION), SetDataTip(STR_EXTRA_VIEW_PORT_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), NWidget(NWID_VIEWPORT, INVALID_COLOUR, EVW_VIEWPORT), SetPadding(2, 2, 2, 2), SetResize(1, 1), SetFill(1, 1), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, EVW_ZOOMIN), SetDataTip(SPR_IMG_ZOOMIN, STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_IN), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, EVW_ZOOMOUT), SetDataTip(SPR_IMG_ZOOMOUT, STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_OUT), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, EVW_MAIN_TO_VIEW), SetFill(1, 1), SetResize(1, 0), SetDataTip(STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW, STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, EVW_VIEW_TO_MAIN), SetFill(1, 1), SetResize(1, 0), SetDataTip(STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN, STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT), EndContainer(), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), SetResize(1, 0), EndContainer(), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }
Definition at line 36 of file viewport_gui.cpp.