aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/KeysDialog.cpp16
-rw-r--r--gui/KeysDialog.h4
-rw-r--r--gui/ListWidget.cpp18
-rw-r--r--gui/ListWidget.h4
-rw-r--r--gui/PopUpWidget.cpp10
-rw-r--r--gui/TabWidget.cpp4
-rw-r--r--gui/TabWidget.h2
-rw-r--r--gui/about.cpp8
-rw-r--r--gui/about.h4
-rw-r--r--gui/console.cpp22
-rw-r--r--gui/console.h2
-rw-r--r--gui/credits.h4
-rw-r--r--gui/dialog.cpp16
-rw-r--r--gui/dialog.h4
-rw-r--r--gui/editable.cpp6
-rw-r--r--gui/editable.h2
-rw-r--r--gui/launcher.cpp33
-rw-r--r--gui/launcher.h4
-rw-r--r--gui/newgui.cpp4
-rw-r--r--gui/options.cpp12
-rw-r--r--gui/theme-config.cpp42
-rw-r--r--gui/themes/classic080.ini19
-rw-r--r--gui/themes/modern.ini245
-rw-r--r--gui/widget.h5
24 files changed, 255 insertions, 235 deletions
diff --git a/gui/KeysDialog.cpp b/gui/KeysDialog.cpp
index 33d09e4e69..666f03bbc9 100644
--- a/gui/KeysDialog.cpp
+++ b/gui/KeysDialog.cpp
@@ -126,23 +126,23 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
}
}
-void KeysDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers){
+void KeysDialog::handleKeyDown(Common::KeyState state){
if (!Actions::Instance()->mappingActive())
- Dialog::handleKeyDown(ascii,keycode,modifiers);
+ Dialog::handleKeyDown(state);
}
-void KeysDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
+void KeysDialog::handleKeyUp(Common::KeyState state) {
#ifdef __SYMBIAN32__
if (Actions::Instance()->mappingActive()) {
#else
- if (modifiers == 0xff && Actions::Instance()->mappingActive()) { // GAPI key was selected
+ if (state.flags == 0xff && Actions::Instance()->mappingActive()) { // GAPI key was selected
#endif
char selection[100];
- Actions::Instance()->setMapping((ActionType)_actionSelected, ascii);
+ Actions::Instance()->setMapping((ActionType)_actionSelected, state.ascii);
- if (ascii != 0)
- sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey) keycode));
+ if (state.ascii != 0)
+ sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey) state.keycode));
else
sprintf(selection, "Associated key : none");
@@ -154,7 +154,7 @@ void KeysDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
_actionsList->setEnabled(true);
Actions::Instance()->beginMapping(false);
} else
- Dialog::handleKeyUp(ascii,keycode,modifiers);
+ Dialog::handleKeyUp(state);
}
} // namespace GUI
diff --git a/gui/KeysDialog.h b/gui/KeysDialog.h
index f4fa4d9419..6d780e665a 100644
--- a/gui/KeysDialog.h
+++ b/gui/KeysDialog.h
@@ -38,8 +38,8 @@ public:
KeysDialog(const Common::String &title = "Choose an action to map");
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
- virtual void handleKeyUp(uint16 ascii, int keycode, int modifiers);
- virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
+ virtual void handleKeyUp(Common::KeyState state);
+ virtual void handleKeyDown(Common::KeyState state);
protected:
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 271cbccd94..3d5c3dee62 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -186,12 +186,12 @@ static int matchingCharsIgnoringCase(const char *x, const char *y, bool &stop) {
return match;
}
-bool ListWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
+bool ListWidget::handleKeyDown(Common::KeyState state) {
bool handled = true;
bool dirty = false;
int oldSelectedItem = _selectedItem;
- if (!_editMode && isprint((char)ascii)) {
+ if (!_editMode && isprint((char)state.ascii)) {
// Quick selection mode: Go to first list item starting with this key
// (or a substring accumulated from the last couple key presses).
// Only works in a useful fashion if the list entries are sorted.
@@ -199,9 +199,9 @@ bool ListWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
// method "enableQuickSelect()" or so ?
uint32 time = getMillis();
if (_quickSelectTime < time) {
- _quickSelectStr = (char)ascii;
+ _quickSelectStr = (char)state.ascii;
} else {
- _quickSelectStr += (char)ascii;
+ _quickSelectStr += (char)state.ascii;
}
_quickSelectTime = time + 300; // TODO: Turn this into a proper constant (kQuickSelectDelay ?)
@@ -227,11 +227,11 @@ bool ListWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
scrollToCurrent();
} else if (_editMode) {
// Class EditableWidget handles all text editing related key presses for us
- handled = EditableWidget::handleKeyDown(ascii, keycode, modifiers);
+ handled = EditableWidget::handleKeyDown(state);
} else {
// not editmode
- switch (keycode) {
+ switch (state.keycode) {
case Common::KEYCODE_RETURN:
case Common::KEYCODE_KP_ENTER:
if (_selectedItem >= 0) {
@@ -285,14 +285,14 @@ bool ListWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
#if !defined(PALMOS_MODE)
// not done on PalmOS because keyboard is emulated and keyup is not generated
- _currentKeyDown = keycode;
+ _currentKeyDown = state.keycode;
#endif
return handled;
}
-bool ListWidget::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
- if (keycode == _currentKeyDown)
+bool ListWidget::handleKeyUp(Common::KeyState state) {
+ if (state.keycode == _currentKeyDown)
_currentKeyDown = 0;
return true;
}
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index a8656061d3..fe3dd4cd7e 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -92,8 +92,8 @@ public:
virtual void handleMouseDown(int x, int y, int button, int clickCount);
virtual void handleMouseUp(int x, int y, int button, int clickCount);
virtual void handleMouseWheel(int x, int y, int direction);
- virtual bool handleKeyDown(uint16 ascii, int keycode, int modifiers);
- virtual bool handleKeyUp(uint16 ascii, int keycode, int modifiers);
+ virtual bool handleKeyDown(Common::KeyState state);
+ virtual bool handleKeyUp(Common::KeyState state);
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
virtual void reflowLayout();
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index d40a01c981..ac91376269 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -58,7 +58,7 @@ public:
void handleMouseUp(int x, int y, int button, int clickCount);
void handleMouseWheel(int x, int y, int direction); // Scroll through entries with scroll wheel
void handleMouseMoved(int x, int y, int button); // Redraw selections depending on mouse position
- void handleKeyDown(uint16 ascii, int keycode, int modifiers); // Scroll through entries with arrow keys etc.
+ void handleKeyDown(Common::KeyState state); // Scroll through entries with arrow keys etc.
protected:
void drawMenuEntry(int entry, bool hilite);
@@ -210,8 +210,8 @@ void PopUpDialog::handleMouseMoved(int x, int y, int button) {
setSelection(item);
}
-void PopUpDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
- if (keycode == Common::KEYCODE_ESCAPE) {
+void PopUpDialog::handleKeyDown(Common::KeyState state) {
+ if (state.keycode == Common::KEYCODE_ESCAPE) {
// Don't change the previous selection
setResult(-1);
close();
@@ -221,7 +221,7 @@ void PopUpDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
if (isMouseDown())
return;
- switch (keycode) {
+ switch (state.keycode) {
case Common::KEYCODE_RETURN:
case Common::KEYCODE_KP_ENTER:
setResult(_selection);
@@ -239,6 +239,8 @@ void PopUpDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
case Common::KEYCODE_END:
setSelection(_popUpBoss->_entries.size()-1);
break;
+ default:
+ break;
}
}
diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp
index 38ea6229ec..c414f6bf3b 100644
--- a/gui/TabWidget.cpp
+++ b/gui/TabWidget.cpp
@@ -198,11 +198,11 @@ void TabWidget::handleMouseDown(int x, int y, int button, int clickCount) {
}
}
-bool TabWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
+bool TabWidget::handleKeyDown(Common::KeyState state) {
// TODO: maybe there should be a way to switch between tabs
// using the keyboard? E.g. Alt-Shift-Left/Right-Arrow or something
// like that.
- return Widget::handleKeyDown(ascii, keycode, modifiers);
+ return Widget::handleKeyDown(state);
}
void TabWidget::reflowLayout() {
diff --git a/gui/TabWidget.h b/gui/TabWidget.h
index 928f7916b6..a8c5e07525 100644
--- a/gui/TabWidget.h
+++ b/gui/TabWidget.h
@@ -87,7 +87,7 @@ public:
void setActiveTab(int tabID);
virtual void handleMouseDown(int x, int y, int button, int clickCount);
- virtual bool handleKeyDown(uint16 ascii, int keycode, int modifiers);
+ virtual bool handleKeyDown(Common::KeyState state);
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
virtual void reflowLayout();
diff --git a/gui/about.cpp b/gui/about.cpp
index 31381cadd5..780091f35d 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -302,13 +302,13 @@ void AboutDialog::handleMouseUp(int x, int y, int button, int clickCount) {
close();
}
-void AboutDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
- if (ascii)
+void AboutDialog::handleKeyDown(Common::KeyState state) {
+ if (state.ascii)
_willClose = true;
}
-void AboutDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
- if (ascii && _willClose)
+void AboutDialog::handleKeyUp(Common::KeyState state) {
+ if (state.ascii && _willClose)
close();
}
diff --git a/gui/about.h b/gui/about.h
index a1ee96b090..d62510b1a6 100644
--- a/gui/about.h
+++ b/gui/about.h
@@ -52,8 +52,8 @@ public:
void drawDialog();
void handleTickle();
void handleMouseUp(int x, int y, int button, int clickCount);
- void handleKeyDown(uint16 ascii, int keycode, int modifiers);
- void handleKeyUp(uint16 ascii, int keycode, int modifiers);
+ void handleKeyDown(Common::KeyState state);
+ void handleKeyUp(Common::KeyState state);
void reflowLayout();
};
diff --git a/gui/console.cpp b/gui/console.cpp
index b7c257d3ce..04a1103628 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -258,13 +258,13 @@ void ConsoleDialog::handleMouseWheel(int x, int y, int direction) {
_scrollBar->handleMouseWheel(x, y, direction);
}
-void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
+void ConsoleDialog::handleKeyDown(Common::KeyState state) {
int i;
if (_slideMode != kNoSlideMode)
return;
- switch (keycode) {
+ switch (state.keycode) {
case Common::KEYCODE_RETURN:
case Common::KEYCODE_KP_ENTER: {
if (_caretVisible)
@@ -351,7 +351,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
drawLine(pos2line(_currentPos));
break;
case Common::KEYCODE_PAGEUP:
- if (modifiers == Common::KBD_SHIFT) {
+ if (state.flags == Common::KBD_SHIFT) {
_scrollLine -= _linesPerPage - 1;
if (_scrollLine < _firstLineInBuffer + _linesPerPage - 1)
_scrollLine = _firstLineInBuffer + _linesPerPage - 1;
@@ -360,7 +360,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
}
break;
case Common::KEYCODE_PAGEDOWN:
- if (modifiers == Common::KBD_SHIFT) {
+ if (state.flags == Common::KBD_SHIFT) {
_scrollLine += _linesPerPage - 1;
if (_scrollLine > _promptEndPos / kCharsPerLine) {
_scrollLine = _promptEndPos / kCharsPerLine;
@@ -372,7 +372,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
}
break;
case Common::KEYCODE_HOME:
- if (modifiers == Common::KBD_SHIFT) {
+ if (state.flags == Common::KBD_SHIFT) {
_scrollLine = _firstLineInBuffer + _linesPerPage - 1;
updateScrollBuffer();
} else {
@@ -381,7 +381,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
draw();
break;
case Common::KEYCODE_END:
- if (modifiers == Common::KBD_SHIFT) {
+ if (state.flags == Common::KBD_SHIFT) {
_scrollLine = _promptEndPos / kCharsPerLine;
if (_scrollLine < _linesPerPage - 1)
_scrollLine = _linesPerPage - 1;
@@ -408,15 +408,15 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
drawLine(pos2line(_currentPos));
break;
default:
- if (ascii == '~' || ascii == '#') {
+ if (state.ascii == '~' || state.ascii == '#') {
slideUpAndClose();
- } else if (modifiers == Common::KBD_CTRL) {
- specialKeys(keycode);
- } else if ((ascii >= 32 && ascii <= 127) || (ascii >= 160 && ascii <= 255)) {
+ } else if (state.flags == Common::KBD_CTRL) {
+ specialKeys(state.keycode);
+ } else if ((state.ascii >= 32 && state.ascii <= 127) || (state.ascii >= 160 && state.ascii <= 255)) {
for (i = _promptEndPos - 1; i >= _currentPos; i--)
buffer(i + 1) = buffer(i);
_promptEndPos++;
- putchar((byte)ascii);
+ putchar((byte)state.ascii);
scrollToCurrent();
}
}
diff --git a/gui/console.h b/gui/console.h
index ea28e5b449..c683a1f619 100644
--- a/gui/console.h
+++ b/gui/console.h
@@ -140,7 +140,7 @@ public:
void handleTickle();
void reflowLayout();
void handleMouseWheel(int x, int y, int direction);
- void handleKeyDown(uint16 ascii, int keycode, int modifiers);
+ void handleKeyDown(Common::KeyState state);
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
int printf(const char *format, ...);
diff --git a/gui/credits.h b/gui/credits.h
index 5babeb1faa..fba9350bca 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -144,6 +144,8 @@ static const char *credits[] = {
"\\C\\c2""MT-32 emulator",
"\\C\\c0""Jochen Hoenicke",
"\\C\\c2""Speaker & PCjr sound support, Adlib work",
+"\\C\\c0""Robin Watts",
+"\\C\\c2""ARM assembly routines for nice speedups on several ports; improvements to the sound mixer",
"\\C\\c0""",
"\\C\\c0""",
"\\C\\c1""Website (content)",
@@ -286,8 +288,6 @@ static const char *credits[] = {
"\\C\\c2""Final MI1 CD music support, initial Ogg Vorbis support",
"\\C\\c0""Andr\351 Souza",
"\\C\\c2""SDL-based OpenGL renderer",
-"\\C\\c0""Robin Watts",
-"\\C\\c2""ARM assembly routines for the Windows CE port",
"\\C\\c0""",
"\\C\\c0""And to all the contributors, users, and beta testers we've missed. Thanks!",
"\\C\\c0""",
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 1afd18ec52..f643e6f988 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -211,18 +211,18 @@ void Dialog::handleMouseWheel(int x, int y, int direction) {
w->handleMouseWheel(x, y, direction);
}
-void Dialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
+void Dialog::handleKeyDown(Common::KeyState state) {
if (_focusedWidget) {
- if (_focusedWidget->handleKeyDown(ascii, keycode, modifiers))
+ if (_focusedWidget->handleKeyDown(state))
return;
}
// Hotkey handling
- if (ascii != 0) {
+ if (state.ascii != 0) {
Widget *w = _firstWidget;
- ascii = toupper(ascii);
+ state.ascii = toupper(state.ascii);
while (w) {
- if (w->_type == kButtonWidget && ascii == toupper(((ButtonWidget *)w)->_hotkey)) {
+ if (w->_type == kButtonWidget && state.ascii == toupper(((ButtonWidget *)w)->_hotkey)) {
// The hotkey for widget w was pressed. We fake a mouse click into the
// button by invoking the appropriate methods.
w->handleMouseDown(0, 0, 1, 1);
@@ -234,7 +234,7 @@ void Dialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
}
// ESC closes all dialogs by default
- if (keycode == Common::KEYCODE_ESCAPE) {
+ if (state.keycode == Common::KEYCODE_ESCAPE) {
setResult(-1);
close();
}
@@ -242,10 +242,10 @@ void Dialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
// TODO: tab/shift-tab should focus the next/previous focusable widget
}
-void Dialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
+void Dialog::handleKeyUp(Common::KeyState state) {
// Focused widget receives keyup events
if (_focusedWidget)
- _focusedWidget->handleKeyUp(ascii, keycode, modifiers);
+ _focusedWidget->handleKeyUp(state);
}
void Dialog::handleMouseMoved(int x, int y, int button) {
diff --git a/gui/dialog.h b/gui/dialog.h
index 1c97b4b185..418e3b8e63 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -77,8 +77,8 @@ protected:
virtual void handleMouseDown(int x, int y, int button, int clickCount);
virtual void handleMouseUp(int x, int y, int button, int clickCount);
virtual void handleMouseWheel(int x, int y, int direction);
- virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
- virtual void handleKeyUp(uint16 ascii, int keycode, int modifiers);
+ virtual void handleKeyDown(Common::KeyState state);
+ virtual void handleKeyUp(Common::KeyState state);
virtual void handleMouseMoved(int x, int y, int button);
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
diff --git a/gui/editable.cpp b/gui/editable.cpp
index a8638b8b48..1333bf0a9d 100644
--- a/gui/editable.cpp
+++ b/gui/editable.cpp
@@ -85,7 +85,7 @@ void EditableWidget::handleTickle() {
}
}
-bool EditableWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
+bool EditableWidget::handleKeyDown(Common::KeyState state) {
bool handled = true;
bool dirty = false;
bool forcecaret = false;
@@ -94,7 +94,7 @@ bool EditableWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
if (_caretVisible)
drawCaret(true);
- switch (keycode) {
+ switch (state.keycode) {
case Common::KEYCODE_RETURN:
case Common::KEYCODE_KP_ENTER:
// confirm edit and exit editmode
@@ -143,7 +143,7 @@ bool EditableWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
forcecaret = true;
break;
default:
- if (tryInsertChar((byte)ascii, _caretPos)) {
+ if (tryInsertChar((byte)state.ascii, _caretPos)) {
_caretPos++;
dirty = true;
forcecaret = true;
diff --git a/gui/editable.h b/gui/editable.h
index a56b079662..c8ef8a80cb 100644
--- a/gui/editable.h
+++ b/gui/editable.h
@@ -63,7 +63,7 @@ public:
virtual const String &getEditString() const { return _editString; }
virtual void handleTickle();
- virtual bool handleKeyDown(uint16 ascii, int keycode, int modifiers);
+ virtual bool handleKeyDown(Common::KeyState state);
virtual void reflowLayout();
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 995a0cf78a..215f389f6d 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -148,7 +148,7 @@ protected:
EditGameDialog::EditGameDialog(const String &domain, const String &desc)
: OptionsDialog(domain, "gameoptions") {
- int labelWidth = g_gui.evaluator()->getVar("gameOptionsLabelWidth");
+ int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
// GAME: Path to game data (r/o), extra data (r/o), and save data (r/w)
String gamePath(ConfMan.get("path", _domain));
@@ -171,15 +171,15 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
tab->addTab("Game");
// GUI: Label & edit widget for the game ID
- new StaticTextWidget(tab, "gameoptions_id", "ID: ");
+ new StaticTextWidget(tab, "gameoptions_id", "ID:");
_domainWidget = new DomainEditTextWidget(tab, "gameoptions_domain", _domain);
// GUI: Label & edit widget for the description
- new StaticTextWidget(tab, "gameoptions_name", "Name: ");
+ new StaticTextWidget(tab, "gameoptions_name", "Name:");
_descriptionWidget = new EditTextWidget(tab, "gameoptions_desc", description);
// Language popup
- _langPopUp = new PopUpWidget(tab, "gameoptions_lang", "Language: ", labelWidth);
+ _langPopUp = new PopUpWidget(tab, "gameoptions_lang", "Language:", labelWidth);
_langPopUp->appendEntry("<default>");
_langPopUp->appendEntry("");
const Common::LanguageDescription *l = Common::g_languages;
@@ -188,7 +188,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
}
// Platform popup
- _platformPopUp = new PopUpWidget(tab, "gameoptions_platform", "Platform: ", labelWidth);
+ _platformPopUp = new PopUpWidget(tab, "gameoptions_platform", "Platform:", labelWidth);
_platformPopUp->appendEntry("<default>");
_platformPopUp->appendEntry("");
const Common::PlatformDescription *p = Common::g_platforms;
@@ -242,7 +242,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
// in the small version of the GUI.
// GUI: Button + Label for the game path
- new ButtonWidget(tab, "gameoptions_gamepath", "Game Path: ", kCmdGameBrowser, 0);
+ new ButtonWidget(tab, "gameoptions_gamepath", "Game Path:", kCmdGameBrowser, 0);
_gamePathWidget = new StaticTextWidget(tab, "gameoptions_gamepathText", gamePath);
// GUI: Button + Label for the additional path
@@ -253,7 +253,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
}
// GUI: Button + Label for the save path
- new ButtonWidget(tab, "gameoptions_savepath", "Save Path: ", kCmdSaveBrowser, 0);
+ new ButtonWidget(tab, "gameoptions_savepath", "Save Path:", kCmdSaveBrowser, 0);
_savePathWidget = new StaticTextWidget(tab, "gameoptions_savepathText", savePath);
if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
_savePathWidget->setLabel("Default");
@@ -270,7 +270,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
void EditGameDialog::reflowLayout() {
OptionsDialog::reflowLayout();
- int labelWidth = g_gui.evaluator()->getVar("gameOptionsLabelWidth");
+ int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
if (_langPopUp)
_langPopUp->changeLabelWidth(labelWidth);
@@ -588,6 +588,15 @@ void LauncherDialog::updateListing() {
if (g.contains("description"))
description = g.description();
}
+
+#ifdef __DS__
+ // DS port uses an extra section called 'ds'. This prevents the section from being
+ // detected as a game.
+ if (gameid == "ds") {
+ continue;
+ }
+#endif
+
if (description.empty())
description = "Unknown (target " + iter->_key + ", gameid " + gameid + ")";
@@ -789,13 +798,13 @@ void LauncherDialog::editGame(int item) {
}
}
-void LauncherDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
- Dialog::handleKeyDown(ascii, keycode, modifiers);
+void LauncherDialog::handleKeyDown(Common::KeyState state) {
+ Dialog::handleKeyDown(state);
updateButtons();
}
-void LauncherDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
- Dialog::handleKeyUp(ascii, keycode, modifiers);
+void LauncherDialog::handleKeyUp(Common::KeyState state) {
+ Dialog::handleKeyUp(state);
updateButtons();
}
diff --git a/gui/launcher.h b/gui/launcher.h
index 5ccf9cb422..164a7e0707 100644
--- a/gui/launcher.h
+++ b/gui/launcher.h
@@ -47,8 +47,8 @@ public:
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
- virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
- virtual void handleKeyUp(uint16 ascii, int keycode, int modifiers);
+ virtual void handleKeyDown(Common::KeyState state);
+ virtual void handleKeyUp(Common::KeyState state);
protected:
ListWidget *_list;
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index ad1933863a..51d67b8769 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -272,10 +272,10 @@ void NewGui::runLoop() {
switch (event.type) {
case Common::EVENT_KEYDOWN:
- activeDialog->handleKeyDown(event.kbd.ascii, event.kbd.keycode, event.kbd.flags);
+ activeDialog->handleKeyDown(event.kbd);
break;
case Common::EVENT_KEYUP:
- activeDialog->handleKeyUp(event.kbd.ascii, event.kbd.keycode, event.kbd.flags);
+ activeDialog->handleKeyUp(event.kbd);
break;
case Common::EVENT_MOUSEMOVE:
activeDialog->handleMouseMoved(mouse.x, mouse.y, 0);
diff --git a/gui/options.cpp b/gui/options.cpp
index 6d588b6b44..c233c892b9 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -67,7 +67,7 @@ enum {
static const char *savePeriodLabels[] = { "Never", "every 5 mins", "every 10 mins", "every 15 mins", "every 30 mins", 0 };
static const int savePeriodValues[] = { 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, -1 };
-static const char *outputRateLabels[] = { "Default", "22 kHz", "8 kHz", "11kHz", "44 kHz", "48 kHz", 0 };
+static const char *outputRateLabels[] = { "<default>", "22 kHz", "8 kHz", "11kHz", "44 kHz", "48 kHz", 0 };
static const int outputRateValues[] = { 0, 22050, 8000, 11025, 44100, 48000, -1 };
@@ -503,7 +503,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const String &prefix) {
int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
// The GFX mode popup
- _gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup", "Graphics mode: ", labelWidth);
+ _gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup", "Graphics mode:", labelWidth);
_gfxPopUp->appendEntry("<default>");
_gfxPopUp->appendEntry("");
@@ -513,7 +513,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const String &prefix) {
}
// RenderMode popup
- _renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", "Render mode: ", labelWidth);
+ _renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", "Render mode:", labelWidth);
_renderModePopUp->appendEntry("<default>", Common::kRenderDefault);
_renderModePopUp->appendEntry("");
const Common::RenderModeDescription *rm = Common::g_renderModes;
@@ -540,7 +540,7 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const String &prefix) {
int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
// The MIDI mode popup & a label
- _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", "Music driver: ", labelWidth);
+ _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", "Music driver:", labelWidth);
// Populate it
const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers();
@@ -550,7 +550,7 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const String &prefix) {
}
// Sample rate settings
- _outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup", "Output rate: ", labelWidth);
+ _outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup", "Output rate:", labelWidth);
for (int i = 0; outputRateLabels[i]; i++) {
_outputRatePopUp->appendEntry(outputRateLabels[i], outputRateValues[i]);
@@ -720,7 +720,7 @@ GlobalOptionsDialog::GlobalOptionsDialog()
int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
- _autosavePeriodPopUp = new PopUpWidget(tab, "globaloptions_autosaveperiod", "Autosave: ", labelWidth);
+ _autosavePeriodPopUp = new PopUpWidget(tab, "globaloptions_autosaveperiod", "Autosave:", labelWidth);
for (int i = 0; savePeriodLabels[i]; i++) {
_autosavePeriodPopUp->appendEntry(savePeriodLabels[i], savePeriodValues[i]);
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp
index c12ca009da..8da2be99e1 100644
--- a/gui/theme-config.cpp
+++ b/gui/theme-config.cpp
@@ -73,14 +73,14 @@ const char *Theme::_defaultConfigINI =
"\n"
"# audio tab\n"
"opYoffset=vBorder\n"
-"gameoptions_audioCheckbox=gox opYoffset (kFontHeight + 10 + 180) buttonHeight\n"
+"gameoptions_audioCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight + 6)\n"
"useWithPrefix=audioControls gameoptions_\n"
"useWithPrefix=subtitleControls gameoptions_\n"
"\n"
"# volume tab\n"
"opYoffset=vBorder\n"
-"gameoptions_volumeCheckbox=gox opYoffset (kFontHeight + 10 + 190) buttonHeight\n"
+"gameoptions_volumeCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight + 6)\n"
"useWithPrefix=volumeControls gameoptions_\n"
"\n"
@@ -268,26 +268,26 @@ const char *Theme::_defaultConfigINI =
"# graphics tab\n"
"opYoffset=vBorder\n"
"opXoffset=gox\n"
-"gameoptions_graphicsCheckbox=gox opYoffset (kFontHeight + 10 + 192) buttonHeight\n"
+"gameoptions_graphicsCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight)\n"
"useWithPrefix=graphicsControls gameoptions_\n"
"\n"
"# audio tab\n"
"opYoffset=vBorder\n"
-"gameoptions_audioCheckbox=gox opYoffset (kFontHeight + 10 + 180) buttonHeight\n"
+"gameoptions_audioCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight)\n"
"useWithPrefix=audioControls gameoptions_\n"
"useWithPrefix=subtitleControls gameoptions_\n"
"\n"
"# volume tab\n"
"opYoffset=vBorder\n"
-"gameoptions_volumeCheckbox=gox opYoffset (kFontHeight + 10 + 190) buttonHeight\n"
+"gameoptions_volumeCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight)\n"
"useWithPrefix=volumeControls gameoptions_\n"
"\n"
"# midi tab\n"
"opYoffset=vBorder\n"
-"gameoptions_midiCheckbox=gox opYoffset (kFontHeight + 10 + 174) buttonHeight\n"
+"gameoptions_midiCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight)\n"
"useWithPrefix=midiControls gameoptions_\n"
"\n"
@@ -387,9 +387,9 @@ const char *Theme::_defaultConfigINI =
"opYoffset=(opYoffset + kLineHeight + 4)\n"
"grRenderPopup=prev.x (opYoffset - 1) prev.w prev.h\n"
"opYoffset=(opYoffset + kLineHeight + 4)\n"
-"grFullscreenCheckbox=gcx opYoffset (kFontHeight + 10 + 96) buttonHeight\n"
+"grFullscreenCheckbox=gcx opYoffset (parent.w - gcx - 5) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight)\n"
-"grAspectCheckbox=prev.x opYoffset (kFontHeight + 10 + 180) prev.h\n"
+"grAspectCheckbox=prev.x opYoffset prev.w prev.h\n"
"opYoffset=(opYoffset + buttonHeight)\n"
"\n"
"[audioControls]\n"
@@ -426,11 +426,11 @@ const char *Theme::_defaultConfigINI =
"mcFontPath=(prev.x2 + 20) (opYoffset + 3) (parent.w - (buttonWidth + 20) - 15 - kLineHeight - 10) kLineHeight\n"
"mcFontClearButton=(prev.x2 + 10) (opYoffset + 2) kLineHeight kLineHeight\n"
"opYoffset=(opYoffset + buttonHeight + 2 * midiControlsSpacing)\n"
-"mcMixedCheckbox=mcx opYoffset (kFontHeight + 10 + 135) buttonHeight\n"
+"mcMixedCheckbox=mcx opYoffset (parent.w - mcx - 5) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)\n"
-"mcMt32Checkbox=mcx opYoffset (kFontHeight + 10 + 256) buttonHeight\n"
+"mcMt32Checkbox=mcx opYoffset prev.w buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)\n"
-"mcGSCheckbox=mcx opYoffset (kFontHeight + 10 + 142) buttonHeight\n"
+"mcGSCheckbox=mcx opYoffset prev.w buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)\n"
"mcMidiGainText=mcx (opYoffset + 2) 95 kLineHeight\n"
"mcMidiGainText.align=kTextAlignRight\n"
@@ -445,6 +445,7 @@ const char *Theme::_defaultConfigINI =
"sbtextw=(100 + vcAudioTabIndent)\n"
"opYoffset=(opYoffset + sbYoff)\n"
"subToggleDesc=sbx (opYoffset + sbYoff) sbtextw buttonHeight\n"
+"subToggleDesc.align=kTextAlignRight\n"
"subToggleButton=prev.x2 (opYoffset - sbYoff) (buttonWidth + 54) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight + 6)\n"
"subSubtitleSpeedDesc=sbx (opYoffset + sbOff) sbtextw kLineHeight\n"
@@ -549,7 +550,7 @@ void Theme::processSingleLine(const String &section, const String &prefix, const
const char **postfixes = (ntmppostfix == 2) ? postfixesRGB : postfixesXYWH;
- // Now do it for real, only this time we already know the parantheses
+ // Now do it for real, only this time we already know the parentheses
// are balanced.
for (i = 0; i < str.size(); i++) {
@@ -570,10 +571,15 @@ void Theme::processSingleLine(const String &section, const String &prefix, const
_evaluator->setStringVar(prefixedname, _evaluator->lastToken());
// process VAR=VALUE construct
- if (npostfix == 0)
+ if (npostfix == 0) {
_evaluator->setVar(name, value);
- else
+
+ // Fix bug #1742561: "GUI: Missaligned text"
+ // "blah.align=foo" should be prefixed too
+ _evaluator->setVar(prefixedname, value);
+ } else {
_evaluator->setVar(prefixedname + postfixes[npostfix], value);
+ }
// If we have all 4 parameters, set .x2 and .y2
if (npostfix == 3) {
@@ -611,16 +617,16 @@ void Theme::processResSection(Common::ConfigFile &config, const String &name, bo
if (iterk->key == "use") {
if (iterk->value == name)
error("Theme section [%s]: cannot use itself", name.c_str());
- if (!config.hasSection(name))
- error("Undefined use of section [%s]", name.c_str());
+ if (!config.hasSection(iterk->value))
+ error("Undefined use of section [%s]", iterk->value.c_str());
processResSection(config, iterk->value, true);
continue;
}
if (iterk->key == "useAsIs") {
if (iterk->value == name)
error("Theme section [%s]: cannot use itself", name.c_str());
- if (!config.hasSection(name))
- error("Undefined use of section [%s]", name.c_str());
+ if (!config.hasSection(iterk->value))
+ error("Undefined use of section [%s]", iterk->value.c_str());
processResSection(config, iterk->value);
continue;
}
diff --git a/gui/themes/classic080.ini b/gui/themes/classic080.ini
index 481d00c27a..3a58ec60f7 100644
--- a/gui/themes/classic080.ini
+++ b/gui/themes/classic080.ini
@@ -187,26 +187,26 @@ opYoffset=(opYoffset + buttonHeight + 4)
# graphics tab
opYoffset=vBorder
opXoffset=gox
-gameoptions_graphicsCheckbox=gox opYoffset (kFontHeight + 10 + 192) buttonHeight
+gameoptions_graphicsCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight
opYoffset=(opYoffset + buttonHeight)
useWithPrefix=graphicsControls gameoptions_
# audio tab
opYoffset=vBorder
-gameoptions_audioCheckbox=gox opYoffset (kFontHeight + 10 + 180) buttonHeight
+gameoptions_audioCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight
opYoffset=(opYoffset + buttonHeight)
useWithPrefix=audioControls gameoptions_
useWithPrefix=subtitleControls gameoptions_
# volume tab
opYoffset=vBorder
-gameoptions_volumeCheckbox=gox opYoffset (kFontHeight + 10 + 190) buttonHeight
+gameoptions_volumeCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight
opYoffset=(opYoffset + buttonHeight)
useWithPrefix=volumeControls gameoptions_
# midi tab
opYoffset=vBorder
-gameoptions_midiCheckbox=gox opYoffset (kFontHeight + 10 + 174) buttonHeight
+gameoptions_midiCheckbox=gox opYoffset (parent.w - gox - 5) buttonHeight
opYoffset=(opYoffset + buttonHeight)
useWithPrefix=midiControls gameoptions_
@@ -305,9 +305,9 @@ grModePopup=(gcx - 5) (opYoffset - 1) (gcw + 5) (kLineHeight + 2)
opYoffset=(opYoffset + kLineHeight + 4)
grRenderPopup=prev.x (opYoffset - 1) prev.w prev.h
opYoffset=(opYoffset + kLineHeight + 4)
-grFullscreenCheckbox=gcx opYoffset (kFontHeight + 10 + 96) buttonHeight
+grFullscreenCheckbox=gcx opYoffset (parent.w - gcx - 5) buttonHeight
opYoffset=(opYoffset + buttonHeight)
-grAspectCheckbox=prev.x opYoffset (kFontHeight + 10 + 180) prev.h
+grAspectCheckbox=prev.x opYoffset prev.w prev.h
opYoffset=(opYoffset + buttonHeight)
[audioControls]
@@ -344,11 +344,11 @@ mcFontButton=mcx opYoffset buttonWidth buttonHeight
mcFontPath=(prev.x2 + 20) (opYoffset + 3) (parent.w - (buttonWidth + 20) - mcx - kLineHeight - 20) kLineHeight
mcFontClearButton=(prev.x2 + 10) (opYoffset + 3) kLineHeight kLineHeight
opYoffset=(opYoffset + buttonHeight + 2 * midiControlsSpacing)
-mcMixedCheckbox=mcx opYoffset (kFontHeight + 10 + 135) buttonHeight
+mcMixedCheckbox=mcx opYoffset (parent.w - mcx - 5) buttonHeight
opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
-mcMt32Checkbox=mcx opYoffset (kFontHeight + 10 + 256) buttonHeight
+mcMt32Checkbox=mcx opYoffset prev.w buttonHeight
opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
-mcGSCheckbox=mcx opYoffset (kFontHeight + 10 + 142) buttonHeight
+mcGSCheckbox=mcx opYoffset prev.w buttonHeight
opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
mcMidiGainText=mcx (opYoffset + 2) 95 kLineHeight
mcMidiGainText.align=kTextAlignRight
@@ -363,6 +363,7 @@ sbOff=((sliderHeight - kLineHeight) / 2 + 2)
sbtextw=(100 + vcAudioTabIndent)
opYoffset=(opYoffset + sbYoff)
subToggleDesc=sbx (opYoffset + sbYoff) sbtextw buttonHeight
+subToggleDesc.align=kTextAlignRight
subToggleButton=prev.x2 (opYoffset - sbYoff) (buttonWidth + 54) buttonHeight
opYoffset=(opYoffset + buttonHeight + 6)
subSubtitleSpeedDesc=sbx (opYoffset + sbOff) sbtextw kLineHeight
diff --git a/gui/themes/modern.ini b/gui/themes/modern.ini
index 25fd8da01d..541c2fb00a 100644
--- a/gui/themes/modern.ini
+++ b/gui/themes/modern.ini
@@ -185,9 +185,9 @@ def_insetY=94
def_insetW=(w - buttonWidth - 17 * 2 - insetX)
def_insetH=(h - 23 - insetY)
def_optionsVPad=20
-def_gameOptionsLabelWidth=90
+def_optionsLabelWidth=110
def_gameOptionsOverrideVPad=20
-def_tabPopupsLabelW=110
+def_tabPopupsLabelW=optionsLabelWidth
def_aboutXOff=8
def_aboutYOff=5
def_aboutOuterBorder=80
@@ -196,10 +196,13 @@ def_scummmainVSpace=15
def_scummmainVAddOff=5
def_scummhelpW=370
def_scummhelpX=((w - scummhelpW) / 2)
-def_midiControlsSpacing=4
def_launcherVersionX=(w / 2 - 283 / 2 - 90)
def_launcherVersionY=21
+def_xSeparation=10
+def_ySeparation=10
+def_xBorder=15
+
use=pixmaps
use=colors
use=gradients
@@ -214,7 +217,7 @@ ListWidget.hlLeftPadding=0
ListWidget.hlRightPadding=0
PopUpWidget.leftPadding=7
PopUpWidget.rightPadding=5
-PopUpWidget.labelSpacing=3
+PopUpWidget.labelSpacing=xSeparation
EditTextWidget.font=kFontStyleNormal
EditTextWidget.leftPadding=7
EditTextWidget.rightPadding=5
@@ -245,7 +248,7 @@ launcher_logo=(w / 2 - 283 / 2) 5 283 80
launcher_logo.visible=true
space1=20
space2=5
-launcher_list=insetX insetY (w - buttonWidth - 17 * 2 - self.x) (h - 23 - self.y)
+launcher_list=insetX insetY insetW insetH
launcher_start_button=(prev.x2 + 17) prev.y buttonWidth buttonHeight
launcher_addGame_button=prev.x (prev.y2 + space1) prev.w prev.h
launcher_editGame_button=prev.x (prev.y2 + space2) prev.w prev.h
@@ -260,7 +263,7 @@ use=scummmain
globaloptions=insetX insetY insetW insetH
set_parent=globaloptions
vBorder=optionsVPad
-globaloptions_tabwidget=0 0 parent.w (parent.h - buttonHeight - 16)
+globaloptions_tabwidget=0 0 parent.w (parent.h - buttonHeight - 8 - ySeparation)
# graphics tab
opYoffset=vBorder
@@ -283,93 +286,94 @@ useWithPrefix=midiControls globaloptions_
# paths tab
yoffset=vBorder
glOff=((buttonHeight - kLineHeight) / 2 + 2)
-globaloptions_savebutton=10 yoffset buttonWidth buttonHeight
-globaloptions_savepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight
-yoffset=(yoffset + buttonHeight + 8)
-globaloptions_extrabutton=10 yoffset buttonWidth buttonHeight
-globaloptions_extrapath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight
-yoffset=(yoffset + buttonHeight + 8)
-globaloptions_themebutton=10 yoffset buttonWidth buttonHeight
-globaloptions_themepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight
-yoffset=(yoffset + buttonHeight + 12)
-globaloptions_keysbutton=5 yoffset buttonWidth buttonHeight
+globaloptions_savebutton=xBorder yoffset buttonWidth buttonHeight
+globaloptions_savepath=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
+yoffset=(yoffset + buttonHeight + ySeparation)
+globaloptions_extrabutton=xBorder yoffset buttonWidth buttonHeight
+globaloptions_extrapath=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
+yoffset=(yoffset + buttonHeight + ySeparation)
+globaloptions_themebutton=xBorder yoffset buttonWidth buttonHeight
+globaloptions_themepath=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
+yoffset=(yoffset + buttonHeight + ySeparation)
+globaloptions_keysbutton=xBorder yoffset buttonWidth buttonHeight
# Misc options
yoffset=vBorder
glOff=((buttonHeight - kLineHeight) / 2 + 2)
-globaloptions_themebutton2=10 yoffset buttonWidth buttonHeight
-globaloptions_curtheme=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight
-yoffset=(yoffset + buttonHeight + 12)
-globaloptions_autosaveperiod=10 yoffset (parent.w - 10 - 25) kPopUpHeight
+globaloptions_themebutton2=xBorder yoffset buttonWidth buttonHeight
+globaloptions_curtheme=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
+yoffset=(yoffset + buttonHeight + ySeparation)
+globaloptions_autosaveperiod=xBorder yoffset (parent.w - self.x - xBorder) kPopUpHeight
-globaloptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
-globaloptions_ok=(prev.x2 + 10) prev.y prev.w prev.h
+globaloptions_cancel=(parent.w - 2 * buttonWidth - xSeparation - xBorder) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
+globaloptions_ok=(prev.x2 + xSeparation) prev.y prev.w prev.h
### game options
gameoptions=insetX insetY insetW insetH
set_parent=gameoptions
vBorder=gameOptionsOverrideVPad
-gox=10
-gow=(parent.w - gox - 25)
+gox=xBorder
+gow=(parent.w - gox - xBorder)
-gameoptions_tabwidget=0 0 parent.w (parent.h - buttonHeight - 16)
+gameoptions_tabwidget=0 0 parent.w (parent.h - buttonHeight - 8 - ySeparation)
# game tab
opYoffset=optionsVPad
-gameoptions_id=gox (opYoffset + 2) gameOptionsLabelWidth kLineHeight
+glOff=((kPopUpHeight - kLineHeight) / 2 + 2)
+gameoptions_id=gox (opYoffset + glOff) optionsLabelWidth kLineHeight
gameoptions_id.align=kTextAlignRight
-gameoptions_domain=prev.x2 (prev.y - 1) (gow - prev.w) kPopUpHeight
-opYoffset=(opYoffset + kLineHeight + 12)
-gameoptions_name=gox (opYoffset + 2) gameOptionsLabelWidth kLineHeight
+gameoptions_domain=(prev.x2 + xSeparation) opYoffset (parent.w - self.x - xBorder) kPopUpHeight
+opYoffset=(opYoffset + prev.h + ySeparation)
+gameoptions_name=gox (opYoffset + glOff) optionsLabelWidth kLineHeight
gameoptions_name.align=kTextAlignRight
-gameoptions_desc=prev.x2 (prev.y - 1) (gow - prev.w) kPopUpHeight
-opYoffset=(opYoffset + kLineHeight + 15)
-gameoptions_lang=gox (opYoffset - 1) gow kPopUpHeight
-opYoffset=(opYoffset + kLineHeight + 12)
+gameoptions_desc=(prev.x2 + xSeparation) opYoffset (parent.w - self.x - xBorder) kPopUpHeight
+opYoffset=(opYoffset + prev.h + ySeparation)
+gameoptions_lang=gox opYoffset (parent.w - self.x - xBorder) kPopUpHeight
+opYoffset=(opYoffset + prev.h + ySeparation)
gameoptions_platform=prev.x opYoffset prev.w prev.h
-opYoffset=(opYoffset + kLineHeight + 8)
+opYoffset=(opYoffset + prev.h + ySeparation)
# paths tab
opYoffset=optionsVPad
goOff=((buttonHeight - kLineHeight) / 2 + 2)
gameoptions_savepath=gox opYoffset buttonWidth buttonHeight
-gameoptions_savepathText=(prev.x2 + 20) (opYoffset + goOff) (parent.w - self.x - 10) kLineHeight
-opYoffset=(opYoffset + buttonHeight + 8)
+gameoptions_savepathText=(prev.x2 + xSeparation) (opYoffset + goOff) (parent.w - self.x - xBorder) kLineHeight
+opYoffset=(opYoffset + buttonHeight + ySeparation)
gameoptions_extrapath=gox opYoffset buttonWidth buttonHeight
-gameoptions_extrapathText=(prev.x2 + 20) (opYoffset + goOff) (parent.w - self.x - 10) kLineHeight
-opYoffset=(opYoffset + buttonHeight + 8)
+gameoptions_extrapathText=(prev.x2 + xSeparation) (opYoffset + goOff) (parent.w - self.x - xBorder) kLineHeight
+opYoffset=(opYoffset + buttonHeight + ySeparation)
gameoptions_gamepath=gox opYoffset buttonWidth buttonHeight
-gameoptions_gamepathText=(prev.x2 + 20) (opYoffset + goOff) (parent.w - self.x - 10) kLineHeight
-opYoffset=(opYoffset + buttonHeight + 8)
+gameoptions_gamepathText=(prev.x2 + xSeparation) (opYoffset + goOff) (parent.w - self.x - xBorder) kLineHeight
+opYoffset=(opYoffset + buttonHeight + ySeparation)
# graphics tab
opYoffset=vBorder
opXoffset=gox
-gameoptions_graphicsCheckbox=gox opYoffset (kFontHeight + 10 + 192) buttonHeight
-opYoffset=(opYoffset + buttonHeight + 6)
+gameoptions_graphicsCheckbox=gox opYoffset (parent.w - gox - xBorder) buttonHeight
+opYoffset=(prev.y2 + ySeparation)
useWithPrefix=graphicsControls gameoptions_
# audio tab
opYoffset=vBorder
-gameoptions_audioCheckbox=gox opYoffset (kFontHeight + 10 + 180) buttonHeight
-opYoffset=(opYoffset + buttonHeight + 6)
+gameoptions_audioCheckbox=gox opYoffset (parent.w - gox - xBorder) buttonHeight
+opYoffset=(prev.y2 + ySeparation)
useWithPrefix=audioControls gameoptions_
useWithPrefix=subtitleControls gameoptions_
# volume tab
opYoffset=vBorder
-gameoptions_volumeCheckbox=gox opYoffset (kFontHeight + 10 + 180) buttonHeight
-opYoffset=(opYoffset + buttonHeight + 6)
+gameoptions_volumeCheckbox=gox opYoffset (parent.w - gox - xBorder) buttonHeight
+opYoffset=(prev.y2 + ySeparation)
useWithPrefix=volumeControls gameoptions_
# midi tab
opYoffset=vBorder
-gameoptions_midiCheckbox=gox opYoffset (kFontHeight + 10 + 174) buttonHeight
-opYoffset=(opYoffset + buttonHeight + 6)
+gameoptions_midiCheckbox=gox opYoffset (parent.w - gox - xBorder) buttonHeight
+opYoffset=(prev.y2 + ySeparation)
useWithPrefix=midiControls gameoptions_
-gameoptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
-gameoptions_ok=(prev.x2 + 10) prev.y prev.w prev.h
+gameoptions_cancel=(parent.w - 2 * buttonWidth - xSeparation - xBorder) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
+gameoptions_ok=(prev.x2 + xSeparation) prev.y prev.w prev.h
### keys dialog
keysdialog=(w / 20) (h / 10) (w - w / 10) (h - h / 5)
@@ -386,14 +390,14 @@ keysdialog_mapping.align=kTextAlignCenter
### mass add dialog
massadddialog=10 20 300 174
set_parent=massadddialog
-massadddialog_caption=10 (10 + 1 * kLineHeight) (parent.w - 2*10) kLineHeight
+massadddialog_caption=xBorder (10 + 1 * kLineHeight) (parent.w - 2 * xBorder) kLineHeight
massadddialog_caption.align=kTextAlignCenter
-massadddialog_dirprogress=10 (10 + 3 * kLineHeight) prev.w prev.h
+massadddialog_dirprogress=xBorder (10 + 3 * kLineHeight) prev.w prev.h
massadddialog_dirprogress.align=kTextAlignCenter
-massadddialog_gameprogress=10 (10 + 4 * kLineHeight) prev.w prev.h
+massadddialog_gameprogress=xBorder (10 + 4 * kLineHeight) prev.w prev.h
massadddialog_gameprogress.align=kTextAlignCenter
-massadddialog_ok=((parent.w - (buttonWidth * 2)) / 2) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
-massadddialog_cancel=(prev.x2 + 10) prev.y prev.w prev.h
+massadddialog_ok=((parent.w - (buttonWidth * 2) - xSeparation) / 2) (parent.h - buttonHeight - ySeparation) buttonWidth buttonHeight
+massadddialog_cancel=(prev.x2 + xSeparation) prev.y prev.w prev.h
##### SCUMM dialogs
@@ -455,95 +459,93 @@ scummsaveload_extinfo.visible=true
[chooser]
chooserW=insetW
chooser=insetX insetY chooserW opHeight
-chooser_headline=10 6 (chooserW - 2 * 10) (kLineHeight)
-chooser_list=10 (6 + kLineHeight + 2) prev.w (opHeight - self.y - buttonHeight - 12)
-chooser_cancel=(chooserW - 2 * (buttonWidth + 10)) (opHeight - buttonHeight - 8) buttonWidth buttonHeight
-chooser_ok=(prev.x2 + 10) prev.y prev.w prev.h
+chooser_headline=xBorder 6 (chooserW - 2 * xBorder) kLineHeight
+chooser_list=prev.x (prev.y2 + 2) prev.w (opHeight - self.y - buttonHeight - 12)
+#JVPRAT: next Y doesn't seem right
+chooser_cancel=(chooserW - 2 * buttonWidth - xSeparation - xBorder) (opHeight - buttonHeight - 8) buttonWidth buttonHeight
+chooser_ok=(prev.x2 + xSeparation) prev.y prev.w prev.h
[browser]
browser=insetX insetY insetW insetH
set_parent=browser
-browser_headline=10 5 (parent.w - 2 * 10) kLineHeight
+browser_headline=xBorder 5 (parent.w - 2 * xBorder) kLineHeight
browser_headline.align=kTextAlignCenter
-browser_path=10 (prev.y2 + 5) prev.w prev.h
-browser_list=10 prev.y2 prev.w (parent.h - 3 * kLineHeight - buttonHeight - 14)
-browser_up=10 (parent.h - buttonHeight - 8) buttonWidth buttonHeight
-browser_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
-browser_choose=(prev.x2 + 10) prev.y prev.w prev.h
+browser_path=prev.x (prev.y2 + 5) prev.w prev.h
+browser_list=prev.x prev.y2 prev.w (parent.h - 3 * kLineHeight - buttonHeight - 14)
+browser_up=prev.x (parent.h - buttonHeight - 8) buttonWidth buttonHeight
+#JVPRAT: doesn't it lack insetx?:
+browser_cancel=(parent.w - 2 * buttonWidth - xSeparation - xBorder) (parent.h - buttonHeight - 8) buttonWidth buttonHeight
+browser_choose=(prev.x2 + xSeparation) prev.y prev.w prev.h
[graphicsControls]
-gcx=(opXoffset + 10)
-gcw=(parent.w - gcx - 25)
-grModePopup=(gcx - 5) (opYoffset - 1) (gcw + 5) kPopUpHeight
-opYoffset=(opYoffset + kLineHeight + 12)
+gcx=(opXoffset + xBorder)
+grModePopup=gcx opYoffset (parent.w - self.x - xBorder) kPopUpHeight
+opYoffset=(prev.y2 + ySeparation)
grRenderPopup=prev.x (opYoffset - 1) prev.w prev.h
-opYoffset=(opYoffset + kLineHeight + 16)
-grFullscreenCheckbox=gcx opYoffset (kFontHeight + 10 + 96) buttonHeight
-opYoffset=(opYoffset + buttonHeight + 4)
-grAspectCheckbox=prev.x opYoffset (kFontHeight + 10 + 136) prev.h
-opYoffset=(opYoffset + buttonHeight + 4)
+opYoffset=(prev.y2 + ySeparation)
+grFullscreenCheckbox=gcx opYoffset (parent.w - gcx - xBorder) kLineHeight
+opYoffset=(prev.y2 + ySeparation)
+grAspectCheckbox=prev.x opYoffset prev.w prev.h
+opYoffset=(prev.y2 + ySeparation)
[audioControls]
-aux=(opXoffset + 10)
-auw=(parent.w - aux - 30)
-auMidiPopup=(aux) (opYoffset - 1) (auw + 5) kPopUpHeight
-opYoffset=(opYoffset + buttonHeight + 4)
-auSampleRatePopup=(aux) (opYoffset - 1) (auw + 5) kPopUpHeight
-opYoffset=(opYoffset + buttonHeight + 4)
+aux=(opXoffset + xBorder)
+auMidiPopup=aux opYoffset (parent.w - self.x - xBorder) kPopUpHeight
+opYoffset=(opYoffset + prev.h + ySeparation)
+auSampleRatePopup=aux (opYoffset - 1) prev.w kPopUpHeight
+opYoffset=(opYoffset + prev.h + ySeparation)
[volumeControls]
-vctextw=110
-vcxoff=(opXoffset + vctextw + 10)
-vcx=(opXoffset + 10)
-vcMusicText=vcx (opYoffset + 2) vctextw kLineHeight
+vcx=(opXoffset + xBorder)
+vcOff=((sliderHeight - kLineHeight) / 2 + 2)
+vcMusicText=vcx (opYoffset + vcOff) optionsLabelWidth kLineHeight
vcMusicText.align=kTextAlignRight
-vcMusicSlider=vcxoff opYoffset sliderWidth sliderHeight
-vcMusicLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight
-opYoffset=(opYoffset + sliderHeight + 8)
-vcSfxText=vcx (opYoffset + 2) vctextw kLineHeight
+vcMusicSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
+vcMusicLabel=(prev.x2 + xSeparation) (opYoffset + vcOff) 24 kLineHeight
+opYoffset=(opYoffset + sliderHeight + ySeparation)
+vcSfxText=vcx (opYoffset + vcOff) optionsLabelWidth kLineHeight
vcSfxText.align=kTextAlignRight
-vcSfxSlider=vcxoff opYoffset sliderWidth sliderHeight
-vcSfxLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight
-opYoffset=(opYoffset + sliderHeight + 8)
-vcSpeechText=vcx (opYoffset + 2) vctextw kLineHeight
+vcSfxSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
+vcSfxLabel=(prev.x2 + xSeparation) (opYoffset + vcOff) 24 kLineHeight
+opYoffset=(opYoffset + sliderHeight + ySeparation)
+vcSpeechText=vcx (opYoffset + vcOff) optionsLabelWidth kLineHeight
vcSpeechText.align=kTextAlignRight
-vcSpeechSlider=vcxoff opYoffset sliderWidth sliderHeight
-vcSpeechLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight
-opYoffset=(opYoffset + sliderHeight + 12)
+vcSpeechSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
+vcSpeechLabel=(prev.x2 + xSeparation) (opYoffset + vcOff) 24 kLineHeight
+opYoffset=(opYoffset + sliderHeight + ySeparation)
[midiControls]
-mcx=(opXoffset + 10)
+mcx=(opXoffset + xBorder)
mcOff=((buttonHeight - kLineHeight) / 2 + 2)
mcFontButton=mcx opYoffset buttonWidth buttonHeight
-mcFontPath=(prev.x2 + 20) (opYoffset + mcOff) (parent.w - (buttonWidth + 20) - mcx - kLineHeight - 20) kLineHeight
-mcFontClearButton=(prev.x2 + 10) (opYoffset + mcOff) kLineHeight kLineHeight
-opYoffset=(opYoffset + buttonHeight + 6 * midiControlsSpacing)
-mcMixedCheckbox=mcx opYoffset (kFontHeight + 10 + 135) buttonHeight
-opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
-mcMt32Checkbox=mcx opYoffset (kFontHeight + 10 + 256) buttonHeight
-opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
-mcGSCheckbox=mcx opYoffset (kFontHeight + 10 + 142) buttonHeight
-opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
-mcMidiGainText=mcx (opYoffset + 2) 80 kLineHeight
+mcFontPath=(prev.x2 + xSeparation) (opYoffset + mcOff) (parent.w - self.x - xSeparation - kLineHeight - xBorder) kLineHeight
+mcFontClearButton=(prev.x2 + xSeparation) prev.y kLineHeight kLineHeight
+opYoffset=(opYoffset + buttonHeight + ySeparation)
+mcMixedCheckbox=mcx opYoffset (parent.w - self.x - xBorder) kLineHeight
+opYoffset=(opYoffset + prev.h + ySeparation)
+mcMt32Checkbox=mcx opYoffset prev.w kLineHeight
+opYoffset=(opYoffset + prev.h + ySeparation)
+mcGSCheckbox=mcx opYoffset prev.w kLineHeight
+opYoffset=(opYoffset + prev.h + ySeparation)
+mcOff=((sliderHeight - kLineHeight) / 2 + 2)
+mcMidiGainText=mcx (opYoffset + mcOff) optionsLabelWidth kLineHeight
mcMidiGainText.align=kTextAlignRight
-mcMidiGainSlider=(prev.x2 + 10) opYoffset sliderWidth sliderHeight
-mcMidiGainLabel=(prev.x2 + 10) (opYoffset + 2) 40 kLineHeight
-opYoffset=(opYoffset + sliderHeight + midiControlsSpacing)
+mcMidiGainSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
+mcMidiGainLabel=(prev.x2 + xSeparation) (opYoffset + mcOff) 40 kLineHeight
+opYoffset=(opYoffset + sliderHeight + ySeparation)
[subtitleControls]
-sbx=(opXoffset + 10)
-sbtextw=110
-sbYoff=(buttonHeight / 8)
-sbOff=((sliderHeight - kLineHeight) / 2)
-opYoffset=(opYoffset + sbYoff)
-subToggleDesc=sbx (opYoffset + sbYoff) sbtextw buttonHeight
-subToggleButton=prev.x2 opYoffset (buttonWidth + 34) sliderHeight
-opYoffset=(opYoffset + buttonHeight + 6)
-subSubtitleSpeedDesc=sbx (opYoffset + sbOff) sbtextw kLineHeight
+sbx=(opXoffset + xBorder)
+sbOff=((sliderHeight - kLineHeight) / 2 + 2)
+subToggleDesc=sbx (opYoffset + sbOff) optionsLabelWidth kLineHeight
+subToggleDesc.align=kTextAlignRight
+subToggleButton=(prev.x2 + xSeparation) opYoffset (buttonWidth + 34) sliderHeight
+opYoffset=(prev.y2 + ySeparation)
+subSubtitleSpeedDesc=sbx (opYoffset + sbOff) optionsLabelWidth kLineHeight
subSubtitleSpeedDesc.align=kTextAlignRight
-subSubtitleSpeedSlider=prev.x2 opYoffset sliderWidth sliderHeight
-subSubtitleSpeedLabel=(prev.x2 + 10) (opYoffset + sbOff) 24 kLineHeight
-opYoffset=(opYoffset + sliderHeight + 8)
+subSubtitleSpeedSlider=(prev.x2 + xSeparation) opYoffset sliderWidth sliderHeight
+subSubtitleSpeedLabel=(prev.x2 + xSeparation) (opYoffset + sbOff) 24 kLineHeight
+opYoffset=(opYoffset + sliderHeight + ySeparation)
[scummmain]
## Main dialog
@@ -592,7 +594,6 @@ def_insetW=(w - buttonWidth - 17 * 2 - insetX)
def_insetH=(h - 13 - insetY)
def_launcherVersionX=50
def_launcherVersionY=5
-def_midiControlsSpacing=2
def_gameOptionsOverrideVPad=10
def_aboutXOff=3
def_aboutYOff=2
diff --git a/gui/widget.h b/gui/widget.h
index bf15081f79..c19059d32c 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -27,6 +27,7 @@
#include "common/scummsys.h"
#include "common/str.h"
+#include "common/keyboard.h"
#include "graphics/font.h"
#include "graphics/surface.h"
#include "gui/object.h"
@@ -127,8 +128,8 @@ public:
virtual void handleMouseLeft(int button) {}
virtual void handleMouseMoved(int x, int y, int button) {}
virtual void handleMouseWheel(int x, int y, int direction) {}
- virtual bool handleKeyDown(uint16 ascii, int keycode, int modifiers) { return false; } // Return true if the event was handled
- virtual bool handleKeyUp(uint16 ascii, int keycode, int modifiers) { return false; } // Return true if the event was handled
+ virtual bool handleKeyDown(Common::KeyState state) { return false; } // Return true if the event was handled
+ virtual bool handleKeyUp(Common::KeyState state) { return false; } // Return true if the event was handled
virtual void handleTickle() {}
virtual void reflowLayout() { GuiObject::reflowLayout(); }