Merge pull request #631 from lioncash/scrolling

DolphinWX: Implement scrolling in the code view and DSP disassembly view.
This commit is contained in:
Dolphin Bot 2014-07-16 03:53:53 +02:00
commit 57a4bfb835
2 changed files with 20 additions and 0 deletions

View File

@ -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);

View File

@ -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);