mousewheel/horizontal scrolling
hello everybody,
since the mousewheel function does not support hscrolling, i've written my own scrollwheel handler using the osx api which works fine but it "steals" the scrollwheel from my patcher window.
is it possible to access the patchers scrollbar position, something like this:
OSStatus arrange_handleWindowEvent (EventHandlerCallRef callRef, EventRef theEvent, myMaxObject *x)
{
if ( GetEventClass (theEvent) == kEventClassMouse)
{
if (GetEventKind (theEvent) == kEventMouseWheelMoved)
{
OSStatus status;
UInt32 modifiers;
EventMouseWheelAxis axis;
SInt32 delta;
status = GetEventParameter( theEvent, kEventParamKeyModifiers, typeUInt32,
NULL, sizeof(modifiers), NULL, &modifiers );
status = GetEventParameter( theEvent, kEventParamMouseWheelAxis,
typeMouseWheelAxis, NULL, sizeof(axis), NULL, &axis );
status = GetEventParameter( theEvent, kEventParamMouseWheelDelta,
typeLongInteger, NULL, sizeof(delta), NULL, &delta );
if ( axis == kEventMouseWheelAxisY )
{
if(x->mouseInside) // if mouse is inside my object move my objects scrollbar
myMaxObject_vScrollbarMove(x, -delta); ///this works fine
// else
// MOVE_MY_PATCHERS_VSCROLLBAR
return noErr;
}
else if ( axis == kEventMouseWheelAxisX )
{
if(x->mouseInside) // if mouse is inside my object move my objects hScrollbar
myMaxObject_hScrollbarMove(x, -delta);//this works fine
// else
// MOVE_MY_PATCHERS_HSCROLLBAR
return noErr;
}
else
{
return noErr;
}
}
else return eventNotHandledErr;
}
else return eventNotHandledErr;
}
thanks in advance,
cheers,
tom
I am not sure what you mean here, but the mousewheel method does support both horizontal and vertical scrolling.
It's prototyped as:
void yourobj_mousewheel(t_yourobj *x, t_object *patcherview, t_pt pt, long modifiers, double dx, double dy);dx and dy hold the scrolling delta information.
- Luigi
hi,
thanks so much, i' m so stupid i guess...
tom