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


C++ CAVector::size方法代码示例

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


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

示例1: scrollViewStopMoved

void CDNewsImageController::scrollViewStopMoved(CrossApp::CAScrollView *view)
{
    CAVector<CATableViewCell*> temVec =  p_TableView->displayingTableCell();
    for(int i=0;i<temVec.size();i++)
    {
        CDNewsImageTableCell* cell = (CDNewsImageTableCell*)temVec.at(i);
        CCLog("cell-index===%d",cell->getRow());
        int row = cell->getRow();
        int img_num = m_ImageNum[row];
        
        for (int i=0; i<img_num; i++)
        {
            CommonUrlImageView* temImage = dynamic_cast<CommonUrlImageView*>(cell->getSubviewByTag(200 + i));
            if (temImage)
            {
                temImage->setUrl(m_ImageMsg[row].m_imageUrl[1 + i]);
            }
        }
    }
}
开发者ID:jtly1985,项目名称:CrossApp,代码行数:20,代码来源:CDNewsImageController.cpp

示例2: initWithViewControllers

bool CATabBarController::initWithViewControllers(const CAVector<CAViewController*>& viewControllers, CABarVerticalAlignment var)
{
    CAViewController::init();
    
    do
    {
        CC_BREAK_IF(viewControllers.size() == 0);
        m_pViewControllers = viewControllers;
        
        std::vector<CATabBarItem*> items;
        
        for (unsigned int i=0; i<m_pViewControllers.size(); i++)
        {
            CAViewController* view = m_pViewControllers.at(i);
            if (view->getTabBarItem() == NULL)
            {
                char title[8];
                sprintf(title, "item%d", i);
                CATabBarItem* item = CATabBarItem::create(title, NULL);
                item->setTag(i);
                view->setTabBarItem(item);
            }
            items.push_back(view->getTabBarItem());
            view->m_pTabBarController = this;
        }
        
        m_pTabBar = CATabBar::create(items);
        m_pTabBar->retain();
        m_pTabBar->setDelegate(this);
        
    }
    while (0);
    
    m_eTabBarVerticalAlignment = var;
    
    return true;
    
}
开发者ID:Brian1900,项目名称:CrossApp,代码行数:38,代码来源:CAViewController.cpp

示例3: updateAtlasIndex

void CABatchView::updateAtlasIndex(CAView* view, int* curIndex)
{
    const CAVector<CAView*> pVector = view->getSubviews();
    unsigned int count = (unsigned int)pVector.size();

    int oldIndex = 0;

    if( count == 0 )
    {
        oldIndex = view->getAtlasIndex();
        view->setAtlasIndex(*curIndex);
        view->setOrderOfArrival(0);
        if (oldIndex != *curIndex)
        {
            swap(oldIndex, *curIndex);
        }
        (*curIndex)++;
    }
    else
    {
        bool needNewIndex = true;

        if (pVector.front()->getZOrder() >= 0)
        {
            oldIndex = view->getAtlasIndex();
            view->setAtlasIndex(*curIndex);
            view->setOrderOfArrival(0);
            if (oldIndex != *curIndex)
            {
                swap(oldIndex, *curIndex);
            }
            (*curIndex)++;
            
            needNewIndex = false;
        }
        
        CAVector<CAView*>::const_iterator itr;
        for (itr=pVector.begin(); itr!=pVector.end(); itr++)
        {
            CAView* subview = *itr;
            if (needNewIndex && subview->getZOrder() >= 0)
            {
                oldIndex = view->getAtlasIndex();
                view->setAtlasIndex(*curIndex);
                view->setOrderOfArrival(0);
                if (oldIndex != *curIndex)
                {
                    this->swap(oldIndex, *curIndex);
                }
                (*curIndex)++;
                needNewIndex = false;
                
            }
            
            updateAtlasIndex(subview, curIndex);
        }

        if (needNewIndex)
        {
            oldIndex = view->getAtlasIndex();
            view->setAtlasIndex(*curIndex);
            view->setOrderOfArrival(0);
            if (oldIndex!=*curIndex)
            {
                swap(oldIndex, *curIndex);
            }
            (*curIndex)++;
        }
    }
}
开发者ID:Brian1900,项目名称:CrossApp,代码行数:70,代码来源:CABatchView.cpp


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