本文整理汇总了C#中Client.Gump.OnMouseEnter方法的典型用法代码示例。如果您正苦于以下问题:C# Gump.OnMouseEnter方法的具体用法?C# Gump.OnMouseEnter怎么用?C# Gump.OnMouseEnter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client.Gump
的用法示例。
在下文中一共展示了Gump.OnMouseEnter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MouseMove
public static bool MouseMove(int X, int Y, MouseButtons mb)
{
if (m_Capture != null)
{
Point point = m_Capture.PointToClient(new Point(X, Y));
if (m_LastOver != m_Capture)
{
if (m_LastOver != null)
{
m_LastOver.OnMouseLeave();
}
m_Capture.OnMouseEnter(point.X, point.Y, mb);
m_LastOver = m_Capture;
}
m_Capture.OnMouseMove(point.X, point.Y, mb);
return true;
}
if ((m_Desktop == null) || (m_Desktop.Children.Count == 0))
{
return false;
}
if ((m_Drag != null) && m_Drag.m_IsDragging)
{
int x = X - m_Drag.m_OffsetX;
int y = Y - m_Drag.m_OffsetY;
if ((x + m_Drag.Width) < m_Drag.m_DragClipX)
{
x = m_Drag.m_DragClipX - m_Drag.Width;
}
else if (x > (Engine.ScreenWidth - m_Drag.m_DragClipX))
{
x = Engine.ScreenWidth - m_Drag.m_DragClipX;
}
if ((y + m_Drag.Height) < m_Drag.m_DragClipY)
{
y = m_Drag.m_DragClipY - m_Drag.Height;
}
else if (y > (Engine.ScreenHeight - m_Drag.m_DragClipY))
{
y = Engine.ScreenHeight - m_Drag.m_DragClipY;
}
Point point2 = m_Drag.Parent.PointToClient(new Point(x, y));
m_Drag.X = point2.X;
m_Drag.Y = point2.Y;
m_Drag.OnDragMove();
Gump target = null;
RecurseFindDrop(0, 0, m_Desktop, X, Y, mb, ref target);
if (target != null)
{
if (m_LastDragOver != target)
{
if (m_LastDragOver != null)
{
m_LastDragOver.OnDragLeave(m_Drag);
}
target.OnDragEnter(m_Drag);
}
}
else if (m_LastDragOver != null)
{
m_LastDragOver.OnDragLeave(m_Drag);
}
m_LastDragOver = target;
if (m_LastOver != m_Drag)
{
if (m_LastOver != null)
{
m_LastOver.OnMouseLeave();
}
m_LastOver = m_Drag;
if (m_LastOver != null)
{
point2 = m_LastOver.PointToClient(new Point(X, Y));
m_LastOver.OnMouseEnter(point2.X, point2.Y, mb);
}
}
return !IsWorldAt(X, Y, false);
}
Gump startDrag = m_StartDrag;
if (!RecurseMouseMove(0, 0, m_Desktop, X, Y, mb))
{
if (((startDrag != null) && startDrag.m_CanDrag) && (mb == MouseButtons.Left))
{
m_Drag = startDrag;
startDrag.m_IsDragging = true;
startDrag.OnDragStart();
}
else if (m_LastOver != null)
{
m_LastOver.OnMouseLeave();
m_LastOver = null;
}
return (m_Modal != null);
}
if ((((startDrag != m_LastOver) && (startDrag != null)) && (startDrag.m_CanDrag && !startDrag.m_IsDragging)) && (!startDrag.m_QuickDrag && (mb == MouseButtons.Left)))
{
m_Drag = startDrag;
if (m_LastOver != m_Drag)
{
if (m_LastOver != null)
//.........这里部分代码省略.........
示例2: RecurseMouseMove
private static bool RecurseMouseMove(int X, int Y, Gump g, int mX, int mY, MouseButtons mb)
{
if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))))
{
Gump[] gumpArray = g.Children.ToArray();
for (int i = gumpArray.Length - 1; i >= 0; i--)
{
Gump gump = gumpArray[i];
if (RecurseMouseMove(X + gump.X, Y + gump.Y, gump, mX, mY, mb))
{
return true;
}
}
if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))
{
if ((m_Modal == null) && g.HitTest(mX - X, mY - Y))
{
if (m_LastOver == g)
{
g.OnMouseMove(mX - X, mY - Y, mb);
}
else
{
if (m_LastOver != null)
{
m_LastOver.OnMouseLeave();
}
g.OnMouseEnter(mX - X, mY - Y, mb);
if (g.Tooltip != null)
{
m_TipDelay = new TimeDelay(g.Tooltip.Delay);
}
else
{
m_TipDelay = null;
}
m_LastOver = g;
}
return true;
}
if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y))
{
if (m_LastOver == g)
{
g.OnMouseMove(mX - X, mY - Y, mb);
}
else
{
if (m_LastOver != null)
{
m_LastOver.OnMouseLeave();
}
g.OnMouseEnter(mX - X, mY - Y, mb);
if (g.Tooltip != null)
{
m_TipDelay = new TimeDelay(g.Tooltip.Delay);
}
else
{
m_TipDelay = null;
}
m_LastOver = g;
}
return true;
}
}
}
return false;
}