This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/utils/vgui/lib/FlowLayout.cpp

31 lines
606 B
C++

//========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#include<VGUI_FlowLayout.h>
#include<VGUI_Panel.h>
using namespace vgui;
FlowLayout::FlowLayout(int hgap) : Layout()
{
_hgap=hgap;
}
void FlowLayout::performLayout(Panel* panel)
{
int xx=0;
for(int i=0;i<panel->getChildCount();i++)
{
int x,y,wide,tall;
Panel* child=panel->getChild(i);
child->getBounds(x,y,wide,tall);
child->setPos(xx,y);
xx+=wide+_hgap;
}
}