本文整理汇总了C#中Gwen.Control.ControlBase.DragAndDrop_HoverEnter方法的典型用法代码示例。如果您正苦于以下问题:C# ControlBase.DragAndDrop_HoverEnter方法的具体用法?C# ControlBase.DragAndDrop_HoverEnter怎么用?C# ControlBase.DragAndDrop_HoverEnter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gwen.Control.ControlBase
的用法示例。
在下文中一共展示了ControlBase.DragAndDrop_HoverEnter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateHoveredControl
private static void UpdateHoveredControl(ControlBase control, int x, int y)
{
//
// We use this global variable to represent our hovered control
// That way, if the new hovered control gets deleted in one of the
// Hover callbacks, we won't be left with a hanging pointer.
// This isn't ideal - but it's minimal.
//
m_NewHoveredControl = control;
// Nothing to change..
if (HoveredControl == m_NewHoveredControl)
return;
// We changed - tell the old hovered control that it's no longer hovered.
if (HoveredControl != null && HoveredControl != m_NewHoveredControl)
HoveredControl.DragAndDrop_HoverLeave(CurrentPackage);
// If we're hovering where the control came from, just forget it.
// By changing it to null here we're not going to show any error cursors
// it will just do nothing if you drop it.
if (m_NewHoveredControl == SourceControl)
m_NewHoveredControl = null;
// Check to see if the new potential control can accept this type of package.
// If not, ignore it and show an error cursor.
while (m_NewHoveredControl != null && !m_NewHoveredControl.DragAndDrop_CanAcceptPackage(CurrentPackage))
{
// We can't drop on this control, so lets try to drop
// onto its parent..
m_NewHoveredControl = m_NewHoveredControl.Parent;
// Its parents are dead. We can't drop it here.
// Show the NO WAY cursor.
if (m_NewHoveredControl == null)
{
Platform.Neutral.SetCursor(Cursors.No);
}
}
// Become out new hovered control
HoveredControl = m_NewHoveredControl;
// If we exist, tell us that we've started hovering.
if (HoveredControl != null)
{
HoveredControl.DragAndDrop_HoverEnter(CurrentPackage, x, y);
}
m_NewHoveredControl = null;
}