diff options
author | Eugene Sandulenko | 2009-05-09 22:36:57 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-05-09 22:36:57 +0000 |
commit | 87fdc5d544e73a4cb520eb6c794bb12d87f0a6a8 (patch) | |
tree | 0c17a184751c144156bc2da3e2034cc151e27264 /backends | |
parent | 8b813f02b850f7b67c17cdaf4a058c73f2febe2c (diff) | |
download | scummvm-rg350-87fdc5d544e73a4cb520eb6c794bb12d87f0a6a8.tar.gz scummvm-rg350-87fdc5d544e73a4cb520eb6c794bb12d87f0a6a8.tar.bz2 scummvm-rg350-87fdc5d544e73a4cb520eb6c794bb12d87f0a6a8.zip |
Original GSoC'08 keymapper now works.
Plans:
- Make remap dialog less ugly
- Port dialog to other resolutions and classic theme
- Stop polluting config namespaces with keymap
- Improve automapper
- Add support to the engines and backends
svn-id: r40404
Diffstat (limited to 'backends')
-rw-r--r-- | backends/keymapper/remap-dialog.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index cded6ba5a0..5a61b9e7e1 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -80,6 +80,8 @@ void RemapDialog::open() { keymapCount += _gameKeymaps->size(); } + debug(3, "keymaps: %d", keymapCount); + _keymapTable = (Keymap **)malloc(sizeof(Keymap*) * keymapCount); Keymapper::Domain::iterator it; @@ -125,14 +127,15 @@ void RemapDialog::reflowLayout() { int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0); int scrollbarWidth = g_gui.xmlEval()->getVar("Globals.Scrollbar.Width", 0); - int areaX = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.x"); - int areaY = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.y"); - int areaW = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.w"); - int areaH = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.h"); - int spacing = 10; //g_gui.xmlEval()->getVar("remap_spacing"); - int labelWidth = 100; //g_gui.xmlEval()->getVar("remap_label_width"); - int buttonWidth = 80; //g_gui.xmlEval()->getVar("remap_button_width"); + int16 areaX, areaY; + uint16 areaW, areaH; + int spacing = g_gui.xmlEval()->getVar("Globals.KeyRemapper.Spacing"); + int labelWidth = g_gui.xmlEval()->getVar("Globals.KeyRemapper.LabelWidth"); + int buttonWidth = g_gui.xmlEval()->getVar("Globals.KeyRemapper.ButtonWidth"); int colWidth = labelWidth + buttonWidth + spacing; + + g_gui.xmlEval()->getWidgetData((const String&)String("KeyRemapper.KeymapArea"), areaX, areaY, areaW, areaH); + _colCount = (areaW - scrollbarWidth) / colWidth; _rowCount = (areaH + spacing) / (buttonHeight + spacing); if (_colCount <= 0 || _rowCount <= 0) |