本文整理汇总了C++中CGUIStaticItemPtr::IsVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIStaticItemPtr::IsVisible方法的具体用法?C++ CGUIStaticItemPtr::IsVisible怎么用?C++ CGUIStaticItemPtr::IsVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIStaticItemPtr
的用法示例。
在下文中一共展示了CGUIStaticItemPtr::IsVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateVisibility
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;
int selected = GetSelectedItem();
CGUIListItem* selectedItem = (selected >= 0 && (unsigned int)selected < m_items.size()) ? m_items[selected].get() : NULL;
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;
// if item is selected and it changed position, re-select it
if (item.get() == selectedItem && selected != (int)m_items.size() - 1)
SelectItem(m_items.size() - 1);
}
// update any properties
if (updateItems)
item->UpdateProperties(GetParentID());
}
UpdateScrollByLetter();
}
}
示例2: UpdateVisibility
void CGUIBaseContainer::UpdateVisibility(const CGUIListItem *item)
{
CGUIControl::UpdateVisibility(item);
if (!IsVisible())
return; // no need to update the content if we're not visible
// check whether we need to update our layouts
if ((m_layout && m_layout->GetCondition() && !g_infoManager.GetBool(m_layout->GetCondition(), GetParentID())) ||
(m_focusedLayout && m_focusedLayout->GetCondition() && !g_infoManager.GetBool(m_focusedLayout->GetCondition(), GetParentID())))
{
// 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();
}
}