Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.2 KiB

9 years ago
//========= Copyright <EFBFBD> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#pragma once
#ifndef VGUI_HELPERS_H
3 years ago
#define VGUI_HELPERS_H
9 years ago
#include "VGUI_Panel.h"
#include "VGUI_Label.h"
9 years ago
inline int PanelTop( vgui::Panel *pPanel )
{
int x, y, w, h;
9 years ago
pPanel->getBounds( x, y, w, h );
9 years ago
return y;
}
inline int PanelLeft( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return x;
}
inline int PanelRight( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return x + w;
}
inline int PanelBottom( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return y + h;
}
inline int PanelWidth( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return w;
}
inline int PanelHeight( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return h;
}
9 years ago
// Places child at the requested position inside pParent. iAlignment is from Label::Alignment.
void AlignPanel( vgui::Panel *pChild, vgui::Panel *pParent, int alignment );
9 years ago
#endif // VGUI_HELPERS_H