diff options
author | Alex Marsev <alex.marsev@gmail.com> | 2014-01-08 15:06:56 +0400 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2015-09-24 01:50:55 +0300 |
commit | 352a67887a93870c91fc3a2dd8f2442fc2f23574 (patch) | |
tree | 8f61073c8f17c66e24eab161b9e53358ada4383f | |
parent | 0cf555f76284658fd15f7e5ff16a69fd3ab7f743 (diff) |
VolumeCtrl: make mouse wheel consistent
Wheel up - volume up, wheel down - volume down.
And use the same steps as volume control command.
-rw-r--r-- | src/mpc-hc/VolumeCtrl.cpp | 15 | ||||
-rw-r--r-- | src/mpc-hc/VolumeCtrl.h | 3 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/mpc-hc/VolumeCtrl.cpp b/src/mpc-hc/VolumeCtrl.cpp index bd41188ed..f2365c4e4 100644 --- a/src/mpc-hc/VolumeCtrl.cpp +++ b/src/mpc-hc/VolumeCtrl.cpp @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -79,6 +79,7 @@ BEGIN_MESSAGE_MAP(CVolumeCtrl, CSliderCtrl) ON_WM_HSCROLL_REFLECT()
ON_WM_SETCURSOR()
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify)
+ ON_WM_MOUSEWHEEL()
END_MESSAGE_MAP()
// CVolumeCtrl message handlers
@@ -210,3 +211,15 @@ BOOL CVolumeCtrl::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult) return TRUE;
}
+
+BOOL CVolumeCtrl::OnMouseWheel(UINT nFlags, short zDelta, CPoint point)
+{
+ if (zDelta > 0) {
+ IncreaseVolume();
+ } else if (zDelta < 0) {
+ DecreaseVolume();
+ } else {
+ return FALSE;
+ }
+ return TRUE;
+}
diff --git a/src/mpc-hc/VolumeCtrl.h b/src/mpc-hc/VolumeCtrl.h index 7584d4404..e8230bc0d 100644 --- a/src/mpc-hc/VolumeCtrl.h +++ b/src/mpc-hc/VolumeCtrl.h @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2012, 2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -49,4 +49,5 @@ public: afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void HScroll(UINT nSBCode, UINT nPos);
+ afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint point);
};
|