Beispiel #1
0
void CGUIBaseContainer::AllocResources()
{
  CGUIControl::AllocResources();
  CalculateLayout();
  if (m_listProvider)
  {
    UpdateListProvider(true);
    SelectItem(m_listProvider->GetDefaultItem());
  }
}
Beispiel #2
0
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 itemIndex = GetSelectedItem();
        UpdateLayout(true); // true to refresh all items
        SelectItem(itemIndex);
    }

    UpdateListProvider();
}
Beispiel #3
0
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

  // update layouts in case of condition changed
  if ((m_layout && m_layout->CheckCondition() != m_layoutCondition) ||
      (m_focusedLayout && m_focusedLayout->CheckCondition() != m_focusedLayoutCondition))
  {
    m_layoutCondition = m_layout->CheckCondition();
    m_focusedLayoutCondition = m_focusedLayout->CheckCondition();

    int itemIndex = GetSelectedItem();
    UpdateLayout(true); // true to refresh all items
    SelectItem(itemIndex);
  }

  UpdateListProvider();
}
Beispiel #4
0
void CGUIBaseContainer::SetListProvider(IListProvider *provider)
{
  delete m_listProvider;
  m_listProvider = provider;
  UpdateListProvider(true);
}