summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-16 18:27:50 +0000
committertruebrain <truebrain@openttd.org>2011-12-16 18:27:50 +0000
commite4887d4dc4300006304f9c3623dba8c2ee10d6f0 (patch)
treeccb513339dbe46683153d2ada96a2cd74dd8db63
parentbdb6280e799e2a511d8dc807fd6948f4b09de255 (diff)
downloadopenttd-e4887d4dc4300006304f9c3623dba8c2ee10d6f0.tar.xz
(svn r23551) -Codechange: document and rename widgets to be consistent and understandable
-rw-r--r--src/settings_gui.cpp330
-rw-r--r--src/signs_gui.cpp108
-rw-r--r--src/widgets/settings_widget.h82
-rw-r--r--src/widgets/sign_widget.h26
4 files changed, 273 insertions, 273 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 0b21f4aed..5afcd541f 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -150,7 +150,7 @@ struct GameOptionsWindow : Window {
{
DropDownList *list = NULL;
switch (widget) {
- case GOW_CURRENCY_DROPDOWN: { // Setup currencies dropdown
+ case WID_GO_CURRENCY_DROPDOWN: { // Setup currencies dropdown
list = new DropDownList();
*selected_index = this->opt->locale.currency;
StringID *items = BuildCurrencyDropdown();
@@ -175,7 +175,7 @@ struct GameOptionsWindow : Window {
break;
}
- case GOW_DISTANCE_DROPDOWN: { // Setup distance unit dropdown
+ case WID_GO_DISTANCE_DROPDOWN: { // Setup distance unit dropdown
list = new DropDownList();
*selected_index = this->opt->locale.units;
const StringID *items = _units_dropdown;
@@ -185,7 +185,7 @@ struct GameOptionsWindow : Window {
break;
}
- case GOW_ROADSIDE_DROPDOWN: { // Setup road-side dropdown
+ case WID_GO_ROADSIDE_DROPDOWN: { // Setup road-side dropdown
list = new DropDownList();
*selected_index = this->opt->vehicle.road_side;
const StringID *items = _driveside_dropdown;
@@ -204,7 +204,7 @@ struct GameOptionsWindow : Window {
break;
}
- case GOW_TOWNNAME_DROPDOWN: { // Setup townname dropdown
+ case WID_GO_TOWNNAME_DROPDOWN: { // Setup townname dropdown
list = new DropDownList();
*selected_index = this->opt->game_creation.town_name;
@@ -232,7 +232,7 @@ struct GameOptionsWindow : Window {
break;
}
- case GOW_AUTOSAVE_DROPDOWN: { // Setup autosave dropdown
+ case WID_GO_AUTOSAVE_DROPDOWN: { // Setup autosave dropdown
list = new DropDownList();
*selected_index = _settings_client.gui.autosave;
const StringID *items = _autosave_dropdown;
@@ -242,7 +242,7 @@ struct GameOptionsWindow : Window {
break;
}
- case GOW_LANG_DROPDOWN: { // Setup interface language dropdown
+ case WID_GO_LANG_DROPDOWN: { // Setup interface language dropdown
list = new DropDownList();
for (uint i = 0; i < _languages.Length(); i++) {
if (&_languages[i] == _current_language) *selected_index = i;
@@ -252,7 +252,7 @@ struct GameOptionsWindow : Window {
break;
}
- case GOW_RESOLUTION_DROPDOWN: // Setup resolution dropdown
+ case WID_GO_RESOLUTION_DROPDOWN: // Setup resolution dropdown
list = new DropDownList();
*selected_index = GetCurRes();
for (int i = 0; i < _num_resolutions; i++) {
@@ -260,7 +260,7 @@ struct GameOptionsWindow : Window {
}
break;
- case GOW_SCREENSHOT_DROPDOWN: // Setup screenshot format dropdown
+ case WID_GO_SCREENSHOT_DROPDOWN: // Setup screenshot format dropdown
list = new DropDownList();
*selected_index = _cur_screenshot_format;
for (uint i = 0; i < _num_screenshot_formats; i++) {
@@ -268,15 +268,15 @@ struct GameOptionsWindow : Window {
}
break;
- case GOW_BASE_GRF_DROPDOWN:
+ case WID_GO_BASE_GRF_DROPDOWN:
list = BuiltSetDropDownList<BaseGraphics>(selected_index);
break;
- case GOW_BASE_SFX_DROPDOWN:
+ case WID_GO_BASE_SFX_DROPDOWN:
list = BuiltSetDropDownList<BaseSounds>(selected_index);
break;
- case GOW_BASE_MUSIC_DROPDOWN:
+ case WID_GO_BASE_MUSIC_DROPDOWN:
list = BuiltSetDropDownList<BaseMusic>(selected_index);
break;
@@ -290,36 +290,36 @@ struct GameOptionsWindow : Window {
virtual void SetStringParameters(int widget) const
{
switch (widget) {
- case GOW_CURRENCY_DROPDOWN: SetDParam(0, _currency_specs[this->opt->locale.currency].name); break;
- case GOW_DISTANCE_DROPDOWN: SetDParam(0, STR_GAME_OPTIONS_MEASURING_UNITS_IMPERIAL + this->opt->locale.units); break;
- case GOW_ROADSIDE_DROPDOWN: SetDParam(0, STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT + this->opt->vehicle.road_side); break;
- case GOW_TOWNNAME_DROPDOWN: SetDParam(0, TownName(this->opt->game_creation.town_name)); break;
- case GOW_AUTOSAVE_DROPDOWN: SetDParam(0, _autosave_dropdown[_settings_client.gui.autosave]); break;
- case GOW_LANG_DROPDOWN: SetDParamStr(0, _current_language->own_name); break;
- case GOW_RESOLUTION_DROPDOWN: SetDParam(0, GetCurRes() == _num_resolutions ? STR_GAME_OPTIONS_RESOLUTION_OTHER : SPECSTR_RESOLUTION_START + GetCurRes()); break;
- case GOW_SCREENSHOT_DROPDOWN: SetDParam(0, SPECSTR_SCREENSHOT_START + _cur_screenshot_format); break;
- case GOW_BASE_GRF_DROPDOWN: SetDParamStr(0, BaseGraphics::GetUsedSet()->name); break;
- case GOW_BASE_GRF_STATUS: SetDParam(0, BaseGraphics::GetUsedSet()->GetNumInvalid()); break;
- case GOW_BASE_SFX_DROPDOWN: SetDParamStr(0, BaseSounds::GetUsedSet()->name); break;
- case GOW_BASE_MUSIC_DROPDOWN: SetDParamStr(0, BaseMusic::GetUsedSet()->name); break;
- case GOW_BASE_MUSIC_STATUS: SetDParam(0, BaseMusic::GetUsedSet()->GetNumInvalid()); break;
+ case WID_GO_CURRENCY_DROPDOWN: SetDParam(0, _currency_specs[this->opt->locale.currency].name); break;
+ case WID_GO_DISTANCE_DROPDOWN: SetDParam(0, STR_GAME_OPTIONS_MEASURING_UNITS_IMPERIAL + this->opt->locale.units); break;
+ case WID_GO_ROADSIDE_DROPDOWN: SetDParam(0, STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT + this->opt->vehicle.road_side); break;
+ case WID_GO_TOWNNAME_DROPDOWN: SetDParam(0, TownName(this->opt->game_creation.town_name)); break;
+ case WID_GO_AUTOSAVE_DROPDOWN: SetDParam(0, _autosave_dropdown[_settings_client.gui.autosave]); break;
+ case WID_GO_LANG_DROPDOWN: SetDParamStr(0, _current_language->own_name); break;
+ case WID_GO_RESOLUTION_DROPDOWN: SetDParam(0, GetCurRes() == _num_resolutions ? STR_GAME_OPTIONS_RESOLUTION_OTHER : SPECSTR_RESOLUTION_START + GetCurRes()); break;
+ case WID_GO_SCREENSHOT_DROPDOWN: SetDParam(0, SPECSTR_SCREENSHOT_START + _cur_screenshot_format); break;
+ case WID_GO_BASE_GRF_DROPDOWN: SetDParamStr(0, BaseGraphics::GetUsedSet()->name); break;
+ case WID_GO_BASE_GRF_STATUS: SetDParam(0, BaseGraphics::GetUsedSet()->GetNumInvalid()); break;
+ case WID_GO_BASE_SFX_DROPDOWN: SetDParamStr(0, BaseSounds::GetUsedSet()->name); break;
+ case WID_GO_BASE_MUSIC_DROPDOWN: SetDParamStr(0, BaseMusic::GetUsedSet()->name); break;
+ case WID_GO_BASE_MUSIC_STATUS: SetDParam(0, BaseMusic::GetUsedSet()->GetNumInvalid()); break;
}
}
virtual void DrawWidget(const Rect &r, int widget) const
{
switch (widget) {
- case GOW_BASE_GRF_DESCRIPTION:
+ case WID_GO_BASE_GRF_DESCRIPTION:
SetDParamStr(0, BaseGraphics::GetUsedSet()->GetDescription(GetCurrentLanguageIsoCode()));
DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_BLACK_RAW_STRING);
break;
- case GOW_BASE_SFX_DESCRIPTION:
+ case WID_GO_BASE_SFX_DESCRIPTION:
SetDParamStr(0, BaseSounds::GetUsedSet()->GetDescription(GetCurrentLanguageIsoCode()));
DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_BLACK_RAW_STRING);
break;
- case GOW_BASE_MUSIC_DESCRIPTION:
+ case WID_GO_BASE_MUSIC_DESCRIPTION:
SetDParamStr(0, BaseMusic::GetUsedSet()->GetDescription(GetCurrentLanguageIsoCode()));
DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_BLACK_RAW_STRING);
break;
@@ -329,7 +329,7 @@ struct GameOptionsWindow : Window {
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
{
switch (widget) {
- case GOW_BASE_GRF_DESCRIPTION:
+ case WID_GO_BASE_GRF_DESCRIPTION:
/* Find the biggest description for the default size. */
for (int i = 0; i < BaseGraphics::GetNumSets(); i++) {
SetDParamStr(0, BaseGraphics::GetSet(i)->GetDescription(GetCurrentLanguageIsoCode()));
@@ -337,7 +337,7 @@ struct GameOptionsWindow : Window {
}
break;
- case GOW_BASE_GRF_STATUS:
+ case WID_GO_BASE_GRF_STATUS:
/* Find the biggest description for the default size. */
for (int i = 0; i < BaseGraphics::GetNumSets(); i++) {
uint invalid_files = BaseGraphics::GetSet(i)->GetNumInvalid();
@@ -348,7 +348,7 @@ struct GameOptionsWindow : Window {
}
break;
- case GOW_BASE_SFX_DESCRIPTION:
+ case WID_GO_BASE_SFX_DESCRIPTION:
/* Find the biggest description for the default size. */
for (int i = 0; i < BaseSounds::GetNumSets(); i++) {
SetDParamStr(0, BaseSounds::GetSet(i)->GetDescription(GetCurrentLanguageIsoCode()));
@@ -356,7 +356,7 @@ struct GameOptionsWindow : Window {
}
break;
- case GOW_BASE_MUSIC_DESCRIPTION:
+ case WID_GO_BASE_MUSIC_DESCRIPTION:
/* Find the biggest description for the default size. */
for (int i = 0; i < BaseMusic::GetNumSets(); i++) {
SetDParamStr(0, BaseMusic::GetSet(i)->GetDescription(GetCurrentLanguageIsoCode()));
@@ -364,7 +364,7 @@ struct GameOptionsWindow : Window {
}
break;
- case GOW_BASE_MUSIC_STATUS:
+ case WID_GO_BASE_MUSIC_STATUS:
/* Find the biggest description for the default size. */
for (int i = 0; i < BaseMusic::GetNumSets(); i++) {
uint invalid_files = BaseMusic::GetSet(i)->GetNumInvalid();
@@ -398,12 +398,12 @@ struct GameOptionsWindow : Window {
virtual void OnClick(Point pt, int widget, int click_count)
{
switch (widget) {
- case GOW_FULLSCREEN_BUTTON: // Click fullscreen on/off
+ case WID_GO_FULLSCREEN_BUTTON: // Click fullscreen on/off
/* try to toggle full-screen on/off */
if (!ToggleFullScreen(!_fullscreen)) {
ShowErrorMessage(STR_ERROR_FULLSCREEN_FAILED, INVALID_STRING_ID, WL_ERROR);
}
- this->SetWidgetLoweredState(GOW_FULLSCREEN_BUTTON, _fullscreen);
+ this->SetWidgetLoweredState(WID_GO_FULLSCREEN_BUTTON, _fullscreen);
this->SetDirty();
break;
@@ -441,18 +441,18 @@ struct GameOptionsWindow : Window {
virtual void OnDropdownSelect(int widget, int index)
{
switch (widget) {
- case GOW_CURRENCY_DROPDOWN: // Currency
+ case WID_GO_CURRENCY_DROPDOWN: // Currency
if (index == CUSTOM_CURRENCY_ID) ShowCustCurrency();
this->opt->locale.currency = index;
ReInitAllWindows();
break;
- case GOW_DISTANCE_DROPDOWN: // Measuring units
+ case WID_GO_DISTANCE_DROPDOWN: // Measuring units
this->opt->locale.units = index;
MarkWholeScreenDirty();
break;
- case GOW_ROADSIDE_DROPDOWN: // Road side
+ case WID_GO_ROADSIDE_DROPDOWN: // Road side
if (this->opt->vehicle.road_side != index) { // only change if setting changed
uint i;
if (GetSettingFromName("vehicle.road_side", &i) == NULL) NOT_REACHED();
@@ -461,19 +461,19 @@ struct GameOptionsWindow : Window {
}
break;
- case GOW_TOWNNAME_DROPDOWN: // Town names
+ case WID_GO_TOWNNAME_DROPDOWN: // Town names
if (_game_mode == GM_MENU || Town::GetNumItems() == 0) {
this->opt->game_creation.town_name = index;
SetWindowDirty(WC_GAME_OPTIONS, 0);
}
break;
- case GOW_AUTOSAVE_DROPDOWN: // Autosave options
+ case WID_GO_AUTOSAVE_DROPDOWN: // Autosave options
_settings_client.gui.autosave = index;
this->SetDirty();
break;
- case GOW_LANG_DROPDOWN: // Change interface language
+ case WID_GO_LANG_DROPDOWN: // Change interface language
ReadLanguagePack(&_languages[index]);
DeleteWindowByClass(WC_QUERY_STRING);
CheckForMissingGlyphs();
@@ -481,26 +481,26 @@ struct GameOptionsWindow : Window {
ReInitAllWindows();
break;
- case GOW_RESOLUTION_DROPDOWN: // Change resolution
+ case WID_GO_RESOLUTION_DROPDOWN: // Change resolution
if (index < _num_resolutions && ChangeResInGame(_resolutions[index].width, _resolutions[index].height)) {
this->SetDirty();
}
break;
- case GOW_SCREENSHOT_DROPDOWN: // Change screenshot format
+ case WID_GO_SCREENSHOT_DROPDOWN: // Change screenshot format
SetScreenshotFormat(index);
this->SetDirty();
break;
- case GOW_BASE_GRF_DROPDOWN:
+ case WID_GO_BASE_GRF_DROPDOWN:
this->SetMediaSet<BaseGraphics>(index);
break;
- case GOW_BASE_SFX_DROPDOWN:
+ case WID_GO_BASE_SFX_DROPDOWN:
this->SetMediaSet<BaseSounds>(index);
break;
- case GOW_BASE_MUSIC_DROPDOWN:
+ case WID_GO_BASE_MUSIC_DROPDOWN:
this->SetMediaSet<BaseMusic>(index);
break;
}
@@ -514,13 +514,13 @@ struct GameOptionsWindow : Window {
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
{
if (!gui_scope) return;
- this->SetWidgetLoweredState(GOW_FULLSCREEN_BUTTON, _fullscreen);
+ this->SetWidgetLoweredState(WID_GO_FULLSCREEN_BUTTON, _fullscreen);
bool missing_files = BaseGraphics::GetUsedSet()->GetNumMissing() == 0;
- this->GetWidget<NWidgetCore>(GOW_BASE_GRF_STATUS)->SetDataTip(missing_files ? STR_EMPTY : STR_GAME_OPTIONS_BASE_GRF_STATUS, STR_NULL);
+ this->GetWidget<NWidgetCore>(WID_GO_BASE_GRF_STATUS)->SetDataTip(missing_files ? STR_EMPTY : STR_GAME_OPTIONS_BASE_GRF_STATUS, STR_NULL);
missing_files = BaseMusic::GetUsedSet()->GetNumInvalid() == 0;
- this->GetWidget<NWidgetCore>(GOW_BASE_MUSIC_STATUS)->SetDataTip(missing_files ? STR_EMPTY : STR_GAME_OPTIONS_BASE_MUSIC_STATUS, STR_NULL);
+ this->GetWidget<NWidgetCore>(WID_GO_BASE_MUSIC_STATUS)->SetDataTip(missing_files ? STR_EMPTY : STR_GAME_OPTIONS_BASE_MUSIC_STATUS, STR_NULL);
}
};
@@ -529,39 +529,39 @@ static const NWidgetPart _nested_game_options_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
EndContainer(),
- NWidget(WWT_PANEL, COLOUR_GREY, GOW_BACKGROUND), SetPIP(6, 6, 10),
+ NWidget(WWT_PANEL, COLOUR_GREY, WID_GO_BACKGROUND), SetPIP(6, 6, 10),
NWidget(NWID_HORIZONTAL), SetPIP(10, 10, 10),
NWidget(NWID_VERTICAL), SetPIP(0, 6, 0),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME, STR_NULL),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_CURRENCY_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_CURRENCY_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME, STR_NULL),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_ROADSIDE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_ROADSIDE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_AUTOSAVE_FRAME, STR_NULL),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_AUTOSAVE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_AUTOSAVE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_RESOLUTION, STR_NULL),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_RESOLUTION_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_RESOLUTION_TOOLTIP), SetFill(1, 0), SetPadding(0, 0, 3, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_RESOLUTION_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_RESOLUTION_TOOLTIP), SetFill(1, 0), SetPadding(0, 0, 3, 0),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_GAME_OPTIONS_FULLSCREEN, STR_NULL),
- NWidget(WWT_TEXTBTN, COLOUR_GREY, GOW_FULLSCREEN_BUTTON), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP),
+ NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_FULLSCREEN_BUTTON), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP),
EndContainer(),
EndContainer(),
EndContainer(),
NWidget(NWID_VERTICAL), SetPIP(0, 6, 0),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_MEASURING_UNITS_FRAME, STR_NULL),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_DISTANCE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_MEASURING_UNITS_DROPDOWN_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_DISTANCE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_MEASURING_UNITS_DROPDOWN_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_TOWN_NAMES_FRAME, STR_NULL),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_TOWNNAME_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_TOWNNAME_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_LANGUAGE, STR_NULL),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_LANG_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_LANGUAGE_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_LANG_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_LANGUAGE_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_SCREENSHOT_FORMAT, STR_NULL),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_SCREENSHOT_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_SCREENSHOT_FORMAT_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_SCREENSHOT_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_SCREENSHOT_FORMAT_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 0), SetFill(0, 1),
EndContainer(),
@@ -569,26 +569,26 @@ static const NWidgetPart _nested_game_options_widgets[] = {
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_BASE_GRF, STR_NULL), SetPadding(0, 10, 0, 10),
NWidget(NWID_HORIZONTAL), SetPIP(0, 30, 0),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_BASE_GRF_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_BASE_GRF_TOOLTIP),
- NWidget(WWT_TEXT, COLOUR_GREY, GOW_BASE_GRF_STATUS), SetMinimalSize(150, 12), SetDataTip(STR_EMPTY, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_BASE_GRF_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_BASE_GRF_TOOLTIP),
+ NWidget(WWT_TEXT, COLOUR_GREY, WID_GO_BASE_GRF_STATUS), SetMinimalSize(150, 12), SetDataTip(STR_EMPTY, STR_NULL), SetFill(1, 0),
EndContainer(),
- NWidget(WWT_TEXT, COLOUR_GREY, GOW_BASE_GRF_DESCRIPTION), SetMinimalSize(330, 0), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_BASE_GRF_DESCRIPTION_TOOLTIP), SetFill(1, 0), SetPadding(6, 0, 0, 0),
+ NWidget(WWT_TEXT, COLOUR_GREY, WID_GO_BASE_GRF_DESCRIPTION), SetMinimalSize(330, 0), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_BASE_GRF_DESCRIPTION_TOOLTIP), SetFill(1, 0), SetPadding(6, 0, 0, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_BASE_SFX, STR_NULL), SetPadding(0, 10, 0, 10),
NWidget(NWID_HORIZONTAL), SetPIP(0, 30, 0),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_BASE_SFX_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_BASE_SFX_TOOLTIP),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_BASE_SFX_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_BASE_SFX_TOOLTIP),
NWidget(NWID_SPACER), SetFill(1, 0),
EndContainer(),
- NWidget(WWT_TEXT, COLOUR_GREY, GOW_BASE_SFX_DESCRIPTION), SetMinimalSize(330, 0), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_BASE_SFX_DESCRIPTION_TOOLTIP), SetFill(1, 0), SetPadding(6, 0, 0, 0),
+ NWidget(WWT_TEXT, COLOUR_GREY, WID_GO_BASE_SFX_DESCRIPTION), SetMinimalSize(330, 0), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_BASE_SFX_DESCRIPTION_TOOLTIP), SetFill(1, 0), SetPadding(6, 0, 0, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_BASE_MUSIC, STR_NULL), SetPadding(0, 10, 0, 10),
NWidget(NWID_HORIZONTAL), SetPIP(0, 30, 0),
- NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_BASE_MUSIC_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_BASE_MUSIC_TOOLTIP),
- NWidget(WWT_TEXT, COLOUR_GREY, GOW_BASE_MUSIC_STATUS), SetMinimalSize(150, 12), SetDataTip(STR_EMPTY, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_BASE_MUSIC_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_BASE_MUSIC_TOOLTIP),
+ NWidget(WWT_TEXT, COLOUR_GREY, WID_GO_BASE_MUSIC_STATUS), SetMinimalSize(150, 12), SetDataTip(STR_EMPTY, STR_NULL), SetFill(1, 0),
EndContainer(),
- NWidget(WWT_TEXT, COLOUR_GREY, GOW_BASE_MUSIC_DESCRIPTION), SetMinimalSize(330, 0), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_BASE_MUSIC_DESCRIPTION_TOOLTIP), SetFill(1, 0), SetPadding(6, 0, 0, 0),
+ NWidget(WWT_TEXT, COLOUR_GREY, WID_GO_BASE_MUSIC_DESCRIPTION), SetMinimalSize(330, 0), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_BASE_MUSIC_DESCRIPTION_TOOLTIP), SetFill(1, 0), SetPadding(6, 0, 0, 0),
EndContainer(),
EndContainer(),
};
@@ -629,13 +629,13 @@ public:
/* Setup disabled buttons when creating window
* disable all other difficulty buttons during gameplay except for 'custom' */
this->SetWidgetsDisabledState(_game_mode != GM_MENU,
- GDW_LVL_EASY,
- GDW_LVL_MEDIUM,
- GDW_LVL_HARD,
- GDW_LVL_CUSTOM,
+ WID_GD_LVL_EASY,
+ WID_GD_LVL_MEDIUM,
+ WID_GD_LVL_HARD,
+ WID_GD_LVL_CUSTOM,
WIDGET_LIST_END);
- this->SetWidgetDisabledState(GDW_HIGHSCORE, _game_mode == GM_EDITOR || _networking); // highscore chart in multiplayer
- this->SetWidgetDisabledState(GDW_ACCEPT, _networking && !_network_server); // Save-button in multiplayer (and if client)
+ this->SetWidgetDisabledState(WID_GD_HIGHSCORE, _game_mode == GM_EDITOR || _networking); // highscore chart in multiplayer
+ this->SetWidgetDisabledState(WID_GD_ACCEPT, _networking && !_network_server); // Save-button in multiplayer (and if client)
/* Read data */
this->OnInvalidateData(GOID_DIFFICULTY_CHANGED);
@@ -643,7 +643,7 @@ public:
virtual void SetStringParameters(int widget) const
{
- widget -= GDW_OPTIONS_START;
+ widget -= WID_GD_OPTIONS_START;
if (widget < 0 || (widget % 3) != 2) return;
widget /= 3;
@@ -657,7 +657,7 @@ public:
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
{
/* Only for the 'descriptions' */
- int index = widget - GDW_OPTIONS_START;
+ int index = widget - WID_GD_OPTIONS_START;
if (index < 0 || (index % 3) != 2) return;
index /= 3;
@@ -676,8 +676,8 @@ public:
virtual void OnClick(Point pt, int widget, int click_count)
{
- if (widget >= GDW_OPTIONS_START) {
- widget -= GDW_OPTIONS_START;
+ if (widget >= WID_GD_OPTIONS_START) {
+ widget -= WID_GD_OPTIONS_START;
if ((widget % 3) == 2) return;
/* Don't allow clients to make any changes */
@@ -699,9 +699,9 @@ public:
/* save value in temporary variable */
WriteValue(GetVariableAddress(&this->opt_mod_temp, &sd->save), sd->save.conv, val);
- this->RaiseWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
+ this->RaiseWidget(WID_GD_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
SetDifficultyLevel(3, &this->opt_mod_temp.difficulty); // set difficulty level to custom
- this->LowerWidget(GDW_LVL_CUSTOM);
+ this->LowerWidget(WID_GD_LVL_CUSTOM);
this->InvalidateData();
if (widget / 3 == 0 &&
@@ -713,22 +713,22 @@ public:
}
switch (widget) {
- case GDW_LVL_EASY:
- case GDW_LVL_MEDIUM:
- case GDW_LVL_HARD:
- case GDW_LVL_CUSTOM:
+ case WID_GD_LVL_EASY:
+ case WID_GD_LVL_MEDIUM:
+ case WID_GD_LVL_HARD:
+ case WID_GD_LVL_CUSTOM:
/* temporarily change difficulty level */
- this->RaiseWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
- SetDifficultyLevel(widget - GDW_LVL_EASY, &this->opt_mod_temp.difficulty);
- this->LowerWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
+ this->RaiseWidget(WID_GD_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
+ SetDifficultyLevel(widget - WID_GD_LVL_EASY, &this->opt_mod_temp.difficulty);
+ this->LowerWidget(WID_GD_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
this->InvalidateData();
break;
- case GDW_HIGHSCORE: // Highscore Table
+ case WID_GD_HIGHSCORE: // Highscore Table
ShowHighscoreTable(this->opt_mod_temp.difficulty.diff_level, -1);
break;
- case GDW_ACCEPT: { // Save button - save changes
+ case WID_GD_ACCEPT: { // Save button - save changes
GameSettings *opt_ptr = &GetGameSettings();
uint i;
@@ -752,7 +752,7 @@ public:
break;
}
- case GDW_CANCEL: // Cancel button - close window, abandon changes
+ case WID_GD_CANCEL: // Cancel button - close window, abandon changes
delete this;
break;
}
@@ -774,7 +774,7 @@ public:
* change that when setting stuff, copy back on clicking 'OK' */
this->opt_mod_temp = GetGameSettings();
- this->LowerWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
+ this->LowerWidget(WID_GD_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
}
uint i;
@@ -788,8 +788,8 @@ public:
(_game_mode == GM_NORMAL ||
(_game_mode == GM_EDITOR && (sd->desc.flags & SGF_SCENEDIT_TOO) == 0));
- this->SetWidgetDisabledState(GDW_OPTIONS_START + i * 3 + 0, disable || sdb->min == value);
- this->SetWidgetDisabledState(GDW_OPTIONS_START + i * 3 + 1, disable || sdb->max == (uint32)value);
+ this->SetWidgetDisabledState(WID_GD_OPTIONS_START + i * 3 + 0, disable || sdb->min == value);
+ this->SetWidgetDisabledState(WID_GD_OPTIONS_START + i * 3 + 1, disable || sdb->max == (uint32)value);
}
}
};
@@ -798,7 +798,7 @@ static NWidgetBase *MakeDifficultyOptionsWidgets(int *biggest_index)
{
NWidgetVertical *vert_desc = new NWidgetVertical;
- int widnum = GDW_OPTIONS_START;
+ int widnum = WID_GD_OPTIONS_START;
uint i, j;
const SettingDesc *sd = GetSettingFromName("difficulty.max_no_competitors", &i);
@@ -839,13 +839,13 @@ static const NWidgetPart _nested_game_difficulty_widgets[] = {
NWidget(WWT_PANEL, COLOUR_MAUVE),
NWidget(NWID_VERTICAL), SetPIP(2, 0, 2),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(10, 0, 10),
- NWidget(WWT_TEXTBTN, COLOUR_YELLOW, GDW_LVL_EASY), SetDataTip(STR_DIFFICULTY_LEVEL_EASY, STR_NULL), SetFill(1, 0),
- NWidget(WWT_TEXTBTN, COLOUR_YELLOW, GDW_LVL_MEDIUM), SetDataTip(STR_DIFFICULTY_LEVEL_MEDIUM, STR_NULL), SetFill(1, 0),
- NWidget(WWT_TEXTBTN, COLOUR_YELLOW, GDW_LVL_HARD), SetDataTip(STR_DIFFICULTY_LEVEL_HARD, STR_NULL), SetFill(1, 0),
- NWidget(WWT_TEXTBTN, COLOUR_YELLOW, GDW_LVL_CUSTOM), SetDataTip(STR_DIFFICULTY_LEVEL_CUSTOM, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GD_LVL_EASY), SetDataTip(STR_DIFFICULTY_LEVEL_EASY, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GD_LVL_MEDIUM), SetDataTip(STR_DIFFICULTY_LEVEL_MEDIUM, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GD_LVL_HARD), SetDataTip(STR_DIFFICULTY_LEVEL_HARD, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_TEXTBTN, COLOUR_YELLOW, WID_GD_LVL_CUSTOM), SetDataTip(STR_DIFFICULTY_LEVEL_CUSTOM, STR_NULL), SetFill(1, 0),
EndContainer(),
NWidget(NWID_HORIZONTAL), SetPIP(10, 0, 10),
- NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, GDW_HIGHSCORE), SetDataTip(STR_DIFFICULTY_LEVEL_HIGH_SCORE_BUTTON, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_GD_HIGHSCORE), SetDataTip(STR_DIFFICULTY_LEVEL_HIGH_SCORE_BUTTON, STR_NULL), SetFill(1, 0),
EndContainer(),
EndContainer(),
EndContainer(),
@@ -860,8 +860,8 @@ static const NWidgetPart _nested_game_difficulty_widgets[] = {
NWidget(NWID_VERTICAL), SetPIP(2, 0, 2),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(10, 0, 10),
NWidget(NWID_SPACER), SetFill(1, 0),
- NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, GDW_ACCEPT), SetDataTip(STR_DIFFICULTY_LEVEL_SAVE, STR_NULL), SetFill(1, 0),
- NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, GDW_CANCEL), SetDataTip(STR_BUTTON_CANCEL, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_GD_ACCEPT), SetDataTip(STR_DIFFICULTY_LEVEL_SAVE, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_GD_CANCEL), SetDataTip(STR_BUTTON_CANCEL, STR_NULL), SetFill(1, 0),
NWidget(NWID_SPACER), SetFill(1, 0),
EndContainer(),
EndContainer(),
@@ -1593,7 +1593,7 @@ struct GameSettingsWindow : Window {
this->clicked_entry = NULL; // No numeric setting buttons are depressed
this->CreateNestedTree(desc);
- this->vscroll = this->GetScrollbar(SETTINGSEL_SCROLLBAR);
+ this->vscroll = this->GetScrollbar(WID_GS_SCROLLBAR);
this->FinishInitNested(desc, 0);
this->vscroll->SetCount(_settings_main_page.Length());
@@ -1601,7 +1601,7 @@ struct GameSettingsWindow : Window {
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
{
- if (widget != SETTINGSEL_OPTIONSPANEL) return;
+ if (widget != WID_GS_OPTIONSPANEL) return;
resize->height = SETTING_HEIGHT = max(11, FONT_HEIGHT_NORMAL + 1);
resize->width = 1;
@@ -1611,7 +1611,7 @@ struct GameSettingsWindow : Window {
virtual void DrawWidget(const Rect &r, int widget) const
{
- if (widget != SETTINGSEL_OPTIONSPANEL) return;
+ if (widget != WID_GS_OPTIONSPANEL) return;
_settings_main_page.Draw(settings_ptr, r.left + SETTINGTREE_LEFT_OFFSET, r.right - SETTINGTREE_RIGHT_OFFSET, r.top + SETTINGTREE_TOP_OFFSET,
this->vscroll->GetPosition(), this->vscroll->GetPosition() + this->vscroll->GetCapacity());
@@ -1619,9 +1619,9 @@ struct GameSettingsWindow : Window {
virtual void OnClick(Point pt, int widget, int click_count)
{
- if (widget != SETTINGSEL_OPTIONSPANEL) return;
+ if (widget != WID_GS_OPTIONSPANEL) return;
- uint btn = this->vscroll->GetScrolledRowFromWidget(pt.y, this, SETTINGSEL_OPTIONSPANEL, SETTINGTREE_TOP_OFFSET - 1);
+ uint btn = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GS_OPTIONSPANEL, SETTINGTREE_TOP_OFFSET - 1);
if (btn == INT_MAX) return;
uint cur_row = 0;
@@ -1763,7 +1763,7 @@ struct GameSettingsWindow : Window {
virtual void OnResize()
{
- this->vscroll->SetCapacityFromWidget(this, SETTINGSEL_OPTIONSPANEL, SETTINGTREE_TOP_OFFSET + SETTINGTREE_BOTTOM_OFFSET);
+ this->vscroll->SetCapacityFromWidget(this, WID_GS_OPTIONSPANEL, SETTINGTREE_TOP_OFFSET + SETTINGTREE_BOTTOM_OFFSET);
}
};
@@ -1775,9 +1775,9 @@ static const NWidgetPart _nested_settings_selection_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_MAUVE), SetDataTip(STR_CONFIG_SETTING_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
EndContainer(),
NWidget(NWID_HORIZONTAL),
- NWidget(WWT_PANEL, COLOUR_MAUVE, SETTINGSEL_OPTIONSPANEL), SetMinimalSize(400, 174), SetScrollbar(SETTINGSEL_SCROLLBAR), EndContainer(),
+ NWidget(WWT_PANEL, COLOUR_MAUVE, WID_GS_OPTIONSPANEL), SetMinimalSize(400, 174), SetScrollbar(WID_GS_SCROLLBAR), EndContainer(),
NWidget(NWID_VERTICAL),
- NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, SETTINGSEL_SCROLLBAR),
+ NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, WID_GS_SCROLLBAR),
NWidget(WWT_RESIZEBOX, COLOUR_MAUVE),
EndContainer(),
EndContainer(),
@@ -1838,25 +1838,25 @@ struct CustomCurrencyWindow : Window {
void SetButtonState()
{
- this->SetWidgetDisabledState(CUSTCURR_RATE_DOWN, _custom_currency.rate == 1);
- this->SetWidgetDisabledState(CUSTCURR_RATE_UP, _custom_currency.rate == UINT16_MAX);
- this->SetWidgetDisabledState(CUSTCURR_YEAR_DOWN, _custom_currency.to_euro == CF_NOEURO);
- this->SetWidgetDisabledState(CUSTCURR_YEAR_UP, _custom_currency.to_euro == MAX_YEAR);
+ this->SetWidgetDisabledState(WID_CC_RATE_DOWN, _custom_currency.rate == 1);
+ this->SetWidgetDisabledState(WID_CC_RATE_UP, _custom_currency.rate == UINT16_MAX);
+ this->SetWidgetDisabledState(WID_CC_YEAR_DOWN, _custom_currency.to_euro == CF_NOEURO);
+ this->SetWidgetDisabledState(WID_CC_YEAR_UP, _custom_currency.to_euro == MAX_YEAR);
}
virtual void SetStringParameters(int widget) const
{
switch (widget) {
- case CUSTCURR_RATE: SetDParam(0, 1); SetDParam(1, 1); break;
- case CUSTCURR_SEPARATOR: SetDParamStr(0, _custom_currency.separator); break;
- case CUSTCURR_PREFIX: SetDParamStr(0, _custom_currency.prefix); break;
- case CUSTCURR_SUFFIX: SetDParamStr(0, _custom_currency.suffix); break;
- case CUSTCURR_YEAR:
+ case WID_CC_RATE: SetDParam(0, 1); SetDParam(1, 1); break;
+ case WID_CC_SEPARATOR: SetDParamStr(0, _custom_currency.separator); break;
+ case WID_CC_PREFIX: SetDParamStr(0, _custom_currency.prefix); break;
+ case WID_CC_SUFFIX: SetDParamStr(0, _custom_currency.suffix); break;
+ case WID_CC_YEAR:
SetDParam(0, (_custom_currency.to_euro != CF_NOEURO) ? STR_CURRENCY_SWITCH_TO_EURO : STR_CURRENCY_SWITCH_TO_EURO_NEVER);
SetDParam(1, _custom_currency.to_euro);
break;
- case CUSTCURR_PREVIEW:
+ case WID_CC_PREVIEW:
SetDParam(0, 10000);
break;
}
@@ -1866,14 +1866,14 @@ struct CustomCurrencyWindow : Window {
{
switch (widget) {
/* Set the appropriate width for the edit 'buttons' */
- case CUSTCURR_SEPARATOR_EDIT:
- case CUSTCURR_PREFIX_EDIT:
- case CUSTCURR_SUFFIX_EDIT:
- size->width = this->GetWidget<NWidgetBase>(CUSTCURR_RATE_DOWN)->smallest_x + this->GetWidget<NWidgetBase>(CUSTCURR_RATE_UP)->smallest_x;
+ case WID_CC_SEPARATOR_EDIT:
+ case WID_CC_PREFIX_EDIT:
+ case WID_CC_SUFFIX_EDIT:
+ size->width = this->GetWidget<NWidgetBase>(WID_CC_RATE_DOWN)->smallest_x + this->GetWidget<NWidgetBase>(WID_CC_RATE_UP)->smallest_x;
break;
/* Make sure the window is wide enough for the widest exchange rate */
- case CUSTCURR_RATE:
+ case WID_CC_RATE:
SetDParam(0, 1);
SetDParam(1, INT32_MAX);
*size = GetStringBoundingBox(STR_CURRENCY_EXCHANGE_RATE);
@@ -1889,67 +1889,67 @@ struct CustomCurrencyWindow : Window {
CharSetFilter afilter = CS_ALPHANUMERAL;
switch (widget) {
- case CUSTCURR_RATE_DOWN:
+ case WID_CC_RATE_DOWN:
if (_custom_currency.rate > 1) _custom_currency.rate--;
- if (_custom_currency.rate == 1) this->DisableWidget(CUSTCURR_RATE_DOWN);
- this->EnableWidget(CUSTCURR_RATE_UP);
+ if (_custom_currency.rate == 1) this->DisableWidget(WID_CC_RATE_DOWN);
+ this->EnableWidget(WID_CC_RATE_UP);
break;
- case CUSTCURR_RATE_UP:
+ case WID_CC_RATE_UP:
if (_custom_currency.rate < UINT16_MAX) _custom_currency.rate++;
- if (_custom_currency.rate == UINT16_MAX) this->DisableWidget(CUSTCURR_RATE_UP);
- this->EnableWidget(CUSTCURR_RATE_DOWN);
+ if (_custom_currency.rate == UINT16_MAX) this->DisableWidget(WID_CC_RATE_UP);
+ this->EnableWidget(WID_CC_RATE_DOWN);
break;
- case CUSTCURR_RATE:
+ case WID_CC_RATE:
SetDParam(0, _custom_currency.rate);
str = STR_JUST_INT;
len = 5;
- line = CUSTCURR_RATE;
+ line = WID_CC_RATE;
afilter = CS_NUMERAL;
break;
- case CUSTCURR_SEPARATOR_EDIT:
- case CUSTCURR_SEPARATOR:
+ case WID_CC_SEPARATOR_EDIT:
+ case WID_CC_SEPARATOR:
SetDParamStr(0, _custom_currency.separator);
str = STR_JUST_RAW_STRING;
len = 1;
- line = CUSTCURR_SEPARATOR;
+ line = WID_CC_SEPARATOR;
break;
- case CUSTCURR_PREFIX_EDIT:
- case CUSTCURR_PREFIX:
+ case WID_CC_PREFIX_EDIT:
+ case WID_CC_PREFIX:
SetDParamStr(0, _custom_currency.prefix);
str = STR_JUST_RAW_STRING;
len = 12;
- line = CUSTCURR_PREFIX;
+ line = WID_CC_PREFIX;
break;
- case CUSTCURR_SUFFIX_EDIT:
- case CUSTCURR_SUFFIX:
+ case WID_CC_SUFFIX_EDIT:
+ case WID_CC_SUFFIX:
SetDParamStr(0, _custom_currency.suffix);
str = STR_JUST_RAW_STRING;
len = 12;
- line = CUSTCURR_SUFFIX;
+ line = WID_CC_SUFFIX;
break;
- case CUSTCURR_YEAR_DOWN:
+ case WID_CC_YEAR_DOWN:
_custom_currency.to_euro = (_custom_currency.to_euro <= 2000) ? CF_NOEURO : _custom_currency.to_euro - 1;
- if (_custom_currency.to_euro == CF_NOEURO) this->DisableWidget(CUSTCURR_YEAR_DOWN);
- this->EnableWidget(CUSTCURR_YEAR_UP);
+ if (_custom_currency.to_euro == CF_NOEURO) this->DisableWidget(WID_CC_YEAR_DOWN);
+ this->EnableWidget(WID_CC_YEAR_UP);
break;
- case CUSTCURR_YEAR_UP:
+ case WID_CC_YEAR_UP:
_custom_currency.to_euro = Clamp(_custom_currency.to_euro + 1, 2000, MAX_YEAR);
- if (_custom_currency.to_euro == MAX_YEAR) this->DisableWidget(CUSTCURR_YEAR_UP);
- this->EnableWidget(CUSTCURR_YEAR_DOWN);
+ if (_custom_currency.to_euro == MAX_YEAR) this->DisableWidget(WID_CC_YEAR_UP);
+ this->EnableWidget(WID_CC_YEAR_DOWN);
break;
- case CUSTCURR_YEAR:
+ case WID_CC_YEAR:
SetDParam(0, _custom_currency.to_euro);
str = STR_JUST_INT;
len = 7;
- line = CUSTCURR_YEAR;
+ line = WID_CC_YEAR;
afilter = CS_NUMERAL;
break;
}
@@ -1968,23 +1968,23 @@ struct CustomCurrencyWindow : Window {
if (str == NULL) return;
switch (this->query_widget) {
- case CUSTCURR_RATE:
+ case WID_CC_RATE:
_custom_currency.rate = Clamp(atoi(str), 1, UINT16_MAX);
break;
- case CUSTCURR_SEPARATOR: // Thousands seperator
+ case WID_CC_SEPARATOR: // Thousands seperator
strecpy(_custom_currency.separator, str, lastof(_custom_currency.separator));
break;
- case CUSTCURR_PREFIX:
+ case WID_CC_PREFIX:
strecpy(_custom_currency.prefix, str, lastof(_custom_currency.prefix));
break;
- case CUSTCURR_SUFFIX:
+ case WID_CC_SUFFIX:
strecpy(_custom_currency.suffix, str, lastof(_custom_currency.suffix));
break;
- case CUSTCURR_YEAR: { // Year to switch to euro
+ case WID_CC_YEAR: { // Year to switch to euro
int val = atoi(str);
_custom_currency.to_euro = (val < 2000 ? CF_NOEURO : min(val, MAX_YEAR));
@@ -2009,34 +2009,34 @@ static const NWidgetPart _nested_cust_currency_widgets[] = {
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(NWID_VERTICAL, NC_EQUALSIZE), SetPIP(7, 3, 0),
NWidget(NWID_HORIZONTAL), SetPIP(10, 0, 5),
- NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, CUSTCURR_RATE_DOWN), SetDataTip(AWV_DECREASE, STR_CURRENCY_DECREASE_EXCHANGE_RATE_TOOLTIP),
- NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, CUSTCURR_RATE_UP), SetDataTip(AWV_INCREASE, STR_CURRENCY_INCREASE_EXCHANGE_RATE_TOOLTIP),
+ NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, WID_CC_RATE_DOWN), SetDataTip(AWV_DECREASE, STR_CURRENCY_DECREASE_EXCHANGE_RATE_TOOLTIP),
+ NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, WID_CC_RATE_UP), SetDataTip(AWV_INCREASE, STR_CURRENCY_INCREASE_EXCHANGE_RATE_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
- NWidget(WWT_TEXT, COLOUR_BLUE, CUSTCURR_RATE), SetDataTip(STR_CURRENCY_EXCHANGE_RATE, STR_CURRENCY_SET_EXCHANGE_RATE_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_RATE), SetDataTip(STR_CURRENCY_EXCHANGE_RATE, STR_CURRENCY_SET_EXCHANGE_RATE_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(NWID_HORIZONTAL), SetPIP(10, 0, 5),
- NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, CUSTCURR_SEPARATOR_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP), SetFill(0, 1),
+ NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, WID_CC_SEPARATOR_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP), SetFill(0, 1),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
- NWidget(WWT_TEXT, COLOUR_BLUE, CUSTCURR_SEPARATOR), SetDataTip(STR_CURRENCY_SEPARATOR, STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_SEPARATOR), SetDataTip(STR_CURRENCY_SEPARATOR, STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(NWID_HORIZONTAL), SetPIP(10, 0, 5),
- NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, CUSTCURR_PREFIX_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP), SetFill(0, 1),
+ NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, WID_CC_PREFIX_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP), SetFill(0, 1),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
- NWidget(WWT_TEXT, COLOUR_BLUE, CUSTCURR_PREFIX), SetDataTip(STR_CURRENCY_PREFIX, STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_PREFIX), SetDataTip(STR_CURRENCY_PREFIX, STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(NWID_HORIZONTAL), SetPIP(10, 0, 5),
- NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, CUSTCURR_SUFFIX_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_SUFFIX_TOOLTIP), SetFill(0, 1),
+ NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, WID_CC_SUFFIX_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_SUFFIX_TOOLTIP), SetFill(0, 1),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
- NWidget(WWT_TEXT, COLOUR_BLUE, CUSTCURR_SUFFIX), SetDataTip(STR_CURRENCY_SUFFIX, STR_CURRENCY_SET_CUSTOM_CURRENCY_SUFFIX_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_SUFFIX), SetDataTip(STR_CURRENCY_SUFFIX, STR_CURRENCY_SET_CUSTOM_CURRENCY_SUFFIX_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(NWID_HORIZONTAL), SetPIP(10, 0, 5),
- NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, CUSTCURR_YEAR_DOWN), SetDataTip(AWV_DECREASE, STR_CURRENCY_DECREASE_CUSTOM_CURRENCY_TO_EURO_TOOLTIP),
- NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, CUSTCURR_YEAR_UP), SetDataTip(AWV_INCREASE, STR_CURRENCY_INCREASE_CUSTOM_CURRENCY_TO_EURO_TOOLTIP),
+ NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, WID_CC_YEAR_DOWN), SetDataTip(AWV_DECREASE, STR_CURRENCY_DECREASE_CUSTOM_CURRENCY_TO_EURO_TOOLTIP),
+ NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, WID_CC_YEAR_UP), SetDataTip(AWV_INCREASE, STR_CURRENCY_INCREASE_CUSTOM_CURRENCY_TO_EURO_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
- NWidget(WWT_TEXT, COLOUR_BLUE, CUSTCURR_YEAR), SetDataTip(STR_JUST_STRING, STR_CURRENCY_SET_CUSTOM_CURRENCY_TO_EURO_TOOLTIP), SetFill(1, 0),
+ NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_YEAR), SetDataTip(STR_JUST_STRING, STR_CURRENCY_SET_CUSTOM_CURRENCY_TO_EURO_TOOLTIP), SetFill(1, 0),
EndContainer(),
EndContainer(),
- NWidget(WWT_LABEL, COLOUR_BLUE, CUSTCURR_PREVIEW),
+ NWidget(WWT_LABEL, COLOUR_BLUE, WID_CC_PREVIEW),
SetDataTip(STR_CURRENCY_PREVIEW, STR_CURRENCY_CUSTOM_CURRENCY_PREVIEW_TOOLTIP), SetPadding(15, 1, 18, 2),
EndContainer(),
};
diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp
index 00c2a5a35..cd71227b2 100644
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -147,15 +147,15 @@ enum SignListHotkeys {
};
struct SignListWindow : QueryStringBaseWindow, SignList {
- int text_offset; ///< Offset of the sign text relative to the left edge of the SILW_LIST widget.
+ int text_offset; ///< Offset of the sign text relative to the left edge of the WID_SIL_LIST widget.
Scrollbar *vscroll;
SignListWindow(const WindowDesc *desc, WindowNumber window_number) : QueryStringBaseWindow(MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS)
{
this->CreateNestedTree(desc);
- this->vscroll = this->GetScrollbar(SILW_SCROLLBAR);
+ this->vscroll = this->GetScrollbar(WID_SIL_SCROLLBAR);
this->FinishInitNested(desc, window_number);
- this->SetWidgetLoweredState(SILW_FILTER_MATCH_CASE_BTN, SignList::match_case);
+ this->SetWidgetLoweredState(WID_SIL_FILTER_MATCH_CASE_BTN, SignList::match_case);
/* Initialize the text edit widget */
this->afilter = CS_ALPHANUMERAL;
@@ -180,7 +180,7 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
this->edit_str_buf[0] = '\0';
UpdateTextBufferSize(&this->text);
- this->SetWidgetDirty(SILW_FILTER_TEXT);
+ this->SetWidgetDirty(WID_SIL_FILTER_TEXT);
}
/**
@@ -198,17 +198,17 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
this->signs.SetFilterState(true);
- this->EnableWidget(SILW_FILTER_CLEAR_BTN);
+ this->EnableWidget(WID_SIL_FILTER_CLEAR_BTN);
} else {
/* There is no new string -> clear this->filter_string */
this->filter_string[0] = '\0';
this->signs.SetFilterState(!HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS)); // keep sign list filtering active if competitor signs should be hidden
- this->DisableWidget(SILW_FILTER_CLEAR_BTN);
+ this->DisableWidget(WID_SIL_FILTER_CLEAR_BTN);
}
/* Repaint the clear button since its disabled state may have changed */
- this->SetWidgetDirty(SILW_FILTER_CLEAR_BTN);
+ this->SetWidgetDirty(WID_SIL_FILTER_CLEAR_BTN);
/* Rebuild the list of signs */
this->InvalidateData();
@@ -218,13 +218,13 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
{
if (this->signs.NeedRebuild()) this->BuildSortSignList();
this->DrawWidgets();
- if (!this->IsShaded()) this->DrawEditBox(SILW_FILTER_TEXT);
+ if (!this->IsShaded()) this->DrawEditBox(WID_SIL_FILTER_TEXT);
}
virtual void DrawWidget(const Rect &r, int widget) const
{
switch (widget) {
- case SILW_LIST: {
+ case WID_SIL_LIST: {
uint y = r.top + WD_FRAMERECT_TOP; // Offset from top of widget.
/* No signs? */
if (this->vscroll->GetCount() == 0) {
@@ -255,28 +255,28 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
virtual void SetStringParameters(int widget) const
{
- if (widget == SILW_CAPTION) SetDParam(0, this->vscroll->GetCount());
+ if (widget == WID_SIL_CAPTION) SetDParam(0, this->vscroll->GetCount());
}
virtual void OnClick(Point pt, int widget, int click_count)
{
switch (widget) {
- case SILW_LIST: {
- uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, SILW_LIST, WD_FRAMERECT_TOP);
+ case WID_SIL_LIST: {
+ uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SIL_LIST, WD_FRAMERECT_TOP);
if (id_v == INT_MAX) return;
const Sign *si = this->signs[id_v];
ScrollMainWindowToTile(TileVirtXY(si->x, si->y));
break;
}
- case SILW_FILTER_CLEAR_BTN:
+ case WID_SIL_FILTER_CLEAR_BTN:
this->ClearFilterTextWidget(); // Empty the text in the EditBox widget
this->SetFilterString(""); // Use empty text as filter text (= view all signs)
break;
- case SILW_FILTER_MATCH_CASE_BTN:
+ case WID_SIL_FILTER_MATCH_CASE_BTN:
SignList::match_case = !SignList::match_case; // Toggle match case
- this->SetWidgetLoweredState(SILW_FILTER_MATCH_CASE_BTN, SignList::match_case); // Toggle button pushed state
+ this->SetWidgetLoweredState(WID_SIL_FILTER_MATCH_CASE_BTN, SignList::match_case); // Toggle button pushed state
this->InvalidateData(); // Rebuild the list of signs
break;
}
@@ -284,13 +284,13 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
virtual void OnResize()
{
- this->vscroll->SetCapacityFromWidget(this, SILW_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM);
+ this->vscroll->SetCapacityFromWidget(this, WID_SIL_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM);
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
{
switch (widget) {
- case SILW_LIST: {
+ case WID_SIL_LIST: {
Dimension spr_dim = GetSpriteSize(SPR_COMPANY_ICON);
this->text_offset = WD_FRAMETEXT_LEFT + spr_dim.width + 2; // 2 pixels space between icon and the sign text.
resize->height = max<uint>(FONT_HEIGHT_NORMAL, spr_dim.height);
@@ -299,7 +299,7 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
break;
}
- case SILW_CAPTION:
+ case WID_SIL_CAPTION:
SetDParam(0, max<size_t>(1000, Sign::GetPoolSize()));
*size = GetStringBoundingBox(STR_SIGN_LIST_CAPTION);
size->height += padding.height;
@@ -311,7 +311,7 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
EventState state = ES_NOT_HANDLED;
- switch (this->HandleEditBoxKey(SILW_FILTER_TEXT, key, keycode, state)) {
+ switch (this->HandleEditBoxKey(WID_SIL_FILTER_TEXT, key, keycode, state)) {
case HEBR_EDITING:
this->SetFilterString(this->text.buf);
break;
@@ -324,13 +324,13 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
return state;
case HEBR_CANCEL: // ESC pressed, clear filter.
- this->OnClick(Point(), SILW_FILTER_CLEAR_BTN, 1); // Simulate click on clear button.
+ this->OnClick(Point(), WID_SIL_FILTER_CLEAR_BTN, 1); // Simulate click on clear button.
this->UnfocusFocusedWidget(); // Unfocus the text box.
return state;
case HEBR_NOT_FOCUSED: // The filter text box is not globaly focused.
if (CheckHotkeyMatch(signlist_hotkeys, keycode, this) == SLHK_FOCUS_FILTER_BOX) {
- this->SetFocusedWidget(SILW_FILTER_TEXT);
+ this->SetFocusedWidget(WID_SIL_FILTER_TEXT);
SetFocusedWindow(this); // The user has asked to give focus to the text box, so make sure this window is focused.
state = ES_HANDLED;
}
@@ -340,19 +340,19 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
NOT_REACHED();
}
- if (state == ES_HANDLED) OnOSKInput(SILW_FILTER_TEXT);
+ if (state == ES_HANDLED) OnOSKInput(WID_SIL_FILTER_TEXT);
return state;
}
virtual void OnOSKInput(int widget)
{
- if (widget == SILW_FILTER_TEXT) this->SetFilterString(this->text.buf);
+ if (widget == WID_SIL_FILTER_TEXT) this->SetFilterString(this->text.buf);
}
virtual void OnMouseLoop()
{
- this->HandleEditBox(SILW_FILTER_TEXT);
+ this->HandleEditBox(WID_SIL_FILTER_TEXT);
}
void BuildSortSignList()
@@ -360,7 +360,7 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
if (this->signs.NeedRebuild()) {
this->BuildSignsList();
this->vscroll->SetCount(this->signs.Length());
- this->SetWidgetDirty(SILW_CAPTION);
+ this->SetWidgetDirty(WID_SIL_CAPTION);
}
this->SortSignsList();
}
@@ -406,26 +406,26 @@ Hotkey<SignListWindow> *_signlist_hotkeys = SignListWindow::signlist_hotkeys;
static const NWidgetPart _nested_sign_list_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
- NWidget(WWT_CAPTION, COLOUR_GREY, SILW_CAPTION), SetDataTip(STR_SIGN_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_CAPTION, COLOUR_GREY, WID_SIL_CAPTION), SetDataTip(STR_SIGN_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_VERTICAL),
- NWidget(WWT_PANEL, COLOUR_GREY, SILW_LIST), SetMinimalSize(WD_FRAMETEXT_LEFT + 16 + 255 + WD_FRAMETEXT_RIGHT, 50),
- SetResize(1, 10), SetFill(1, 0), SetScrollbar(SILW_SCROLLBAR), EndContainer(),
+ NWidget(WWT_PANEL, COLOUR_GREY, WID_SIL_LIST), SetMinimalSize(WD_FRAMETEXT_LEFT + 16 + 255 + WD_FRAMETEXT_RIGHT, 50),
+ SetResize(1, 10), SetFill(1, 0), SetScrollbar(WID_SIL_SCROLLBAR), EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1),
- NWidget(WWT_EDITBOX, COLOUR_GREY, SILW_FILTER_TEXT), SetMinimalSize(80, 12), SetResize(1, 0), SetFill(1, 0), SetPadding(2, 2, 2, 2),
+ NWidget(WWT_EDITBOX, COLOUR_GREY, WID_SIL_FILTER_TEXT), SetMinimalSize(80, 12), SetResize(1, 0), SetFill(1, 0), SetPadding(2, 2, 2, 2),
SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP),
EndContainer(),
- NWidget(WWT_TEXTBTN, COLOUR_GREY, SILW_FILTER_MATCH_CASE_BTN), SetDataTip(STR_SIGN_LIST_MATCH_CASE, STR_SIGN_LIST_MATCH_CASE_TOOLTIP),
- NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, SILW_FILTER_CLEAR_BTN), SetDataTip(STR_SIGN_LIST_CLEAR, STR_SIGN_LIST_CLEAR_TOOLTIP),
+ NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_SIL_FILTER_MATCH_CASE_BTN), SetDataTip(STR_SIGN_LIST_MATCH_CASE, STR_SIGN_LIST_MATCH_CASE_TOOLTIP),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SIL_FILTER_CLEAR_BTN), SetDataTip(STR_SIGN_LIST_CLEAR, STR_SIGN_LIST_CLEAR_TOOLTIP),
EndContainer(),
EndContainer(),
NWidget(NWID_VERTICAL),
NWidget(NWID_VERTICAL), SetFill(0, 1),
- NWidget(NWID_VSCROLLBAR, COLOUR_GREY, SILW_SCROLLBAR),
+ NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_SIL_SCROLLBAR),
EndContainer(),
NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(),
@@ -481,9 +481,9 @@ struct SignWindow : QueryStringBaseWindow, SignList {
this->InitNested(desc);
- this->LowerWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
+ this->LowerWidget(WID_QES_TEXT);
UpdateSignEditWindow(si);
- this->SetFocusedWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
+ this->SetFocusedWidget(WID_QES_TEXT);
}
void UpdateSignEditWindow(const Sign *si)
@@ -502,8 +502,8 @@ struct SignWindow : QueryStringBaseWindow, SignList {
this->cur_sign = si->index;
InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, this->max_chars);
- this->SetWidgetDirty(QUERY_EDIT_SIGN_WIDGET_TEXT);
- this->SetFocusedWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
+ this->SetWidgetDirty(WID_QES_TEXT);
+ this->SetFocusedWidget(WID_QES_TEXT);
}
/**
@@ -536,7 +536,7 @@ struct SignWindow : QueryStringBaseWindow, SignList {
virtual void SetStringParameters(int widget) const
{
switch (widget) {
- case QUERY_EDIT_SIGN_WIDGET_CAPTION:
+ case WID_QES_CAPTION:
SetDParam(0, this->caption);
break;
}
@@ -545,15 +545,15 @@ struct SignWindow : QueryStringBaseWindow, SignList {
virtual void OnPaint()
{
this->DrawWidgets();
- if (!this->IsShaded()) this->DrawEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);
+ if (!this->IsShaded()) this->DrawEditBox(WID_QES_TEXT);
}
virtual void OnClick(Point pt, int widget, int click_count)
{
switch (widget) {
- case QUERY_EDIT_SIGN_WIDGET_PREVIOUS:
- case QUERY_EDIT_SIGN_WIDGET_NEXT: {
- const Sign *si = this->PrevNextSign(widget == QUERY_EDIT_SIGN_WIDGET_NEXT);
+ case WID_QES_PREVIOUS:
+ case WID_QES_NEXT: {
+ const Sign *si = this->PrevNextSign(widget == WID_QES_NEXT);
/* Rebuild the sign list */
this->signs.ForceRebuild();
@@ -567,17 +567,17 @@ struct SignWindow : QueryStringBaseWindow, SignList {
break;
}
- case QUERY_EDIT_SIGN_WIDGET_DELETE:
+ case WID_QES_DELETE:
/* Only need to set the buffer to null, the rest is handled as the OK button */
RenameSign(this->cur_sign, "");
/* don't delete this, we are deleted in Sign::~Sign() -> DeleteRenameSignWindow() */
break;
- case QUERY_EDIT_SIGN_WIDGET_OK:
+ case WID_QES_OK:
if (RenameSign(this->cur_sign, this->text.buf)) break;
/* FALL THROUGH */
- case QUERY_EDIT_SIGN_WIDGET_CANCEL:
+ case WID_QES_CANCEL:
delete this;
break;
}
@@ -586,7 +586,7 @@ struct SignWindow : QueryStringBaseWindow, SignList {
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
EventState state = ES_NOT_HANDLED;
- switch (this->HandleEditBoxKey(QUERY_EDIT_SIGN_WIDGET_TEXT, key, keycode, state)) {
+ switch (this->HandleEditBoxKey(WID_QES_TEXT, key, keycode, state)) {
default: break;
case HEBR_CONFIRM:
@@ -602,30 +602,30 @@ struct SignWindow : QueryStringBaseWindow, SignList {
virtual void OnMouseLoop()
{
- this->HandleEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);
+ this->HandleEditBox(WID_QES_TEXT);
}
virtual void OnOpenOSKWindow(int wid)
{
- ShowOnScreenKeyboard(this, wid, QUERY_EDIT_SIGN_WIDGET_CANCEL, QUERY_EDIT_SIGN_WIDGET_OK);
+ ShowOnScreenKeyboard(this, wid, WID_QES_CANCEL, WID_QES_OK);
}
};
static const NWidgetPart _nested_query_sign_edit_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
- NWidget(WWT_CAPTION, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_CAPTION), SetDataTip(STR_WHITE_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_CAPTION, COLOUR_GREY, WID_QES_CAPTION), SetDataTip(STR_WHITE_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY),
- NWidget(WWT_EDITBOX, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_TEXT), SetMinimalSize(256, 12), SetDataTip(STR_EDIT_SIGN_SIGN_OSKTITLE, STR_NULL), SetPadding(2, 2, 2, 2),
+ NWidget(WWT_EDITBOX, COLOUR_GREY, WID_QES_TEXT), SetMinimalSize(256, 12), SetDataTip(STR_EDIT_SIGN_SIGN_OSKTITLE, STR_NULL), SetPadding(2, 2, 2, 2),
EndContainer(),
NWidget(NWID_HORIZONTAL),
- NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_OK), SetMinimalSize(61, 12), SetDataTip(STR_BUTTON_OK, STR_NULL),
- NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_CANCEL), SetMinimalSize(60, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
- NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_DELETE), SetMinimalSize(60, 12), SetDataTip(STR_TOWN_VIEW_DELETE_BUTTON, STR_NULL),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_QES_OK), SetMinimalSize(61, 12), SetDataTip(STR_BUTTON_OK, STR_NULL),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_QES_CANCEL), SetMinimalSize(60, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_QES_DELETE), SetMinimalSize(60, 12), SetDataTip(STR_TOWN_VIEW_DELETE_BUTTON, STR_NULL),
NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), EndContainer(),
- NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_PREVIOUS), SetMinimalSize(11, 12), SetDataTip(AWV_DECREASE, STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP),
- NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_NEXT), SetMinimalSize(11, 12), SetDataTip(AWV_INCREASE, STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP),
+ NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_QES_PREVIOUS), SetMinimalSize(11, 12), SetDataTip(AWV_DECREASE, STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP),
+ NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_QES_NEXT), SetMinimalSize(11, 12), SetDataTip(AWV_INCREASE, STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP),
EndContainer(),
};
diff --git a/src/widgets/settings_widget.h b/src/widgets/settings_widget.h
index 9eb5bf4f4..a62fcf9a6 100644
--- a/src/widgets/settings_widget.h
+++ b/src/widgets/settings_widget.h
@@ -14,60 +14,60 @@
/** Widgets of the WC_GAME_OPTIONS (WC_GAME_OPTIONS is also used in others). */
enum GameOptionsWidgets {
- GOW_BACKGROUND, ///< Background of the window
- GOW_CURRENCY_DROPDOWN, ///< Currency dropdown
- GOW_DISTANCE_DROPDOWN, ///< Measuring unit dropdown
- GOW_ROADSIDE_DROPDOWN, ///< Dropdown to select the road side (to set the right side ;))
- GOW_TOWNNAME_DROPDOWN, ///< Town name dropdown
- GOW_AUTOSAVE_DROPDOWN, ///< Dropdown to say how often to autosave
- GOW_LANG_DROPDOWN, ///< Language dropdown
- GOW_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution
- GOW_FULLSCREEN_BUTTON, ///< Toggle fullscreen
- GOW_SCREENSHOT_DROPDOWN, ///< Select the screenshot type... please use PNG!
- GOW_BASE_GRF_DROPDOWN, ///< Use to select a base GRF
- GOW_BASE_GRF_STATUS, ///< Info about missing files etc.
- GOW_BASE_GRF_DESCRIPTION, ///< Description of selected base GRF
- GOW_BASE_SFX_DROPDOWN, ///< Use to select a base SFX
- GOW_BASE_SFX_DESCRIPTION, ///< Description of selected base SFX
- GOW_BASE_MUSIC_DROPDOWN, ///< Use to select a base music set
- GOW_BASE_MUSIC_STATUS, ///< Info about corrupted files etc.
- GOW_BASE_MUSIC_DESCRIPTION, ///< Description of selected base music set
+ WID_GO_BACKGROUND, ///< Background of the window.
+ WID_GO_CURRENCY_DROPDOWN, ///< Currency dropdown.
+ WID_GO_DISTANCE_DROPDOWN, ///< Measuring unit dropdown.
+ WID_GO_ROADSIDE_DROPDOWN, ///< Dropdown to select the road side (to set the right side ;)).
+ WID_GO_TOWNNAME_DROPDOWN, ///< Town name dropdown.
+ WID_GO_AUTOSAVE_DROPDOWN, ///< Dropdown to say how often to autosave.
+ WID_GO_LANG_DROPDOWN, ///< Language dropdown.
+ WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution.
+ WID_GO_FULLSCREEN_BUTTON, ///< Toggle fullscreen.
+ WID_GO_SCREENSHOT_DROPDOWN, ///< Select the screenshot type... please use PNG!.
+ WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF.
+ WID_GO_BASE_GRF_STATUS, ///< Info about missing files etc.
+ WID_GO_BASE_GRF_DESCRIPTION, ///< Description of selected base GRF.
+ WID_GO_BASE_SFX_DROPDOWN, ///< Use to select a base SFX.
+ WID_GO_BASE_SFX_DESCRIPTION, ///< Description of selected base SFX.
+ WID_GO_BASE_MUSIC_DROPDOWN, ///< Use to select a base music set.
+ WID_GO_BASE_MUSIC_STATUS, ///< Info about corrupted files etc.
+ WID_GO_BASE_MUSIC_DESCRIPTION, ///< Description of selected base music set.
};
/** Widgets of the WC_GAME_OPTIONS (WC_GAME_OPTIONS is also used in others). */
enum GameDifficultyWidgets {
- GDW_LVL_EASY,
- GDW_LVL_MEDIUM,
- GDW_LVL_HARD,
- GDW_LVL_CUSTOM,
- GDW_HIGHSCORE,
- GDW_ACCEPT,
- GDW_CANCEL,
+ WID_GD_LVL_EASY, ///< Easy level button.
+ WID_GD_LVL_MEDIUM, ///< Medium level button.
+ WID_GD_LVL_HARD, ///< Hard level button.
+ WID_GD_LVL_CUSTOM, ///< Custom level button.
+ WID_GD_HIGHSCORE, ///< Highscore button.
+ WID_GD_ACCEPT, ///< Accept button.
+ WID_GD_CANCEL, ///< Cancel button.
- GDW_OPTIONS_START,
+ WID_GD_OPTIONS_START, ///< Start of the options.
};
/** Widgets of the WC_GAME_OPTIONS (WC_GAME_OPTIONS is also used in others). */
enum GameSettingsWidgets {
- SETTINGSEL_OPTIONSPANEL, ///< Panel widget containing the option lists
- SETTINGSEL_SCROLLBAR, ///< Scrollbar
+ WID_GS_OPTIONSPANEL, ///< Panel widget containing the option lists.
+ WID_GS_SCROLLBAR, ///< Scrollbar.
};
/** Widgets of the WC_CUSTOM_CURRENCY. */
enum CustomCurrencyWidgets {
- CUSTCURR_RATE_DOWN,
- CUSTCURR_RATE_UP,
- CUSTCURR_RATE,
- CUSTCURR_SEPARATOR_EDIT,
- CUSTCURR_SEPARATOR,
- CUSTCURR_PREFIX_EDIT,
- CUSTCURR_PREFIX,
- CUSTCURR_SUFFIX_EDIT,
- CUSTCURR_SUFFIX,
- CUSTCURR_YEAR_DOWN,
- CUSTCURR_YEAR_UP,
- CUSTCURR_YEAR,
- CUSTCURR_PREVIEW,
+ WID_CC_RATE_DOWN, ///< Down button.
+ WID_CC_RATE_UP, ///< Up button.
+ WID_CC_RATE, ///< Rate of currency.
+ WID_CC_SEPARATOR_EDIT, ///< Seperator edit button.
+ WID_CC_SEPARATOR, ///< Current seperator.
+ WID_CC_PREFIX_EDIT, ///< Prefix edit button.
+ WID_CC_PREFIX, ///< Current prefix.
+ WID_CC_SUFFIX_EDIT, ///< Suffix edit button.
+ WID_CC_SUFFIX, ///< Current suffix.
+ WID_CC_YEAR_DOWN, ///< Down button.
+ WID_CC_YEAR_UP, ///< Up button.
+ WID_CC_YEAR, ///< Year of introduction.
+ WID_CC_PREVIEW, ///< Preview.
};
#endif /* WIDGETS_SETTINGS_WIDGET_H */
diff --git a/src/widgets/sign_widget.h b/src/widgets/sign_widget.h
index 638e6b8fa..c8e4afd84 100644
--- a/src/widgets/sign_widget.h
+++ b/src/widgets/sign_widget.h
@@ -15,23 +15,23 @@
/** Widgets of the WC_SIGN_LIST. */
enum SignListWidgets {
/* Name starts with SI instead of S, because of collision with StationListWidgets */
- SILW_CAPTION,
- SILW_LIST,
- SILW_SCROLLBAR,
- SILW_FILTER_TEXT, ///< Text box for typing a filter string
- SILW_FILTER_MATCH_CASE_BTN, ///< Button to toggle if case sensitive filtering should be used
- SILW_FILTER_CLEAR_BTN, ///< Button to clear the filter
+ WID_SIL_CAPTION, ///< Caption of the window.
+ WID_SIL_LIST, ///< List of signs.
+ WID_SIL_SCROLLBAR, ///< Scrollbar of list.
+ WID_SIL_FILTER_TEXT, ///< Text box for typing a filter string.
+ WID_SIL_FILTER_MATCH_CASE_BTN, ///< Button to toggle if case sensitive filtering should be used.
+ WID_SIL_FILTER_CLEAR_BTN, ///< Button to clear the filter.
};
/** Widgets of the WC_QUERY_STRING (WC_QUERY_STRING is also used in QueryStringWidgets). */
enum QueryEditSignWidgets {
- QUERY_EDIT_SIGN_WIDGET_CAPTION,
- QUERY_EDIT_SIGN_WIDGET_TEXT,
- QUERY_EDIT_SIGN_WIDGET_OK,
- QUERY_EDIT_SIGN_WIDGET_CANCEL,
- QUERY_EDIT_SIGN_WIDGET_DELETE,
- QUERY_EDIT_SIGN_WIDGET_PREVIOUS,
- QUERY_EDIT_SIGN_WIDGET_NEXT,
+ WID_QES_CAPTION, ///< Caption of the window.
+ WID_QES_TEXT, ///< Text of the query.
+ WID_QES_OK, ///< OK button.
+ WID_QES_CANCEL, ///< Cancel button.
+ WID_QES_DELETE, ///< Delete button.
+ WID_QES_PREVIOUS, ///< Previous button.
+ WID_QES_NEXT, ///< Next button.
};
#endif /* */