OpenTTD Source: src/subsidy_gui.cpp Source File

OpenTTD Source 15.0-RC2

subsidy_gui.cpp
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#include "stdafx.h"
11#include "industry.h"
12#include "town.h"
13#include "window_gui.h"
14#include "strings_func.h"
15#include "timer/timer_game_calendar.h"
16#include "viewport_func.h"
17#include "gui.h"
18#include "subsidy_func.h"
19#include "subsidy_base.h"
20#include "core/geometry_func.hpp"
21
22#include "widgets/subsidy_widget.h"
23
24#include "table/strings.h"
25
26#include "safeguards.h"
27
28 struct SubsidyListWindow : Window {
29 Scrollbar *vscroll = nullptr;
30 Dimension cargo_icon_size{};
31
32 SubsidyListWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
33 {
34 this->CreateNestedTree();
35 this->vscroll = this->GetScrollbar(WID_SUL_SCROLLBAR);
36 this->FinishInitNested(window_number);
37 this->OnInvalidateData(0);
38 }
39
40 void OnInit() override
41 {
42 this->cargo_icon_size = GetLargestCargoIconSize();
43 }
44
45 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
46 {
47 if (widget != WID_SUL_PANEL) return;
48
49 int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SUL_PANEL, WidgetDimensions::scaled.framerect.top);
50 int num = 0;
51 for (const Subsidy *s : Subsidy::Iterate()) {
52 if (!s->IsAwarded()) {
53 y--;
54 if (y == 0) {
55 this->HandleClick(s);
56 return;
57 }
58 num++;
59 }
60 }
61
62 if (num == 0) {
63 y--; // "None"
64 if (y < 0) return;
65 }
66
67 y -= 2; // "Services already subsidised:"
68 if (y < 0) return;
69
70 for (const Subsidy *s : Subsidy::Iterate()) {
71 if (s->IsAwarded()) {
72 y--;
73 if (y == 0) {
74 this->HandleClick(s);
75 return;
76 }
77 }
78 }
79 }
80
81 void HandleClick(const Subsidy *s)
82 {
83 /* determine src coordinate for subsidy and try to scroll to it */
84 TileIndex xy;
85 switch (s->src.type) {
86 case SourceType::Industry: xy = Industry::Get(s->src.ToIndustryID())->location.tile; break;
87 case SourceType::Town: xy = Town::Get(s->src.ToTownID())->xy; break;
88 default: NOT_REACHED();
89 }
90
91 if (_ctrl_pressed || !ScrollMainWindowToTile(xy)) {
92 if (_ctrl_pressed) ShowExtraViewportWindow(xy);
93
94 /* otherwise determine dst coordinate for subsidy and scroll to it */
95 switch (s->dst.type) {
96 case SourceType::Industry: xy = Industry::Get(s->dst.ToIndustryID())->location.tile; break;
97 case SourceType::Town: xy = Town::Get(s->dst.ToTownID())->xy; break;
98 default: NOT_REACHED();
99 }
100
101 if (_ctrl_pressed) {
102 ShowExtraViewportWindow(xy);
103 } else {
104 ScrollMainWindowToTile(xy);
105 }
106 }
107 }
108
113 uint CountLines()
114 {
115 /* Count number of (non) awarded subsidies */
116 uint num_awarded = 0;
117 uint num_not_awarded = 0;
118 for (const Subsidy *s : Subsidy::Iterate()) {
119 if (!s->IsAwarded()) {
120 num_not_awarded++;
121 } else {
122 num_awarded++;
123 }
124 }
125
126 /* Count the 'none' lines */
127 if (num_awarded == 0) num_awarded = 1;
128 if (num_not_awarded == 0) num_not_awarded = 1;
129
130 /* Offered, accepted and an empty line before the accepted ones. */
131 return 3 + num_awarded + num_not_awarded;
132 }
133
134 void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
135 {
136 if (widget != WID_SUL_PANEL) return;
137 Dimension d = maxdim(GetStringBoundingBox(STR_SUBSIDIES_OFFERED_TITLE), GetStringBoundingBox(STR_SUBSIDIES_SUBSIDISED_TITLE));
138
139 fill.height = resize.height = GetCharacterHeight(FS_NORMAL);
140
141 d.height *= 5;
142 d.width += WidgetDimensions::scaled.framerect.Horizontal();
143 d.height += WidgetDimensions::scaled.framerect.Vertical();
144 size = maxdim(size, d);
145 }
146
147 void DrawCargoIcon(const Rect &r, int y_offset, CargoType cargo_type) const
148 {
149 bool rtl = _current_text_dir == TD_RTL;
150 SpriteID icon = CargoSpec::Get(cargo_type)->GetCargoIcon();
151 Dimension d = GetSpriteSize(icon);
152 Rect ir = r.WithWidth(this->cargo_icon_size.width, rtl).WithHeight(GetCharacterHeight(FS_NORMAL));
153 DrawSprite(icon, PAL_NONE, CentreBounds(ir.left, ir.right, d.width), CentreBounds(ir.top, ir.bottom, this->cargo_icon_size.height) + y_offset);
154 }
155
156 void DrawWidget(const Rect &r, WidgetID widget) const override
157 {
158 if (widget != WID_SUL_PANEL) return;
159
160 TimerGameEconomy::YearMonthDay ymd = TimerGameEconomy::ConvertDateToYMD(TimerGameEconomy::date);
161
162 Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
163 Rect sr = tr.Indent(this->cargo_icon_size.width + WidgetDimensions::scaled.hsep_normal, _current_text_dir == TD_RTL);
164
165 int pos = -this->vscroll->GetPosition();
166 const int cap = this->vscroll->GetCapacity();
167
168 /* Section for drawing the offered subsidies */
169 if (IsInsideMM(pos, 0, cap)) DrawString(tr.left, tr.right, tr.top + pos * GetCharacterHeight(FS_NORMAL), STR_SUBSIDIES_OFFERED_TITLE);
170 pos++;
171
172 uint num = 0;
173 for (const Subsidy *s : Subsidy::Iterate()) {
174 if (!s->IsAwarded()) {
175 if (IsInsideMM(pos, 0, cap)) {
176 /* Displays the two offered towns */
177 const CargoSpec *cs = CargoSpec::Get(s->cargo_type);
178 std::string text;
179
180 /* If using wallclock units, show minutes remaining. Otherwise show the date when the subsidy ends. */
181 if (TimerGameEconomy::UsingWallclockUnits()) {
182 text = GetString(STR_SUBSIDIES_OFFERED_FROM_TO,
183 cs->name, s->src.GetFormat(), s->src.id, s->dst.GetFormat(), s->dst.id,
184 STR_SUBSIDIES_OFFERED_EXPIRY_TIME,
185 s->remaining + 1); // We get the rest of the current economy month for free, since the expiration is checked on each new month.
186 } else {
187 text = GetString(STR_SUBSIDIES_OFFERED_FROM_TO,
188 cs->name, s->src.GetFormat(), s->src.id, s->dst.GetFormat(), s->dst.id,
189 STR_SUBSIDIES_OFFERED_EXPIRY_DATE,
190 TimerGameEconomy::date.base() - ymd.day + s->remaining * 32);
191 }
192
193 DrawCargoIcon(tr, pos * GetCharacterHeight(FS_NORMAL), s->cargo_type);
194 DrawString(sr.left, sr.right, sr.top + pos * GetCharacterHeight(FS_NORMAL), text);
195 }
196 pos++;
197 num++;
198 }
199 }
200
201 if (num == 0) {
202 if (IsInsideMM(pos, 0, cap)) DrawString(tr.left, tr.right, tr.top + pos * GetCharacterHeight(FS_NORMAL), STR_SUBSIDIES_NONE);
203 pos++;
204 }
205
206 /* Section for drawing the already granted subsidies */
207 pos++;
208 if (IsInsideMM(pos, 0, cap)) DrawString(tr.left, tr.right, tr.top + pos * GetCharacterHeight(FS_NORMAL), STR_SUBSIDIES_SUBSIDISED_TITLE);
209 pos++;
210 num = 0;
211
212 for (const Subsidy *s : Subsidy::Iterate()) {
213 if (s->IsAwarded()) {
214 if (IsInsideMM(pos, 0, cap)) {
215 const CargoSpec *cs = CargoSpec::Get(s->cargo_type);
216 std::string text;
217
218 /* If using wallclock units, show minutes remaining. Otherwise show the date when the subsidy ends. */
219 if (TimerGameEconomy::UsingWallclockUnits()) {
220 text = GetString(STR_SUBSIDIES_SUBSIDISED_FROM_TO,
221 cs->name, s->src.GetFormat(), s->src.id, s->dst.GetFormat(), s->dst.id,
222 s->awarded,
223 STR_SUBSIDIES_SUBSIDISED_EXPIRY_TIME,
224 s->remaining + 1); // We get the rest of the current economy month for free, since the expiration is checked on each new month.
225 } else {
226 text = GetString(STR_SUBSIDIES_SUBSIDISED_FROM_TO,
227 cs->name, s->src.GetFormat(), s->src.id, s->dst.GetFormat(), s->dst.id,
228 s->awarded,
229 STR_SUBSIDIES_SUBSIDISED_EXPIRY_DATE,
230 TimerGameEconomy::date.base() - ymd.day + s->remaining * 32);
231 }
232
233 /* Displays the two connected stations */
234 DrawCargoIcon(tr, pos * GetCharacterHeight(FS_NORMAL), s->cargo_type);
235 DrawString(sr.left, sr.right, sr.top + pos * GetCharacterHeight(FS_NORMAL), text);
236 }
237 pos++;
238 num++;
239 }
240 }
241
242 if (num == 0) {
243 if (IsInsideMM(pos, 0, cap)) DrawString(tr.left, tr.right, tr.top + pos * GetCharacterHeight(FS_NORMAL), STR_SUBSIDIES_NONE);
244 pos++;
245 }
246 }
247
248 void OnResize() override
249 {
250 this->vscroll->SetCapacityFromWidget(this, WID_SUL_PANEL, WidgetDimensions::scaled.framerect.Vertical());
251 }
252
258 void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
259 {
260 if (!gui_scope) return;
261 this->vscroll->SetCount(this->CountLines());
262 }
263};
264
265static constexpr std::initializer_list<NWidgetPart> _nested_subsidies_list_widgets = {
266 NWidget(NWID_HORIZONTAL),
267 NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
268 NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_SUBSIDIES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
269 NWidget(WWT_SHADEBOX, COLOUR_BROWN),
270 NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
271 NWidget(WWT_STICKYBOX, COLOUR_BROWN),
272 EndContainer(),
273 NWidget(NWID_HORIZONTAL),
274 NWidget(WWT_PANEL, COLOUR_BROWN, WID_SUL_PANEL), SetToolTip(STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER), SetResize(1, 1), SetScrollbar(WID_SUL_SCROLLBAR), EndContainer(),
275 NWidget(NWID_VERTICAL),
276 NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, WID_SUL_SCROLLBAR),
277 NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
278 EndContainer(),
279 EndContainer(),
280};
281
282static WindowDesc _subsidies_list_desc(
283 WDP_AUTO, "list_subsidies", 500, 127,
284 WC_SUBSIDIES_LIST, WC_NONE,
285 {},
286 _nested_subsidies_list_widgets
287);
288
289
290void ShowSubsidiesList()
291{
292 AllocateWindowDescFront<SubsidyListWindow>(_subsidies_list_desc, 0);
293}
CargoType
uint8_t CargoType
Cargo slots to indicate a cargo type within a game.
Definition cargo_type.h:21
GetLargestCargoIconSize
Dimension GetLargestCargoIconSize()
Get dimensions of largest cargo icon.
Definition cargotype.cpp:163
Scrollbar
Scrollbar data structure.
Definition widget_type.h:708
Scrollbar::GetCapacity
size_type GetCapacity() const
Gets the number of visible elements of the scrollbar.
Definition widget_type.h:743
Scrollbar::SetCount
void SetCount(size_t num)
Sets the number of elements in the list.
Definition widget_type.h:792
Scrollbar::GetScrolledRowFromWidget
size_type GetScrolledRowFromWidget(int clickpos, const Window *const w, WidgetID widget, int padding=0, int line_height=-1) const
Compute the row of a scrolled widget that a user clicked in.
Definition widget.cpp:2425
Scrollbar::SetCapacityFromWidget
void SetCapacityFromWidget(Window *w, WidgetID widget, int padding=0)
Set capacity of visible elements from the size and resize properties of a widget.
Definition widget.cpp:2499
Scrollbar::GetPosition
size_type GetPosition() const
Gets the position of the first visible element in the list.
Definition widget_type.h:752
TimerGameEconomy::date
static Date date
Current date in days (day counter).
Definition timer_game_economy.h:38
TimerGameEconomy::UsingWallclockUnits
static bool UsingWallclockUnits(bool newgame=false)
Check if we are using wallclock units.
Definition timer_game_economy.cpp:98
TimerGameEconomy::ConvertDateToYMD
static YearMonthDay ConvertDateToYMD(Date date)
Converts a Date to a Year, Month & Day.
Definition timer_game_economy.cpp:47
WidgetDimensions::framerect
RectPadding framerect
Standard padding inside many panels.
Definition window_gui.h:40
WidgetDimensions::scaled
static WidgetDimensions scaled
Widget dimensions scaled for current zoom level.
Definition window_gui.h:30
WidgetDimensions::hsep_normal
int hsep_normal
Normal horizontal spacing.
Definition window_gui.h:61
GetCharacterHeight
int GetCharacterHeight(FontSize size)
Get height of a character for a given font size.
Definition fontcache.cpp:87
maxdim
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
Definition geometry_func.cpp:22
geometry_func.hpp
Geometry functions.
CentreBounds
int CentreBounds(int min, int max, int size)
Determine where to position a centred object.
Definition geometry_type.hpp:26
GetSpriteSize
Dimension GetSpriteSize(SpriteID sprid, Point *offset, ZoomLevel zoom)
Get the size of a sprite.
Definition gfx.cpp:965
GetStringBoundingBox
Dimension GetStringBoundingBox(std::string_view str, FontSize start_fontsize)
Return the string dimension in pixels.
Definition gfx.cpp:894
DrawString
int DrawString(int left, int right, int top, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
Definition gfx.cpp:665
_ctrl_pressed
bool _ctrl_pressed
Is Ctrl pressed?
Definition gfx.cpp:38
DrawSprite
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
Definition gfx.cpp:1031
SpriteID
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition gfx_type.h:17
FS_NORMAL
@ FS_NORMAL
Index of the normal font in the font tables.
Definition gfx_type.h:249
SetScrollbar
constexpr NWidgetPart SetScrollbar(WidgetID index)
Attach a scrollbar to a widget.
Definition widget_type.h:1399
SetStringTip
constexpr NWidgetPart SetStringTip(StringID string, StringID tip={})
Widget part function for setting the string and tooltip.
Definition widget_type.h:1240
SetToolTip
constexpr NWidgetPart SetToolTip(StringID tip)
Widget part function for setting tooltip and clearing the widget data.
Definition widget_type.h:1318
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition widget_type.h:1229
NWidget
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=INVALID_WIDGET)
Widget part function for starting a new 'real' widget.
Definition widget_type.h:1424
SetResize
constexpr NWidgetPart SetResize(int16_t dx, int16_t dy)
Widget part function for setting the resize step.
Definition widget_type.h:1145
gui.h
GUI functions that shouldn't be here.
ShowExtraViewportWindow
void ShowExtraViewportWindow(TileIndex tile=INVALID_TILE)
Show a new Extra Viewport window.
Definition viewport_gui.cpp:159
industry.h
Base of all industries.
IsInsideMM
constexpr bool IsInsideMM(const size_t x, const size_t min, const size_t max) noexcept
Checks if a value is in an interval.
Definition math_func.hpp:267
safeguards.h
A number of safeguards to prevent using unsafe methods.
SourceType::Industry
@ Industry
Source/destination is an industry.
SourceType::Town
@ Town
Source/destination is a town.
stdafx.h
Definition of base types and functions in a cross-platform compatible way.
GetString
std::string GetString(StringID string)
Resolve the given StringID into a std::string with formatting but no parameters.
Definition strings.cpp:424
_current_text_dir
TextDirection _current_text_dir
Text direction of the currently selected language.
Definition strings.cpp:56
strings_func.h
Functions related to OTTD's strings.
TD_RTL
@ TD_RTL
Text is written right-to-left by default.
Definition strings_type.h:27
CargoSpec
Specification of a cargo type.
Definition cargotype.h:74
CargoSpec::Get
static CargoSpec * Get(size_t index)
Retrieve cargo details for the given cargo type.
Definition cargotype.h:137
CargoSpec::GetCargoIcon
SpriteID GetCargoIcon() const
Get sprite for showing cargo of this type.
Definition cargotype.cpp:176
CargoSpec::name
StringID name
Name of this type of cargo.
Definition cargotype.h:91
Coord2D< int >
Dimension
Dimensions (a width and height) of a rectangle in 2D.
Definition geometry_type.hpp:56
Pool::PoolItem<&_subsidy_pool >::Iterate
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
Definition pool_type.hpp:436
Pool::PoolItem<&_industry_pool >::Get
static Titem * Get(auto index)
Returns Titem with given index.
Definition pool_type.hpp:387
RectPadding::Horizontal
constexpr uint Horizontal() const
Get total horizontal padding of RectPadding.
Definition geometry_type.hpp:89
RectPadding::Vertical
constexpr uint Vertical() const
Get total vertical padding of RectPadding.
Definition geometry_type.hpp:95
Rect
Specification of a rectangle with absolute coordinates of all edges.
Definition geometry_type.hpp:101
Rect::WithWidth
Rect WithWidth(int width, bool end) const
Copy Rect and set its width.
Definition geometry_type.hpp:211
Rect::Shrink
Rect Shrink(int s) const
Copy and shrink Rect by s pixels.
Definition geometry_type.hpp:124
Rect::WithHeight
Rect WithHeight(int height, bool end=false) const
Copy Rect and set its height.
Definition geometry_type.hpp:237
Rect::Indent
Rect Indent(int indent, bool end) const
Copy Rect and indent it from its position.
Definition geometry_type.hpp:224
Source::id
SourceID id
Index of industry/town/HQ, Source::Invalid if unknown/invalid.
Definition source_type.h:36
Source::GetFormat
StringID GetFormat() const
Get the format string for a subsidy Source.
Definition subsidy.cpp:56
Source::type
SourceType type
Type of source_id.
Definition source_type.h:37
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
SubsidyListWindow
Definition subsidy_gui.cpp:28
SubsidyListWindow::CountLines
uint CountLines()
Count the number of lines in this window.
Definition subsidy_gui.cpp:113
SubsidyListWindow::OnInit
void OnInit() override
Notification that the nested widget tree gets initialized.
Definition subsidy_gui.cpp:40
SubsidyListWindow::OnClick
void OnClick(Point pt, WidgetID widget, int click_count) override
A click with the left mouse button has been made on the window.
Definition subsidy_gui.cpp:45
SubsidyListWindow::DrawWidget
void DrawWidget(const Rect &r, WidgetID widget) const override
Draw the contents of a nested widget.
Definition subsidy_gui.cpp:156
SubsidyListWindow::OnInvalidateData
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
Definition subsidy_gui.cpp:258
SubsidyListWindow::UpdateWidgetSize
void UpdateWidgetSize(WidgetID widget, Dimension &size, const Dimension &padding, Dimension &fill, Dimension &resize) override
Update size and resize step of a widget in the window.
Definition subsidy_gui.cpp:134
SubsidyListWindow::OnResize
void OnResize() override
Called after the window got resized.
Definition subsidy_gui.cpp:248
Subsidy
Struct about subsidies, offered and awarded.
Definition subsidy_base.h:23
Subsidy::IsAwarded
bool IsAwarded() const
Tests whether this subsidy has been awarded to someone.
Definition subsidy_base.h:45
Subsidy::cargo_type
CargoType cargo_type
Cargo type involved in this subsidy, INVALID_CARGO for invalid subsidy.
Definition subsidy_base.h:24
Subsidy::awarded
CompanyID awarded
Subsidy is awarded to this company; CompanyID::Invalid() if it's not awarded to anyone.
Definition subsidy_base.h:26
Subsidy::dst
Source dst
Destination of subsidised path.
Definition subsidy_base.h:28
Subsidy::src
Source src
Source of subsidised path.
Definition subsidy_base.h:27
Subsidy::remaining
uint16_t remaining
Remaining months when this subsidy is valid.
Definition subsidy_base.h:25
WindowDesc
High level window description.
Definition window_gui.h:168
WindowNumber
Number to differentiate different windows of the same class.
Definition window_type.h:760
Window
Data structure for an opened window.
Definition window_gui.h:274
Window::FinishInitNested
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
Definition window.cpp:1807
Window::resize
ResizeInfo resize
Resize information.
Definition window_gui.h:315
Window::CreateNestedTree
void CreateNestedTree()
Perform the first part of the initialization of a nested widget tree.
Definition window.cpp:1797
Window::GetScrollbar
const Scrollbar * GetScrollbar(WidgetID widnum) const
Return the Scrollbar to a widget index.
Definition window.cpp:313
Window::window_number
WindowNumber window_number
Window number within the window class.
Definition window_gui.h:303
subsidy_base.h
Subsidy base class.
subsidy_func.h
Functions related to subsidies.
subsidy_widget.h
Types related to the subsidy widgets.
WID_SUL_PANEL
@ WID_SUL_PANEL
Main panel of window.
Definition subsidy_widget.h:16
WID_SUL_SCROLLBAR
@ WID_SUL_SCROLLBAR
Scrollbar of panel.
Definition subsidy_widget.h:17
timer_game_calendar.h
Definition of the game-calendar-timer.
town.h
Base of the town class.
ScrollMainWindowToTile
bool ScrollMainWindowToTile(TileIndex tile, bool instant)
Scrolls the viewport of the main window to a given location.
Definition viewport.cpp:2592
viewport_func.h
Functions related to (drawing on) viewports.
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition widget_type.h:66
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition widget_type.h:39
WWT_STICKYBOX
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition widget_type.h:57
WWT_SHADEBOX
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition widget_type.h:55
WWT_CAPTION
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition widget_type.h:52
NWID_VSCROLLBAR
@ NWID_VSCROLLBAR
Vertical scrollbar.
Definition widget_type.h:76
NWID_VERTICAL
@ NWID_VERTICAL
Vertical container.
Definition widget_type.h:68
WWT_CLOSEBOX
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition widget_type.h:60
WWT_RESIZEBOX
@ WWT_RESIZEBOX
Resize box (normally at bottom-right of a window)
Definition widget_type.h:59
WWT_DEFSIZEBOX
@ WWT_DEFSIZEBOX
Default window size box (at top-right of a window, between WWT_SHADEBOX and WWT_STICKYBOX)
Definition widget_type.h:56
window_gui.h
Functions, definitions and such used only by the GUI.
WDP_AUTO
@ WDP_AUTO
Find a place automatically.
Definition window_gui.h:144
WidgetID
int WidgetID
Widget ID.
Definition window_type.h:20
WC_NONE
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
Definition window_type.h:50
WC_SUBSIDIES_LIST
@ WC_SUBSIDIES_LIST
Subsidies list; Window numbers:
Definition window_type.h:265