本文整理匯總了C++中CGUIListItemLayout::SetParentControl方法的典型用法代碼示例。如果您正苦於以下問題:C++ CGUIListItemLayout::SetParentControl方法的具體用法?C++ CGUIListItemLayout::SetParentControl怎麽用?C++ CGUIListItemLayout::SetParentControl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CGUIListItemLayout
的用法示例。
在下文中一共展示了CGUIListItemLayout::SetParentControl方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ProcessItem
void CGUIBaseContainer::ProcessItem(float posX, float posY, CGUIListItemPtr& item, bool focused, unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
if (!m_focusedLayout || !m_layout) return;
// set the origin
g_graphicsContext.SetOrigin(posX, posY);
if (m_bInvalidated)
item->SetInvalid();
if (focused)
{
if (!item->GetFocusedLayout())
{
CGUIListItemLayout *layout = new CGUIListItemLayout(*m_focusedLayout, this);
item->SetFocusedLayout(layout);
}
if (item->GetFocusedLayout())
{
if (item != m_lastItem || !HasFocus())
{
item->GetFocusedLayout()->SetFocusedItem(0);
}
if (item != m_lastItem && HasFocus())
{
item->GetFocusedLayout()->ResetAnimation(ANIM_TYPE_UNFOCUS);
unsigned int subItem = 1;
if (m_lastItem && m_lastItem->GetFocusedLayout())
subItem = m_lastItem->GetFocusedLayout()->GetFocusedItem();
item->GetFocusedLayout()->SetFocusedItem(subItem ? subItem : 1);
}
item->GetFocusedLayout()->Process(item.get(), m_parentID, currentTime, dirtyregions);
}
m_lastItem = item;
}
else
{
if (item->GetFocusedLayout())
item->GetFocusedLayout()->SetFocusedItem(0); // focus is not set
if (!item->GetLayout())
{
CGUIListItemLayout *layout = new CGUIListItemLayout(*m_layout);
layout->SetParentControl(this);
item->SetLayout(layout);
}
if (item->GetFocusedLayout())
item->GetFocusedLayout()->Process(item.get(), m_parentID, currentTime, dirtyregions);
if (item->GetLayout())
item->GetLayout()->Process(item.get(), m_parentID, currentTime, dirtyregions);
}
g_graphicsContext.RestoreOrigin();
}