本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}