summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-04-12 15:17:27 +0000
committeralberth <alberth@openttd.org>2009-04-12 15:17:27 +0000
commit0196f06744a5020182ef4679d11097fd8c1cc2f5 (patch)
treed76045fe2396bbb46685c28e4aa2467883802ced /src
parent07a5f529bfad62dd0b7bafe852681fe85177c528 (diff)
downloadopenttd-0196f06744a5020182ef4679d11097fd8c1cc2f5.tar.xz
(svn r16039) -Codechange: Completing widget number enums of town windows and adding them as comment to the widget arrays.
Diffstat (limited to 'src')
-rw-r--r--src/town_gui.cpp104
1 files changed, 58 insertions, 46 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 5192137ba..1afdf68eb 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -222,10 +222,12 @@ private:
Town *town;
enum TownViewWidget {
- TVW_CAPTION = 1,
+ TVW_CLOSEBOX,
+ TVW_CAPTION,
TVW_STICKY,
TVW_VIEWPORTPANEL,
- TVW_INFOPANEL = 5,
+ TVW_VIEWPORTINSET,
+ TVW_INFOPANEL,
TVW_CENTERVIEW,
TVW_SHOWAUTHORITY,
TVW_CHANGENAME,
@@ -418,17 +420,17 @@ public:
static const Widget _town_view_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, COLOUR_BROWN, 11, 172, 0, 13, STR_2005, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_STICKYBOX, RESIZE_NONE, COLOUR_BROWN, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
-{ WWT_PANEL, RESIZE_NONE, COLOUR_BROWN, 0, 259, 14, 105, 0x0, STR_NULL},
-{ WWT_INSET, RESIZE_NONE, COLOUR_BROWN, 2, 257, 16, 103, 0x0, STR_NULL},
-{ WWT_PANEL, RESIZE_NONE, COLOUR_BROWN, 0, 259, 106, 137, 0x0, STR_NULL},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 0, 85, 138, 149, STR_00E4_LOCATION, STR_200B_CENTER_THE_MAIN_VIEW_ON},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 86, 171, 138, 149, STR_2020_LOCAL_AUTHORITY, STR_2021_SHOW_INFORMATION_ON_LOCAL},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 172, 247, 0, 13, STR_0130_RENAME, STR_200C_CHANGE_TOWN_NAME},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 86, 171, 138, 149, STR_023C_EXPAND, STR_023B_INCREASE_SIZE_OF_TOWN},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 172, 259, 138, 149, STR_0290_DELETE, STR_0291_DELETE_THIS_TOWN_COMPLETELY},
+{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // TVW_CLOSEBOX
+{ WWT_CAPTION, RESIZE_NONE, COLOUR_BROWN, 11, 172, 0, 13, STR_2005, STR_018C_WINDOW_TITLE_DRAG_THIS}, // TVW_CAPTION
+{ WWT_STICKYBOX, RESIZE_NONE, COLOUR_BROWN, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, // TVW_STICKY
+{ WWT_PANEL, RESIZE_NONE, COLOUR_BROWN, 0, 259, 14, 105, 0x0, STR_NULL}, // TVW_VIEWPORTPANEL
+{ WWT_INSET, RESIZE_NONE, COLOUR_BROWN, 2, 257, 16, 103, 0x0, STR_NULL}, // TVW_VIEWPORTINSET
+{ WWT_PANEL, RESIZE_NONE, COLOUR_BROWN, 0, 259, 106, 137, 0x0, STR_NULL}, // TVW_INFOPANEL
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 0, 85, 138, 149, STR_00E4_LOCATION, STR_200B_CENTER_THE_MAIN_VIEW_ON}, // TVW_CENTERVIEW
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 86, 171, 138, 149, STR_2020_LOCAL_AUTHORITY, STR_2021_SHOW_INFORMATION_ON_LOCAL}, // TVW_SHOWAUTHORITY
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 172, 247, 0, 13, STR_0130_RENAME, STR_200C_CHANGE_TOWN_NAME}, // TVW_CHANGENAME
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 86, 171, 138, 149, STR_023C_EXPAND, STR_023B_INCREASE_SIZE_OF_TOWN}, // TVW_EXPAND
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 172, 259, 138, 149, STR_0290_DELETE, STR_0291_DELETE_THIS_TOWN_COMPLETELY}, // TVW_DELETE
{ WIDGETS_END},
};
@@ -445,15 +447,15 @@ void ShowTownViewWindow(TownID town)
}
static const Widget _town_directory_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, COLOUR_BROWN, 11, 195, 0, 13, STR_2000_TOWNS, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_STICKYBOX, RESIZE_NONE, COLOUR_BROWN, 196, 207, 0, 13, 0x0, STR_STICKY_BUTTON},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 0, 98, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 99, 195, 14, 25, STR_SORT_BY_POPULATION, STR_SORT_ORDER_TIP},
-{ WWT_PANEL, RESIZE_BOTTOM, COLOUR_BROWN, 0, 195, 26, 189, 0x0, STR_200A_TOWN_NAMES_CLICK_ON_NAME},
-{ WWT_SCROLLBAR, RESIZE_BOTTOM, COLOUR_BROWN, 196, 207, 14, 189, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{ WWT_PANEL, RESIZE_TB, COLOUR_BROWN, 0, 195, 190, 201, 0x0, STR_NULL},
-{ WWT_RESIZEBOX, RESIZE_TB, COLOUR_BROWN, 196, 207, 190, 201, 0x0, STR_RESIZE_BUTTON},
+{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // TDW_CLOSEBOX
+{ WWT_CAPTION, RESIZE_NONE, COLOUR_BROWN, 11, 195, 0, 13, STR_2000_TOWNS, STR_018C_WINDOW_TITLE_DRAG_THIS}, // TDW_CAPTION
+{ WWT_STICKYBOX, RESIZE_NONE, COLOUR_BROWN, 196, 207, 0, 13, 0x0, STR_STICKY_BUTTON}, // TDW_STICKYBOX
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 0, 98, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, // TDW_SORTNAME
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_BROWN, 99, 195, 14, 25, STR_SORT_BY_POPULATION, STR_SORT_ORDER_TIP}, // TDW_SORTPOPULATION
+{ WWT_PANEL, RESIZE_BOTTOM, COLOUR_BROWN, 0, 195, 26, 189, 0x0, STR_200A_TOWN_NAMES_CLICK_ON_NAME}, // TDW_CENTERTOWN
+{ WWT_SCROLLBAR, RESIZE_BOTTOM, COLOUR_BROWN, 196, 207, 14, 189, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // TDW_SCROLLBAR
+{ WWT_PANEL, RESIZE_TB, COLOUR_BROWN, 0, 195, 190, 201, 0x0, STR_NULL}, // TDW_EMPTYBOTTOM
+{ WWT_RESIZEBOX, RESIZE_TB, COLOUR_BROWN, 196, 207, 190, 201, 0x0, STR_RESIZE_BUTTON}, // TDW_RESIZEBOX
{ WIDGETS_END},
};
@@ -461,9 +463,15 @@ static const Widget _town_directory_widgets[] = {
struct TownDirectoryWindow : public Window {
private:
enum TownDirectoryWidget {
- TDW_SORTNAME = 3,
+ TDW_CLOSEBOX,
+ TDW_CAPTION,
+ TDW_STICKYBOX,
+ TDW_SORTNAME,
TDW_SORTPOPULATION,
TDW_CENTERTOWN,
+ TDW_SCROLLBAR,
+ TDW_EMPTYBOTTOM,
+ TDW_RESIZEBOX,
};
/* Runtime saved values */
@@ -671,28 +679,28 @@ void CcBuildTown(bool success, TileIndex tile, uint32 p1, uint32 p2)
}
static const Widget _found_town_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_NONE, COLOUR_DARK_GREEN, 11, 147, 0, 13, STR_0233_TOWN_GENERATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_STICKYBOX, RESIZE_NONE, COLOUR_DARK_GREEN, 148, 159, 0, 13, 0x0, STR_STICKY_BUTTON},
-{ WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 159, 14, 161, 0x0, STR_NULL},
-
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 16, 27, STR_0234_NEW_TOWN, STR_0235_CONSTRUCT_NEW_TOWN},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 29, 40, STR_023D_RANDOM_TOWN, STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 42, 53, STR_MANY_RANDOM_TOWNS, STR_RANDOM_TOWNS_TIP},
-
-{ WWT_LABEL, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 147, 54, 67, STR_02A5_TOWN_SIZE, STR_NULL},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 79, 68, 79, STR_02A1_SMALL, STR_02A4_SELECT_TOWN_SIZE},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 80, 157, 68, 79, STR_02A2_MEDIUM, STR_02A4_SELECT_TOWN_SIZE},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 79, 81, 92, STR_02A3_LARGE, STR_02A4_SELECT_TOWN_SIZE},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 80, 157, 81, 92, STR_SELECT_TOWN_SIZE_RANDOM, STR_02A4_SELECT_TOWN_SIZE},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 96, 107, STR_FOUND_TOWN_CITY, STR_FOUND_TOWN_CITY_TOOLTIP},
-
-{ WWT_LABEL, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 147, 108, 121, STR_TOWN_ROAD_LAYOUT, STR_NULL},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 79, 122, 133, STR_SELECT_LAYOUT_ORIGINAL, STR_SELECT_TOWN_ROAD_LAYOUT},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 80, 157, 122, 133, STR_SELECT_LAYOUT_BETTER_ROADS, STR_SELECT_TOWN_ROAD_LAYOUT},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 79, 135, 146, STR_SELECT_LAYOUT_2X2_GRID, STR_SELECT_TOWN_ROAD_LAYOUT},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 80, 157, 135, 146, STR_SELECT_LAYOUT_3X3_GRID, STR_SELECT_TOWN_ROAD_LAYOUT},
-{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 148, 159, STR_SELECT_LAYOUT_RANDOM, STR_SELECT_TOWN_ROAD_LAYOUT},
+{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // TSEW_CLOSEBOX
+{ WWT_CAPTION, RESIZE_NONE, COLOUR_DARK_GREEN, 11, 147, 0, 13, STR_0233_TOWN_GENERATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // TSEW_CAPTION
+{ WWT_STICKYBOX, RESIZE_NONE, COLOUR_DARK_GREEN, 148, 159, 0, 13, 0x0, STR_STICKY_BUTTON}, // TSEW_STICKYBOX
+{ WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 159, 14, 161, 0x0, STR_NULL}, // TSEW_BACKGROUND
+
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 16, 27, STR_0234_NEW_TOWN, STR_0235_CONSTRUCT_NEW_TOWN}, // TSEW_NEWTOWN
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 29, 40, STR_023D_RANDOM_TOWN, STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION}, // TSEW_RANDOMTOWN
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 42, 53, STR_MANY_RANDOM_TOWNS, STR_RANDOM_TOWNS_TIP}, // TSEW_MANYRANDOMTOWNS
+
+{ WWT_LABEL, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 147, 54, 67, STR_02A5_TOWN_SIZE, STR_NULL}, // TSEW_TOWNSIZE
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 79, 68, 79, STR_02A1_SMALL, STR_02A4_SELECT_TOWN_SIZE}, // TSEW_SIZE_SMALL
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 80, 157, 68, 79, STR_02A2_MEDIUM, STR_02A4_SELECT_TOWN_SIZE}, // TSEW_SIZE_MEDIUM
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 79, 81, 92, STR_02A3_LARGE, STR_02A4_SELECT_TOWN_SIZE}, // TSEW_SIZE_LARGE
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 80, 157, 81, 92, STR_SELECT_TOWN_SIZE_RANDOM, STR_02A4_SELECT_TOWN_SIZE}, // TSEW_SIZE_RANDOM
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 96, 107, STR_FOUND_TOWN_CITY, STR_FOUND_TOWN_CITY_TOOLTIP}, // TSEW_CITY
+
+{ WWT_LABEL, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 147, 108, 121, STR_TOWN_ROAD_LAYOUT, STR_NULL}, // TSEW_TOWNLAYOUT
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 79, 122, 133, STR_SELECT_LAYOUT_ORIGINAL, STR_SELECT_TOWN_ROAD_LAYOUT}, // TSEW_LAYOUT_ORIGINAL
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 80, 157, 122, 133, STR_SELECT_LAYOUT_BETTER_ROADS, STR_SELECT_TOWN_ROAD_LAYOUT}, // TSEW_LAYOUT_BETTER
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 79, 135, 146, STR_SELECT_LAYOUT_2X2_GRID, STR_SELECT_TOWN_ROAD_LAYOUT}, // TSEW_LAYOUT_GRID2
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 80, 157, 135, 146, STR_SELECT_LAYOUT_3X3_GRID, STR_SELECT_TOWN_ROAD_LAYOUT}, // TSEW_LAYOUT_GRID3
+{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 2, 157, 148, 159, STR_SELECT_LAYOUT_RANDOM, STR_SELECT_TOWN_ROAD_LAYOUT}, // TSEW_LAYOUT_RANDOM
{ WIDGETS_END},
};
@@ -701,7 +709,11 @@ struct FoundTownWindow : Window
{
private:
enum TownScenarioEditorWidget {
- TSEW_NEWTOWN = 4,
+ TSEW_CLOSEBOX,
+ TSEW_CAPTION,
+ TSEW_STICKYBOX,
+ TSEW_BACKGROUND,
+ TSEW_NEWTOWN,
TSEW_RANDOMTOWN,
TSEW_MANYRANDOMTOWNS,
TSEW_TOWNSIZE,