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


C++ WindowList::push_back方法代码示例

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


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

示例1: getParentList

void Window::getParentList(WindowList& wl) const {
    const Window* current = this;

    while(current) {
        wl.push_back(const_cast<Window*>(current));

        if(current->_parent) current = current->_parent;

        else current = 0;
    }
}
开发者ID:dev2dev,项目名称:OpenSceneGraph-port-to-IOS,代码行数:11,代码来源:Window.cpp

示例2: getAncestors

void GuiWindow::getAncestors(WindowList *captured)
{
   WindowList backward;

   for ( GuiWindow* curr = this; curr != NULL; curr = curr->getParent() )
   {
      backward.push_back(curr);
   }

   for ( auto it = backward.rbegin(); it != backward.rend(); it++ )
   {
      captured->push_back(*it);
   }
}
开发者ID:ghbenjamin,项目名称:NotPathfinder,代码行数:14,代码来源:GuiWindow.cpp

示例3: getEmbeddedList

bool Window::getEmbeddedList(WindowList& wl) const {
    for(ConstIterator i = begin(); i != end(); i++) if(i->valid()) {
        EmbeddedWindow* ew = dynamic_cast<EmbeddedWindow*>(i->get());

        if(!ew || !ew->getWindow()) continue;

        else {
            wl.push_back(ew->getWindow());

            ew->getWindow()->getEmbeddedList(wl);
        }
    }

    return wl.size() != 0;
}
开发者ID:dev2dev,项目名称:OpenSceneGraph-port-to-IOS,代码行数:15,代码来源:Window.cpp

示例4: EnumerateWindowsCallback

BOOL CALLBACK EnumerateWindowsCallback( HWND hwnd, LPARAM lParam){
	int titleLength = GetWindowTextLength(hwnd);
	if(!titleLength){
		return true;
	}
	titleLength += 1; // For null character

	LPTSTR buff = new TCHAR[titleLength];
	int length = GetWindowText(hwnd, buff, titleLength);
	if(!length){
		delete buff;
		_tprintf(_T("%x failed because %d\n"), hwnd, GetLastError());
		return true;
	}
	WindowObject* myWindowObject = new WindowObject(buff, hwnd);
	windowTitles.push_back(*myWindowObject);
	return true;
}
开发者ID:WesleyLuk90,项目名称:memory-search-and-read,代码行数:18,代码来源:ConsoleApplication1.cpp

示例5: Update

void Window::Update(float elapsed)
{
    if (IsDone())
    {
        return;
    }

    OnUpdate(elapsed);

    WindowList doneChildren;
    for (WindowList::iterator iter = m_children.begin(); iter != m_children.end(); ++iter)
    {
        const boost::shared_ptr<Window> child(*iter);
        if (child->IsDone())
        {
            doneChildren.push_back(child);
        }
    }

    for (WindowList::iterator iter = doneChildren.begin(); iter != doneChildren.end(); ++iter)
    {
        m_children.erase(find(m_children.begin(), m_children.end(), *iter));
    }
}
开发者ID:FooSoft,项目名称:moonfall,代码行数:24,代码来源:Window.cpp

示例6: AddDlg

void DialogManager::AddDlg(Dialog *dialog)
{
	dialogs.push_back(dialog);
}
开发者ID:716Girl,项目名称:ppsspp,代码行数:4,代码来源:DialogManager.cpp

示例7: stopRedraw

void        LinearLayout::Layout()
{
    if ( ! this->childWindows.size())
    {
        return;
    }

    RedrawLock stopRedraw(this);

    bool isVertical = (this->orientation == VerticalLayout);
    bool isHorizontal = ( ! isVertical);

    WindowList wrappedChildren;
    WindowList filledChildren;
    ChildSizeMap finalSizes;
    int wrappedSize = 0;
    float totalWeight = 0.0f;

    WindowList::iterator it, end;

    Size layoutSize = this->ClientSize();

    // PASS 1: figure out which windows are wrapped in direction of the
    // orientation, and which are filled. Also, calculate the correct
    // size of the child opposite to its orientation.
    it = this->childWindows.begin();
    end = this->childWindows.end();
    for ( ; it != end; it++)
    {
        Window* child = (*it);
        Size childSize = child->WindowSize();

        // map the child to its fill type
        if (((isVertical) && (child->LayoutHeight() == LayoutFillParent))
        || ((isHorizontal) && (child->LayoutWidth() == LayoutFillParent)))
        {
            filledChildren.push_back(child);
            totalWeight += child->LayoutWeight();
        }
        else
        {
            wrappedChildren.push_back(child);

            // figure out the space all of the wrapped children will occupy.
            wrappedSize += (isVertical ? childSize.height : childSize.width);
        }

        // fill direction opposite the orientation
        if ((isVertical) && (child->LayoutWidth() == LayoutFillParent))
        {
            childSize.width = layoutSize.width;
        }
        else if ((isHorizontal) && (child->LayoutHeight() == LayoutFillParent))
        {
            childSize.height = layoutSize.height;
        }
        //
        finalSizes[child] = childSize;
    }
    //
    wrappedSize += (this->spacing * ((int) this->childWindows.size() - 1));

    // PASS 2: determine final child size for the filled children based on
    // their specified LayoutWeight()'s.
    if (filledChildren.size())
    {
        int remainingSize = (isVertical)
            ? layoutSize.height - wrappedSize
            : layoutSize.width - wrappedSize;
        //
        int weightedSize = 0;
        //
        it = filledChildren.begin();
        end = filledChildren.end();
        for ( ; it != end; it++)
        {
            Window* child = (*it);
            Size childSize = finalSizes[child];
            float remainingRatio = (child->LayoutWeight() / totalWeight);
            int newSize = (int) ((float) remainingSize * remainingRatio);

            // using floating calculations may cause small rounding errors. give
            // give the last filled child whatever space may be left over
            weightedSize += newSize;
            if ((it + 1) == end)
            {
                newSize += (remainingSize - weightedSize);
            }

            isVertical
                ? childSize.height = newSize
                : childSize.width = newSize;

            finalSizes[child] = childSize;
        }
    }

    // PASS 3: layout everything out!
    it = this->childWindows.begin();
    end = this->childWindows.end();
//.........这里部分代码省略.........
开发者ID:LeonJavaAndroid,项目名称:musikcube,代码行数:101,代码来源:LinearLayout.cpp


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