18#include "table/strings.h"
50static constexpr std::initializer_list<NWidgetPart> _nested_screenshot = {
75void ShowScreenshotWindow()
89 if (scw ==
nullptr)
return;
94 scw->
left += 2 * _screen.width;
97 scw->
left -= 2 * _screen.width;
Functions related to the gfx engine.
void SetDirty() const
Mark entire window as dirty (in need of re-paint).
#define Point
Macro that prevents name conflicts between included headers.
A number of safeguards to prevent using unsafe methods.
void MakeScreenshotWithConfirm(ScreenshotType t)
Make a screenshot.
Functions to make screenshots.
ScreenshotType
Type of requested screenshot.
@ SC_VIEWPORT
Screenshot of viewport.
@ SC_ZOOMEDIN
Fully zoomed in screenshot of the visible area.
@ SC_HEIGHTMAP
Heightmap of the world.
@ SC_WORLD
World screenshot.
@ SC_MINIMAP
Minimap screenshot.
@ SC_DEFAULTZOOM
Zoomed to default zoom level screenshot of the visible area.
void SetScreenshotWindowVisibility(bool hide)
Set the visibility of the screenshot window when taking a screenshot.
static WindowDesc _screenshot_window_desc(WindowPosition::Automatic, "take_a_screenshot", 200, 100, WC_SCREENSHOT, WC_NONE, {}, _nested_screenshot)
Window definition for the screenshot window.
Definition of base types and functions in a cross-platform compatible way.
void OnClick(Point pt, WidgetID widget, int click_count) override
A click with the left mouse button has been made on the window.
void OnPaint() override
The window must be repainted.
High level window description.
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
void DrawWidgets() const
Paint all widgets of a window.
void CreateNestedTree()
Perform the first part of the initialization of a nested widget tree.
int left
x position of left edge of the window
Window(WindowDesc &desc)
Empty constructor, initialization has been moved to InitNested() called from the constructor of the d...
void CloseWindowById(WindowClass cls, WindowNumber number, bool force, int data)
Close a window by its class and window number (if it is open).
Window * FindWindowById(WindowClass cls, WindowNumber number)
Find a window by its class and window number.
Window functions not directly related to making/drawing windows.
Functions, definitions and such used only by the GUI.
@ Automatic
Find a place automatically.
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
@ WC_SCREENSHOT
Screenshot window; Window numbers: