Merge pull request #650 from lioncash/scrolling

DolphinWX: Implement scrolling in the memory views
This commit is contained in:
Dolphin Bot 2014-07-19 19:31:41 +02:00
commit 5df45dfbba
2 changed files with 20 additions and 0 deletions

View File

@ -50,6 +50,7 @@ BEGIN_EVENT_TABLE(CMemoryView, wxControl)
EVT_LEFT_UP(CMemoryView::OnMouseUpL)
EVT_MOTION(CMemoryView::OnMouseMove)
EVT_RIGHT_DOWN(CMemoryView::OnMouseDownR)
EVT_MOUSEWHEEL(CMemoryView::OnScrollWheel)
EVT_MENU(-1, CMemoryView::OnPopupMenu)
EVT_SIZE(CMemoryView::OnResize)
END_EVENT_TABLE()
@ -137,6 +138,24 @@ void CMemoryView::OnMouseUpL(wxMouseEvent& event)
event.Skip();
}
void CMemoryView::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 CMemoryView::OnPopupMenu(wxCommandEvent& event)
{
#if wxUSE_CLIPBOARD

View File

@ -21,6 +21,7 @@ public:
void OnMouseMove(wxMouseEvent& event);
void OnMouseUpL(wxMouseEvent& event);
void OnMouseDownR(wxMouseEvent& event);
void OnScrollWheel(wxMouseEvent& event);
void OnPopupMenu(wxCommandEvent& event);
u32 GetSelection() { return selection ; }