本文整理匯總了C++中CGUIListItemLayout::GetFocusedItem方法的典型用法代碼示例。如果您正苦於以下問題:C++ CGUIListItemLayout::GetFocusedItem方法的具體用法?C++ CGUIListItemLayout::GetFocusedItem怎麽用?C++ CGUIListItemLayout::GetFocusedItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CGUIListItemLayout
的用法示例。
在下文中一共展示了CGUIListItemLayout::GetFocusedItem方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: GetCondition
bool CGUIBaseContainer::GetCondition(int condition, int data) const
{
switch (condition)
{
case CONTAINER_ROW:
return (m_orientation == VERTICAL) ? (GetCursor() == data) : true;
case CONTAINER_COLUMN:
return (m_orientation == HORIZONTAL) ? (GetCursor() == data) : true;
case CONTAINER_POSITION:
return (GetCursor() == data);
case CONTAINER_HAS_NEXT:
return (HasNextPage());
case CONTAINER_HAS_PREVIOUS:
return (HasPreviousPage());
case CONTAINER_SUBITEM:
{
CGUIListItemLayout *layout = GetFocusedLayout();
return layout ? (layout->GetFocusedItem() == (unsigned int)data) : false;
}
case CONTAINER_SCROLLING:
return (m_scrollTimer.GetElapsedMilliseconds() > std::max(m_scroller.GetDuration(), SCROLLING_THRESHOLD) || m_pageChangeTimer.IsRunning());
default:
return false;
}
}
示例2: GetCondition
bool CGUIBaseContainer::GetCondition(int condition, int data) const
{
switch (condition)
{
case CONTAINER_ROW:
return (m_orientation == VERTICAL) ? (GetCursor() == data) : true;
case CONTAINER_COLUMN:
return (m_orientation == HORIZONTAL) ? (GetCursor() == data) : true;
case CONTAINER_POSITION:
return (GetCursor() == data);
case CONTAINER_HAS_NEXT:
return (HasNextPage());
case CONTAINER_HAS_PREVIOUS:
return (HasPreviousPage());
case CONTAINER_HAS_PARENT_ITEM:
return (m_items.size() && m_items[0]->IsFileItem() && (std::static_pointer_cast<CFileItem>(m_items[0]))->IsParentFolder());
case CONTAINER_SUBITEM:
{
CGUIListItemLayout *layout = GetFocusedLayout();
return layout ? (layout->GetFocusedItem() == (unsigned int)data) : false;
}
case CONTAINER_SCROLLING:
return ((m_scrollTimer.IsRunning() && m_scrollTimer.GetElapsedMilliseconds() > std::max(m_scroller.GetDuration(), SCROLLING_THRESHOLD)) || m_pageChangeTimer.IsRunning());
case CONTAINER_ISUPDATING:
return (m_listProvider) ? m_listProvider->IsUpdating() : false;
default:
return false;
}
}
示例3: OnClick
bool CGUIBaseContainer::OnClick(int actionID)
{
int subItem = 0;
if (actionID == ACTION_SELECT_ITEM || actionID == ACTION_MOUSE_LEFT_CLICK)
{
if (m_listProvider)
{ // "select" action
int selected = GetSelectedItem();
if (selected >= 0 && selected < (int)m_items.size())
{
if (m_clickActions.HasActionsMeetingCondition())
m_clickActions.ExecuteActions(0, GetParentID(), m_items[selected]);
else
m_listProvider->OnClick(m_items[selected]);
}
return true;
}
// grab the currently focused subitem (if applicable)
CGUIListItemLayout *focusedLayout = GetFocusedLayout();
if (focusedLayout)
subItem = focusedLayout->GetFocusedItem();
}
else if (actionID == ACTION_MOUSE_RIGHT_CLICK)
{
if (OnContextMenu())
return true;
}
// Don't know what to do, so send to our parent window.
CGUIMessage msg(GUI_MSG_CLICKED, GetID(), GetParentID(), actionID, subItem);
return SendWindowMessage(msg);
}
示例4: 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())
{
CFileItemPtr item = boost::static_pointer_cast<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->GetFocusedItem();
}
// Don't know what to do, so send to our parent window.
CGUIMessage msg(GUI_MSG_CLICKED, GetID(), GetParentID(), actionID, subItem);
return SendWindowMessage(msg);
}
示例5: OnClick
bool CGUIBaseContainer::OnClick(int 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())
{
CGUIStaticItemPtr item = boost::static_pointer_cast<CGUIStaticItem>(m_items[selected]);
item->GetClickActions().Execute(GetID(), GetParentID());
}
return true;
}
// grab the currently focused subitem (if applicable)
CGUIListItemLayout *focusedLayout = GetFocusedLayout();
if (focusedLayout)
subItem = focusedLayout->GetFocusedItem();
}
// Don't know what to do, so send to our parent window.
CGUIMessage msg(GUI_MSG_CLICKED, GetID(), GetParentID(), actionID, subItem);
return SendWindowMessage(msg);
}