TITANIC: Implement mouse scrolling for PET Remote

This commit is contained in:
Paul Gilbert
2016-11-16 19:21:25 -05:00
parent 0fb54db9b8
commit 4e3a9b25ea
3 changed files with 20 additions and 10 deletions
+10 -10
View File
@@ -274,16 +274,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
*/
@@ -455,6 +445,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
*/
@@ -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);
}
+1
View File
@@ -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