summaryrefslogtreecommitdiff
path: root/src/gui/listbox.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 14:54:39 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 14:54:39 +0000
commitf842e0b40d8382011f0bc46b1446945d99ac0425 (patch)
tree5ddbb7c146a8ece28a4260d788350b1c2cf0dbed /src/gui/listbox.cpp
parentcbbcc5489e2f72a76b66ae849cbe8f1dc44246ca (diff)
downloadmana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.gz
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.bz2
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.xz
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.zip
Upgraded to Guichan 0.6.0 (merge from guichan-0.6.0 branch).
Diffstat (limited to 'src/gui/listbox.cpp')
-rw-r--r--src/gui/listbox.cpp33
1 files changed, 6 insertions, 27 deletions
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
index d4a2c6cb..a7f6df8d 100644
--- a/src/gui/listbox.cpp
+++ b/src/gui/listbox.cpp
@@ -31,8 +31,7 @@
#include <guichan/mouseinput.hpp>
ListBox::ListBox(gcn::ListModel *listModel):
- gcn::ListBox(listModel),
- mMousePressed(false)
+ gcn::ListBox(listModel)
{
}
@@ -61,39 +60,19 @@ void ListBox::draw(gcn::Graphics *graphics)
}
}
-void ListBox::setSelected(int selected)
+void
+ListBox::setSelected(int selected)
{
gcn::ListBox::setSelected(selected);
fireSelectionChangedEvent();
}
-void ListBox::mousePress(int x, int y, int button)
+void
+ListBox::mouseDragged(gcn::MouseEvent &event)
{
- gcn::ListBox::mousePress(x, y, button);
-
- if (button == gcn::MouseInput::LEFT && hasMouse())
- {
- mMousePressed = true;
- }
-}
-
-void ListBox::mouseRelease(int x, int y, int button)
-{
- gcn::ListBox::mouseRelease(x, y, button);
-
- mMousePressed = false;
-}
-
-void ListBox::mouseMotion(int x, int y)
-{
- gcn::ListBox::mouseMotion(x, y);
-
// Pretend mouse is pressed continuously while dragged. Causes list
// selection to be updated as is default in many GUIs.
- if (mMousePressed)
- {
- mousePress(x, y, gcn::MouseInput::LEFT);
- }
+ mousePressed(event);
}
void ListBox::fireSelectionChangedEvent()