当前位置: 首页>>代码示例>>C++>>正文


C++ MHRoot::GetRunningStatus方法代码示例

本文整理汇总了C++中MHRoot::GetRunningStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ MHRoot::GetRunningStatus方法的具体用法?C++ MHRoot::GetRunningStatus怎么用?C++ MHRoot::GetRunningStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MHRoot的用法示例。


在下文中一共展示了MHRoot::GetRunningStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Update

// Update action - set the position of the cells to be displayed and deactivate those
// which aren't.
void MHListGroup::Update(MHEngine *engine)
{
    if (!m_ItemList.size())   // Special cases when the list becomes empty
    {
        if (m_fFirstItemDisplayed)
        {
            m_fFirstItemDisplayed = false;
            engine->EventTriggered(this, EventFirstItemPresented, false);
        }

        if (m_fLastItemDisplayed)
        {
            m_fLastItemDisplayed = false;
            engine->EventTriggered(this, EventLastItemPresented, false);
        }
    }
    else   // Usual case.
    {
        for (int i = 0; i < m_ItemList.size(); i++)
        {
            MHRoot *pVis = m_ItemList.at(i)->m_pVisible;
            int nCell = i + 1 - m_nFirstItem; // Which cell does this item map onto?

            if (nCell >= 0 && nCell < m_Positions.Size())
            {
                if (i == 0 && ! m_fFirstItemDisplayed)
                {
                    m_fFirstItemDisplayed = true;
                    engine->EventTriggered(this, EventFirstItemPresented, true);
                }

                if (i == m_ItemList.size() - 1 && ! m_fLastItemDisplayed)
                {
                    m_fLastItemDisplayed = true;
                    engine->EventTriggered(this, EventLastItemPresented, true);
                }

                try
                {
                    pVis->SetPosition(m_Positions.GetAt(i - m_nFirstItem + 1).x(), m_Positions.GetAt(i - m_nFirstItem + 1).y(), engine);
                }
                catch (...) {}

                if (! pVis->GetRunningStatus())
                {
                    pVis->Activation(engine);
                }
            }
            else
            {
                if (i == 0 && m_fFirstItemDisplayed)
                {
                    m_fFirstItemDisplayed = false;
                    engine->EventTriggered(this, EventFirstItemPresented, false);
                }

                if (i == m_ItemList.size() - 1 && m_fLastItemDisplayed)
                {
                    m_fLastItemDisplayed = false;
                    engine->EventTriggered(this, EventLastItemPresented, false);
                }

                if (pVis->GetRunningStatus())
                {
                    pVis->Deactivation(engine);
                    pVis->ResetPosition();
                }
            }
        }
    }

    // Generate the HeadItems and TailItems events.  Even in the MHEG corrigendum this is unclear.
    // I'm not at all sure this is right.
    if (m_nLastFirstItem != m_nFirstItem)
    {
        engine->EventTriggered(this, EventHeadItems, m_nFirstItem);
    }

    if (m_nLastCount - m_nLastFirstItem != m_ItemList.size() - m_nFirstItem)
    {
        engine->EventTriggered(this, EventTailItems, m_ItemList.size() - m_nFirstItem);
    }

    m_nLastCount = m_ItemList.size();
    m_nLastFirstItem = m_nFirstItem;
}
开发者ID:Olti,项目名称:mythtv,代码行数:88,代码来源:TokenGroup.cpp


注:本文中的MHRoot::GetRunningStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。