summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/subsidy_gui.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp
index 76d586ea7..aa61d0d3e 100644
--- a/src/subsidy_gui.cpp
+++ b/src/subsidy_gui.cpp
@@ -17,6 +17,16 @@
#include "table/strings.h"
+/** Widget numbers for the subsidy list window. */
+enum SubsidyListWidgets {
+ SLW_CLOSEBOX,
+ SLW_CAPTION,
+ SLW_STICKYBOX,
+ SLW_PANEL,
+ SLW_SCROLLBAR,
+ SLW_RESIZEBOX,
+};
+
struct SubsidyListWindow : Window {
SubsidyListWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
{
@@ -25,7 +35,7 @@ struct SubsidyListWindow : Window {
virtual void OnClick(Point pt, int widget)
{
- if (widget != 3) return;
+ if (widget != SLW_PANEL) return;
int y = pt.y - 25;
@@ -157,12 +167,12 @@ struct SubsidyListWindow : Window {
};
static const Widget _subsidies_list_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_BROWN, 11, 307, 0, 13, STR_2025_SUBSIDIES, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_STICKYBOX, RESIZE_LR, COLOUR_BROWN, 308, 319, 0, 13, STR_NULL, STR_STICKY_BUTTON},
-{ WWT_PANEL, RESIZE_RB, COLOUR_BROWN, 0, 307, 14, 126, 0x0, STR_01FD_CLICK_ON_SERVICE_TO_CENTER},
-{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_BROWN, 308, 319, 14, 114, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_BROWN, 308, 319, 115, 126, 0x0, STR_RESIZE_BUTTON},
+{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // SLW_CLOSEBOX
+{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_BROWN, 11, 307, 0, 13, STR_2025_SUBSIDIES, STR_018C_WINDOW_TITLE_DRAG_THIS}, // SLW_CAPTION
+{ WWT_STICKYBOX, RESIZE_LR, COLOUR_BROWN, 308, 319, 0, 13, STR_NULL, STR_STICKY_BUTTON}, // SLW_STICKYBOX
+{ WWT_PANEL, RESIZE_RB, COLOUR_BROWN, 0, 307, 14, 126, 0x0, STR_01FD_CLICK_ON_SERVICE_TO_CENTER}, // SLW_PANEL
+{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_BROWN, 308, 319, 14, 114, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // SLW_SCROLLBAR
+{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_BROWN, 308, 319, 115, 126, 0x0, STR_RESIZE_BUTTON}, // SLW_RESIZEBOX
{ WIDGETS_END},
};