Merge pull request #650 from lioncash/scrolling
DolphinWX: Implement scrolling in the memory views
This commit is contained in:
commit
5df45dfbba
|
@ -50,6 +50,7 @@ BEGIN_EVENT_TABLE(CMemoryView, wxControl)
|
||||||
EVT_LEFT_UP(CMemoryView::OnMouseUpL)
|
EVT_LEFT_UP(CMemoryView::OnMouseUpL)
|
||||||
EVT_MOTION(CMemoryView::OnMouseMove)
|
EVT_MOTION(CMemoryView::OnMouseMove)
|
||||||
EVT_RIGHT_DOWN(CMemoryView::OnMouseDownR)
|
EVT_RIGHT_DOWN(CMemoryView::OnMouseDownR)
|
||||||
|
EVT_MOUSEWHEEL(CMemoryView::OnScrollWheel)
|
||||||
EVT_MENU(-1, CMemoryView::OnPopupMenu)
|
EVT_MENU(-1, CMemoryView::OnPopupMenu)
|
||||||
EVT_SIZE(CMemoryView::OnResize)
|
EVT_SIZE(CMemoryView::OnResize)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
@ -137,6 +138,24 @@ void CMemoryView::OnMouseUpL(wxMouseEvent& event)
|
||||||
event.Skip();
|
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)
|
void CMemoryView::OnPopupMenu(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
#if wxUSE_CLIPBOARD
|
#if wxUSE_CLIPBOARD
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
void OnMouseMove(wxMouseEvent& event);
|
void OnMouseMove(wxMouseEvent& event);
|
||||||
void OnMouseUpL(wxMouseEvent& event);
|
void OnMouseUpL(wxMouseEvent& event);
|
||||||
void OnMouseDownR(wxMouseEvent& event);
|
void OnMouseDownR(wxMouseEvent& event);
|
||||||
|
void OnScrollWheel(wxMouseEvent& event);
|
||||||
void OnPopupMenu(wxCommandEvent& event);
|
void OnPopupMenu(wxCommandEvent& event);
|
||||||
|
|
||||||
u32 GetSelection() { return selection ; }
|
u32 GetSelection() { return selection ; }
|
||||||
|
|
Loading…
Reference in New Issue