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


C++ IteratorPtr类代码示例

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


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

示例1: CalcIdealSize

nuiRect nuiZoomView::CalcIdealSize()
{
  nuiRect rect;

  nuiSize HorizontalZoomLevel = mHorizontalZoomLevel; 
  nuiSize VerticalZoomLevel = mVerticalZoomLevel;

  if (mpVerticalSlider)
    VerticalZoomLevel = mpVerticalSlider->GetRange().GetValue();
  if (mpHorizontalSlider)
    HorizontalZoomLevel = mpHorizontalSlider->GetRange().GetValue();


  IteratorPtr pIt;
  for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
  {
    nuiWidgetPtr pItem = pIt->GetWidget();
    nuiRect itemRect = pItem->GetIdealRect();
    itemRect.SetSize(itemRect.GetWidth() * HorizontalZoomLevel, itemRect.GetHeight() * VerticalZoomLevel);
    rect.Union(rect, itemRect); 
  }
  delete pIt;

  rect.mLeft = 0;
  rect.mTop = 0;

  mIdealRect = rect;
  return mIdealRect;
}
开发者ID:YetToCome,项目名称:nui3,代码行数:29,代码来源:nuiZoomView.cpp

示例2: rect

bool nuiScrollView::Draw(nuiDrawContext* pContext)
{
  nuiSize scrollv = (mpVertical->IsVisible() && !mForceNoVertical && !mVerticalIsExternal)?mBarSize:0;
  nuiSize scrollh = (mpHorizontal->IsVisible() && !mForceNoHorizontal && !mHorizontalIsExternal)?mBarSize:0;
  nuiRect rect(0.0f,0.0f,mRect.GetWidth()-scrollv, mRect.GetHeight()-scrollh);

  IteratorPtr pIt;
  for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
  {
    nuiWidgetPtr pItem = pIt->GetWidget();
    nuiRect intersect;
    if (intersect.Intersect(rect, pItem->GetOverDrawRect(true, true)))
    {
      DrawChild(pContext, pItem);
    }
  }

  delete pIt;

  if (GetDebug())
  {
    pContext->SetStrokeColor(nuiColor("red"));
    pContext->DrawRect(GetRect().Size(), eStrokeShape);
    pContext->SetStrokeColor(nuiColor("blue"));
    pContext->DrawRect(GetIdealRect().Size(), eStrokeShape);
    pContext->SetStrokeColor("yellow");
    float h = GetRect().GetHeight() - scrollh - 1;
    pContext->DrawLine(0, h, GetRect().GetWidth(), h);
  }
  return true;
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例3: CheckValid

void nuiContainer::SilentInvalidateChildren(bool Recurse)
{
  CheckValid();
  IteratorPtr pIt;
  if (Recurse)
  {
    for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
    {
      nuiWidgetPtr pItem = pIt->GetWidget();
      nuiContainerPtr pCont = dynamic_cast<nuiContainerPtr>(pItem);
      if (pCont)
        pCont->SilentInvalidateChildren(Recurse);
      pItem->SilentInvalidate();
    }
  }
  else
  {
    for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
    {
      nuiWidgetPtr pItem = pIt->GetWidget();
      pItem->SilentInvalidate();
    }
  }
  delete pIt;
}
开发者ID:,项目名称:,代码行数:25,代码来源:

示例4: GetFirstChild

void nuiToggleButton::SetDisplayAsFrameBox(bool set) 
{ 
  if (set)
  {
    mDisplayAsCheckBox = false;
  }

  mDisplayAsFrameBox = set;
  
  IteratorPtr pIt = GetFirstChild();
  nuiLabel* pItem = dynamic_cast<nuiLabel*>(pIt->GetWidget());
  
  if (pItem)
  {
    if (mDisplayAsCheckBox)
    {
      pItem->SetPosition(nuiLeft);
    }
    else
    {
      pItem->SetPosition(nuiCenter);
    }
  }
  
  delete pIt;
  
  InvalidateLayout(); 
}
开发者ID:jpastuszek,项目名称:nui3,代码行数:28,代码来源:nuiToggleButton.cpp

示例5: CheckValid

bool nuiContainer::DrawChildren(nuiDrawContext* pContext)
{
  CheckValid();
  IteratorPtr pIt;

  if (mReverseRender)
  {
    for (pIt = GetLastChild(); pIt && pIt->IsValid(); GetPreviousChild(pIt))
    {
      nuiWidgetPtr pItem = pIt->GetWidget();
      if (pItem)
        DrawChild(pContext, pItem);
    }
    delete pIt;
  }
  else
  {
    for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
    {
      nuiWidgetPtr pItem = pIt->GetWidget();
      if (pItem)
        DrawChild(pContext, pItem);
    }
    delete pIt;
  }
  return true;
}
开发者ID:hamedmohammadi,项目名称:nui3,代码行数:27,代码来源:nuiContainer.cpp

示例6: CreateKeys

void Document::CreateKeys()
{
	IteratorPtr<Symbol<double>*> iter = _calculator->GetSymbols();

	float min = MIN(_size.GetWidth(),_size.GetHeight());
	float edgeLength = (int)((float)min/((float)COL));

	float xStart = 0,yStart = 0;
	wxPoint pos(xStart,yStart);
	
	int colCount = 1;

	for(iter->First();!iter->IsDone();iter->Next())
	{
		Key *key = new Key(pos,edgeLength,iter->Current());
		
		_keys.push_back(key);

		if(colCount>=COL)
		{
			pos.x = xStart;
			pos.y += edgeLength;
			colCount = 1;
		}
		else
		{
			colCount++;
			pos.x += edgeLength;
		}
	}
}
开发者ID:stumpOS,项目名称:TSCalculator,代码行数:31,代码来源:Document.cpp

示例7:

void SearchSpaceTimerEvaluatorImpl<T>::releaseResultIter(IteratorPtr<LookupResult<T> >& pFindResultIter) {
	while(pFindResultIter != NullPtr && !pFindResultIter->isDone()) {
		T element = pFindResultIter->getObj().m_resultElement;
		pFindResultIter->next();
		_destroy(element);
	}
	_destroy(pFindResultIter);
	pFindResultIter = NullPtr;
}
开发者ID:wws2003,项目名称:Research,代码行数:9,代码来源:SearchSpaceTimerEvaluator.cpp

示例8: GetUnselected

uint nuiList::GetUnselected(nuiWidgetList& unselitems)
{
  IteratorPtr pIt;
  for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
  {
    nuiWidgetPtr pItem = pIt->GetWidget();
    if (!pItem->IsSelected())
      unselitems.push_back(pItem);
  }
  delete pIt;
  return unselitems.size();
}
开发者ID:jpastuszek,项目名称:nui3,代码行数:12,代码来源:nuiList.cpp

示例9: nuiRect

nuiRect nuiFixed::CalcIdealSize()
{
    mIdealRect = nuiRect();
    IteratorPtr pIt;
    for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
    {
        nuiWidgetPtr pItem = pIt->GetWidget();
        mIdealRect.Union(mIdealRect,pItem->GetIdealRect());
    }
    delete pIt;

    mIdealRect.mLeft = 0;
    mIdealRect.mTop = 0;
    return mIdealRect;
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例10: GetItem

nuiWidgetPtr nuiList::GetItem(nuiSize X,nuiSize Y)
{
  IteratorPtr pIt;
  for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
  {
    nuiWidgetPtr pItem = pIt->GetWidget();
    if (pItem->GetRect().IsInside(X,Y))
    {
      delete pIt;
      return pItem;
    }
  }
  delete pIt;
  return NULL;
}
开发者ID:jpastuszek,项目名称:nui3,代码行数:15,代码来源:nuiList.cpp

示例11: SetRect

bool nuiButton::SetRect(const nuiRect& rRect)
{
  nuiWidget::SetRect(rRect);
  nuiRect Rect = rRect.Size();

  IteratorPtr pIt;
  for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
  {
    nuiWidgetPtr pItem = pIt->GetWidget();
    if (pItem)
      pItem->SetLayout(Rect);
  }
  delete pIt;
  return true;
}
开发者ID:hamedmohammadi,项目名称:nui3,代码行数:15,代码来源:nuiButton.cpp

示例12: GetSelected

nuiWidget* nuiList::GetSelected ()
{
 IteratorPtr pIt;
  for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
  {
    nuiWidgetPtr pItem = pIt->GetWidget();
    if (pItem->IsSelected())
    {
      delete pIt;
      return pItem;
    }
  }
  delete pIt;
  return NULL;
}
开发者ID:jpastuszek,项目名称:nui3,代码行数:15,代码来源:nuiList.cpp

示例13: SelectItemSilent

void nuiList::SelectItemSilent(uint ItemNumber)
{
  nuiWidgetPtr pItem = NULL;
  int32 i = 0;
  IteratorPtr pIt;
  for (pIt = GetFirstChild(); pIt && pIt->IsValid() && i <= ItemNumber; GetNextChild(pIt))
  {
    pItem = pIt->GetWidget();
    i++;
  }
  delete pIt;

  if (pItem && i == ItemNumber+1)
    SelectItemSilent(pItem);
}
开发者ID:jpastuszek,项目名称:nui3,代码行数:15,代码来源:nuiList.cpp

示例14: ActivateWindow

bool nuiWindowManager::DispatchMouseClick(const nglMouseInfo& rInfo)
{
  if (!IsEnabled())
    return false;

  if (IsInsideFromRoot(rInfo.X, rInfo.Y))
  {
    if (!mWindows.empty())
    {
      std::list<nuiWindow*>::iterator it;
      std::list<nuiWindow*>::iterator begin = mWindows.begin();
      it = mWindows.end();
      do 
      {
        it--;
        nuiWindow* win = *it;
        if (win->IsInsideFromRoot(rInfo.X, rInfo.Y))
        {
          if (GetActiveWindow() != win)
            ActivateWindow(win);
          break;
        }
      } while (it!=begin);
    }

    IteratorPtr pIt;
    for (pIt = GetLastChild(); pIt && pIt->IsValid(); GetPreviousChild(pIt))
    {
      nuiWidgetPtr pItem = pIt->GetWidget();
      if (pItem && pItem->IsVisible() && pItem->IsEnabled())
      {
        if (pItem->DispatchMouseClick(rInfo))
        {
          delete pIt;
          return true;
        }
      }
    }
    delete pIt;

    nglMouseInfo info(rInfo);
    GlobalToLocal(info.X, info.Y);
    bool ret = MouseClicked(info);
    ret |= Clicked(info);
    return ret;
  }
  return false;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:48,代码来源:nuiWindowManager.cpp

示例15: SetRect

bool nuiFixed::SetRect(const nuiRect& rRect)
{
    nuiWidget::SetRect(rRect);

    IteratorPtr pIt;
    for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
    {
        nuiWidgetPtr pItem = pIt->GetWidget();
        nuiRect rect = pItem->GetIdealRect();
        pItem->SetLayout(rect);
    }
    delete pIt;

    return true;

}
开发者ID:,项目名称:,代码行数:16,代码来源:


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