当前位置: 首页>>代码示例>>C#>>正文


C# Gump.PointToClient方法代码示例

本文整理汇总了C#中Client.Gump.PointToClient方法的典型用法代码示例。如果您正苦于以下问题:C# Gump.PointToClient方法的具体用法?C# Gump.PointToClient怎么用?C# Gump.PointToClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Client.Gump的用法示例。


在下文中一共展示了Gump.PointToClient方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
//.........这里部分代码省略.........
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:101,代码来源:Gumps.cs


注:本文中的Client.Gump.PointToClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。