summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/listbox.cpp10
-rw-r--r--src/gui/widgets/listbox.h2
2 files changed, 12 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);
+}
diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h
index e4b6dd54e..1df07f19d 100644
--- a/src/gui/widgets/listbox.h
+++ b/src/gui/widgets/listbox.h
@@ -66,6 +66,8 @@ class ListBox : public gcn::ListBox
void mouseDragged(gcn::MouseEvent &event);
+ void refocus();
+
protected:
gcn::Color mHighlightColor;
static float mAlpha;