diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-03-04 16:08:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-03-04 16:08:55 +0300 |
commit | f74202392745923f9ce372a6bdcd0a45db6bcd08 (patch) | |
tree | 34804d1fb3a94060544529a781983dd108ce1586 /src/gui/widgets/listbox.cpp | |
parent | 27de1601aa4a952d9555cc9b1aba8630f9043af4 (diff) | |
download | mv-f74202392745923f9ce372a6bdcd0a45db6bcd08.tar.gz mv-f74202392745923f9ce372a6bdcd0a45db6bcd08.tar.bz2 mv-f74202392745923f9ce372a6bdcd0a45db6bcd08.tar.xz mv-f74202392745923f9ce372a6bdcd0a45db6bcd08.zip |
Fix possible crash in npc menu.
Diffstat (limited to 'src/gui/widgets/listbox.cpp')
-rw-r--r-- | src/gui/widgets/listbox.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 28fe9daa1..2944c5be6 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -29,6 +29,7 @@ #include "gui/sdlinput.h" #include "gui/theme.h" +#include <guichan/focushandler.hpp> #include <guichan/font.hpp> #include <guichan/graphics.hpp> #include <guichan/key.hpp> @@ -149,3 +150,12 @@ void ListBox::mouseDragged(gcn::MouseEvent &event) if (getRowHeight()) setSelected(y / getRowHeight()); } + +void ListBox::refocus() +{ + if (!mFocusHandler) + return; + + if (isFocusable()) + mFocusHandler->requestFocus(this); +} |