Пример #1
0
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
0
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
0
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;
}