aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/dialogs.cpp205
-rw-r--r--engines/scumm/dialogs.h2
-rw-r--r--gui/browser.cpp4
-rw-r--r--gui/eval.cpp6
-rw-r--r--gui/launcher.cpp10
-rw-r--r--gui/message.cpp2
-rw-r--r--gui/newgui.cpp7
-rw-r--r--gui/theme-config.cpp116
-rw-r--r--gui/themes/default-theme.ini114
-rw-r--r--gui/widget.cpp7
-rw-r--r--gui/widget.h2
11 files changed, 269 insertions, 206 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 4e1e4c303e..4d501340da 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -211,8 +211,8 @@ static ResString string_map_table_v345[] = {
#pragma mark -
-ScummDialog::ScummDialog(ScummEngine *scumm, int x, int y, int w, int h)
- : GUI::Dialog(x, y, w, h), _vm(scumm) {
+ScummDialog::ScummDialog(ScummEngine *scumm, String name)
+ : GUI::Dialog(name), _vm(scumm) {
_drawingHints |= GUI::THEME_HINT_SPECIAL_COLOR;
}
@@ -353,27 +353,29 @@ public:
};
SaveLoadChooserEx::SaveLoadChooserEx(const String &title, const String &buttonLabel, bool saveMode, ScummEngine *engine)
- : Dialog(8, 8, engine->_system->getOverlayWidth() - 2 * 8, engine->_system->getOverlayHeight() - 16), _saveMode(saveMode), _list(0), _chooseButton(0), _gfxWidget(0), _scumm(engine) {
+ : Dialog("scummsaveload"), _saveMode(saveMode), _list(0), _chooseButton(0), _gfxWidget(0), _scumm(engine) {
- new StaticTextWidget(this, 10, 6, _w - 2 * 10, kLineHeight, title, kTextAlignCenter);
+ new StaticTextWidget(this, "scummsaveload_title", title, kTextAlignCenter);
// Add choice list
- _list = new GUI::ListWidget(this, 10, 18, _w - 2 * 10 - 180, _h - 14 - kBigButtonHeight - 18, GUI::kBigWidgetSize);
+ _list = new GUI::ListWidget(this, "scummsaveload_list");
_list->setEditable(saveMode);
_list->setNumberingMode(saveMode ? GUI::kListNumberingOne : GUI::kListNumberingZero);
+ int thumbX = g_gui.evaluator()->getVar("scummsaveload_thumbnail.x");
+ int thumbY = g_gui.evaluator()->getVar("scummsaveload_thumbnail.y");
+
// Add the thumbnail display
_gfxWidget = new GUI::GraphicsWidget(this,
- _w - (kThumbnailWidth + 22),
- 18,
+ thumbX, thumbY,
kThumbnailWidth + 8,
((_scumm->_system->getHeight() % 200 && _scumm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1) + 8);
_gfxWidget->setFlags(GUI::WIDGET_BORDER);
- int height = 18 + ((_scumm->_system->getHeight() % 200 && _scumm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1) + 8;
+ int height = thumbY + ((_scumm->_system->getHeight() % 200 && _scumm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1) + 8;
_date = new StaticTextWidget(this,
- _w - (kThumbnailWidth + 22),
+ thumbX,
height,
kThumbnailWidth + 8,
kLineHeight,
@@ -384,7 +386,7 @@ SaveLoadChooserEx::SaveLoadChooserEx(const String &title, const String &buttonLa
height += kLineHeight;
_time = new StaticTextWidget(this,
- _w - (kThumbnailWidth + 22),
+ thumbX,
height,
kThumbnailWidth + 8,
kLineHeight,
@@ -395,7 +397,7 @@ SaveLoadChooserEx::SaveLoadChooserEx(const String &title, const String &buttonLa
height += kLineHeight;
_playtime = new StaticTextWidget(this,
- _w - (kThumbnailWidth + 22),
+ thumbX,
height,
kThumbnailWidth + 8,
kLineHeight,
@@ -404,8 +406,8 @@ SaveLoadChooserEx::SaveLoadChooserEx(const String &title, const String &buttonLa
_playtime->setFlags(GUI::WIDGET_CLEARBG);
// Buttons
- addButton(this, _w - 2 * (kBigButtonWidth + 10), _h - kBigButtonHeight - 8, "Cancel", kCloseCmd, 0, GUI::kBigWidgetSize);
- _chooseButton = addButton(this, _w - (kBigButtonWidth + 10), _h - kBigButtonHeight - 8, buttonLabel, kChooseCmd, 0, GUI::kBigWidgetSize);
+ new GUI::ButtonWidget(this, "scummsaveload_cancel", "Cancel", kCloseCmd, 0);
+ _chooseButton = new GUI::ButtonWidget(this, "scummsaveload_choose", buttonLabel, kChooseCmd, 0);
_chooseButton->setEnabled(false);
}
@@ -524,66 +526,21 @@ Common::StringList generateSavegameList(ScummEngine *scumm, bool saveMode) {
return l;
}
-#define addBigButton(label, cmd, hotkey) \
- new GUI::ButtonWidget(this, hOffset, y, buttonWidth, buttonHeight, label, cmd, hotkey, ws); \
- y += (buttonHeight + vAddOff)
-
MainMenuDialog::MainMenuDialog(ScummEngine *scumm)
- : ScummDialog(scumm, 0, 0, 0, 0) {
-
- const int screenW = g_system->getOverlayWidth();
- const int screenH = g_system->getOverlayHeight();
-
- int hOffset;
- int vSpace;
- int vAddOff;
-
- GUI::WidgetSize ws;
- int buttonWidth;
- int buttonHeight;
-
- if (screenW >= 400 && screenH >= 300) {
- buttonWidth = 160;
- buttonHeight = 28;
- ws = GUI::kBigWidgetSize;
- hOffset = 12;
- vSpace = 7;
- vAddOff = 3;
- } else {
- buttonWidth = 90;
- buttonHeight = 16;
- ws = GUI::kNormalWidgetSize;
- hOffset = 8;
- vSpace = 5;
- vAddOff = 2;
- }
-
- int y = vSpace + vAddOff;
-
+ : ScummDialog(scumm, "scummmain") {
- addBigButton("Resume", kPlayCmd, 'P');
- y += vSpace;
+ new GUI::ButtonWidget(this, "scummmain_resume", "Resume", kPlayCmd, 'P');
- addBigButton("Load", kLoadCmd, 'L');
- addBigButton("Save", kSaveCmd, 'S');
- y += vSpace;
+ new GUI::ButtonWidget(this, "scummmain_load", "Load", kLoadCmd, 'L');
+ new GUI::ButtonWidget(this, "scummmain_save", "Save", kSaveCmd, 'S');
- addBigButton("Options", kOptionsCmd, 'O');
+ new GUI::ButtonWidget(this, "scummmain_options", "Options", kOptionsCmd, 'O');
#ifndef DISABLE_HELP
- addBigButton("Help", kHelpCmd, 'H');
+ new GUI::ButtonWidget(this, "scummmain_help", "Help", kHelpCmd, 'H');
#endif
- addBigButton("About", kAboutCmd, 'A');
- y += vSpace;
-
- addBigButton("Quit", kQuitCmd, 'Q');
-
-
- _w = buttonWidth + 2 * hOffset;
- _h = y + vSpace;
-
- _x = (screenW - _w) / 2;
- _y = (screenH - _h) / 2;
+ new GUI::ButtonWidget(this, "scummmain_about", "About", kAboutCmd, 'A');
+ new GUI::ButtonWidget(this, "scummmain_quit", "Quit", kQuitCmd, 'Q');
//
// Create the sub dialog(s)
@@ -683,68 +640,31 @@ enum {
};
ConfigDialog::ConfigDialog(ScummEngine *scumm)
- : GUI::OptionsDialog("", 40, 30, 240, 124), _vm(scumm) {
-
- const int screenW = g_system->getOverlayWidth();
- const int screenH = g_system->getOverlayHeight();
-
- _w = screenW - 2 * 40;
-
- GUI::WidgetSize ws;
- int buttonWidth;
- int buttonHeight;
- int sliderHeight;
-
- if (screenW >= 400 && screenH >= 300) {
- ws = GUI::kBigWidgetSize;
- buttonWidth = kBigButtonWidth;
- buttonHeight = kBigButtonHeight;
- sliderHeight = GUI::kBigSliderHeight;
- } else {
- ws = GUI::kNormalWidgetSize;
- buttonWidth = kButtonWidth;
- buttonHeight = kButtonHeight;
- sliderHeight = GUI::kSliderHeight;
- }
-
- int yoffset = 8;
+ : GUI::OptionsDialog("", "scummconfig"), _vm(scumm) {
//
// Sound controllers
//
- addVolumeControls(this, "scummoptions_");
- yoffset += (sliderHeight + 4) * 8;
+ addVolumeControls(this, "scummconfig_");
//
// Some misc options
//
- _subtitlesCheckbox = addCheckbox(this, 15, yoffset, "Show subtitles", 0, 'S', ws);
- yoffset += _subtitlesCheckbox->getHeight();
-
- _speechCheckbox = addCheckbox(this, 15, yoffset, "Enable speech", 0, 'E', ws);
- yoffset += _speechCheckbox->getHeight() + 4;
+ _subtitlesCheckbox = new GUI::CheckboxWidget(this, "scummconfig_subtitlesCheckbox", "Show subtitles", 0, 'S');
+ _speechCheckbox = new GUI::CheckboxWidget(this, "scummconfig_speechCheckbox", "Enable speech", 0, 'E');
//
// Add the buttons
//
- _w = 8 + 3 * (buttonWidth + 4); // FIXME/TODO
-
- addButton(this, _w - (buttonWidth + 4) - 4, yoffset, "OK", GUI::OptionsDialog::kOKCmd, 'O', ws);
- addButton(this, _w - 2 * (buttonWidth + 4) - 4, yoffset, "Cancel", kCloseCmd, 'C', ws);
+ new GUI::ButtonWidget(this, "scummconfig_ok", "OK", GUI::OptionsDialog::kOKCmd, 'O');
+ new GUI::ButtonWidget(this, "scummconfig_cancel", "Cancel", kCloseCmd, 'C');
#ifdef SMALL_SCREEN_DEVICE
- addButton(this, _w - 3 * (buttonWidth + 4) - 4, yoffset, "Keys", kKeysCmd, 'K', ws);
+ new GUI::ButtonWidget(this, "scummconfig_keys", "Keys", kKeysCmd, 'K');
#endif
- yoffset += buttonHeight;
-
- _h = yoffset + 8;
-
- _x = (screenW - _w) / 2;
- _y = (screenH - _h) / 2;
-
#ifdef SMALL_SCREEN_DEVICE
//
// Create the sub dialog(s)
@@ -810,50 +730,32 @@ enum {
};
HelpDialog::HelpDialog(ScummEngine *scumm)
- : ScummDialog(scumm, 5, 5, 310, 190) {
+ : ScummDialog(scumm, "scummhelp") {
_drawingHints &= ~GUI::THEME_HINT_SPECIAL_COLOR;
- const int screenW = g_system->getOverlayWidth();
- const int screenH = g_system->getOverlayHeight();
-
- GUI::WidgetSize ws;
- int buttonHeight;
- int buttonWidth;
-
- if (screenW >= 400 && screenH >= 300) {
- ws = GUI::kBigWidgetSize;
- buttonHeight = kBigButtonHeight;
- buttonWidth = kBigButtonWidth;
- _w = 370;
- _x = (screenW - _w) / 2;
- } else {
- ws = GUI::kNormalWidgetSize;
- buttonHeight = kButtonHeight;
- buttonWidth = kButtonWidth;
- _x = 5;
- _w = screenW - 2 * 5;
- }
-
int lineHeight = g_gui.getFontHeight();
- _h = 5 + (2 + HELP_NUM_LINES) * lineHeight + buttonHeight + 7;
- _y = (screenH - _h) / 2;
-
- _title = new StaticTextWidget(this, 10, 5, _w, lineHeight, "", kTextAlignCenter, ws);
+ _title = new StaticTextWidget(this, "scummhelp_title", "", kTextAlignCenter);
+ int keyX = g_gui.evaluator()->getVar("scummhelp_key.x");
+ int keyYoff = g_gui.evaluator()->getVar("scummhelp_key.yoffset");
+ int keyW = g_gui.evaluator()->getVar("scummhelp_key.w");
+ int keyH = g_gui.evaluator()->getVar("scummhelp_key.h");
+ int dscX = g_gui.evaluator()->getVar("scummhelp_dsc.x");
+ int dscYoff = g_gui.evaluator()->getVar("scummhelp_dsc.yoffset");
+ int dscW = g_gui.evaluator()->getVar("scummhelp_dsc.w");
+ int dscH = g_gui.evaluator()->getVar("scummhelp_dsc.h");
for (int i = 0; i < HELP_NUM_LINES; i++) {
- _key[i] = new StaticTextWidget(this, 10, 5 + lineHeight * (i + 2), 80, lineHeight, "", kTextAlignLeft, ws);
- _dsc[i] = new StaticTextWidget(this, 90, 5 + lineHeight * (i + 2), _w - 10 - 90, lineHeight, "", kTextAlignLeft, ws);
+ _key[i] = new StaticTextWidget(this, keyX, keyYoff + lineHeight * (i + 2), keyW, keyH, "", kTextAlignLeft);
+ _dsc[i] = new StaticTextWidget(this, dscX, dscYoff + lineHeight * (i + 2), dscW, dscH, "", kTextAlignLeft);
}
_page = 1;
_numPages = ScummHelp::numPages(scumm->_game.id);
- int y = 5 + lineHeight * (HELP_NUM_LINES + 2) + 2;
-
- _prevButton = addButton(this, 10, y, "Previous", kPrevCmd, 'P', ws);
- _nextButton = addButton(this, 10 + buttonWidth + 8, y, "Next", kNextCmd, 'N', ws);
- addButton(this, _w - 8 - buttonWidth, y, "Close", kCloseCmd, 'C', ws);
+ _prevButton = new GUI::ButtonWidget(this, "scummhelp_prev", "Previous", kPrevCmd, 'P');
+ _nextButton = new GUI::ButtonWidget(this, "scummhelp_next", "Next", kNextCmd, 'N');
+ new GUI::ButtonWidget(this, "scummhelp_close", "Close", kCloseCmd, 'C');
_prevButton->clearFlags(WIDGET_ENABLED);
displayKeyBindings();
@@ -910,25 +812,18 @@ void HelpDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
#pragma mark -
InfoDialog::InfoDialog(ScummEngine *scumm, int res)
-: ScummDialog(scumm, 0, 80, 0, 16) { // dummy x and w
+: ScummDialog(scumm, "scummDummyDialog") { // dummy x and w
setInfoText(queryResString (res));
}
InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)
-: ScummDialog(scumm, 0, 80, 0, 16) { // dummy x and w
+: ScummDialog(scumm, "scummDummyDialog") { // dummy x and w
setInfoText(message);
}
void InfoDialog::setInfoText(const String& message) {
const int screenW = g_system->getOverlayWidth();
const int screenH = g_system->getOverlayHeight();
- GUI::WidgetSize ws;
-
- if (screenW >= 400 && screenH >= 300) {
- ws = GUI::kBigWidgetSize;
- } else {
- ws = GUI::kNormalWidgetSize;
- }
int width = g_gui.getStringWidth(message) + 16;
int height = g_gui.getFontHeight() + 8;
@@ -938,7 +833,7 @@ void InfoDialog::setInfoText(const String& message) {
_x = (screenW - width) / 2;
_y = (screenH - height) / 2;
- new StaticTextWidget(this, 4, 4, _w - 8, _h, message, kTextAlignCenter, ws);
+ new StaticTextWidget(this, 4, 4, _w - 8, _h, message, kTextAlignCenter);
}
#pragma mark -
@@ -972,13 +867,13 @@ void ConfirmDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
#pragma mark -
ValueDisplayDialog::ValueDisplayDialog(const Common::String& label, int minVal, int maxVal, int val, uint16 incKey, uint16 decKey)
- : GUI::Dialog(0, 80, 0, 16), _label(label), _min(minVal), _max(maxVal), _value(val), _incKey(incKey), _decKey(decKey) {
+ : GUI::Dialog("scummDummyDialog"), _label(label), _min(minVal), _max(maxVal), _value(val), _incKey(incKey), _decKey(decKey) {
assert(_min <= _value && _value <= _max);
const int screenW = g_system->getOverlayWidth();
const int screenH = g_system->getOverlayHeight();
- if (screenW >= 400 && screenH >= 300) {
+ if (g_gui.getWidgetSize() == GUI::kBigWidgetSize) {
_percentBarWidth = kBigPercentBarWidth;
} else {
_percentBarWidth = kPercentBarWidth;
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index c49a710eb7..03a2844072 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -42,7 +42,7 @@ class ScummEngine;
class ScummDialog : public GUI::Dialog {
public:
- ScummDialog(ScummEngine *scumm, int x, int y, int w, int h);
+ ScummDialog(ScummEngine *scumm, Common::String name);
protected:
typedef Common::String String;
diff --git a/gui/browser.cpp b/gui/browser.cpp
index 8c050402f8..d31e3b851a 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -160,10 +160,10 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
_currentPath = NULL;
// Headline - TODO: should be customizable during creation time
- new StaticTextWidget(this, 10, kLineHeight, _w - 2 * 10, kLineHeight, title, kTextAlignCenter, ws);
+ new StaticTextWidget(this, 10, kLineHeight, _w - 2 * 10, kLineHeight, title, kTextAlignCenter);
// Current path - TODO: handle long paths ?
- _currentPath = new StaticTextWidget(this, 10, 2 * kLineHeight, _w - 2 * 10, kLineHeight, "DUMMY", kTextAlignLeft, ws);
+ _currentPath = new StaticTextWidget(this, 10, 2 * kLineHeight, _w - 2 * 10, kLineHeight, "DUMMY", kTextAlignLeft);
// Add file list
_fileList = new ListWidget(this, 10, 3 * kLineHeight, _w - 2 * 10, _h - 3 * kLineHeight - buttonHeight - 14, ws);
diff --git a/gui/eval.cpp b/gui/eval.cpp
index ba2ed1e694..18a027a830 100644
--- a/gui/eval.cpp
+++ b/gui/eval.cpp
@@ -26,6 +26,8 @@
#include "gui/widget.h"
#include "gui/newgui.h"
+#include "graphics/scaler.h"
+
namespace GUI {
static bool isdelim(char c) {
@@ -45,7 +47,7 @@ Eval::~Eval() {
int Eval::eval(const String &input, const String &section, const String &name, int startpos) {
int result;
- debug(3, "<%s>", input.c_str());
+ debug(3, "%s=%s", name.c_str(), input.c_str());
strncpy(_input, input.c_str(), 256);
_section = section;
@@ -240,6 +242,8 @@ static const BuiltinConsts builtinConsts[] = {
{"kNormalWidgetSize", GUI::kNormalWidgetSize},
{"kBigWidgetSize", GUI::kBigWidgetSize},
+ {"kThumbnailWidth", kThumbnailWidth},
+
{"false", 0},
{"true", 1},
{NULL, 0}
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index e539460ee5..24723ce3d1 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -191,12 +191,12 @@ EditGameDialog::EditGameDialog(const String &domain, const char *desc)
yoffset = vBorder;
// GUI: Label & edit widget for the game ID
- new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "ID: ", kTextAlignRight, ws);
+ new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "ID: ", kTextAlignRight);
_domainWidget = new DomainEditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10 - x, kLineHeight, _domain, ws);
yoffset += _domainWidget->getHeight() + 3;
// GUI: Label & edit widget for the description
- new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "Name: ", kTextAlignRight, ws);
+ new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "Name: ", kTextAlignRight);
_descriptionWidget = new EditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10 - x, kLineHeight, description, ws);
yoffset += _descriptionWidget->getHeight() + 3;
@@ -229,12 +229,12 @@ EditGameDialog::EditGameDialog(const String &domain, const char *desc)
// GUI: Button + Label for the game path
new ButtonWidget(tab, x, yoffset, buttonWidth + 5, buttonHeight, "Game Path: ", kCmdGameBrowser, 0, ws);
- _gamePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, gamePath, kTextAlignLeft, ws);
+ _gamePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, gamePath, kTextAlignLeft);
yoffset += buttonHeight + 4;
// GUI: Button + Label for the additional path
new ButtonWidget(tab, x, yoffset, buttonWidth + 5, buttonHeight, "Extra Path:", kCmdExtraBrowser, 0, ws);
- _extraPathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, extraPath, kTextAlignLeft, ws);
+ _extraPathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, extraPath, kTextAlignLeft);
if (extraPath.isEmpty() || !ConfMan.hasKey("extrapath", _domain)) {
_extraPathWidget->setLabel("None");
}
@@ -242,7 +242,7 @@ EditGameDialog::EditGameDialog(const String &domain, const char *desc)
// GUI: Button + Label for the save path
new ButtonWidget(tab, x, yoffset, buttonWidth + 5, buttonHeight, "Save Path: ", kCmdSaveBrowser, 0, ws);
- _savePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, savePath, kTextAlignLeft, ws);
+ _savePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, savePath, kTextAlignLeft);
if (savePath.isEmpty() || !ConfMan.hasKey("savepath", _domain)) {
_savePathWidget->setLabel("Default");
}
diff --git a/gui/message.cpp b/gui/message.cpp
index da89a0a385..96d620bb07 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -83,7 +83,7 @@ MessageDialog::MessageDialog(const Common::String &message, const char *defaultB
// Each line is represented by one static text item.
for (int i = 0; i < lineCount; i++) {
new StaticTextWidget(this, 10, 10 + i * kLineHeight, maxlineWidth, kLineHeight,
- lines[i], kTextAlignCenter, ws);
+ lines[i], kTextAlignCenter);
}
// FIXME - allow for more than two buttons, and return in runModal() which one
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index 808dea699d..67cffab6df 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -58,10 +58,13 @@ enum {
// HACK. FIXME. This doesn't belong here. But otherwise it creates compulation problems
GuiObject::GuiObject(Common::String name) : _firstWidget(0) {
- _x = g_gui.evaluator()->getVar(name + ".x");
- _y = g_gui.evaluator()->getVar(name + ".y");
+ if ((_x = g_gui.evaluator()->getVar(name + ".x")) == EVAL_UNDEF_VAR)
+ error("Undefined variable %s.x", name.c_str());
+ if ((_y = g_gui.evaluator()->getVar(name + ".y")) == EVAL_UNDEF_VAR)
+ error("Undefined variable %s.y", name.c_str());
_w = g_gui.evaluator()->getVar(name + ".w");
_h = g_gui.evaluator()->getVar(name + ".h");
+
_name = name;
}
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp
index 4249fd882c..10edc49251 100644
--- a/gui/theme-config.cpp
+++ b/gui/theme-config.cpp
@@ -37,6 +37,13 @@ def_kFontHeight=10\n\
def_globOptionsW=(w - 2 * 10)\n\
def_globOptionsH=(h - 1 * 40)\n\
def_tabPopupsLabelW=100\n\
+def_scummmainHOffset=8\n\
+def_scummmainVSpace=5\n\
+def_scummmainVAddOff=2\n\
+def_scummmainButtonWidth=90\n\
+def_scummmainButtonHeight=16\n\
+def_scummhelpX=5\n\
+def_scummhelpW=(w - 2 * 5)\n\
def_midiControlsSpacing=1\n\
use=XxY\n\
\n\
@@ -51,11 +58,18 @@ def_kFontHeight=14\n\
def_globOptionsW=(w - 2 * 10)\n\
def_globOptionsH=(h - 2 * 40)\n\
def_tabPopupsLabelW=150\n\
+def_scummmainHOffset=12\n\
+def_scummmainVSpace=7\n\
+def_scummmainVAddOff=3\n\
+def_scummmainButtonWidth=160\n\
+def_scummmainButtonHeight=28\n\
+def_scummhelpW=370\n\
+def_scummhelpX=((w - scummhelpW) / 2)\n\
def_midiControlsSpacing=2\n\
chooser_headline=10 6 (w - 2 * 16) (kLineHeight)\n\
chooser_list=10 (6 + kLineHeight + 2) (w - 2 * 16) (h - self.y - buttonHeight - 12)\n\
\n\
-## launcher\n\
+##### launcher\n\
hBorder=10\n\
launcher_version=hBorder 8 (w - 2 * hBorder) kLineHeight\n\
top=(h - 8 - buttonHeight)\n\
@@ -63,23 +77,23 @@ numButtons=4\n\
space=8\n\
butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)\n\
launcher_quit_button=hBorder top butWidth buttonHeight\n\
-launcher_about_button=(prev.x2 + space) top butWidth buttonHeight\n\
-launcher_options_button=(prev.x2 + space) top butWidth buttonHeight\n\
-launcher_start_button=(prev.x2 + space) top butWidth buttonHeight\n\
+launcher_about_button=(prev.x2 + space) prev.y prev.w prev.h\n\
+launcher_options_button=(prev.x2 + space) prev.y prev.w prev.h\n\
+launcher_start_button=(prev.x2 + space) prev.y prev.w prev.h\n\
top=(top - buttonHeight * 2)\n\
numButtons=3\n\
space=10\n\
butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)\n\
launcher_addGame_button=hBorder top butWidth buttonHeight\n\
-launcher_editGame_button=(prev.x2 + space) top butWidth buttonHeight\n\
-launcher_removeGame_button=(prev.x2 + space) top butWidth buttonHeight\n\
+launcher_editGame_button=(prev.x2 + space) prev.y prev.w prev.h\n\
+launcher_removeGame_button=(prev.x2 + space) prev.y prev.w prev.h\n\
launcher_list=hBorder (kLineHeight + 16) (w - 2 * hBorder) (top - kLineHeight - 20)\n\
\n\
-# global options\n\
+### global options\n\
globaloptions=10 40 globOptionsW globOptionsH\n\
set_parent=globaloptions\n\
vBorder=5\n\
-globaloptions_tabwidget=0, vBorder parent.w (parent.h - buttonHeight -8 - 2 * vBorder)\n\
+globaloptions_tabwidget=0, vBorder parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)\n\
\n\
# graphics tab\n\
opYoffset=vBorder\n\
@@ -100,17 +114,17 @@ useWithPrefix=midiControls globaloptions_\n\
# paths tab\n\
yoffset=vBorder\n\
globaloptions_savebutton=5 yoffset (buttonWidth + 5) buttonHeight\n\
-globaloptions_savepath=(prev.x2 + 20) (vBorder + 3) (parent.w - (5 + buttonWidth + 20) - 10) kLineHeight\n\
+globaloptions_savepath=(prev.x2 + 20) (vBorder + 3) (parent.w - (prev.w + 20) - 10) kLineHeight\n\
yoffset=(yoffset + buttonHeight + 4)\n\
globaloptions_extrabutton=5 yoffset (buttonWidth + 5) buttonHeight\n\
-globaloptions_extrapath=(prev.x2 + 20) (vBorder + 3) (parent.w - (5 + buttonWidth + 20) - 10) kLineHeight\n\
+globaloptions_extrapath=(prev.x2 + 20) (vBorder + 3) (parent.w - (prev.w + 20) - 10) kLineHeight\n\
yoffset=(yoffset + buttonHeight + 4)\n\
globaloptions_keysbutton=5 yoffset buttonWidth buttonHeight\n\
\n\
-globaloptions_ok=(parent.w - (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n\
globaloptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n\
+globaloptions_ok=(prev.x2 + 10) prev.y prev.w prev.h\n\
\n\
-# game options\n\
+### game options\n\
opYoffset=(vBorder + buttonHeight)\n\
opWidth=globOptionsW\n\
useWithPrefix=graphicsControls gameoptions_\n\
@@ -124,20 +138,86 @@ useWithPrefix=volumeControls gameoptions_\n\
opYoffset=(vBorder + buttonHeight)\n\
useWithPrefix=midiControls gameoptions_\n\
\n\
-### SCUMM game options\n\
+##### SCUMM dialogs\n\
+scummDummyDialog=0 80 0 16\n\
+\n\
+## Main dialog\n\
+# note that scummmain size depends on overall height\n\
+smY=(scummmainVSpace + scummmainVAddOff)\n\
+scummmain_resume=scummmainHOffset smY scummmainButtonWidth scummmainButtonHeight\n\
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\
+smY=(smY + scummmainVSpace)\n\
+scummmain_load=prev.x smY prev.w prev.h\n\
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\
+scummmain_save=prev.x smY prev.w prev.h\n\
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\
+smY=(smY + scummmainVSpace)\n\
+scummmain_options=prev.x smY prev.w prev.h\n\
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\
+scummmain_help=prev.x smY prev.w prev.h\n\
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\
+scummmain_about=prev.x smY prev.w prev.h\n\
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\
+smY=(smY + scummmainVSpace)\n\
+scummmain_quit=prev.x smY prev.w prev.h\n\
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\
+smW=(scummmainButtonWidth + 2 * scummmainHOffset)\n\
+smH=(smY + scummmainVSpace)\n\
+scummmain=((w - smW) / 2) ((h - smH) / 2) smW smH\n\
+\n\
+## Engine config\n\
+# note that scummconfig size depends on overall height\n\
+# hence it is on the end of the list\n\
opYoffset=8\n\
-useWithPrefix=volumeControls scummoptions_\n\
+useWithPrefix=volumeControls scummconfig_\n\
+scummconfig_subtitlesCheckbox=15 opYoffset (kFontHeight + 10 + 89) buttonHeight\n\
+opYoffset=(opYoffset + buttonHeight)\n\
+scummconfig_speechCheckbox=prev.x opYoffset (kFontHeight + 10 + 85) buttonHeight\n\
+opYoffset=(opYoffset + buttonHeight + 4)\n\
+soWidth=(8 + 3 * buttonWidth + 4)\n\
+scummconfig_keys=(soWidth - 3 * (buttonWidth + 4) - 4) opYoffset buttonWidth buttonHeight\n\
+scummconfig_cancel=(prev.x2 + 4) prev.y prev.w prev.h\n\
+scummconfig_ok=(prev.x2 + 4) prev.y prev.w prev.h\n\
+opYoffset=(opYoffset + buttonHeight)\n\
+scummconfig=((w - soWidth) / 2) ((h - opYoffset) / 2) soWidth (opYoffset + 8)\n\
+\n\
+## Help\n\
+scummHelpNumLines=15\n\
+shH=(5 + (2 + scummHelpNumLines) * kFontHeight + buttonHeight + 7)\n\
+scummhelp=scummhelpX ((h - shH) / 2) scummhelpW shH\n\
+scummhelp_title=10 5 scummhelpW kFontHeight\n\
+scummhelp_key.x=10\n\
+scummhelp_key.yoffset=5\n\
+scummhelp_key.w=80\n\
+scummhelp_key.h=kFontHeight\n\
+scummhelp_dsc.x=90\n\
+scummhelp_dsc.yoffset=5\n\
+scummhelp_dsc.w=(scummhelpW - 10 - 90)\n\
+scummhelp_dsc.h=kFontHeight\n\
+scummhelp_prev=10 (5 + kFontHeight * (scummHelpNumLines + 2) + 2) buttonWidth buttonHeight\n\
+scummhelp_next=(prev.x2 + 8) prev.y prev.w prev.h\n\
+scummhelp_close=(scummhelpW - 8 - buttonWidth) prev.y prev.w prev.h\n\
+\n\
+# Saveload dialog\n\
+scummsaveload=8 8 (w - 2 * 8) (h - 16)\n\
+set_parent=scummsaveload\n\
+scummsaveload_title=10 6 (parent.w - 2 * 10) kLineHeight\n\
+scummsaveload_list=10 18 (parent.w - 2 * 10 - 180) (parent.h - 14 - buttonHeight - 18)\n\
+scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 22)) 18\n\
+scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n\
+scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h\n\
\n\
+############################################\n\
[graphicsControls]\n\
gcx=10\n\
gcw=(opWidth - 2 * 10)\n\
grModePopup=(gcx - 5) opYoffset (gcw + 5) kLineHeight\n\
opYoffset=(opYoffset + kLineHeight + 4)\n\
-grRenderPopup=(gcx - 5) opYoffset (gcw + 5) kLineHeight\n\
+grRenderPopup=prev.x opYoffset prev.w prev.h\n\
opYoffset=(opYoffset + kLineHeight + 4)\n\
grFullscreenCheckbox=gcx opYoffset (kFontHeight + 10 + 96) buttonHeight\n\
opYoffset=(opYoffset + buttonHeight)\n\
-grAspectCheckbox=gcx opYoffset (kFontHeight + 10 + 136) buttonHeight\n\
+grAspectCheckbox=prev.x opYoffset (kFontHeight + 10 + 136) prev.h\n\
opYoffset=(opYoffset + buttonHeight)\n\
\n\
[audioControls]\n\
@@ -200,7 +280,7 @@ void Theme::processSingleLine(const String &section, const String prefix, const
for (i = 0; i < str.size(); i++) {
if (isspace(str[i]) && level == 0) {
- value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name, start);
+ value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name + "." + postfixes[npostfix], start);
_evaluator->setVariable(prefix + name + "." + postfixes[npostfix++], value);
start = i + 1;
}
@@ -220,7 +300,7 @@ void Theme::processSingleLine(const String &section, const String prefix, const
error("Missing ')' in section: [%s] expression: \"%s\" start is at: %d",
section.c_str(), name.c_str(), start);
- value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name, start);
+ value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name + "." + postfixes[npostfix], start);
// process VAR=VALUE construct
if (npostfix == 0)
diff --git a/gui/themes/default-theme.ini b/gui/themes/default-theme.ini
index 3b6e0a034b..74b8e0c138 100644
--- a/gui/themes/default-theme.ini
+++ b/gui/themes/default-theme.ini
@@ -141,6 +141,13 @@ def_kFontHeight=10
def_globOptionsW=(w - 2 * 10)
def_globOptionsH=(h - 1 * 40)
def_tabPopupsLabelW=100
+def_scummmainHOffset=8
+def_scummmainVSpace=5
+def_scummmainVAddOff=2
+def_scummmainButtonWidth=90
+def_scummmainButtonHeight=16
+def_scummhelpX=5
+def_scummhelpW=(w - 2 * 5)
def_midiControlsSpacing=1
use=XxY
@@ -155,11 +162,18 @@ def_kFontHeight=14
def_globOptionsW=(w - 2 * 10)
def_globOptionsH=(h - 2 * 40)
def_tabPopupsLabelW=150
+def_scummmainHOffset=12
+def_scummmainVSpace=7
+def_scummmainVAddOff=3
+def_scummmainButtonWidth=160
+def_scummmainButtonHeight=28
+def_scummhelpW=370
+def_scummhelpX=((w - scummhelpW) / 2)
def_midiControlsSpacing=2
chooser_headline=10 6 (w - 2 * 16) (kLineHeight)
chooser_list=10 (6 + kLineHeight + 2) (w - 2 * 16) (h - self.y - buttonHeight - 12)
-## launcher
+##### launcher
hBorder=10
launcher_version=hBorder 8 (w - 2 * hBorder) kLineHeight
top=(h - 8 - buttonHeight)
@@ -167,23 +181,23 @@ numButtons=4
space=8
butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)
launcher_quit_button=hBorder top butWidth buttonHeight
-launcher_about_button=(prev.x2 + space) top butWidth buttonHeight
-launcher_options_button=(prev.x2 + space) top butWidth buttonHeight
-launcher_start_button=(prev.x2 + space) top butWidth buttonHeight
+launcher_about_button=(prev.x2 + space) prev.y prev.w prev.h
+launcher_options_button=(prev.x2 + space) prev.y prev.w prev.h
+launcher_start_button=(prev.x2 + space) prev.y prev.w prev.h
top=(top - buttonHeight * 2)
numButtons=3
space=10
butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)
launcher_addGame_button=hBorder top butWidth buttonHeight
-launcher_editGame_button=(prev.x2 + space) top butWidth buttonHeight
-launcher_removeGame_button=(prev.x2 + space) top butWidth buttonHeight
+launcher_editGame_button=(prev.x2 + space) prev.y prev.w prev.h
+launcher_removeGame_button=(prev.x2 + space) prev.y prev.w prev.h
launcher_list=hBorder (kLineHeight + 16) (w - 2 * hBorder) (top - kLineHeight - 20)
-# global options
+### global options
globaloptions=10 40 globOptionsW globOptionsH
set_parent=globaloptions
vBorder=5
-globaloptions_tabwidget=0, vBorder parent.w (parent.h - buttonHeight -8 - 2 * vBorder)
+globaloptions_tabwidget=0, vBorder parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)
# graphics tab
opYoffset=vBorder
@@ -204,17 +218,17 @@ useWithPrefix=midiControls globaloptions_
# paths tab
yoffset=vBorder
globaloptions_savebutton=5 yoffset (buttonWidth + 5) buttonHeight
-globaloptions_savepath=(prev.x2 + 20) (vBorder + 3) (parent.w - (5 + buttonWidth + 20) - 10) kLineHeight
+globaloptions_savepath=(prev.x2 + 20) (vBorder + 3) (parent.w - (prev.w + 20) - 10) kLineHeight
yoffset=(yoffset + buttonHeight + 4)
globaloptions_extrabutton=5 yoffset (buttonWidth + 5) buttonHeight
-globaloptions_extrapath=(prev.x2 + 20) (vBorder + 3) (parent.w - (5 + buttonWidth + 20) - 10) kLineHeight
+globaloptions_extrapath=(prev.x2 + 20) (vBorder + 3) (parent.w - (prev.w + 20) - 10) kLineHeight
yoffset=(yoffset + buttonHeight + 4)
globaloptions_keysbutton=5 yoffset buttonWidth buttonHeight
-globaloptions_ok=(parent.w - (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
globaloptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
+globaloptions_ok=(prev.x2 + 10) prev.y prev.w prev.h
-# game options
+### game options
opYoffset=(vBorder + buttonHeight)
opWidth=globOptionsW
useWithPrefix=graphicsControls gameoptions_
@@ -228,20 +242,86 @@ useWithPrefix=volumeControls gameoptions_
opYoffset=(vBorder + buttonHeight)
useWithPrefix=midiControls gameoptions_
-### SCUMM game options
+##### SCUMM dialogs
+scummDummyDialog=0 80 0 16
+
+## Main dialog
+# note that scummmain size depends on overall height
+smY=(scummmainVSpace + scummmainVAddOff)
+scummmain_resume=scummmainHOffset smY scummmainButtonWidth scummmainButtonHeight
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)
+smY=(smY + scummmainVSpace)
+scummmain_load=prev.x smY prev.w prev.h
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)
+scummmain_save=prev.x smY prev.w prev.h
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)
+smY=(smY + scummmainVSpace)
+scummmain_options=prev.x smY prev.w prev.h
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)
+scummmain_help=prev.x smY prev.w prev.h
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)
+scummmain_about=prev.x smY prev.w prev.h
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)
+smY=(smY + scummmainVSpace)
+scummmain_quit=prev.x smY prev.w prev.h
+smY=(smY + scummmainButtonHeight + scummmainVAddOff)
+smW=(scummmainButtonWidth + 2 * scummmainHOffset)
+smH=(smY + scummmainVSpace)
+scummmain=((w - smW) / 2) ((h - smH) / 2) smW smH
+
+## Engine config
+# note that scummconfig size depends on overall height
+# hence it is on the end of the list
opYoffset=8
-useWithPrefix=volumeControls scummoptions_
-
+useWithPrefix=volumeControls scummconfig_
+scummconfig_subtitlesCheckbox=15 opYoffset (kFontHeight + 10 + 89) buttonHeight
+opYoffset=(opYoffset + buttonHeight)
+scummconfig_speechCheckbox=prev.x opYoffset (kFontHeight + 10 + 85) buttonHeight
+opYoffset=(opYoffset + buttonHeight + 4)
+soWidth=(8 + 3 * buttonWidth + 4)
+scummconfig_keys=(soWidth - 3 * (buttonWidth + 4) - 4) opYoffset buttonWidth buttonHeight
+scummconfig_cancel=(prev.x2 + 4) prev.y prev.w prev.h
+scummconfig_ok=(prev.x2 + 4) prev.y prev.w prev.h
+opYoffset=(opYoffset + buttonHeight)
+scummconfig=((w - soWidth) / 2) ((h - opYoffset) / 2) soWidth (opYoffset + 8)
+
+## Help
+scummHelpNumLines=15
+shH=(5 + (2 + scummHelpNumLines) * kFontHeight + buttonHeight + 7)
+scummhelp=scummhelpX ((h - shH) / 2) scummhelpW shH
+scummhelp_title=10 5 scummhelpW kFontHeight
+scummhelp_key.x=10
+scummhelp_key.yoffset=5
+scummhelp_key.w=80
+scummhelp_key.h=kFontHeight
+scummhelp_dsc.x=90
+scummhelp_dsc.yoffset=5
+scummhelp_dsc.w=(scummhelpW - 10 - 90)
+scummhelp_dsc.h=kFontHeight
+scummhelp_prev=10 (5 + kFontHeight * (scummHelpNumLines + 2) + 2) buttonWidth buttonHeight
+scummhelp_next=(prev.x2 + 8) prev.y prev.w prev.h
+scummhelp_close=(scummhelpW - 8 - buttonWidth) prev.y prev.w prev.h
+
+# Saveload dialog
+scummsaveload=8 8 (w - 2 * 8) (h - 16)
+set_parent=scummsaveload
+scummsaveload_title=10 6 (parent.w - 2 * 10) kLineHeight
+scummsaveload_list=10 18 (parent.w - 2 * 10 - 180) (parent.h - 14 - buttonHeight - 18)
+scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 22)) 18
+scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
+scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h
+
+############################################
[graphicsControls]
gcx=10
gcw=(opWidth - 2 * 10)
grModePopup=(gcx - 5) opYoffset (gcw + 5) kLineHeight
opYoffset=(opYoffset + kLineHeight + 4)
-grRenderPopup=(gcx - 5) opYoffset (gcw + 5) kLineHeight
+grRenderPopup=prev.x opYoffset prev.w prev.h
opYoffset=(opYoffset + kLineHeight + 4)
grFullscreenCheckbox=gcx opYoffset (kFontHeight + 10 + 96) buttonHeight
opYoffset=(opYoffset + buttonHeight)
-grAspectCheckbox=gcx opYoffset (kFontHeight + 10 + 136) buttonHeight
+grAspectCheckbox=prev.x opYoffset (kFontHeight + 10 + 136) prev.h
opYoffset=(opYoffset + buttonHeight)
[audioControls]
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 21b18a1f1b..54383c073f 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -123,8 +123,9 @@ bool Widget::isVisible() const {
#pragma mark -
-StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align, WidgetSize ws)
- : Widget(boss, x, y, w, h), _align(align), _ws(ws) {
+StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align)
+ : Widget(boss, x, y, w, h), _align(align) {
+ _ws = g_gui.getWidgetSize();
_flags = WIDGET_ENABLED;
_type = kStaticTextWidget;
_label = text;
@@ -169,7 +170,7 @@ void StaticTextWidget::drawWidget(bool hilite) {
#pragma mark -
ButtonWidget::ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd, uint8 hotkey, WidgetSize ws)
- : StaticTextWidget(boss, x, y, w, h, label, kTextAlignCenter, ws), CommandSender(boss),
+ : StaticTextWidget(boss, x, y, w, h, label, kTextAlignCenter), CommandSender(boss),
_cmd(cmd), _hotkey(hotkey) {
_flags = WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG;
_type = kButtonWidget;
diff --git a/gui/widget.h b/gui/widget.h
index 17ad52221a..112177db8e 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -163,7 +163,7 @@ protected:
TextAlignment _align;
WidgetSize _ws;
public:
- StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align, WidgetSize ws = kDefaultWidgetSize);
+ StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align);
StaticTextWidget(GuiObject *boss, String name, const String &text, TextAlignment align);
void setValue(int value);
void setLabel(const String &label);