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


C++ CGUIListItemLayout::GetFocus方法代码示例

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


在下文中一共展示了CGUIListItemLayout::GetFocus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnClick

bool CGUIBaseContainer::OnClick(DWORD actionID)
{
    int subItem = 0;
    if (actionID == ACTION_SELECT_ITEM || actionID == ACTION_MOUSE_LEFT_CLICK)
    {
        if (m_staticContent)
        {   // "select" action
            int selected = GetSelectedItem();
            if (selected >= 0 && selected < (int)m_items.size())
            {
                CFileItem *item = (CFileItem *)m_items[selected];
                // multiple action strings are concat'd together, separated with " , "
                vector<CStdString> actions;
                StringUtils::SplitString(item->m_strPath, " , ", actions);
                for (unsigned int i = 0; i < actions.size(); i++)
                {
                    CStdString action = actions[i];
                    action.Replace(",,", ",");
                    CGUIMessage message(GUI_MSG_EXECUTE, GetID(), GetParentID());
                    message.SetStringParam(action);
                    g_graphicsContext.SendMessage(message);
                }
            }
            return true;
        }
        // grab the currently focused subitem (if applicable)
        CGUIListItemLayout *focusedLayout = GetFocusedLayout();
        if (focusedLayout)
            subItem = focusedLayout->GetFocus();
    }
    // Don't know what to do, so send to our parent window.
    CGUIMessage msg(GUI_MSG_CLICKED, GetID(), GetParentID(), actionID, subItem);
    return SendWindowMessage(msg);
}
开发者ID:jeppster,项目名称:xbmc-fork,代码行数:34,代码来源:GUIBaseContainer.cpp

示例2: GetCondition

bool CGUIBaseContainer::GetCondition(int condition, int data) const
{
    switch (condition)
    {
    case CONTAINER_ROW:
        return (m_orientation == VERTICAL) ? (m_cursor == data) : true;
    case CONTAINER_COLUMN:
        return (m_orientation == HORIZONTAL) ? (m_cursor == data) : true;
    case CONTAINER_POSITION:
        return (m_cursor == data);
    case CONTAINER_HAS_NEXT:
        return (HasNextPage());
    case CONTAINER_HAS_PREVIOUS:
        return (HasPreviousPage());
    case CONTAINER_SUBITEM:
    {
        CGUIListItemLayout *layout = GetFocusedLayout();
        return layout ? (layout->GetFocus() == (unsigned int)data) : false;
    }
    default:
        return false;
    }
}
开发者ID:jeppster,项目名称:xbmc-fork,代码行数:23,代码来源:GUIBaseContainer.cpp


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