diff options
-rw-r--r-- | src/ai/ai_gui.cpp | 8 | ||||
-rw-r--r-- | src/airport_gui.cpp | 2 | ||||
-rw-r--r-- | src/autoreplace_gui.cpp | 8 | ||||
-rw-r--r-- | src/bridge_gui.cpp | 2 | ||||
-rw-r--r-- | src/build_vehicle_gui.cpp | 2 | ||||
-rw-r--r-- | src/depot_gui.cpp | 4 | ||||
-rw-r--r-- | src/fios_gui.cpp | 6 | ||||
-rw-r--r-- | src/group_gui.cpp | 4 | ||||
-rw-r--r-- | src/industry_gui.cpp | 6 | ||||
-rw-r--r-- | src/network/network_content_gui.cpp | 2 | ||||
-rw-r--r-- | src/network/network_gui.cpp | 6 | ||||
-rw-r--r-- | src/newgrf_debug_gui.cpp | 4 | ||||
-rw-r--r-- | src/newgrf_gui.cpp | 6 | ||||
-rw-r--r-- | src/news_gui.cpp | 2 | ||||
-rw-r--r-- | src/order_gui.cpp | 6 | ||||
-rw-r--r-- | src/rail_gui.cpp | 4 | ||||
-rw-r--r-- | src/settings_gui.cpp | 2 | ||||
-rw-r--r-- | src/signs_gui.cpp | 2 | ||||
-rw-r--r-- | src/station_gui.cpp | 6 | ||||
-rw-r--r-- | src/subsidy_gui.cpp | 2 | ||||
-rw-r--r-- | src/timetable_gui.cpp | 2 | ||||
-rw-r--r-- | src/town_gui.cpp | 4 | ||||
-rw-r--r-- | src/vehicle_gui.cpp | 6 | ||||
-rw-r--r-- | src/widget.cpp | 46 | ||||
-rw-r--r-- | src/widget_type.h | 5 | ||||
-rw-r--r-- | src/widgets/dropdown.cpp | 2 | ||||
-rw-r--r-- | src/window.cpp | 9 |
27 files changed, 70 insertions, 88 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index fa65f1e26..968c36d5d 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -199,7 +199,7 @@ static const NWidgetPart _nested_ai_list_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_MAUVE, AIL_WIDGET_LIST), SetMinimalSize(188, 112), SetFill(1, 1), SetResize(1, 1), SetDataTip(0x501, STR_AI_LIST_TOOLTIP), SetScrollbar(AIL_WIDGET_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_MAUVE, AIL_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, AIL_WIDGET_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_MAUVE, AIL_WIDGET_INFO_BG), SetMinimalTextLines(8, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), SetResize(1, 0), EndContainer(), @@ -432,7 +432,7 @@ static const NWidgetPart _nested_ai_settings_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_MAUVE, AIS_WIDGET_BACKGROUND), SetMinimalSize(188, 182), SetResize(1, 1), SetFill(1, 0), SetDataTip(0x501, STR_NULL), SetScrollbar(AIS_WIDGET_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_MAUVE, AIS_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, AIS_WIDGET_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), @@ -499,7 +499,7 @@ static const NWidgetPart _nested_ai_config_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_MAUVE, AIC_WIDGET_LIST), SetMinimalSize(288, 112), SetFill(1, 0), SetDataTip(0x801, STR_AI_CONFIG_LIST_TOOLTIP), SetScrollbar(AIC_WIDGET_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_MAUVE, AIC_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, AIC_WIDGET_SCROLLBAR), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 9), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(5, 0, 5), @@ -1130,7 +1130,7 @@ static const NWidgetPart _nested_ai_debug_widgets[] = { EndContainer(), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, AID_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, AID_WIDGET_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), EndContainer(), diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 5f852fceb..b0486f3a5 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -543,7 +543,7 @@ static const NWidgetPart _nested_build_airport_widgets[] = { NWidget(WWT_DROPDOWN, COLOUR_GREY, BAIRW_CLASS_DROPDOWN), SetFill(1, 0), SetDataTip(STR_BLACK_STRING, STR_NULL), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, BAIRW_AIRPORT_LIST), SetFill(1, 0), SetDataTip(0x501, STR_NULL), SetScrollbar(BAIRW_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, BAIRW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, BAIRW_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(NWID_BUTTON_ARROW, COLOUR_GREY, BAIRW_LAYOUT_DECREASE), SetMinimalSize(12, 0),SetDataTip(AWV_DECREASE, STR_NULL), diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 6d0176b96..586af963f 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -519,9 +519,9 @@ static const NWidgetPart _nested_replace_rail_vehicle_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), NWidget(WWT_MATRIX, COLOUR_GREY, RVW_WIDGET_LEFT_MATRIX), SetMinimalSize(216, 0), SetFill(1, 1), SetDataTip(0x1, STR_REPLACE_HELP_LEFT_ARRAY), SetResize(1, 1), SetScrollbar(RVW_WIDGET_LEFT_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, RVW_WIDGET_LEFT_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, RVW_WIDGET_LEFT_SCROLLBAR), NWidget(WWT_MATRIX, COLOUR_GREY, RVW_WIDGET_RIGHT_MATRIX), SetMinimalSize(216, 0), SetFill(1, 1), SetDataTip(0x1, STR_REPLACE_HELP_RIGHT_ARRAY), SetResize(1, 1), SetScrollbar(RVW_WIDGET_RIGHT_SCROLLBAR), - NWidget(WWT_SCROLL2BAR, COLOUR_GREY, RVW_WIDGET_RIGHT_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, RVW_WIDGET_RIGHT_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), NWidget(WWT_PANEL, COLOUR_GREY, RVW_WIDGET_LEFT_DETAILS), SetMinimalSize(228, 102), SetResize(1, 0), EndContainer(), @@ -559,9 +559,9 @@ static const NWidgetPart _nested_replace_vehicle_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), NWidget(WWT_MATRIX, COLOUR_GREY, RVW_WIDGET_LEFT_MATRIX), SetMinimalSize(216, 0), SetFill(1, 1), SetDataTip(0x1, STR_REPLACE_HELP_LEFT_ARRAY), SetResize(1, 1), SetScrollbar(RVW_WIDGET_LEFT_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, RVW_WIDGET_LEFT_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, RVW_WIDGET_LEFT_SCROLLBAR), NWidget(WWT_MATRIX, COLOUR_GREY, RVW_WIDGET_RIGHT_MATRIX), SetMinimalSize(216, 0), SetFill(1, 1), SetDataTip(0x1, STR_REPLACE_HELP_RIGHT_ARRAY), SetResize(1, 1), SetScrollbar(RVW_WIDGET_RIGHT_SCROLLBAR), - NWidget(WWT_SCROLL2BAR, COLOUR_GREY, RVW_WIDGET_RIGHT_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, RVW_WIDGET_RIGHT_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), NWidget(WWT_PANEL, COLOUR_GREY, RVW_WIDGET_LEFT_DETAILS), SetMinimalSize(228, 92), SetResize(1, 0), EndContainer(), diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 7af7f8452..1bc23a327 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -328,7 +328,7 @@ static const NWidgetPart _nested_build_bridge_widgets[] = { /* scrollbar + resize button */ NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_DARK_GREEN, BBSW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_DARK_GREEN, BBSW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN), EndContainer(), EndContainer(), diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 91cdabfaa..2133d87dc 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -78,7 +78,7 @@ static const NWidgetPart _nested_build_vehicle_widgets[] = { /* Vehicle list. */ NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, BUILD_VEHICLE_WIDGET_LIST), SetResize(1, 1), SetFill(1, 0), SetDataTip(0x101, STR_NULL), SetScrollbar(BUILD_VEHICLE_WIDGET_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, BUILD_VEHICLE_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, BUILD_VEHICLE_WIDGET_SCROLLBAR), EndContainer(), /* Panel with details. */ NWidget(WWT_PANEL, COLOUR_GREY, BUILD_VEHICLE_WIDGET_PANEL), SetMinimalSize(240, 122), SetResize(1, 0), EndContainer(), diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index ac1d48a40..520694cd6 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -71,7 +71,7 @@ static const NWidgetPart _nested_train_depot_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(NWID_VERTICAL), NWidget(WWT_MATRIX, COLOUR_GREY, DEPOT_WIDGET_MATRIX), SetDataTip(0x0, STR_NULL), SetResize(1, 1), SetScrollbar(DEPOT_WIDGET_V_SCROLL), - NWidget(WWT_HSCROLLBAR, COLOUR_GREY, DEPOT_WIDGET_H_SCROLL), + NWidget(NWID_HSCROLLBAR, COLOUR_GREY, DEPOT_WIDGET_H_SCROLL), EndContainer(), NWidget(NWID_VERTICAL), NWidget(WWT_IMGBTN, COLOUR_GREY, DEPOT_WIDGET_SELL), SetDataTip(0x0, STR_NULL), SetResize(0, 1), SetFill(0, 1), @@ -79,7 +79,7 @@ static const NWidgetPart _nested_train_depot_widgets[] = { NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, DEPOT_WIDGET_SELL_ALL), SetDataTip(0x0, STR_NULL), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, DEPOT_WIDGET_AUTOREPLACE), SetDataTip(0x0, STR_NULL), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, DEPOT_WIDGET_V_SCROLL), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, DEPOT_WIDGET_V_SCROLL), EndContainer(), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, DEPOT_WIDGET_BUILD), SetDataTip(0x0, STR_NULL), SetFill(1, 1), SetResize(1, 0), diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index a8c45dbb8..7e7dd2543 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -100,7 +100,7 @@ static const NWidgetPart _nested_load_dialog_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_INSET, COLOUR_GREY, SLWW_DRIVES_DIRECTORIES_LIST), SetFill(1, 1), SetPadding(2, 1, 2, 2), SetDataTip(0x0, STR_SAVELOAD_LIST_TOOLTIP), SetResize(1, 10), SetScrollbar(SLWW_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, SLWW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, SLWW_SCROLLBAR), EndContainer(), NWidget(NWID_SELECTION, INVALID_COLOUR, SLWW_CONTENT_DOWNLOAD_SEL), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, SLWW_CONTENT_DOWNLOAD), SetResize(1, 0), @@ -140,7 +140,7 @@ static const NWidgetPart _nested_load_heightmap_dialog_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_INSET, COLOUR_GREY, SLWW_DRIVES_DIRECTORIES_LIST), SetFill(1, 1), SetPadding(2, 1, 2, 2), SetDataTip(0x0, STR_SAVELOAD_LIST_TOOLTIP), SetResize(1, 10), SetScrollbar(SLWW_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, SLWW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, SLWW_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, SLWW_CONTENT_DOWNLOAD), SetResize(1, 0), @@ -171,7 +171,7 @@ static const NWidgetPart _nested_save_dialog_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_INSET, COLOUR_GREY, SLWW_DRIVES_DIRECTORIES_LIST), SetPadding(2, 1, 0, 2), SetDataTip(0x0, STR_SAVELOAD_LIST_TOOLTIP), SetResize(1, 10), SetScrollbar(SLWW_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, SLWW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, SLWW_SCROLLBAR), EndContainer(), NWidget(WWT_EDITBOX, COLOUR_GREY, SLWW_SAVE_OSK_TITLE), SetPadding(3, 2, 2, 2), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_SAVELOAD_OSKTITLE, STR_SAVELOAD_EDITBOX_TOOLTIP), diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 35f935a7d..ba08bb301 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -70,7 +70,7 @@ static const NWidgetPart _nested_group_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, GRP_WIDGET_LIST_GROUP), SetMinimalSize(188, 0), SetDataTip(0x701, STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP), SetFill(1, 0), SetResize(0, 1), SetScrollbar(GRP_WIDGET_LIST_GROUP_SCROLLBAR), - NWidget(WWT_SCROLL2BAR, COLOUR_GREY, GRP_WIDGET_LIST_GROUP_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, GRP_WIDGET_LIST_GROUP_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, GRP_WIDGET_CREATE_GROUP), SetMinimalSize(24, 25), SetFill(0, 1), @@ -94,7 +94,7 @@ static const NWidgetPart _nested_group_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, GRP_WIDGET_LIST_VEHICLE), SetMinimalSize(248, 0), SetDataTip(0x701, STR_NULL), SetResize(1, 1), SetFill(1, 0), SetScrollbar(GRP_WIDGET_LIST_VEHICLE_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, GRP_WIDGET_LIST_VEHICLE_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, GRP_WIDGET_LIST_VEHICLE_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, GRP_WIDGET_AVAILABLE_VEHICLES), SetMinimalSize(106, 12), SetFill(0, 1), diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 341bb194f..12842f365 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -180,7 +180,7 @@ static const NWidgetPart _nested_build_industry_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_DARK_GREEN, DPIW_MATRIX_WIDGET), SetDataTip(0x801, STR_FUND_INDUSTRY_SELECTION_TOOLTIP), SetFill(1, 0), SetResize(1, 1), SetScrollbar(DPIW_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_DARK_GREEN, DPIW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_DARK_GREEN, DPIW_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_DARK_GREEN, DPIW_INFOPANEL), SetResize(1, 0), EndContainer(), @@ -958,7 +958,7 @@ static const NWidgetPart _nested_industry_directory_widgets[] = { NWidget(WWT_PANEL, COLOUR_BROWN, IDW_INDUSTRY_LIST), SetDataTip(0x0, STR_INDUSTRY_DIRECTORY_LIST_CAPTION), SetResize(1, 1), SetScrollbar(IDW_SCROLLBAR), EndContainer(), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_BROWN, IDW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, IDW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), EndContainer(), @@ -1326,7 +1326,7 @@ static const NWidgetPart _nested_industry_cargoes_widgets[] = { EndContainer(), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_BROWN, ICW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, ICW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), EndContainer(), diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index adeddff15..be99a338b 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -830,7 +830,7 @@ static const NWidgetPart _nested_network_content_list_widgets[] = { EndContainer(), NWidget(WWT_MATRIX, COLOUR_LIGHT_BLUE, NCLWW_MATRIX), SetResize(1, 14), SetFill(1, 1), SetScrollbar(NCLWW_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_LIGHT_BLUE, NCLWW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_LIGHT_BLUE, NCLWW_SCROLLBAR), EndContainer(), EndContainer(), /* Right side. */ diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 99520c2ec..608ceddc5 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -950,7 +950,7 @@ static const NWidgetPart _nested_network_game_widgets[] = { NWidget(WWT_MATRIX, COLOUR_LIGHT_BLUE, NGWW_MATRIX), SetResize(1, 1), SetFill(1, 0), SetDataTip(0, STR_NETWORK_SERVER_LIST_CLICK_GAME_TO_SELECT), SetScrollbar(NGWW_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_LIGHT_BLUE, NGWW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_LIGHT_BLUE, NGWW_SCROLLBAR), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 7), SetResize(1, 0), SetFill(1, 1), NWidget(WWT_TEXT, COLOUR_LIGHT_BLUE, NGWW_LASTJOINED_LABEL), SetFill(1, 0), @@ -1360,7 +1360,7 @@ static const NWidgetPart _nested_network_start_server_window_widgets[] = { NWidget(NWID_SPACER), SetMinimalSize(0, 6), SetFill(1, 0), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, NSSW_SELMAP), SetMinimalSize(250, 0), SetFill(1, 1), SetDataTip(STR_NULL, STR_NETWORK_START_SERVER_SELECT_MAP_TOOLTIP), SetScrollbar(NSSW_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_LIGHT_BLUE, NSSW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_LIGHT_BLUE, NSSW_SCROLLBAR), EndContainer(), EndContainer(), NWidget(NWID_VERTICAL), SetPIP(10, 0, 10), @@ -1697,7 +1697,7 @@ static const NWidgetPart _nested_network_lobby_window_widgets[] = { NWidget(WWT_PANEL, COLOUR_WHITE, NLWW_HEADER), SetMinimalSize(146, 0), SetResize(1, 0), SetFill(1, 0), EndContainer(), NWidget(WWT_MATRIX, COLOUR_LIGHT_BLUE, NLWW_MATRIX), SetMinimalSize(146, 0), SetResize(1, 1), SetFill(1, 1), SetDataTip(0, STR_NETWORK_GAME_LOBBY_COMPANY_LIST_TOOLTIP), SetScrollbar(NLWW_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_LIGHT_BLUE, NLWW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_LIGHT_BLUE, NLWW_SCROLLBAR), NWidget(NWID_SPACER), SetMinimalSize(5, 0), SetResize(0, 1), /* Company info. */ NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, NLWW_DETAILS), SetMinimalSize(232, 0), SetResize(1, 1), SetFill(1, 1), EndContainer(), diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index bbc3abf0f..74d3c5f85 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -471,7 +471,7 @@ static const NWidgetPart _nested_newgrf_inspect_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY, NIW_MAINPANEL), SetMinimalSize(300, 0), SetScrollbar(NIW_SCROLLBAR), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, NIW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, NIW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), EndContainer(), @@ -800,7 +800,7 @@ static const NWidgetPart _nested_sprite_aligner_widgets[] = { NWidget(WWT_TEXTBTN, COLOUR_GREY, SAW_PICKER), SetDataTip(STR_SPRITE_ALIGNER_PICKER_BUTTON, STR_SPRITE_ALIGNER_PICKER_TOOLTIP), SetFill(1, 0), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, SAW_LIST), SetResize(1, 1), SetDataTip(0x101, STR_NULL), SetFill(1, 1), SetScrollbar(SAW_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, SAW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, SAW_SCROLLBAR), EndContainer(), EndContainer(), EndContainer(), diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 375a3729d..bc4505283 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -345,7 +345,7 @@ static const NWidgetPart _nested_newgrf_parameter_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_MAUVE, GRFPAR_WIDGET_BACKGROUND), SetMinimalSize(188, 182), SetResize(1, 1), SetFill(1, 0), SetDataTip(0x501, STR_NULL), SetScrollbar(GRFPAR_WIDGET_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_MAUVE, GRFPAR_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, GRFPAR_WIDGET_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_MAUVE, GRFPAR_WIDGET_DESCRIPTION), SetResize(1, 0), SetFill(1, 0), EndContainer(), @@ -1397,7 +1397,7 @@ static const NWidgetPart _nested_newgrf_actives_widgets[] = { SetFill(1, 1), SetResize(1, 1), SetScrollbar(SNGRFS_SCROLLBAR), EndContainer(), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_MAUVE, SNGRFS_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, SNGRFS_SCROLLBAR), EndContainer(), /* Buttons. */ NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPadding(2, 2, 2, 2), SetPIP(0, WD_RESIZEBOX_WIDTH, 0), @@ -1431,7 +1431,7 @@ static const NWidgetPart _nested_newgrf_availables_widgets[] = { SetFill(1, 1), SetResize(1, 1), SetScrollbar(SNGRFS_SCROLL2BAR), EndContainer(), EndContainer(), - NWidget(WWT_SCROLL2BAR, COLOUR_MAUVE, SNGRFS_SCROLL2BAR), + NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, SNGRFS_SCROLL2BAR), EndContainer(), /* Left side, available grfs, buttons. */ NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPadding(2, 2, 2, 2), SetPIP(0, WD_RESIZEBOX_WIDTH, 0), diff --git a/src/news_gui.cpp b/src/news_gui.cpp index ea6cd07d9..27aeb7d71 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -1052,7 +1052,7 @@ static const NWidgetPart _nested_message_history[] = { NWidget(WWT_PANEL, COLOUR_BROWN, MHW_BACKGROUND), SetMinimalSize(200, 125), SetDataTip(0x0, STR_MESSAGE_HISTORY_TOOLTIP), SetResize(1, 12), SetScrollbar(MHW_SCROLLBAR), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_BROWN, MHW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, MHW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), EndContainer(), diff --git a/src/order_gui.cpp b/src/order_gui.cpp index ff47faeb5..3bedfd063 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -1392,7 +1392,7 @@ static const NWidgetPart _nested_orders_train_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY, ORDER_WIDGET_ORDER_LIST), SetMinimalSize(372, 62), SetDataTip(0x0, STR_ORDERS_LIST_TOOLTIP), SetResize(1, 1), SetScrollbar(ORDER_WIDGET_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR), EndContainer(), /* First button row. */ @@ -1456,7 +1456,7 @@ static const NWidgetPart _nested_orders_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY, ORDER_WIDGET_ORDER_LIST), SetMinimalSize(372, 62), SetDataTip(0x0, STR_ORDERS_LIST_TOOLTIP), SetResize(1, 1), SetScrollbar(ORDER_WIDGET_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR), EndContainer(), /* First button row. */ @@ -1522,7 +1522,7 @@ static const NWidgetPart _nested_other_orders_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY, ORDER_WIDGET_ORDER_LIST), SetMinimalSize(372, 72), SetDataTip(0x0, STR_ORDERS_LIST_TOOLTIP), SetResize(1, 1), SetScrollbar(ORDER_WIDGET_SCROLLBAR), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), EndContainer(), diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 781696182..a192b1aca 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1400,7 +1400,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = { NWidget(WWT_DROPDOWN, COLOUR_GREY, BRSW_NEWST_DROPDOWN), SetMinimalSize(134, 12), SetFill(1, 0), SetPadding(3, 7, 3, 7), SetDataTip(STR_BLACK_STRING, STR_STATION_BUILD_STATION_CLASS_TOOLTIP), NWidget(NWID_HORIZONTAL), SetPIP(7, 0, 7), NWidget(WWT_MATRIX, COLOUR_GREY, BRSW_NEWST_LIST), SetMinimalSize(122, 71), SetFill(1, 0), SetDataTip(0x501, STR_STATION_BUILD_STATION_TYPE_TOOLTIP), SetScrollbar(BRSW_NEWST_SCROLL), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, BRSW_NEWST_SCROLL), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, BRSW_NEWST_SCROLL), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 1), EndContainer(), @@ -1849,7 +1849,7 @@ static const NWidgetPart _nested_build_waypoint_widgets[] = { NWidget(WWT_PANEL, COLOUR_DARK_GREEN, BRWW_WAYPOINT_5), SetMinimalSize(66, 60), SetDataTip(0x0, STR_WAYPOINT_GRAPHICS_TOOLTIP), EndContainer(), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 3), - NWidget(WWT_HSCROLLBAR, COLOUR_DARK_GREEN, BRWW_SCROLL), + NWidget(NWID_HSCROLLBAR, COLOUR_DARK_GREEN, BRWW_SCROLL), EndContainer(), }; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index c01c7236d..853902f9d 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1713,7 +1713,7 @@ static const NWidgetPart _nested_settings_selection_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_MAUVE, SETTINGSEL_OPTIONSPANEL), SetMinimalSize(400, 174), SetScrollbar(SETTINGSEL_SCROLLBAR), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_MAUVE, SETTINGSEL_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, SETTINGSEL_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), EndContainer(), EndContainer(), diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index e8bd685a7..c3e022b43 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -211,7 +211,7 @@ static const NWidgetPart _nested_sign_list_widgets[] = { NWidget(WWT_PANEL, COLOUR_GREY, SLW_LIST), SetMinimalSize(WD_FRAMETEXT_LEFT + 16 + MAX_LENGTH_SIGN_NAME_PIXELS + WD_FRAMETEXT_RIGHT, 50), SetResize(1, 10), SetFill(1, 0), SetScrollbar(SLW_SCROLLBAR), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, SLW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, SLW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), EndContainer(), diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 55c922fd7..34aab9fcd 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -781,7 +781,7 @@ static const NWidgetPart _nested_company_stations_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY, SLW_LIST), SetMinimalSize(346, 125), SetResize(1, 10), SetDataTip(0x0, STR_STATION_LIST_TOOLTIP), SetScrollbar(SLW_SCROLLBAR), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, SLW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, SLW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), EndContainer(), @@ -815,7 +815,7 @@ static const NWidgetPart _nested_station_view_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY, SVW_WAITING), SetMinimalSize(237, 52), SetResize(1, 10), SetScrollbar(SVW_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, SVW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, SVW_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, SVW_ACCEPTLIST), SetMinimalSize(249, 32), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), @@ -1344,7 +1344,7 @@ static const NWidgetPart _nested_select_station_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_DARK_GREEN, JSW_PANEL), SetResize(1, 0), SetScrollbar(JSW_SCROLLBAR), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_DARK_GREEN, JSW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_DARK_GREEN, JSW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN), EndContainer(), EndContainer(), diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index a7f05157c..c96fdf6a8 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -236,7 +236,7 @@ static const NWidgetPart _nested_subsidies_list_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_BROWN, SLW_PANEL), SetDataTip(0x0, STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER), SetResize(1, 1), SetScrollbar(SLW_SCROLLBAR), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_BROWN, SLW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, SLW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), EndContainer(), diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 02534f91e..f77a5b115 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -620,7 +620,7 @@ static const NWidgetPart _nested_timetable_widgets[] = { NWidget(NWID_SELECTION, INVALID_COLOUR, TTV_ARRIVAL_DEPARTURE_SELECTION), NWidget(WWT_PANEL, COLOUR_GREY, TTV_ARRIVAL_DEPARTURE_PANEL), SetMinimalSize(110, 0), SetFill(0, 1), SetDataTip(STR_NULL, STR_TIMETABLE_TOOLTIP), SetScrollbar(TTV_SCROLLBAR), EndContainer(), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, TTV_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, TTV_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, TTV_SUMMARY_PANEL), SetMinimalSize(400, 22), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), diff --git a/src/town_gui.cpp b/src/town_gui.cpp index e3cba8b64..ba6f10928 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -60,7 +60,7 @@ static const NWidgetPart _nested_town_authority_widgets[] = { NWidget(WWT_PANEL, COLOUR_BROWN, TWA_RATING_INFO), SetMinimalSize(317, 92), SetResize(1, 1), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_BROWN, TWA_COMMAND_LIST), SetMinimalSize(305, 52), SetResize(1, 0), SetDataTip(0x0, STR_LOCAL_AUTHORITY_ACTIONS_TOOLTIP), SetScrollbar(TWA_SCROLLBAR), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_BROWN, TWA_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, TWA_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_BROWN, TWA_ACTION_INFO), SetMinimalSize(317, 52), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), @@ -638,7 +638,7 @@ static const NWidgetPart _nested_town_directory_widgets[] = { EndContainer(), EndContainer(), NWidget(NWID_VERTICAL), - NWidget(WWT_SCROLLBAR, COLOUR_BROWN, TDW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, TDW_SCROLLBAR), NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), EndContainer(), diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 100f5cb64..55357e255 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -568,7 +568,7 @@ static const NWidgetPart _nested_vehicle_refit_widgets[] = { /* Matrix + scrollbar. */ NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, VRW_MATRIX), SetMinimalSize(228, 112), SetResize(1, 14), SetFill(1, 1), SetDataTip(0x801, STR_NULL), SetScrollbar(VRW_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, VRW_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, VRW_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, VRW_INFOPANEL), SetMinimalTextLines(2, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), @@ -867,7 +867,7 @@ static const NWidgetPart _nested_vehicle_list[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, VLW_WIDGET_LIST), SetMinimalSize(248, 0), SetFill(1, 0), SetResize(1, 1), SetScrollbar(VLW_WIDGET_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, VLW_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, VLW_WIDGET_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), @@ -1432,7 +1432,7 @@ static const NWidgetPart _nested_train_vehicle_details_widgets[] = { NWidget(WWT_PANEL, COLOUR_GREY, VLD_WIDGET_TOP_DETAILS), SetResize(1, 0), SetMinimalSize(405, 42), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, VLD_WIDGET_MATRIX), SetResize(1, 1), SetMinimalSize(393, 45), SetDataTip(0x701, STR_NULL), SetFill(1, 0), SetScrollbar(VLD_WIDGET_SCROLLBAR), - NWidget(WWT_SCROLLBAR, COLOUR_GREY, VLD_WIDGET_SCROLLBAR), + NWidget(NWID_VSCROLLBAR, COLOUR_GREY, VLD_WIDGET_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(NWID_BUTTON_ARROW, COLOUR_GREY, VLD_WIDGET_DECREASE_SERVICING_INTERVAL), SetFill(0, 1), diff --git a/src/widget.cpp b/src/widget.cpp index d6e9b6f5c..f89ec1213 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -76,7 +76,7 @@ static void ScrollbarClickPositioning(Window *w, NWidgetScrollbar *sb, int x, in int pos; bool rtl = false; - if (sb->type == WWT_HSCROLLBAR) { + if (sb->type == NWID_HSCROLLBAR) { pos = x; rtl = _dynlang.text_dir == TD_RTL; } else { @@ -100,7 +100,7 @@ static void ScrollbarClickPositioning(Window *w, NWidgetScrollbar *sb, int x, in } _left_button_clicked = false; } else { - Point pt = HandleScrollbarHittest(sb, mi, ma, sb->type == WWT_HSCROLLBAR); + Point pt = HandleScrollbarHittest(sb, mi, ma, sb->type == NWID_HSCROLLBAR); if (pos < pt.x) { sb->UpdatePosition(rtl ? sb->GetCapacity() : -sb->GetCapacity()); @@ -129,26 +129,12 @@ void ScrollbarClickHandler(Window *w, NWidgetCore *nw, int x, int y) { int mi, ma; - switch (nw->type) { - case WWT_SCROLLBAR: - /* vertical scroller */ - mi = nw->pos_y; - ma = nw->pos_y + nw->current_y; - break; - - case WWT_SCROLL2BAR: - /* 2nd vertical scroller */ - mi = nw->pos_y; - ma = nw->pos_y + nw->current_y; - break; - - case WWT_HSCROLLBAR: - /* horizontal scroller */ - mi = nw->pos_x; - ma = nw->pos_x + nw->current_x; - break; - - default: NOT_REACHED(); + if (nw->type == NWID_HSCROLLBAR) { + mi = nw->pos_x; + ma = nw->pos_x + nw->current_x; + } else { + mi = nw->pos_y; + ma = nw->pos_y + nw->current_y; } ScrollbarClickPositioning(w, dynamic_cast<NWidgetScrollbar*>(nw), x, y, mi, ma); } @@ -1650,21 +1636,20 @@ void Scrollbar::SetCapacityFromWidget(Window *w, int widget, int padding) * @param colour Colour of the scrollbar. * @param index Index in the widget array used by the window system. */ -NWidgetScrollbar::NWidgetScrollbar(WidgetType tp, Colours colour, int index) : NWidgetCore(tp, colour, 1, 1, 0x0, STR_NULL), Scrollbar(tp != WWT_HSCROLLBAR) +NWidgetScrollbar::NWidgetScrollbar(WidgetType tp, Colours colour, int index) : NWidgetCore(tp, colour, 1, 1, 0x0, STR_NULL), Scrollbar(tp != NWID_HSCROLLBAR) { - assert(tp == WWT_HSCROLLBAR || tp == WWT_SCROLLBAR || tp == WWT_SCROLL2BAR); + assert(tp == NWID_HSCROLLBAR || tp == NWID_VSCROLLBAR); this->SetIndex(index); switch (this->type) { - case WWT_HSCROLLBAR: + case NWID_HSCROLLBAR: this->SetMinimalSize(30, WD_HSCROLLBAR_HEIGHT); this->SetResize(1, 0); this->SetFill(1, 0); this->SetDataTip(0x0, STR_TOOLTIP_HSCROLL_BAR_SCROLLS_LIST); break; - case WWT_SCROLLBAR: - case WWT_SCROLL2BAR: + case NWID_VSCROLLBAR: this->SetMinimalSize(WD_VSCROLLBAR_WIDTH, 30); this->SetResize(0, 1); this->SetFill(0, 1); @@ -1702,7 +1687,7 @@ void NWidgetScrollbar::Draw(const Window *w) bool down_lowered = HasBit(this->disp_flags, NDB_SCROLLBAR_DOWN); bool middle_lowered = (w->scrolling_scrollbar == this->index); - if (this->type == WWT_HSCROLLBAR) { + if (this->type == NWID_HSCROLLBAR) { DrawHorizontalScrollbar(r, this->colour, up_lowered, middle_lowered, down_lowered, this); } else { DrawVerticalScrollbar(r, this->colour, up_lowered, middle_lowered, down_lowered, this); @@ -2258,9 +2243,8 @@ static int MakeNWidget(const NWidgetPart *parts, int count, NWidgetBase **dest, *biggest_index = max(*biggest_index, (int)parts->u.widget.index); break; - case WWT_HSCROLLBAR: - case WWT_SCROLLBAR: - case WWT_SCROLL2BAR: + case NWID_HSCROLLBAR: + case NWID_VSCROLLBAR: if (*dest != NULL) return num_used; *dest = new NWidgetScrollbar(parts->type, parts->u.widget.colour, parts->u.widget.index); *biggest_index = max(*biggest_index, (int)parts->u.widget.index); diff --git a/src/widget_type.h b/src/widget_type.h index 067e892e9..516f338ce 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -56,15 +56,12 @@ enum WidgetType { WWT_LABEL, ///< Centered label WWT_TEXT, ///< Pure simple text WWT_MATRIX, ///< Grid of rows and columns. @see MatrixWidgetValues - WWT_SCROLLBAR, ///< Vertical scrollbar WWT_FRAME, ///< Frame WWT_CAPTION, ///< Window caption (window title between closebox and stickybox) - WWT_HSCROLLBAR, ///< Horizontal scrollbar WWT_SHADEBOX, ///< Shade box (at top-right of a window, between caption and stickybox) WWT_STICKYBOX, ///< Sticky box (normally at top-right of a window) WWT_DEBUGBOX, ///< NewGRF debug box (between shade box and caption) - WWT_SCROLL2BAR, ///< 2nd vertical scrollbar WWT_RESIZEBOX, ///< Resize box (normally at bottom-right of a window) WWT_CLOSEBOX, ///< Close box (at top-left of a window) WWT_DROPDOWN, ///< Drop down list @@ -80,6 +77,8 @@ enum WidgetType { NWID_VIEWPORT, ///< Nested widget containing a viewport. NWID_BUTTON_DROPDOWN, ///< Button with a drop-down. NWID_BUTTON_ARROW, ///< Button with an arrow + NWID_HSCROLLBAR, ///< Horizontal scrollbar + NWID_VSCROLLBAR, ///< Vertical scrollbar /* Nested widget part types. */ WPT_RESIZE, ///< Widget part for specifying resizing. diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 5239928c2..b690b286f 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -76,7 +76,7 @@ enum DropdownMenuWidgets { static const NWidgetPart _nested_dropdown_menu_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_END, DDM_ITEMS), SetMinimalSize(1, 1), SetScrollbar(DDM_SCROLL), EndContainer(), - NWidget(WWT_SCROLLBAR, COLOUR_END, DDM_SCROLL), + NWidget(NWID_VSCROLLBAR, COLOUR_END, DDM_SCROLL), EndContainer(), }; diff --git a/src/window.cpp b/src/window.cpp index 5539dae04..c004a4b81 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -337,9 +337,8 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count) w->HandleButtonClick(widget_index); break; - case WWT_SCROLLBAR: - case WWT_SCROLL2BAR: - case WWT_HSCROLLBAR: + case NWID_VSCROLLBAR: + case NWID_HSCROLLBAR: ScrollbarClickHandler(w, nw, x, y); break; @@ -1382,7 +1381,7 @@ static void DecreaseWindowCounters() /* Unclick scrollbar buttons if they are pressed. */ for (uint i = 0; i < w->nested_array_size; i++) { NWidgetBase *nwid = w->nested_array[i]; - if (nwid != NULL && (nwid->type == WWT_HSCROLLBAR || nwid->type == WWT_SCROLLBAR || nwid->type == WWT_SCROLL2BAR)) { + if (nwid != NULL && (nwid->type == NWID_HSCROLLBAR || nwid->type == NWID_VSCROLLBAR)) { NWidgetScrollbar *sb = static_cast<NWidgetScrollbar*>(nwid); if (sb->disp_flags & (ND_SCROLLBAR_UP | ND_SCROLLBAR_DOWN)) { sb->disp_flags &= ~(ND_SCROLLBAR_UP | ND_SCROLLBAR_DOWN); @@ -1840,7 +1839,7 @@ static EventState HandleScrollbarScrolling() NWidgetScrollbar *sb = w->GetWidget<NWidgetScrollbar>(w->scrolling_scrollbar); bool rtl = false; - if (sb->type == WWT_HSCROLLBAR) { + if (sb->type == NWID_HSCROLLBAR) { i = _cursor.pos.x - _cursorpos_drag_start.x; rtl = _dynlang.text_dir == TD_RTL; } else { |