本文整理汇总了C#中dfControl.OnMouseWheel方法的典型用法代码示例。如果您正苦于以下问题:C# dfControl.OnMouseWheel方法的具体用法?C# dfControl.OnMouseWheel怎么用?C# dfControl.OnMouseWheel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dfControl
的用法示例。
在下文中一共展示了dfControl.OnMouseWheel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessInput
//.........这里部分代码省略.........
// Let the last control know that the button was released whether it was
// released over the control or not
activeControl.OnMouseUp( new dfMouseEventArgs( activeControl, buttonsReleased, 0, ray, position, scroll ) );
// If all buttons are up, then we need to reset the mouse state
if( buttonsDown == dfMouseButtons.None && activeControl != control )
{
setActive( manager, null, position, ray );
}
return;
}
#endregion
#region Doesn't matter if buttons are down or not
if( activeControl != null && activeControl == control )
{
if( mouseMoveDelta.magnitude == 0 && Time.realtimeSinceStartup - lastHoverTime > manager.hoverNotifactionFrequency )
{
activeControl.OnMouseHover( new dfMouseEventArgs( activeControl, buttonsDown, 0, ray, position, scroll ) );
lastHoverTime = Time.realtimeSinceStartup;
}
}
#endregion
#region No buttons down
if( buttonsDown == dfMouseButtons.None )
{
if( scroll != 0 && control != null )
{
setActive( manager, control, position, ray );
control.OnMouseWheel( new dfMouseEventArgs( control, buttonsDown, 0, ray, position, scroll ) );
return;
}
setActive( manager, control, position, ray );
}
#endregion
#region Some buttons down
else if( buttonsDown != dfMouseButtons.None ) // Some buttons are down
{
if( activeControl != null )
{
// Special case: Another control with a higher RenderOrder is now under the mouse.
// This can happen when a control moves, such as when you click on a slider and the
// thumb position is updated to be under the mouse (when it wasn't previously)
if( control != null && control.RenderOrder > activeControl.RenderOrder )
{
// TODO: What to do about this when a control has capture?
}
// If the mouse was moved notify the control, otherwise nothing to do
// NOTE: This is similar to "mouse capture" on Windows Forms
if( mouseMoveDelta.magnitude >= DRAG_START_DELTA )
{
if( ( buttonsDown & ( dfMouseButtons.Left | dfMouseButtons.Right ) ) != 0 && dragState != dfDragDropState.Denied )
{
var dragArgs = new dfDragEventArgs( activeControl ) { Position = position };
activeControl.OnDragStart( dragArgs );
if( dragArgs.State == dfDragDropState.Dragging )
{
dragState = dfDragDropState.Dragging;
dragData = dragArgs.Data;
return;
}
else
{
dragState = dfDragDropState.Denied;
}
}
}
}
}
#endregion
if( activeControl != null && mouseMoveDelta.magnitude >= 1 )
{
var moveArgs = new dfMouseEventArgs( activeControl, buttonsDown, 0, ray, position, scroll ) { MoveDelta = mouseMoveDelta };
activeControl.OnMouseMove( moveArgs );
}
}