本文整理汇总了C++中CGUIStaticItemPtr类的典型用法代码示例。如果您正苦于以下问题:C++ CGUIStaticItemPtr类的具体用法?C++ CGUIStaticItemPtr怎么用?C++ CGUIStaticItemPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGUIStaticItemPtr类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSelectedItem
void CGUIBaseContainer::UpdateVisibility(const CGUIListItem *item)
{
CGUIControl::UpdateVisibility(item);
if (!IsVisible() && !CGUIControl::CanFocus())
return; // no need to update the content if we're not visible and we can't focus
// check whether we need to update our layouts
if ((m_layout && !m_layout->CheckCondition()) ||
(m_focusedLayout && !m_focusedLayout->CheckCondition()))
{
// and do it
int item = GetSelectedItem();
UpdateLayout(true); // true to refresh all items
SelectItem(item);
}
if (m_staticContent)
{ // update our item list with our new content, but only add those items that should
// be visible. Save the previous item and keep it if we are adding that one.
CGUIListItem *lastItem = m_lastItem;
Reset();
bool updateItems = false;
if (!m_staticUpdateTime)
m_staticUpdateTime = CTimeUtils::GetFrameTime();
if (CTimeUtils::GetFrameTime() - m_staticUpdateTime > 1000)
{
m_staticUpdateTime = CTimeUtils::GetFrameTime();
updateItems = true;
}
for (unsigned int i = 0; i < m_staticItems.size(); ++i)
{
CGUIStaticItemPtr item = boost::static_pointer_cast<CGUIStaticItem>(m_staticItems[i]);
if (item->UpdateVisibility(GetParentID()))
MarkDirtyRegion();
if (item->IsVisible())
{
m_items.push_back(item);
if (item.get() == lastItem)
m_lastItem = lastItem;
}
// update any properties
if (updateItems)
item->UpdateProperties(GetParentID());
}
UpdateScrollByLetter();
}
}
示例2: getThumbLoader
std::shared_ptr<CThumbLoader> getThumbLoader(CGUIStaticItemPtr &item)
{
if (item->IsVideo())
{
initThumbLoader<CVideoThumbLoader>(VIDEO);
return m_thumbloaders[VIDEO];
}
if (item->IsAudio())
{
initThumbLoader<CMusicThumbLoader>(AUDIO);
return m_thumbloaders[AUDIO];
}
if (item->IsPicture())
{
initThumbLoader<CPictureThumbLoader>(PICTURE);
return m_thumbloaders[PICTURE];
}
initThumbLoader<CProgramThumbLoader>(PROGRAM);
return m_thumbloaders[PROGRAM];
}
示例3: OnClick
bool CStaticListProvider::OnClick(const CGUIListItemPtr &item)
{
CGUIStaticItemPtr staticItem = boost::static_pointer_cast<CGUIStaticItem>(item);
return staticItem->GetClickActions().ExecuteActions(0, m_parentID);
}