aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-05-20 15:03:26 +0000
committerTorbjörn Andersson2005-05-20 15:03:26 +0000
commit801db4a5159728619d502ade157f81615ba93375 (patch)
tree0aa875e4e4df3fa17bf0f8553ef3ad9d0841af0b
parent5eaedacce643c6a2e5a77d39fa61b8b4c67566b6 (diff)
downloadscummvm-rg350-801db4a5159728619d502ade157f81615ba93375.tar.gz
scummvm-rg350-801db4a5159728619d502ade157f81615ba93375.tar.bz2
scummvm-rg350-801db4a5159728619d502ade157f81615ba93375.zip
Added big editable text widget, and removed some cruft. I think this means
that all our widgets are able to scale themselves now, but I could be mistaken. svn-id: r18192
-rw-r--r--gui/EditTextWidget.cpp10
-rw-r--r--gui/EditTextWidget.h2
-rw-r--r--gui/ListWidget.cpp5
-rw-r--r--gui/browser.cpp6
-rw-r--r--gui/chooser.cpp4
-rw-r--r--gui/dialog.cpp16
-rw-r--r--gui/dialog.h7
-rw-r--r--gui/editable.cpp14
-rw-r--r--gui/editable.h2
-rw-r--r--gui/launcher.cpp39
-rw-r--r--gui/message.cpp4
-rw-r--r--gui/newgui.cpp4
-rw-r--r--gui/newgui.h2
-rw-r--r--gui/options.cpp4
-rw-r--r--scumm/dialogs.cpp20
15 files changed, 66 insertions, 73 deletions
diff --git a/gui/EditTextWidget.cpp b/gui/EditTextWidget.cpp
index 2e0fd21db0..e64a1c43bc 100644
--- a/gui/EditTextWidget.cpp
+++ b/gui/EditTextWidget.cpp
@@ -26,8 +26,8 @@
namespace GUI {
-EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text)
- : EditableWidget(boss, x, y - 1, w, h + 2) {
+EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, WidgetSize ws)
+ : EditableWidget(boss, x, y - 1, w, h + 2, ws) {
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE;
_type = kEditTextWidget;
@@ -44,15 +44,13 @@ void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) {
if (_caretVisible)
drawCaret(true);
- NewGui *gui = &g_gui;
-
x += _editScrollOffset;
int width = 0;
uint i;
for (i = 0; i < _editString.size(); ++i) {
- width += gui->getCharWidth(_editString[i]);
+ width += _font->getCharWidth(_editString[i]);
if (width >= x)
break;
}
@@ -70,7 +68,7 @@ void EditTextWidget::drawWidget(bool hilite) {
// Draw the text
adjustOffset();
- g_gui.drawString(_editString, _x + 2, _y + 2, getEditRect().width(), g_gui._textcolor, kTextAlignLeft, -_editScrollOffset, false);
+ g_gui.drawString(_font, _editString, _x + 2, _y + 2, getEditRect().width(), g_gui._textcolor, kTextAlignLeft, -_editScrollOffset, false);
}
Common::Rect EditTextWidget::getEditRect() const {
diff --git a/gui/EditTextWidget.h b/gui/EditTextWidget.h
index 007d27039d..ae2225c4de 100644
--- a/gui/EditTextWidget.h
+++ b/gui/EditTextWidget.h
@@ -34,7 +34,7 @@ protected:
String _backupString;
public:
- EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text);
+ EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, WidgetSize ws = kNormalWidgetSize);
void setEditString(const String &str);
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 96b37da6c8..6274f78175 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -28,14 +28,11 @@
namespace GUI {
ListWidget::ListWidget(GuiObject *boss, int x, int y, int w, int h, WidgetSize ws)
- : EditableWidget(boss, x, y, w, h), CommandSender(boss) {
+ : EditableWidget(boss, x, y, w, h, ws), CommandSender(boss) {
- // TODO: When in kBigWidgetSize mode, use another font
if (ws == kBigWidgetSize) {
- _font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
_w = w - kBigScrollBarWidth;
} else {
- _font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
_w = w - kNormalScrollBarWidth;
}
_lineHeight = _font->getFontHeight() + 2;
diff --git a/gui/browser.cpp b/gui/browser.cpp
index b4d489427a..431e436e3e 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -177,9 +177,9 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
_fileList->setEditable(false);
// Buttons
- addButton(10, _h - buttonHeight - 8, "Go up", kGoUpCmd, 0, ws);
- addButton(_w - 2 * (buttonWidth + 10), _h - buttonHeight - 8, "Cancel", kCloseCmd, 0, ws);
- addButton(_w - (buttonWidth + 10), _h - buttonHeight - 8, "Choose", kChooseCmd, 0, ws);
+ addButton(this, 10, _h - buttonHeight - 8, "Go up", kGoUpCmd, 0, ws);
+ addButton(this, _w - 2 * (buttonWidth + 10), _h - buttonHeight - 8, "Cancel", kCloseCmd, 0, ws);
+ addButton(this, _w - (buttonWidth + 10), _h - buttonHeight - 8, "Choose", kChooseCmd, 0, ws);
}
void BrowserDialog::open() {
diff --git a/gui/chooser.cpp b/gui/chooser.cpp
index 429d60b171..291e927255 100644
--- a/gui/chooser.cpp
+++ b/gui/chooser.cpp
@@ -39,8 +39,8 @@ ChooserDialog::ChooserDialog(const String &title, const String &buttonLabel, int
_list->setNumberingMode(kListNumberingOff);
// Buttons
- addButton(_w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0);
- _chooseButton = addButton(_w-(kButtonWidth + 10), _h - 24, buttonLabel, kChooseCmd, 0);
+ addButton(this, _w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0);
+ _chooseButton = addButton(this, _w-(kButtonWidth + 10), _h - 24, buttonLabel, kChooseCmd, 0);
_chooseButton->setEnabled(false);
}
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 2b5de0ba9b..a651dd04b6 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -289,10 +289,6 @@ Widget *Dialog::findWidget(int x, int y) {
return Widget::findWidgetInChain(_firstWidget, x, y);
}
-ButtonWidget *Dialog::addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) {
- return addButton(this, x, y, label, cmd, hotkey, ws);
-}
-
ButtonWidget *Dialog::addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) {
int w = kButtonWidth;
int h = kButtonHeight;
@@ -303,10 +299,6 @@ ButtonWidget *Dialog::addButton(GuiObject *boss, int x, int y, const Common::Str
return new ButtonWidget(boss, x, y, w, h, label, cmd, hotkey, ws);
}
-CheckboxWidget *Dialog::addCheckbox(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) {
- return addCheckbox(this, x, y, label, cmd, hotkey, ws);
-}
-
CheckboxWidget *Dialog::addCheckbox(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) {
const Graphics::Font *font;
int w, h;
@@ -324,10 +316,6 @@ CheckboxWidget *Dialog::addCheckbox(GuiObject *boss, int x, int y, const Common:
return new CheckboxWidget(boss, x, y, w, h, label, cmd, hotkey, ws);
}
-SliderWidget *Dialog::addSlider(int x, int y, uint32 cmd, WidgetSize ws) {
- return addSlider(this, x, y, cmd, ws);
-}
-
SliderWidget *Dialog::addSlider(GuiObject *boss, int x, int y, uint32 cmd, WidgetSize ws) {
int w, h;
@@ -342,10 +330,6 @@ SliderWidget *Dialog::addSlider(GuiObject *boss, int x, int y, uint32 cmd, Widge
return new SliderWidget(boss, x, y, w, h, cmd);
}
-PopUpWidget *Dialog::addPopUp(int x, int y, int w, const Common::String &label, uint labelWidth, WidgetSize ws) {
- return addPopUp(this, x, y, w, label, labelWidth, ws);
-}
-
PopUpWidget *Dialog::addPopUp(GuiObject *boss, int x, int y, int w, const Common::String &label, uint labelWidth, WidgetSize ws) {
const Graphics::Font *font;
diff --git a/gui/dialog.h b/gui/dialog.h
index ec024d5df1..a45f26e026 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -88,16 +88,9 @@ protected:
Widget *findWidget(int x, int y); // Find the widget at pos x,y if any
ButtonWidget *addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize);
- ButtonWidget *addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize);
-
CheckboxWidget *addCheckbox(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize);
- CheckboxWidget *addCheckbox(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize);
-
SliderWidget *addSlider(GuiObject *boss, int x, int y, uint32 cmd, WidgetSize ws = kDefaultWidgetSize);
- SliderWidget *addSlider(int x, int y, uint32 cmd, WidgetSize ws = kDefaultWidgetSize);
-
PopUpWidget *addPopUp(GuiObject *boss, int x, int y, int w, const Common::String &label, uint labelWidth = 0, WidgetSize ws = kDefaultWidgetSize);
- PopUpWidget *addPopUp(int x, int y, int w, const Common::String &label, uint labelWidth = 0, WidgetSize ws = kDefaultWidgetSize);
void setResult(int result) { _result = result; }
int getResult() const { return _result; }
diff --git a/gui/editable.cpp b/gui/editable.cpp
index b9a40af981..78510dcc71 100644
--- a/gui/editable.cpp
+++ b/gui/editable.cpp
@@ -25,7 +25,7 @@
namespace GUI {
-EditableWidget::EditableWidget(GuiObject *boss, int x, int y, int w, int h)
+EditableWidget::EditableWidget(GuiObject *boss, int x, int y, int w, int h, WidgetSize ws)
: Widget(boss, x, y, w, h) {
_caretVisible = false;
_caretTime = 0;
@@ -35,7 +35,17 @@ EditableWidget::EditableWidget(GuiObject *boss, int x, int y, int w, int h)
_editScrollOffset = 0;
- _font = &g_gui.getFont(); // Most widgets will probably set this to something else.
+ switch (ws) {
+ case kNormalWidgetSize:
+ _font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
+ break;
+ case kBigWidgetSize:
+ _font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
+ break;
+ default:
+ _font = &g_gui.getFont();
+ break;
+ }
}
EditableWidget::~EditableWidget() {
diff --git a/gui/editable.h b/gui/editable.h
index 0b20bd072d..7f48aa295e 100644
--- a/gui/editable.h
+++ b/gui/editable.h
@@ -47,7 +47,7 @@ protected:
int _editScrollOffset;
public:
- EditableWidget(GuiObject *boss, int x, int y, int w, int h);
+ EditableWidget(GuiObject *boss, int x, int y, int w, int h, WidgetSize ws = kNormalWidgetSize);
virtual ~EditableWidget();
virtual void setEditString(const String &str);
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index b32de81c02..37427f02eb 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -79,8 +79,8 @@ enum {
*/
class DomainEditTextWidget : public EditTextWidget {
public:
- DomainEditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text)
- : EditTextWidget(boss, x, y, w, h, text) {
+ DomainEditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, WidgetSize ws = kNormalWidgetSize)
+ : EditTextWidget(boss, x, y, w, h, text, ws) {
}
protected:
@@ -188,15 +188,25 @@ EditGameDialog::EditGameDialog(const String &domain, GameSettings target)
tab->addTab("Game");
yoffset = vBorder;
+ const Graphics::Font *font;
+
+ if (ws == GUI::kBigWidgetSize) {
+ font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
+ } else {
+ font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
+ }
+
+ int lineHeight = font->getFontHeight() + 2;
+
// GUI: Label & edit widget for the game ID
- new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "ID: ", kTextAlignRight, ws);
- _domainWidget = new DomainEditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10, kLineHeight, _domain);
- yoffset += 16;
+ new StaticTextWidget(tab, x, yoffset + 2, labelWidth, lineHeight, "ID: ", kTextAlignRight, ws);
+ _domainWidget = new DomainEditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10 - x, lineHeight, _domain, ws);
+ yoffset += _domainWidget->getHeight() + 3;
// GUI: Label & edit widget for the description
- new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "Name: ", kTextAlignRight, ws);
- _descriptionWidget = new EditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10, kLineHeight, description);
- yoffset += 16;
+ new StaticTextWidget(tab, x, yoffset + 2, labelWidth, lineHeight, "Name: ", kTextAlignRight, ws);
+ _descriptionWidget = new EditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10 - x, lineHeight, description, ws);
+ yoffset += _descriptionWidget->getHeight() + 3;
// Language popup
_langPopUp = addPopUp(tab, x, yoffset, w, "Language: ", labelWidth, ws);
@@ -224,12 +234,12 @@ EditGameDialog::EditGameDialog(const String &domain, GameSettings target)
// GUI: Button + Label for the game path
addButton(tab, x, yoffset, "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, lineHeight, gamePath, kTextAlignLeft, ws);
yoffset += buttonHeight + 4;
// GUI: Button + Label for the additional path
addButton(tab, x, yoffset, "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, lineHeight, extraPath, kTextAlignLeft, ws);
if (extraPath.isEmpty() || !ConfMan.hasKey("extrapath", _domain)) {
_extraPathWidget->setLabel("None");
}
@@ -237,7 +247,7 @@ EditGameDialog::EditGameDialog(const String &domain, GameSettings target)
// GUI: Button + Label for the save path
addButton(tab, x, yoffset, "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, lineHeight, savePath, kTextAlignLeft, ws);
if (savePath.isEmpty() || !ConfMan.hasKey("savepath", _domain)) {
_savePathWidget->setLabel("Default");
}
@@ -292,8 +302,8 @@ EditGameDialog::EditGameDialog(const String &domain, GameSettings target)
tab->setActiveTab(0);
// Add OK & Cancel buttons
- addButton(_w - 2 * (buttonWidth + 10), _h - buttonHeight - 8, "Cancel", kCloseCmd, 0, ws);
- addButton(_w - (buttonWidth + 10), _h - buttonHeight - 8, "OK", kOKCmd, 0, ws);
+ addButton(this, _w - 2 * (buttonWidth + 10), _h - buttonHeight - 8, "Cancel", kCloseCmd, 0, ws);
+ addButton(this, _w - (buttonWidth + 10), _h - buttonHeight - 8, "OK", kOKCmd, 0, ws);
}
void EditGameDialog::open() {
@@ -506,12 +516,13 @@ LauncherDialog::LauncherDialog(GameDetector &detector)
ws = GUI::kBigWidgetSize;
font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
lineHeight = font->getFontHeight() + 2;
+ buttonHeight = kBigButtonHeight;
} else {
ws = GUI::kNormalWidgetSize;
font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
lineHeight = font->getFontHeight() + 2;
+ buttonHeight = kButtonHeight;
}
- buttonHeight = lineHeight * 4 / 3;
// Show ScummVM version
new StaticTextWidget(this, hBorder, 8, _w - 2*hBorder, lineHeight, gScummVMFullVersion, kTextAlignCenter, ws);
diff --git a/gui/message.cpp b/gui/message.cpp
index 68378d1ac7..5185cb4cbf 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -100,10 +100,10 @@ MessageDialog::MessageDialog(const Common::String &message, const char *defaultB
}
if (defaultButton)
- addButton(okButtonPos, _h - buttonHeight - 8, defaultButton, kOkCmd, '\n', ws); // Confirm dialog
+ addButton(this, okButtonPos, _h - buttonHeight - 8, defaultButton, kOkCmd, '\n', ws); // Confirm dialog
if (altButton)
- addButton(cancelButtonPos, _h - buttonHeight - 8, altButton, kCancelCmd, '\27', ws); // Cancel dialog
+ addButton(this, cancelButtonPos, _h - buttonHeight - 8, altButton, kCancelCmd, '\27', ws); // Cancel dialog
}
void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index d9a6330b90..94bc581511 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -466,8 +466,8 @@ void NewGui::drawString(const String &s, int x, int y, int w, OverlayColor color
getFont().drawString(&_screen, s, x * _scaleFactor, y * _scaleFactor, w * _scaleFactor, color, align, deltax, useEllipsis);
}
-void NewGui::drawString(const Graphics::Font *font, const String &s, int x, int y, int w, OverlayColor color, TextAlignment valign) {
- font->drawString(&_screen, s, x * _scaleFactor, y * _scaleFactor, w * _scaleFactor, color, valign);
+void NewGui::drawString(const Graphics::Font *font, const String &s, int x, int y, int w, OverlayColor color, TextAlignment align, int deltax, bool useEllipsis) {
+ font->drawString(&_screen, s, x * _scaleFactor, y * _scaleFactor, w * _scaleFactor, color, align, deltax, useEllipsis);
}
//
diff --git a/gui/newgui.h b/gui/newgui.h
index c931b248e8..bb0d960444 100644
--- a/gui/newgui.h
+++ b/gui/newgui.h
@@ -154,7 +154,7 @@ public:
void drawChar(byte c, int x, int y, OverlayColor color, const Graphics::Font *font = 0);
void drawString(const String &str, int x, int y, int w, OverlayColor color, Graphics::TextAlignment align = Graphics::kTextAlignLeft, int deltax = 0, bool useEllipsis = true);
- void drawString(const Graphics::Font *font, const String &str, int x, int y, int w, OverlayColor color, Graphics::TextAlignment valign = Graphics::kTextAlignLeft);
+ void drawString(const Graphics::Font *font, const String &str, int x, int y, int w, OverlayColor color, Graphics::TextAlignment align = Graphics::kTextAlignLeft, int deltax = 0, bool useEllipsis = true);
int getStringWidth(const String &str) const;
int getCharWidth(byte c) const;
diff --git a/gui/options.cpp b/gui/options.cpp
index f1f8088d83..63a11a80d4 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -576,8 +576,8 @@ GlobalOptionsDialog::GlobalOptionsDialog()
tab->setActiveTab(0);
// Add OK & Cancel buttons
- addButton(_w - 2 * (buttonWidth + 10), _h - buttonHeight - 8, "Cancel", kCloseCmd, 0, ws);
- addButton(_w - (buttonWidth + 10), _h - buttonHeight - 8, "OK", kOKCmd, 0, ws);
+ addButton(this, _w - 2 * (buttonWidth + 10), _h - buttonHeight - 8, "Cancel", kCloseCmd, 0, ws);
+ addButton(this, _w - (buttonWidth + 10), _h - buttonHeight - 8, "OK", kOKCmd, 0, ws);
// Create file browser dialogs
_dirBrowser = new BrowserDialog("Select directory for savegames", true);
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index 1fdf4555c5..94009c2c62 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -303,8 +303,8 @@ SaveLoadChooserEx::SaveLoadChooserEx(const String &title, const String &buttonLa
_gfxWidget->setFlags(GUI::WIDGET_BORDER);
// Buttons
- addButton(_w - 2 * (kBigButtonWidth + 10), _h - kBigButtonHeight - 8, "Cancel", kCloseCmd, 0, GUI::kBigWidgetSize);
- _chooseButton = addButton(_w - (kBigButtonWidth + 10), _h - kBigButtonHeight - 8, buttonLabel, kChooseCmd, 0, GUI::kBigWidgetSize);
+ 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);
_chooseButton->setEnabled(false);
}
@@ -578,10 +578,10 @@ ConfigDialog::ConfigDialog(ScummEngine *scumm)
// Some misc options
//
- _subtitlesCheckbox = addCheckbox(15, yoffset, "Show subtitles", 0, 'S', ws);
+ _subtitlesCheckbox = addCheckbox(this, 15, yoffset, "Show subtitles", 0, 'S', ws);
yoffset += _subtitlesCheckbox->getHeight();
- _speechCheckbox = addCheckbox(15, yoffset, "Enable speech", 0, 'E', ws);
+ _speechCheckbox = addCheckbox(this, 15, yoffset, "Enable speech", 0, 'E', ws);
yoffset += _speechCheckbox->getHeight() + 4;
//
@@ -590,10 +590,10 @@ ConfigDialog::ConfigDialog(ScummEngine *scumm)
_w = 8 + 3 * (buttonWidth + 4); // FIXME/TODO
- addButton(_w - (buttonWidth + 4) - 4, yoffset, "OK", GUI::OptionsDialog::kOKCmd, 'O', ws);
- addButton(_w - 2 * (buttonWidth + 4) - 4, yoffset, "Cancel", kCloseCmd, 'C', ws);
+ 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);
#ifdef _WIN32_WCE
- addButton(_w - 3 * (buttonWidth + 4) - 4, yoffset, "Keys", kKeysCmd, 'K', ws);
+ addButton(this, _w - 3 * (buttonWidth + 4) - 4, yoffset, "Keys", kKeysCmd, 'K', ws);
#endif
yoffset += buttonHeight;
@@ -712,9 +712,9 @@ HelpDialog::HelpDialog(ScummEngine *scumm)
int y = 5 + lineHeight * (HELP_NUM_LINES + 2) + 2;
- _prevButton = addButton(10, y, "Previous", kPrevCmd, 'P', ws);
- _nextButton = addButton(10 + buttonWidth + 8, y, "Next", kNextCmd, 'N', ws);
- addButton(_w - 8 - buttonWidth, y, "Close", kCloseCmd, 'C', ws);
+ _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->clearFlags(WIDGET_ENABLED);
displayKeyBindings();