Show
Ignore:
Timestamp:
11/19/09 12:21:05 (5 years ago)
Author:
robert
Message:

From J.P. Delport, "simple addition to make the scroll wheel work in the example."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgviewerWX/osgviewerWX.cpp

    r8459 r10778  
    128128    EVT_RIGHT_UP            (OSGCanvas::OnMouseUp) 
    129129    EVT_MOTION              (OSGCanvas::OnMouseMotion) 
     130    EVT_MOUSEWHEEL          (OSGCanvas::OnMouseWheel) 
    130131END_EVENT_TABLE() 
    131132 
     
    228229    if (_graphics_window.valid()) 
    229230        _graphics_window->getEventQueue()->mouseMotion(event.GetX(), event.GetY()); 
     231} 
     232 
     233void OSGCanvas::OnMouseWheel(wxMouseEvent &event) 
     234{ 
     235    int delta = event.GetWheelRotation() / event.GetWheelDelta() * event.GetLinesPerAction(); 
     236 
     237    if (_graphics_window.valid()) { 
     238        _graphics_window->getEventQueue()->mouseScroll( 
     239            delta>0 ?  
     240            osgGA::GUIEventAdapter::SCROLL_UP :  
     241            osgGA::GUIEventAdapter::SCROLL_DOWN); 
     242    } 
    230243} 
    231244