當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。