本文整理汇总了C++中CGUIControl::HitTest方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIControl::HitTest方法的具体用法?C++ CGUIControl::HitTest怎么用?C++ CGUIControl::HitTest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIControl
的用法示例。
在下文中一共展示了CGUIControl::HitTest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouse
bool CGUIWindowMusicOverlay::OnMouse(const CPoint &point)
{
CGUIControl *pControl = (CGUIControl *)GetControl(CONTROL_LOGO_PIC);
if (pControl && pControl->HitTest(point))
{
// send highlight message
g_Mouse.SetState(MOUSE_STATE_FOCUS);
if (g_Mouse.bClick[MOUSE_LEFT_BUTTON])
{ // send mouse message
CGUIMessage message(GUI_MSG_FULLSCREEN, CONTROL_LOGO_PIC, GetID());
g_graphicsContext.SendMessage(message);
// reset the mouse button
g_Mouse.bClick[MOUSE_LEFT_BUTTON] = false;
}
if (g_Mouse.bClick[MOUSE_RIGHT_BUTTON])
{ // toggle the playlist window
if (m_gWindowManager.GetActiveWindow() == WINDOW_MUSIC_PLAYLIST)
m_gWindowManager.PreviousWindow();
else
m_gWindowManager.ActivateWindow(WINDOW_MUSIC_PLAYLIST);
// reset it so that we don't call other actions
g_Mouse.bClick[MOUSE_RIGHT_BUTTON] = false;
}
return true;
}
return false;
}
示例2: HitTest
bool CGUIControlGroup::HitTest(const CPoint &point) const
{
for (ciControls it = m_children.begin(); it != m_children.end(); ++it)
{
CGUIControl *child = *it;
if (child->HitTest(point - CPoint(m_posX, m_posX)))
return true;
}
return false;
}
示例3: OnMouseEvent
EVENT_RESULT CGUIDialogMusicOverlay::OnMouseEvent(const CPoint &point, const CMouseEvent &event)
{
CGUIControl *pControl = GetControl(CONTROL_LOGO_PIC);
if (pControl && pControl->HitTest(point))
{
// send highlight message
CInputManager::Get().SetMouseState(MOUSE_STATE_FOCUS);
if (event.m_id == ACTION_MOUSE_LEFT_CLICK)
{ // send mouse message
CGUIMessage message(GUI_MSG_FULLSCREEN, CONTROL_LOGO_PIC, GetID());
g_windowManager.SendMessage(message);
}
if (event.m_id == ACTION_MOUSE_RIGHT_CLICK)
{ // toggle the playlist window
if (g_windowManager.GetActiveWindow() == WINDOW_MUSIC_PLAYLIST)
g_windowManager.PreviousWindow();
else
g_windowManager.ActivateWindow(WINDOW_MUSIC_PLAYLIST);
}
return EVENT_RESULT_HANDLED;
}
return EVENT_RESULT_UNHANDLED;
}