summaryrefslogtreecommitdiff
path: root/src/gui/listbox.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-25 00:50:33 -0700
committerIra Rice <irarice@gmail.com>2009-02-25 00:50:33 -0700
commitd8bc3a6418c5027d7f6c42ce8f8dceca8dee8971 (patch)
treefbb0b461bd151cbf3ad5aeedb80257140253f57c /src/gui/listbox.h
parenta1e483913672e55704e8fbafeff5ea0ccc0c9b07 (diff)
downloadmana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.tar.gz
mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.tar.bz2
mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.tar.xz
mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.zip
Fixed up NPC list dialogs to be navigatable by keyboard (scrolling
through the list requires the use of the mouse wheel at the moment), fixed wrapping behavior for wrapping around lists to actually wrap around lists properly, and placed a few checks for current_npc where they were assumed before which could cause the client to hang or crash in case the NPC is no longer around. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/listbox.h')
-rw-r--r--src/gui/listbox.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/listbox.h b/src/gui/listbox.h
index e783083f..a6392a94 100644
--- a/src/gui/listbox.h
+++ b/src/gui/listbox.h
@@ -49,6 +49,25 @@ class ListBox : public gcn::ListBox
void mouseDragged(gcn::MouseEvent &event);
+ // Inherited from KeyListener
+
+ virtual void keyPressed(gcn::KeyEvent& keyEvent);
+
+ // Inherited from MouseListener
+
+ virtual void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent);
+
+ virtual void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent);
+
+ /**
+ * Sets the selected item. The selected item is represented by
+ * an index from the list model.
+ *
+ * @param selected the selected item as an index from the list model.
+ * @see getSelected
+ */
+ void setSelected(int selected);
+
private:
static float mAlpha;
};