本文整理汇总了C++中CGUIControl::SendMouseEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIControl::SendMouseEvent方法的具体用法?C++ CGUIControl::SendMouseEvent怎么用?C++ CGUIControl::SendMouseEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIControl
的用法示例。
在下文中一共展示了CGUIControl::SendMouseEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendMouseEvent
EVENT_RESULT CGUIControlGroup::SendMouseEvent(const CPoint &point, const CMouseEvent &event)
{
// transform our position into child coordinates
CPoint childPoint(point);
m_transform.InverseTransformPosition(childPoint.x, childPoint.y);
if (CGUIControl::CanFocus())
{
CPoint pos(GetPosition());
// run through our controls in reverse order (so that last rendered is checked first)
for (rControls i = m_children.rbegin(); i != m_children.rend(); ++i)
{
CGUIControl *child = *i;
EVENT_RESULT ret = child->SendMouseEvent(childPoint - pos, event);
if (ret)
{ // we've handled the action, and/or have focused an item
return ret;
}
}
// none of our children want the event, but we may want it.
EVENT_RESULT ret;
if (HitTest(childPoint) && (ret = OnMouseEvent(childPoint, event)))
return ret;
}
m_focusedControl = 0;
return EVENT_RESULT_UNHANDLED;
}
示例2: SendMouseEvent
EVENT_RESULT CGUIControlGroupList::SendMouseEvent(const CPoint &point, const CMouseEvent &event)
{
// transform our position into child coordinates
CPoint childPoint(point);
m_transform.InverseTransformPosition(childPoint.x, childPoint.y);
if (CGUIControl::CanFocus())
{
float pos = 0;
float alignOffset = GetAlignOffset();
for (ciControls i = m_children.begin(); i != m_children.end(); ++i)
{
CGUIControl *child = *i;
if (child->IsVisible())
{
if (IsControlOnScreen(pos, child))
{ // we're on screen
float offsetX = m_orientation == VERTICAL ? m_posX : m_posX + alignOffset + pos - m_scroller.GetValue();
float offsetY = m_orientation == VERTICAL ? m_posY + alignOffset + pos - m_scroller.GetValue() : m_posY;
EVENT_RESULT ret = child->SendMouseEvent(childPoint - CPoint(offsetX, offsetY), event);
if (ret)
{ // we've handled the action, and/or have focused an item
return ret;
}
}
pos += Size(child) + m_itemGap;
}
}
// none of our children want the event, but we may want it.
EVENT_RESULT ret;
if (HitTest(childPoint) && (ret = OnMouseEvent(childPoint, event)))
return ret;
}
m_focusedControl = 0;
return EVENT_RESULT_UNHANDLED;
}