mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 19:51:49 +00:00
Moved keys mapping dialog to new scheme. Made it generic. Fixed several
compilation errors associated with it. svn-id: r21151
This commit is contained in:
parent
86565fcca5
commit
51495fb199
@ -47,7 +47,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef SMALL_SCREEN_DEVICE
|
||||
#include "KeysDialog.h"
|
||||
#include "gui/KeysDialog.h"
|
||||
#endif
|
||||
|
||||
using GUI::CommandSender;
|
||||
|
@ -20,10 +20,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "common/stdafx.h"
|
||||
#include "gui/KeysDialog.h"
|
||||
#include "gui/Actions.h"
|
||||
#include <sdl_keyboard.h>
|
||||
#include <SDL_keyboard.h>
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
#include "CEDevice.h"
|
||||
@ -48,22 +48,20 @@ enum {
|
||||
};
|
||||
|
||||
KeysDialog::KeysDialog(const Common::String &title)
|
||||
: GUI::Dialog(30, 20, 260, 160) {
|
||||
|
||||
GUI::WidgetSize ws = GUI::kNormalWidgetSize;
|
||||
: GUI::Dialog("keysdialog") {
|
||||
|
||||
//tmp
|
||||
// addButton(this, _w - (buttonWidth + 10), _h - buttonHeight - 8, "Choose", kChooseCmd, 0, ws);
|
||||
//tmp
|
||||
addButton(this, 160, 20, "Map", kMapCmd, 0, ws); // Map
|
||||
addButton(this, 160, 40, "OK", kOKCmd, 0, ws); // OK
|
||||
addButton(this, 160, 60, "Cancel", kCloseCmd, 0, ws); // Cancel
|
||||
new ButtonWidget(this, "keysdialog_map", "Map", kMapCmd, 0);
|
||||
new ButtonWidget(this, "keysdialog_ok", "OK", kOKCmd, 0);
|
||||
new ButtonWidget(this, "keysdialog_cancel", "Cancel", kCloseCmd, 0);
|
||||
|
||||
_actionsList = new ListWidget(this, 10, 20, 140, 90);
|
||||
_actionsList = new ListWidget(this, "keysdialog_list");
|
||||
_actionsList->setNumberingMode(kListNumberingZero);
|
||||
|
||||
_actionTitle = new StaticTextWidget(this, 10, 120, 240, 16, title, kTextAlignCenter);
|
||||
_keyMapping = new StaticTextWidget(this, 10, 140, 240, 16, "", kTextAlignCenter);
|
||||
_actionTitle = new StaticTextWidget(this, "keysdialog_action", title, kTextAlignCenter);
|
||||
_keyMapping = new StaticTextWidget(this, "keysdialog_mapping", "", kTextAlignCenter);
|
||||
|
||||
_actionTitle->setFlags(WIDGET_CLEARBG);
|
||||
_keyMapping->setFlags(WIDGET_CLEARBG);
|
||||
|
@ -119,7 +119,7 @@ yoffset=(yoffset + buttonHeight + 4)\n\
|
||||
globaloptions_extrabutton=5 yoffset (buttonWidth + 5) buttonHeight\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\
|
||||
globaloptions_keysbutton=5 yoffset (buttonWidth + 5) buttonHeight\n\
|
||||
\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\
|
||||
@ -138,6 +138,16 @@ useWithPrefix=volumeControls gameoptions_\n\
|
||||
opYoffset=(vBorder + buttonHeight)\n\
|
||||
useWithPrefix=midiControls gameoptions_\n\
|
||||
\n\
|
||||
### keys dialog\n\
|
||||
keysdialog=(w / 20) (h / 10) (w - w / 10) (h - h / 5)\n\
|
||||
set_parent=keysdialog\n\
|
||||
keysdialog_map=(parent.w - buttonWidth - 10) 20 buttonWidth buttonHeight\n\
|
||||
keysdialog_ok=prev.x (prev.y2 + 4) prev.w prev.h\n\
|
||||
keysdialog_cancel=prev.x (prev.y2 + 4) prev.w prev.h\n\
|
||||
keysdialog_list=10 10 (prev.x - 20) (parent.h - kLineHeight * 4 - self.y)\n\
|
||||
keysdialog_action=prev.x (parent.h - kLineHeight * 3) (parent.w - self.x * 2) kLineHeight\n\
|
||||
keysdialog_mapping=prev.x (prev.y + kLineHeight) prev.w prev.h\n\
|
||||
\n\
|
||||
##### SCUMM dialogs\n\
|
||||
scummDummyDialog=0 80 0 16\n\
|
||||
\n\
|
||||
@ -175,8 +185,8 @@ 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_keys=(soWidth - 3 * (buttonWidth + 4) + 6) opYoffset (buttonWidth - 10) buttonHeight\n\
|
||||
scummconfig_cancel=(prev.x2 + 4) prev.y (prev.w + 10) 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\
|
||||
|
@ -223,7 +223,7 @@ yoffset=(yoffset + buttonHeight + 4)
|
||||
globaloptions_extrabutton=5 yoffset (buttonWidth + 5) buttonHeight
|
||||
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_keysbutton=5 yoffset (buttonWidth + 5) 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
|
||||
@ -242,6 +242,16 @@ useWithPrefix=volumeControls gameoptions_
|
||||
opYoffset=(vBorder + buttonHeight)
|
||||
useWithPrefix=midiControls gameoptions_
|
||||
|
||||
### keys dialog
|
||||
keysdialog=(w / 20) (h / 10) (w - w / 10) (h - h / 5)
|
||||
set_parent=keysdialog
|
||||
keysdialog_map=(parent.w - buttonWidth - 10) 20 buttonWidth buttonHeight
|
||||
keysdialog_ok=prev.x (prev.y2 + 4) prev.w prev.h
|
||||
keysdialog_cancel=prev.x (prev.y2 + 4) prev.w prev.h
|
||||
keysdialog_list=10 10 (prev.x - 20) (parent.h - kLineHeight * 4 - self.y)
|
||||
keysdialog_action=prev.x (parent.h - kLineHeight * 3) (parent.w - self.x * 2) kLineHeight
|
||||
keysdialog_mapping=prev.x (prev.y + kLineHeight) prev.w prev.h
|
||||
|
||||
##### SCUMM dialogs
|
||||
scummDummyDialog=0 80 0 16
|
||||
|
||||
@ -279,8 +289,8 @@ 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_keys=(soWidth - 3 * (buttonWidth + 4) + 6) opYoffset (buttonWidth - 10) buttonHeight
|
||||
scummconfig_cancel=(prev.x2 + 4) prev.y (prev.w + 10) 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user