Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #631 from lioncash/scrolling
DolphinWX: Implement scrolling in the code view and DSP disassembly view.
  • Loading branch information
dolphin-emu-bot committed Jul 16, 2014
2 parents dda7a5a + 9c1b427 commit 57a4bfb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Source/Core/DolphinWX/Debugger/CodeView.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/Debugger/CodeView.h
Expand Up @@ -30,6 +30,7 @@ class CCodeView : public wxControl
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);
Expand Down

0 comments on commit 57a4bfb

Please sign in to comment.