diff options
author | Ira Rice <irarice@gmail.com> | 2009-04-20 22:06:05 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-20 22:06:05 +0200 |
commit | 654cc39c7750bd7a8d798ab5c4732ed960135573 (patch) | |
tree | 847b7f9bbd964a50e1b15639a36a69743f0dda63 /src/gui/table.cpp | |
parent | 0689ecac058ce1ef063b0250c48a39ed1db11f82 (diff) | |
download | mana-654cc39c7750bd7a8d798ab5c4732ed960135573.tar.gz mana-654cc39c7750bd7a8d798ab5c4732ed960135573.tar.bz2 mana-654cc39c7750bd7a8d798ab5c4732ed960135573.tar.xz mana-654cc39c7750bd7a8d798ab5c4732ed960135573.zip |
Repaired table and listbox scrolling when using the keyboard.
Signed-off-by: Tametomo <irarice@gmail.com>
Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
Diffstat (limited to 'src/gui/table.cpp')
-rw-r--r-- | src/gui/table.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/gui/table.cpp b/src/gui/table.cpp index e98d76e5..5ad3b5e1 100644 --- a/src/gui/table.cpp +++ b/src/gui/table.cpp @@ -19,16 +19,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <guichan/actionlistener.hpp> -#include <guichan/graphics.hpp> -#include <guichan/key.hpp> +#include "gui/palette.h" +#include "gui/table.h" +#include "gui/sdlinput.h" -#include "palette.h" -#include "table.h" +#include "configuration.h" -#include "../configuration.h" +#include "utils/dtor.h" -#include "../utils/dtor.h" +#include <guichan/actionlistener.hpp> +#include <guichan/graphics.hpp> +#include <guichan/key.hpp> float GuiTable::mAlpha = 1.0; @@ -377,38 +378,38 @@ void GuiTable::keyPressed(gcn::KeyEvent& keyEvent) { gcn::Key key = keyEvent.getKey(); - if (key.getValue() == gcn::Key::ENTER || key.getValue() == gcn::Key::SPACE) + if (key.getValue() == Key::ENTER || key.getValue() == Key::SPACE) { distributeActionEvent(); keyEvent.consume(); } - else if (key.getValue() == gcn::Key::UP) + else if (key.getValue() == Key::UP) { setSelectedRow(mSelectedRow - 1); keyEvent.consume(); } - else if (key.getValue() == gcn::Key::DOWN) + else if (key.getValue() == Key::DOWN) { setSelectedRow(mSelectedRow + 1); keyEvent.consume(); } - else if (key.getValue() == gcn::Key::LEFT) + else if (key.getValue() == Key::LEFT) { setSelectedColumn(mSelectedColumn - 1); keyEvent.consume(); } - else if (key.getValue() == gcn::Key::RIGHT) + else if (key.getValue() == Key::RIGHT) { setSelectedColumn(mSelectedColumn + 1); keyEvent.consume(); } - else if (key.getValue() == gcn::Key::HOME) + else if (key.getValue() == Key::HOME) { setSelectedRow(0); setSelectedColumn(0); keyEvent.consume(); } - else if (key.getValue() == gcn::Key::END) + else if (key.getValue() == Key::END) { setSelectedRow(mModel->getRows() - 1); setSelectedColumn(mModel->getColumns() - 1); |