本文整理匯總了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);
}
示例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;
}
}