diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 0b725e75d4..d7e06e4585 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -56,6 +56,7 @@ enum BEGIN_EVENT_TABLE(CCodeView, wxControl) EVT_ERASE_BACKGROUND(CCodeView::OnErase) EVT_PAINT(CCodeView::OnPaint) + EVT_MOUSEWHEEL(CCodeView::OnScrollWheel) EVT_LEFT_DOWN(CCodeView::OnMouseDown) EVT_LEFT_UP(CCodeView::OnMouseUpL) EVT_MOTION(CCodeView::OnMouseMove) @@ -114,6 +115,24 @@ void CCodeView::OnMouseDown(wxMouseEvent& event) event.Skip(); } +void CCodeView::OnScrollWheel(wxMouseEvent& event) +{ + const bool scroll_down = (event.GetWheelRotation() < 0); + const int num_lines = event.GetLinesPerAction(); + + if (scroll_down) + { + curAddress += num_lines; + } + else + { + curAddress -= num_lines; + } + + Refresh(); + event.Skip(); +} + void CCodeView::ToggleBreakpoint(u32 address) { debugger->ToggleBreakpoint(address); diff --git a/Source/Core/DolphinWX/Debugger/CodeView.h b/Source/Core/DolphinWX/Debugger/CodeView.h index fde58decb7..8532e53457 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.h +++ b/Source/Core/DolphinWX/Debugger/CodeView.h @@ -30,6 +30,7 @@ public: wxWindow* parent, wxWindowID Id = wxID_ANY); void OnPaint(wxPaintEvent& event); void OnErase(wxEraseEvent& event); + void OnScrollWheel(wxMouseEvent& event); void OnMouseDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); void OnMouseUpL(wxMouseEvent& event);