DolphinWX: Implement scrolling in the code view and DSP disassembly view.
This commit is contained in:
parent
79e90a1521
commit
9c1b427687
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue