aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control
diff options
context:
space:
mode:
authorPaul Gilbert2016-11-16 19:21:25 -0500
committerPaul Gilbert2016-11-16 19:21:25 -0500
commit4e3a9b25ea249e6cd2efc9717dcfaaa5e58df4f7 (patch)
tree5b6ee340ebfeb97ba949aed2877bbaa988da584c /engines/titanic/pet_control
parent0fb54db9b8c32aa1c9cc55a22b52c9c6fb2b7eca (diff)
downloadscummvm-rg350-4e3a9b25ea249e6cd2efc9717dcfaaa5e58df4f7.tar.gz
scummvm-rg350-4e3a9b25ea249e6cd2efc9717dcfaaa5e58df4f7.tar.bz2
scummvm-rg350-4e3a9b25ea249e6cd2efc9717dcfaaa5e58df4f7.zip
TITANIC: Implement mouse scrolling for PET Remote
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r--engines/titanic/pet_control/pet_glyphs.h20
-rw-r--r--engines/titanic/pet_control/pet_remote.cpp9
-rw-r--r--engines/titanic/pet_control/pet_remote.h1
3 files changed, 20 insertions, 10 deletions
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 79e032162c..ac008c5ab0 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -275,16 +275,6 @@ private:
CPetGlyph *getGlyph(int index) const;
/**
- * Scrolls the glyphs to the left
- */
- void scrollLeft();
-
- /**
- * Scrolls the glyphs to the right
- */
- void scrollRight();
-
- /**
* Set the first visible glyph index
*/
void setFirstVisible(int index);
@@ -456,6 +446,16 @@ public:
void scrollToStart() { _firstVisibleIndex = 0; }
/**
+ * Scrolls the glyphs to the left
+ */
+ void scrollLeft();
+
+ /**
+ * Scrolls the glyphs to the right
+ */
+ void scrollRight();
+
+ /**
* Increment the currently selected index
*/
void incSelection();
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 46af55c4d3..f80403c573 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -161,6 +161,15 @@ bool CPetRemote::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
return _items.VirtualKeyCharMsg(msg);
}
+bool CPetRemote::MouseWheelMsg(CMouseWheelMsg *msg) {
+ if (msg->_wheelUp)
+ _items.scrollLeft();
+ else
+ _items.scrollRight();
+
+ return true;
+}
+
bool CPetRemote::isValid(CPetControl *petControl) {
return setupControl(petControl);
}
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 22ea1e05ad..9cd9c1e9d7 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -112,6 +112,7 @@ public:
virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
+ virtual bool MouseWheelMsg(CMouseWheelMsg *msg);
/**
* Returns true if the object is in a valid state